From af0d49c6549f62fedce072a3c841bc60a9edc664 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Thu, 4 Feb 2016 21:09:27 +0100 Subject: [PATCH] Added logic to build and package server console. --- Mage.Server.Console/pom.xml | 43 +++++++++++++++ .../src/main/assembly/distribution.xml | 54 +++++++++++++++++++ Utils/build-and-package-console.pl | 51 ++++++++++++++++++ 3 files changed, 148 insertions(+) create mode 100644 Mage.Server.Console/src/main/assembly/distribution.xml create mode 100755 Utils/build-and-package-console.pl diff --git a/Mage.Server.Console/pom.xml b/Mage.Server.Console/pom.xml index 38af4642cf..28d5fb023f 100644 --- a/Mage.Server.Console/pom.xml +++ b/Mage.Server.Console/pom.xml @@ -31,4 +31,47 @@ test + + + + + org.apache.maven.plugins + maven-compiler-plugin + + + org.apache.maven.plugins + maven-install-plugin + 2.5.2 + + + maven-resources-plugin + + UTF-8 + + + + maven-jar-plugin + + + ${manifest.file} + + true + mage.server.console.ConsoleFrame + + + + + + maven-assembly-plugin + + false + + src/main/assembly/distribution.xml + + + + + + mage-serverconsole + diff --git a/Mage.Server.Console/src/main/assembly/distribution.xml b/Mage.Server.Console/src/main/assembly/distribution.xml new file mode 100644 index 0000000000..892d57c6cc --- /dev/null +++ b/Mage.Server.Console/src/main/assembly/distribution.xml @@ -0,0 +1,54 @@ + + + false + + zip + + + + /lib + + org.mage:mageconsole + + 0644 + + + /lib/ + + org.mage:mageconsole + + 0644 + + + + + true + release/ + + *.sh + + / + + + true + release/ + / + + *.sh + + 0755 + + + false + target/ + + *.exe + + / + + + + diff --git a/Utils/build-and-package-console.pl b/Utils/build-and-package-console.pl new file mode 100755 index 0000000000..4b6093e673 --- /dev/null +++ b/Utils/build-and-package-console.pl @@ -0,0 +1,51 @@ +#!/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 -DskipTests"); +chdir("Mage.Client"); +system("mvn assembly:assembly"); +chdir("../Mage.Server"); +system("mvn assembly:assembly"); +chdir("../Mage.Server.Console"); +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"); +move("../Mage.Server.Console/target/mage-serverconsole.zip", "serverconsole.zip"); + +copy("../Utils/release/startMage.bat", "startMage.bat"); +copy("../Utils/release/startMageWin7.bat", "startMageWin7.bat"); +copy("../Utils/release/startMage.sh", "startMage.sh"); + +my $f = Archive::Extract->new( archive => "client.zip"); +$f->extract( to => "client/"); +$f = Archive::Extract->new( archive => "server.zip"); +$f->extract( to => "server/"); +$f = Archive::Extract->new( archive => "serverconsole.zip"); +$f->extract( to => "serverconsole/"); +unlink("client.zip"); +unlink("server.zip"); +unlink("serverConsole.zip"); + +my $zip = Archive::Zip->new();; +$zip->addTree("client", "mage-client"); +$zip->addTree("server", "mage-server"); +$zip->addTree("serverConsole", "mage-server-Console"); +$zip->addFile("startMage.bat"); +$zip->addFile("startMageWin7.bat"); +$zip->addFile("startMage.sh"); +$zip->writeToFileNamed("../mage-bundle.zip"); +chdir(".."); + +rmtree("temp"); \ No newline at end of file