2011-09-22 23:00:03 +00:00
|
|
|
#!/usr/bin/perl -w
|
|
|
|
# yes, I know that this task can be done by more simple .bat, but perl script is more portable between OS
|
|
|
|
|
|
|
|
|
|
|
|
use strict;
|
|
|
|
use Archive::Extract;
|
|
|
|
use Archive::Zip;
|
|
|
|
use File::Copy;
|
|
|
|
use File::Path;
|
|
|
|
|
|
|
|
print "Start compiling...\n";
|
|
|
|
chdir("..");
|
2012-02-12 21:48:28 +00:00
|
|
|
system("mvn clean install -DskipTests");
|
2011-09-22 23:00:03 +00:00
|
|
|
chdir("Mage.Client");
|
|
|
|
system("mvn assembly:assembly");
|
|
|
|
chdir("../Mage.Server");
|
|
|
|
system("mvn assembly:assembly");
|
|
|
|
chdir("..");
|
|
|
|
mkdir("temp");
|
|
|
|
chdir("temp");
|
|
|
|
move("../Mage.Client/target/mage-client.zip", "client.zip");
|
|
|
|
move("../Mage.Server/target/mage-server.zip", "server.zip");
|
|
|
|
copy("../Utils/release/startMage.bat", "startMage.bat");
|
|
|
|
|
|
|
|
my $f = Archive::Extract->new( archive => "client.zip");
|
|
|
|
$f->extract( to => "client/");
|
|
|
|
$f = Archive::Extract->new( archive => "server.zip");
|
|
|
|
$f->extract( to => "server/");
|
|
|
|
unlink("client.zip");
|
|
|
|
unlink("server.zip");
|
|
|
|
|
|
|
|
my $zip = Archive::Zip->new();;
|
2012-05-29 18:25:49 +00:00
|
|
|
$zip->addTree("client", "mage-client");
|
|
|
|
$zip->addTree("server", "mage-server");
|
2011-09-22 23:00:03 +00:00
|
|
|
$zip->addFile("startMage.bat");
|
|
|
|
$zip->writeToFileNamed("../mage-bundle.zip");
|
|
|
|
chdir("..");
|
|
|
|
|
|
|
|
rmtree("temp");
|