Skip to content

Commit 38fbbbe

Browse files
committed
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.
1 parent bc859b1 commit 38fbbbe

File tree

4 files changed

+15
-9
lines changed

4 files changed

+15
-9
lines changed

.travis.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ language: scala
22

33
env:
44
global:
5-
- PUBLISH_JDK=openjdk6
65
# PGP_PASSPHRASE
76
- secure: "BYC1kEnHjNrINrHYWPGEuTTJ2V340/0ByzqeihLecjoZ75yrjWdsh6MI1JEUWgv5kb+58vLzib21JfnjsPK6Yb2bSXuCFCsEtJNh6RJKgxkWlCOzfTSh5I2wl7PCjRClRL6gseX2uTSvFjL4Z//pmxwxeXlLp7voQe4QAUq1+sE="
87
# SONA_USER
@@ -14,7 +13,7 @@ script: admin/build.sh
1413

1514
jdk:
1615
- openjdk6
17-
- openjdk7
16+
- oraclejdk8
1817

1918
notifications:
2019

admin/README.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ To configure tag driven releases from Travis CI.
1919
Edit `.travis.yml` as prompted.
2020
4. Edit `.travis.yml` to use `./admin/build.sh` as the build script,
2121
and edit that script to use the tasks required for this project.
22-
5. Edit `.travis.yml` to select which JDK will be used for publishing.
22+
5. Edit `build.sbt` to select which JDK will be used for publishing
23+
for which Scala versions.
2324

2425
It is important to add comments in .travis.yml to identify the name
2526
of each environment variable encoded in a `:secure` section.
@@ -30,7 +31,6 @@ form:
3031
language: scala
3132
env:
3233
global:
33-
- PUBLISH_JDK=openjdk6
3434
# PGP_PASSPHRASE
3535
- secure: "XXXXXX"
3636
# SONA_USER
@@ -58,4 +58,3 @@ Be sure to use SBT 0.13.7 or higher to avoid [#1430](https://github.com/sbt/sbt/
5858
3. Log into https://oss.sonatype.org/ and identify the staging repository.
5959
4. Sanity check its contents
6060
5. Release staging repository to Maven and send out release announcement.
61-

admin/build.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ set -e
77
# git on travis does not fetch tags, but we have TRAVIS_TAG
88
# headTag=$(git describe --exact-match ||:)
99

10-
if [ "$TRAVIS_JDK_VERSION" == "$PUBLISH_JDK" ] && [[ "$TRAVIS_TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-[A-Za-z0-9-]+)? ]]; then
10+
if [[ "$TRAVIS_TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-[A-Za-z0-9-]+)? ]]; then
1111
echo "Going to release from tag $TRAVIS_TAG!"
1212
myVer=$(echo $TRAVIS_TAG | sed -e s/^v//)
1313
publishVersion='set every version := "'$myVer'"'

build.sbt

+11-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,17 @@ version := "1.0.5-SNAPSHOT"
88

99
scalaVersion := crossScalaVersions.value.head
1010

11-
crossScalaVersions := Seq("2.11.7", "2.12.0-M2")
12-
13-
//scalacOptions ++= "-deprecation:false -feature -Xlint:-stars-align,-nullary-unit,_ -Xfatal-warnings -Xxml:coalescing".split("\\s+").to[Seq]
11+
crossScalaVersions := {
12+
val java = System.getProperty("java.version")
13+
if (java.startsWith("1.6."))
14+
Seq("2.11.7", "2.12.0-M1")
15+
else if (java.startsWith("1.8."))
16+
Seq("2.12.0-M2")
17+
else
18+
sys.error(s"don't know what Scala versions to build on $java")
19+
}
20+
21+
//reenable -Xfatal-warnings?
1422
scalacOptions ++= "-deprecation:false -feature -Xlint:-stars-align,-nullary-unit,_".split("\\s+").to[Seq]
1523

1624
scalacOptions in Test += "-Xxml:coalescing"

0 commit comments

Comments
 (0)