forked from joncampbell123/dosbox-x
-
Notifications
You must be signed in to change notification settings - Fork 1
/
make-windows-release.pl
executable file
·69 lines (51 loc) · 1.86 KB
/
make-windows-release.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/usr/bin/perl
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime();
my $datestr = sprintf("%04u%02u%02u%02u%02u%02u",$year+1900,$mon+1,$mday,$hour,$min,$sec);
my $ziptool = "vs/tool/zip.exe";
my $subdir="release/windows";
my $brancha=`git branch`;
my $branch;
my @a = split(/\n/,$brancha);
for ($i=0;$i < @a;$i++) {
my $line = $a[$i];
chomp $line;
if ($line =~ s/^\* +//) {
$branch = $line;
}
}
if ( "$branch" eq "develop-win-sdl1-async-hack-201802" ) {
$subdir="release/windows-async";
}
$suffix = $subdir;
$suffix =~ s/^.*\/windows/vsbuild/g;
mkdir "release" unless -d "release";
mkdir "$subdir" unless -d "$subdir";
die "bin directory not exist" unless -d "bin";
die unless -f $ziptool;
print "$zipname\n";
my @platforms = ('ARM', 'ARM64', 'Win32', 'x64');
my @builds = ('Release', 'Release SDL2');
my @files = ('dosbox-x.reference.conf', 'dosbox-x.reference.full.conf', 'readme.txt', 'dosbox-x.exe', 'FREECG98.bmp', 'wqy_11pt.bdf', 'wqy_12pt.bdf', 'Nouveau_IBM.ttf', 'SarasaGothicFixed.ttf', 'changelog.txt', 'drivez', 'scripts', 'shaders', 'glshaders', 'languages');
foreach $platform (@platforms) {
$plat = $platform;
$plat = 'win32' if $plat eq 'Win32';
$plat = 'win64' if $plat eq 'x64';
$plat = 'arm32' if $plat eq 'ARM';
$plat = 'arm64' if $plat eq 'ARM64';
$zipname = "dosbox-x-$suffix-$plat-$datestr.zip";
next if -f $zipname;
my @filelist = ();
push(@filelist, "COPYING");
foreach $build (@builds) {
push(@filelist, "bin/$platform/$build/inpout32.dll") if $plat eq 'win32';
push(@filelist, "bin/$platform/$build/inpoutx64.dll") if $plat eq 'win64';
foreach $file (@files) {
$addfile = "bin/$platform/$build/$file";
die "Missing file $addfile" unless -e $addfile;
push(@filelist, $addfile);
}
}
# do it
$r = system($ziptool, '-9', '-r', "$subdir/$zipname", @filelist);
exit 1 unless $r == 0;
}