Skip to content

Commit

Permalink
Get JitPack to build with OpenJDK 16
Browse files Browse the repository at this point in the history
  • Loading branch information
Johni0702 committed Jun 4, 2021
1 parent af45ba7 commit 34ab703
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
21 changes: 21 additions & 0 deletions ensure-java-16
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

# https://github.com/jitpack/jitpack.io/issues/4355#issuecomment-744678253

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
8 changes: 8 additions & 0 deletions jitpack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
jdk:
- openjdk16
before_install:
- ./ensure-java-16 install
install:
- if ! ./ensure-java-16 use; then source ~/.sdkman/bin/sdkman-init.sh; fi
- java -version
- ./gradlew publishToMavenLocal

0 comments on commit 34ab703

Please sign in to comment.