mirror of
https://github.com/correl/mage.git
synced 2024-11-25 03:00:11 +00:00
Added logic to build and package server console.
This commit is contained in:
parent
7c8d0881f7
commit
af0d49c654
3 changed files with 148 additions and 0 deletions
|
@ -31,4 +31,47 @@
|
|||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-install-plugin</artifactId>
|
||||
<version>2.5.2</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<configuration>
|
||||
<encoding>UTF-8</encoding>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<configuration>
|
||||
<archive>
|
||||
<manifestFile>${manifest.file}</manifestFile>
|
||||
<manifest>
|
||||
<addClasspath>true</addClasspath>
|
||||
<mainClass>mage.server.console.ConsoleFrame</mainClass>
|
||||
</manifest>
|
||||
</archive>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<configuration>
|
||||
<appendAssemblyId>false</appendAssemblyId>
|
||||
<descriptors>
|
||||
<descriptor>src/main/assembly/distribution.xml</descriptor>
|
||||
</descriptors>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
|
||||
<finalName>mage-serverconsole</finalName>
|
||||
</build>
|
||||
</project>
|
||||
|
|
54
Mage.Server.Console/src/main/assembly/distribution.xml
Normal file
54
Mage.Server.Console/src/main/assembly/distribution.xml
Normal file
|
@ -0,0 +1,54 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.1"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.1
|
||||
http://maven.apache.org/xsd/assembly-1.1.1.xsd">
|
||||
<includeBaseDirectory>false</includeBaseDirectory>
|
||||
<formats>
|
||||
<format>zip</format>
|
||||
</formats>
|
||||
<dependencySets>
|
||||
<dependencySet>
|
||||
<outputDirectory>/lib</outputDirectory>
|
||||
<includes>
|
||||
<include>org.mage:mageconsole</include>
|
||||
</includes>
|
||||
<fileMode>0644</fileMode>
|
||||
</dependencySet>
|
||||
<dependencySet>
|
||||
<outputDirectory>/lib/</outputDirectory>
|
||||
<excludes>
|
||||
<exclude>org.mage:mageconsole</exclude>
|
||||
</excludes>
|
||||
<fileMode>0644</fileMode>
|
||||
</dependencySet>
|
||||
</dependencySets>
|
||||
<fileSets>
|
||||
<fileSet>
|
||||
<filtered>true</filtered>
|
||||
<directory>release/</directory>
|
||||
<excludes>
|
||||
<exclude>*.sh</exclude>
|
||||
</excludes>
|
||||
<outputDirectory>/</outputDirectory>
|
||||
</fileSet>
|
||||
<fileSet>
|
||||
<filtered>true</filtered>
|
||||
<directory>release/</directory>
|
||||
<outputDirectory>/</outputDirectory>
|
||||
<includes>
|
||||
<include>*.sh</include>
|
||||
</includes>
|
||||
<fileMode>0755</fileMode>
|
||||
</fileSet>
|
||||
<fileSet>
|
||||
<filtered>false</filtered>
|
||||
<directory>target/</directory>
|
||||
<includes>
|
||||
<include>*.exe</include>
|
||||
</includes>
|
||||
<outputDirectory>/</outputDirectory>
|
||||
</fileSet>
|
||||
|
||||
</fileSets>
|
||||
</assembly>
|
51
Utils/build-and-package-console.pl
Executable file
51
Utils/build-and-package-console.pl
Executable file
|
@ -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");
|
Loading…
Reference in a new issue