-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
64 lines (54 loc) · 2.24 KB
/
build.sh
File metadata and controls
64 lines (54 loc) · 2.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/bin/sh
# Check if cache directory exists, if it doesn't, make one
if [ -d ./.jrecache/linux ]; then
echo "Linux cache folder exests"
else
echo "Making the cache folder for linux"
mkdir -p .jrecache/linux
fi
if [ -d ./.jrecache/windows ]; then
echo "Winodws cache folder exests"
else
echo "Making the cache folder for windows"
mkdir -p .jrecache/windows
fi
# Run the gradle build with a specific jdk
#echo "Starting the gradle build"
#./gradlew -Dorg.gradle.java.home=/usr/lib/jvm/java-15-adoptopenjdk desktop:dist
# Remove the old executable if it exists
if [ -d ./desktop/build/exe ]; then
echo "Removing the old executables"
rm -rf ./desktop/build/exe/*
fi
# Package the jar into an executable
# --platform - what platform is the executable for
# --jdk - URL of the JDK to be used
# --useZgcIfSupportedOs - if a platform supports Z garbage collector, use it
# --executable - name of the executable
# --classpath - location of the jar(s) to be packaged
# --mainclass - name of the main class
# --resources - location of the resources used by the program
# --output - output directory (one cleared in the prevous comand
# --cachejre - folder in which to cache the jre (created by te forst command in this script)
echo "Packaging For Linux"
java -jar packr-all.jar \
--platform linux64 \
--jdk https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15.0.1%2B9/OpenJDK15U-jdk_x64_linux_hotspot_15.0.1_9.tar.gz \
--useZgcIfSupportedOs \
--executable game \
--classpath ./desktop/build/libs/desktop-1.0.jar \
--mainclass com.team13.game.desktop.DesktopLauncher \
--resources ./core/assets \
--output ./desktop/build/exe/linux \
--cachejre .jrecache/linux
echo "Packaging For Windows"
java -jar packr-all.jar \
--platform windows64 \
--jdk https://github.com/AdoptOpenJDK/openjdk15-binaries/releases/download/jdk-15.0.1%2B9/OpenJDK15U-jdk_x64_windows_hotspot_15.0.1_9.zip \
--useZgcIfSupportedOs \
--executable game \
--classpath ./desktop/build/libs/desktop-1.0.jar \
--mainclass com.team13.game.desktop.DesktopLauncher \
--resources ./core/assets \
--output ./desktop/build/exe/windows \
--cachejre .jrecache/windows