diff --git a/.jitpack/ensure-java-16 b/.jitpack/ensure-java-16 new file mode 100644 index 0000000..9bb37cc --- /dev/null +++ b/.jitpack/ensure-java-16 @@ -0,0 +1,19 @@ +#!/bin/bash + +JV=$(java -version 2>&1 >/dev/null | head -1) +echo "$JV" | sed -E 's/^.*version "([^".]*)\.[^"]*".*$/\1/' + +if [ "$JV" != 16 ]; then + case "$1" in + install) + echo "installing sdkman..." + curl -s "https://get.sdkman.io" | bash + source ~/.sdkman/bin/sdkman-init.sh + sdk install java 16.0.1-open + ;; + use) + echo "must source ~/.sdkman/bin/sdkman-init.sh" + exit 1 + ;; + esac +fi \ No newline at end of file diff --git a/jitpack.yml b/jitpack.yml index 8bb4a87..b3771db 100644 --- a/jitpack.yml +++ b/jitpack.yml @@ -1,2 +1,12 @@ +# This file ensures jitpack builds HuskSync correctly by setting the JDK to 16 jdk: - - openjdk16 \ No newline at end of file + - 'openjdk16' +before_install: + - 'git clone https://github.com/WiIIiam278/HSLDataConverter.git --recurse-submodules' + - 'chmod +x gradlew' + - 'chmod +x ./.jitpack/ensure-java-16' + - 'bash ./.jitpack/ensure-java-16 install' +install: + - 'if ! ./.jitpack/ensure-java-16 use; then source ~/.sdkman/bin/sdkman-init.sh; fi' + - 'java -version' + - './gradlew clean publishToMavenLocal' \ No newline at end of file