summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xscripts/link_debian.sh24
-rwxr-xr-xscripts/link_mac.sh11
-rwxr-xr-xscripts/link_windows.sh11
3 files changed, 18 insertions, 28 deletions
diff --git a/scripts/link_debian.sh b/scripts/link_debian.sh
deleted file mode 100755
index 183cb99..0000000
--- a/scripts/link_debian.sh
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/bash
-# Links everything into a self-contained executable using jlink.
-
-set -e
-
-# Needed if you have a java version other than 11 as default
-JAVA_HOME='/usr/lib/jvm/java-11-openjdk-amd64'
-
-# Compile sources
-mvn compile
-
-# Patch gson
-if [ ! -e modules/gson.jar ]; then
- ./scripts/patch_gson.sh
-fi
-
-# Build using jlink
-rm -rf dist/debian
-$JAVA_HOME/bin/jlink \
- --module-path modules/gson.jar:target/classes \
- --add-modules gson,javacs \
- --launcher launcher=javacs/org.javacs.Main \
- --output dist/debian \
- --compress 2
diff --git a/scripts/link_mac.sh b/scripts/link_mac.sh
index cbe8870..e9982bf 100755
--- a/scripts/link_mac.sh
+++ b/scripts/link_mac.sh
@@ -4,7 +4,14 @@
set -e
# Needed if you have a java version other than 11 as default
-JAVA_HOME=$(/usr/libexec/java_home -v 11)
+echo "JAVA_HOME is set to: $JAVA_HOME"
+if [[ "$OSTYPE" == "linux-gnu" ]]; then
+ JAVA_HOME='/usr/lib/jvm/java-11-openjdk-amd64'
+ echo "JAVA_HOME overrided to be: $JAVA_HOME"
+elif [[ "$OSTYPE" == "darwin"* ]]; then
+ JAVA_HOME=$(/usr/libexec/java_home -v 11)
+ echo "JAVA_HOME overrided to be: $JAVA_HOME"
+fi
# Compile sources
mvn compile
@@ -21,4 +28,4 @@ $JAVA_HOME/bin/jlink \
--add-modules gson,javacs \
--launcher launcher=javacs/org.javacs.Main \
--output dist/mac \
- --compress 2 \ No newline at end of file
+ --compress 2
diff --git a/scripts/link_windows.sh b/scripts/link_windows.sh
index be9f7dc..0a5ad6d 100755
--- a/scripts/link_windows.sh
+++ b/scripts/link_windows.sh
@@ -4,7 +4,14 @@
set -e
# Needed if you have a java version other than 11 as default
-JAVA_HOME=$(/usr/libexec/java_home -v 11)
+echo "JAVA_HOME is set to: $JAVA_HOME"
+if [[ "$OSTYPE" == "linux-gnu" ]]; then
+ JAVA_HOME='/usr/lib/jvm/java-11-openjdk-amd64'
+ echo "JAVA_HOME overrided to be: $JAVA_HOME"
+elif [[ "$OSTYPE" == "darwin"* ]]; then
+ JAVA_HOME=$(/usr/libexec/java_home -v 11)
+ echo "JAVA_HOME overrided to be: $JAVA_HOME"
+fi
# Compile sources
mvn compile
@@ -35,4 +42,4 @@ $REAL_JAVA_HOME/bin/jlink \
--add-modules gson,javacs \
--launcher launcher=javacs/org.javacs.Main \
--output dist/windows \
- --compress 2 \ No newline at end of file
+ --compress 2