mirror of
https://github.com/correl/mage.git
synced 2024-11-24 19:19:56 +00:00
script to generate bundle
This commit is contained in:
parent
590218ea98
commit
eb20e71f5d
2 changed files with 44 additions and 0 deletions
39
Utils/build-and-package.pl
Normal file
39
Utils/build-and-package.pl
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
#!/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("..");
|
||||||
|
#system("mvn clean install");
|
||||||
|
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();;
|
||||||
|
$zip->addTree("client", "client");
|
||||||
|
$zip->addTree("server", "server");
|
||||||
|
$zip->addFile("startMage.bat");
|
||||||
|
$zip->writeToFileNamed("../mage-bundle.zip");
|
||||||
|
chdir("..");
|
||||||
|
|
||||||
|
rmtree("temp");
|
5
Utils/release/startMage.bat
Normal file
5
Utils/release/startMage.bat
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
@ECHO OFF
|
||||||
|
cd ./client
|
||||||
|
call startClient
|
||||||
|
cd ../server
|
||||||
|
call startServer
|
Loading…
Reference in a new issue