Skip to content

Set a different jdk went running forked test (fix #77) #83

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

Closed
wants to merge 2 commits into from
Closed
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
22 changes: 16 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,14 @@ scala:
- 2.12.6
- 2.13.0-M4
jdk:
- openjdk7
- openjdk6
- oraclejdk8
env:
global:
# force jdk 8 for sbt due to sonatype droping support for jdk6 on https (TLS 1.0)
# https://stackoverflow.com/questions/50824789/why-am-i-getting-received-fatal-alert-protocol-version-or-peer-not-authentic/50824799#50824799
- JAVA_HOME: /usr/lib/jvm/java-8-oracle

# PGP_PASSPHRASE
- secure: "rjetmX9HXoN/scxTCBFCHIUDFryY0Yd29sR6EBrW/2tCOILO09RTCcJB0kPn2YMZ9en8ChTtOpqGF9133f6wZ7/ZINSUt1tNwnbgDlhGbwJW2WFTUEmL7ScdqmgRGa294aVuAfrvJnr+dN92it6ibAB8nThgsjq0LnZREJsKwQ77vvEeATEKutuPLGlrHrmqL7/XCjb2uYz9Xh0sSpyQlKOGt5EN7JzM/Bzyju+RYS9BvnLVV86fey/UWO1DNDa4MU5835akevqvtwN7CpCFxFKgbfc+40bAh7Xc59UnkxP+Lcs2KxJx9heS6RJJiNEx99r59LL2JALyN++yOAS97HEfii4Yc3OK9VRZCNQFW4gNm3VtGNW4EC+LOX/9cUiUNg2J65nY0UF2d6R3vsqiCKaK6C0cm+jIs3fgDHFlB+MiHC/ZECaoPvwzm1AxQMIWyoFFqXuHQk3Ef137G0x1ejneUoGD/PqMbiEAX64+VVvOxgOI2/jyt4hFTEk6JiWVahmk+7oFAsLH1n9J1Y3csMvmo9S0S/Ey9D3bR07hggc8pj/CJPj9gFSfpGEVhroc37T/VlP23EVJgpteovERyeJGC3P7wVWvi1pNNW6iOVENzY1GkHlHkJUI7Q4B+eIW2mh5wi6JyC/DM2lO4z3M2KQkNqQgzIBdm5p/4hezkkA="
# SONA_USER
Expand All @@ -23,10 +27,10 @@ env:
matrix:
exclude:
# > 2.12 requires jdk8
- jdk: openjdk7
- jdk: openjdk6
scala: 2.12.6

- jdk: openjdk7
- jdk: openjdk6
scala: 2.13.0-M4

# ?
Expand All @@ -43,11 +47,17 @@ matrix:
jdk: oraclejdk8
env: TEST_SCALAFIX=true

- addons:
apt:
packages:
- openjdk-6-jdk
jdk: openjdk6

# | jdk | scala | scala target | scala target version | scalafix test |
# | ----------- | --------- | ------------ | -------------------- |---------------|
# | openjdk7 | 2.11.12 | jvm | | |
# | openjdk7 | 2.11.12 | js | 0.6.23 | |
# | openjdk7 | 2.11.12 | js | 1.0.0-M3 | |
# | openjdk6 | 2.11.12 | jvm | | |
# | openjdk6 | 2.11.12 | js | 0.6.23 | |
# | openjdk6 | 2.11.12 | js | 1.0.0-M3 | |
# | oraclejdk8 | 2.12.6 | jvm | | |
# | oraclejdk8 | 2.12.6 | js | 0.6.23 | |
# | oraclejdk8 | 2.12.6 | js | 1.0.0-M3 | |
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ To use this library, add the following to your build.sbt:
libraryDependencies += "org.scala-lang.modules" %% "scala-collection-compat" % "0.1.1"
```


Note that there are multiple ways to cross-build projects, see https://github.com/scala/collection-strawman/wiki/FAQ#how-do-i-cross-build-my-project-against-scala-212-and-scala-213.

Also note that this library has not fully stabilized yet. We expect that new, binary incompatible releases of this library will be published (for 2.11, 2.12) until Scala 2.13 is getting close to its final state. Therefore you might want to avoid adding a dependency on that library to your 2.11 / 2.12 artifacts for the time being.
Expand Down
2 changes: 1 addition & 1 deletion admin/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,4 @@ if [[ "$TRAVIS_TAG" =~ $tagPat ]]; then
fi
fi

sbt -Dhttps.protocols=TLSv1.2 -sbt-dir=/home/travis/.sbt ";$crossScalaVersion ;$publishVersion ;$projectPrefix/clean ;$testProjectPrefix/test ;$projectPrefix/publishLocal ;$publishTask"
sbt ";$crossScalaVersion ;$publishVersion ;$projectPrefix/clean ;$testProjectPrefix/test ;$projectPrefix/publishLocal ;$publishTask"
19 changes: 18 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,24 @@ lazy val compat = crossProject(JSPlatform, JVMPlatform)
)
.jvmSettings(
OsgiKeys.exportPackage := Seq(s"scala.collection.compat.*;version=${version.value}"),
libraryDependencies += "com.novocode" % "junit-interface" % "0.11" % "test"
libraryDependencies += "com.novocode" % "junit-interface" % "0.11" % "test",
javaHome := {
val oldValue = javaHome.value
val isOnCi = sys.env.get("CI").isDefined

if (isOnCi) {
// switch back to the jdk set by the build matrix
val ciJavaHome =
sys.env("TRAVIS_JDK_VERSION") match {
case "openjdk6" => "/usr/lib/jvm/java-6-openjdk-amd64"
case "oraclejdk8" => "/usr/lib/jvm/java-8-oracle"
}

println(s"using JAVA_HOME: $ciJavaHome")
Some(file(ciJavaHome))
}
else oldValue
}
)
.jsSettings(
scalacOptions += {
Expand Down
25 changes: 25 additions & 0 deletions compat/src/test/scala/test/scala/collection/JdkVersionTest.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package test.scala.collection

import org.junit.Assert._
import org.junit.Test

class JdkVersionTest {

@Test
def testJavaVersion: Unit = {
val isOnCi = sys.env.get("CI").isDefined

if (isOnCi) {
val travisJdkVersion = sys.env("TRAVIS_JDK_VERSION")
val jdkVersion = sys.props("java.specification.version")

if (travisJdkVersion == "openjdk6") {
assertEquals(jdkVersion, "1.8")
} else if (travisJdkVersion == "oraclejdk8") {
assertEquals(jdkVersion, "1.6")
} else {
throw new Exception(s"Unknown CI jdk version: $travisJdkVersion")
}
}
}
}