Skip to content

Use AdoptOpenJDK JDK 8 and 11 #334

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 23 additions & 17 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
language: scala

jdk:
- openjdk8
- openjdk11

scala:
- 2.12.8
- 2.13.0
Expand All @@ -19,20 +15,29 @@ env:
- secure: "Xw7rI/qlML1nD2e2XwlakkhKAWNGZKqqE+Q3ntTvFpfHryl7KLCvVzJ4LIavnL6kGJaWOgy9vlSoEWn5g9nqHSfE31C/k5pY5nTMAKiwiJzfAS+r0asKXW2gmKhwtcTBkqyLVOZLCJSPVlFRQyfBJHY+Fs0L3KWcnMQgtBlyDhU="
matrix:
# The empty SCALAJS_VERSION will only compile for the JVM
- SCALAJS_VERSION=
- SCALAJS_VERSION=0.6.28
- SCALAJS_VERSION=1.0.0-M8
- SCALAJS_VERSION= ADOPTOPENJDK=8
- SCALAJS_VERSION=0.6.28 ADOPTOPENJDK=8
- SCALAJS_VERSION=1.0.0-M8 ADOPTOPENJDK=8
- SCALAJS_VERSION= ADOPTOPENJDK=11

matrix:
exclude:
- jdk: openjdk11
env: SCALAJS_VERSION=0.6.28
- jdk: openjdk11
env: SCALAJS_VERSION=1.0.0-M8
- scala: 0.15.0-RC1
env: SCALAJS_VERSION=0.6.28
- scala: 0.15.0-RC1
env: SCALAJS_VERSION=1.0.0-M8
- scala: 0.16.0-RC3
env: SCALAJS_VERSION=0.6.28 ADOPTOPENJDK=8
- scala: 0.16.0-RC3
env: SCALAJS_VERSION=1.0.0-M8 ADOPTOPENJDK=8

before_install:
# adding $HOME/.sdkman to cache would create an empty directory, which interferes with the initial installation
- "[[ -d $HOME/.sdkman/bin ]] || rm -rf $HOME/.sdkman/"
- curl -sL https://get.sdkman.io | bash
- echo sdkman_auto_answer=true > "$HOME/.sdkman/etc/config"
- source "$HOME/.sdkman/bin/sdkman-init.sh"

install:
- sdk install java $(sdk list java | grep -o "$ADOPTOPENJDK\.[0-9\.]*hs-adpt" | head -1)
- unset JAVA_HOME
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you explain this line? Thanks!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JAVA_HOME is set by Travis CI's base image or language: scala to be whatevet the JDK, like JDK 11 for xenial. since I'm installing a new JDK I don't want the java on PATH and JAVA_HOME to be not inconsistent. This normally only matters when there's forking or Java only project. Alternatively I could try to do which java and set JAVA_HOME to wherever SDKMAN installs AdoptOpenJDK JDK.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, so sdk install adds the installed version to the path, but doesn't set JAVA_HOME. I'm fine with unsetting if we don't need it. For the record, jabba use sets both the PATH and JAVA_HOME.

- java -Xmx32m -version

script:
- admin/build.sh
Expand All @@ -42,5 +47,6 @@ before_cache:
- find $HOME/.ivy2/cache -name "ivydata-*.properties" | xargs rm
cache:
directories:
- $HOME/.ivy2/cache
- $HOME/.sbt
- $HOME/.ivy2/cache
- $HOME/.sbt
- $HOME/.sdkman
2 changes: 1 addition & 1 deletion admin/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ set -e
# of the existing tag. Then a new tag can be created for that commit, e.g., `v1.2.3#2.13.0-M5`.
# Everything after the `#` in the tag name is ignored.

if [[ "$TRAVIS_JDK_VERSION" == "openjdk8" && "$TRAVIS_SCALA_VERSION" =~ 2\.1[23]\..* ]]; then
if [[ "$ADOPTOPENJDK" == "8" && "$TRAVIS_SCALA_VERSION" =~ 2\.1[23]\..* ]]; then
RELEASE_COMBO=true;
fi

Expand Down