From 38fbbbeeff6bc97c4438e3e37041894c93538e46 Mon Sep 17 00:00:00 2001 From: Seth Tisue Date: Tue, 21 Jul 2015 17:16:09 -0400 Subject: [PATCH] redo how crossScalaVersions works the old scheme was: run tests on openjdk7 too, but only publish (for all Scala versions) from openjdk6 this is no longer appropriate now that Scala 2.12.0-M2 requires Java 8. now we want to publish for older Scala versions using JDK 6, but newer versions (M2 and above) using JDK 8. this commit does that. currently Travis doesn't offer OpenJDK 8, so we use Oracle. leaving our JDK 6 setting as "openjdk6" since that's what it's historically been so why rock the boat. what happened to running tests on JDK 7? well, neither Lukas nor I knows why it was even doing that. --- .travis.yml | 3 +-- admin/README.md | 5 ++--- admin/build.sh | 2 +- build.sbt | 14 +++++++++++--- 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9a80fe916..80dde716f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,6 @@ language: scala env: global: - - PUBLISH_JDK=openjdk6 # PGP_PASSPHRASE - secure: "BYC1kEnHjNrINrHYWPGEuTTJ2V340/0ByzqeihLecjoZ75yrjWdsh6MI1JEUWgv5kb+58vLzib21JfnjsPK6Yb2bSXuCFCsEtJNh6RJKgxkWlCOzfTSh5I2wl7PCjRClRL6gseX2uTSvFjL4Z//pmxwxeXlLp7voQe4QAUq1+sE=" # SONA_USER @@ -14,7 +13,7 @@ script: admin/build.sh jdk: - openjdk6 - - openjdk7 + - oraclejdk8 notifications: email: adriaan.moors@typesafe.com diff --git a/admin/README.md b/admin/README.md index 55ae9c8ae..d84727a74 100644 --- a/admin/README.md +++ b/admin/README.md @@ -19,7 +19,8 @@ To configure tag driven releases from Travis CI. Edit `.travis.yml` as prompted. 4. Edit `.travis.yml` to use `./admin/build.sh` as the build script, and edit that script to use the tasks required for this project. - 5. Edit `.travis.yml` to select which JDK will be used for publishing. + 5. Edit `build.sbt` to select which JDK will be used for publishing + for which Scala versions. It is important to add comments in .travis.yml to identify the name of each environment variable encoded in a `:secure` section. @@ -30,7 +31,6 @@ form: language: scala env: global: - - PUBLISH_JDK=openjdk6 # PGP_PASSPHRASE - secure: "XXXXXX" # SONA_USER @@ -58,4 +58,3 @@ Be sure to use SBT 0.13.7 or higher to avoid [#1430](https://github.com/sbt/sbt/ 3. Log into https://oss.sonatype.org/ and identify the staging repository. 4. Sanity check its contents 5. Release staging repository to Maven and send out release announcement. - diff --git a/admin/build.sh b/admin/build.sh index 34f5ccda1..bdd8490de 100755 --- a/admin/build.sh +++ b/admin/build.sh @@ -7,7 +7,7 @@ set -e # git on travis does not fetch tags, but we have TRAVIS_TAG # headTag=$(git describe --exact-match ||:) -if [ "$TRAVIS_JDK_VERSION" == "$PUBLISH_JDK" ] && [[ "$TRAVIS_TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-[A-Za-z0-9-]+)? ]]; then +if [[ "$TRAVIS_TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-[A-Za-z0-9-]+)? ]]; then echo "Going to release from tag $TRAVIS_TAG!" myVer=$(echo $TRAVIS_TAG | sed -e s/^v//) publishVersion='set every version := "'$myVer'"' diff --git a/build.sbt b/build.sbt index ee6011de4..dc924849d 100644 --- a/build.sbt +++ b/build.sbt @@ -8,9 +8,17 @@ version := "1.0.5-SNAPSHOT" scalaVersion := crossScalaVersions.value.head -crossScalaVersions := Seq("2.11.7", "2.12.0-M2") - -//scalacOptions ++= "-deprecation:false -feature -Xlint:-stars-align,-nullary-unit,_ -Xfatal-warnings -Xxml:coalescing".split("\\s+").to[Seq] +crossScalaVersions := { + val java = System.getProperty("java.version") + if (java.startsWith("1.6.")) + Seq("2.11.7", "2.12.0-M1") + else if (java.startsWith("1.8.")) + Seq("2.12.0-M2") + else + sys.error(s"don't know what Scala versions to build on $java") +} + +//reenable -Xfatal-warnings? scalacOptions ++= "-deprecation:false -feature -Xlint:-stars-align,-nullary-unit,_".split("\\s+").to[Seq] scalacOptions in Test += "-Xxml:coalescing"