Add compile script

This commit is contained in:
Yohann D'ANELLO 2020-02-28 19:10:37 +01:00
parent cf03a04786
commit fb9902da44
2 changed files with 26 additions and 0 deletions

2
.gitignore vendored
View File

@ -20,3 +20,5 @@ image.png
/maps/
/assets/
out/
TheGame.jar

24
compile.sh Executable file
View File

@ -0,0 +1,24 @@
#!/bin/bash
chmod +x lib/*.jar
rm -rf tmp
mkdir tmp
javac -cp src/main/java:lib/gson-2.8.6.jar:lib/jopt-simple-6.0-alpha-3.jar \
-target 1.9 -source 1.9 \
-d tmp --module-path src/main/java \
src/main/java/fr/ynerant/leveleditor/api/editor/*.java \
src/main/java/fr/ynerant/leveleditor/client/main/*.java \
src/main/java/fr/ynerant/leveleditor/editor/*.java \
src/main/java/fr/ynerant/leveleditor/frame/*.java \
src/main/java/fr/ynerant/leveleditor/game/*.java \
src/main/java/fr/ynerant/leveleditor/game/mobs/*.java \
src/main/java/fr/ynerant/leveleditor/game/towers/*.java
cp -r src/main/resources/* tmp/
unzip lib/gson-2.8.6.jar -x META-INF/MANIFEST.MF -d tmp
unzip lib/jopt-simple-6.0-alpha-3.jar -x META-INF/MANIFEST.MF -d tmp
cd tmp
zip -r TheGame.jar *
mv TheGame.jar ../
cd ..
rm -rf tmp
chmod +x TheGame.jar
echo "Successfully compiled to \"TheGame.jar\". To run: \"java -jar TheGame.jar\"".