Skip to content

Commit be18260

Browse files
committed
Merge pull request #247 from JoshRosen/scala-2.12.0-M4
Cross-build for Scala 2.12.0-M4
2 parents 0990f98 + 2377c08 commit be18260

File tree

2 files changed

+24
-9
lines changed

2 files changed

+24
-9
lines changed

.travis.yml

+15-7
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,21 @@ cache:
55
- $HOME/.sbt
66

77
language: scala
8-
jdk:
9-
- oraclejdk8
10-
- openjdk6
8+
matrix:
9+
include:
10+
# Test Scala 2.10 and 2.11 with both JDK 6 and 8
11+
- scala: 2.10.6
12+
jdk: openjdk6
13+
- scala: 2.11.7
14+
jdk: openjdk6
15+
- scala: 2.10.6
16+
jdk: oraclejdk8
17+
- scala: 2.11.7
18+
jdk: oraclejdk8
19+
# Scala 2.12+ only supports JDK 8+
20+
- scala: 2.12.0-M4
21+
jdk: oraclejdk8
1122

12-
scala:
13-
- 2.10.6
14-
- 2.11.7
1523
sbt_args: "'set resolvers += \"Sonatype OSS Snapshots\" at \"https://oss.sonatype.org/content/repositories/snapshots\"'"
1624

1725
before_script:
@@ -21,7 +29,7 @@ before_script:
2129

2230
after_success:
2331
- >
24-
test "${TRAVIS_PULL_REQUEST}" = 'false' && test "${TRAVIS_JDK_VERSION}" = 'openjdk6' &&
32+
test "${TRAVIS_PULL_REQUEST}" = 'false' && test "${TRAVIS_JDK_VERSION}" = 'openjdk6' -o "${TRAVIS_SCALA_VERSION}" = '2.12.0-M4' &&
2533
sbt 'set resolvers += "Sonatype OSS Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots"'
2634
'set credentials += Credentials("Sonatype Nexus Repository Manager", "oss.sonatype.org", System.getenv("SONATYPE_USER"), System.getenv("SONATYPE_PASS"))'
2735
++${TRAVIS_SCALA_VERSION}

build.sbt

+9-2
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,15 @@ javacOptions ++= Seq(
2525
"-bootclasspath", Array((java6Home / "jre" / "lib" / "rt.jar").toString, (java6Home / ".." / "Classes"/ "classes.jar").toString).mkString(File.pathSeparator)
2626
)
2727

28-
// Try to future-proof scala jvm targets, in case some future scala version makes 1.7 a default
29-
scalacOptions += "-target:jvm-1.6"
28+
scalacOptions ++= (
29+
if (scalaVersion.value.startsWith("2.12")) {
30+
// -target is deprecated as of Scala 2.12, which uses JVM 1.8 bytecode
31+
Seq.empty
32+
} else {
33+
// Explicitly target 1.6 for scala < 2.12
34+
Seq("-target:jvm-1.6")
35+
}
36+
)
3037

3138
libraryDependencies ++= Seq(
3239
"org.scala-lang" % "scala-reflect" % scalaVersion.value,

0 commit comments

Comments
 (0)