Skip to content

add Java 9 test #179

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
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ addons:
jdk:
- openjdk6
- oraclejdk8
- oraclejdk9

notifications:
email: [email protected]
Expand Down
2 changes: 1 addition & 1 deletion admin/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ if [[ "$TRAVIS_TAG" =~ $tagPat ]]; then
openssl aes-256-cbc -K $K -iv $IV -in admin/secring.asc.enc -out admin/secring.asc -d
fi

sbt "$publishVersion" "$publishScalaVersion" clean update +test +publishLocal $extraTarget
sbt -Dsbt.scala.version=2.10.7 "$publishVersion" "$publishScalaVersion" clean update +test +publishLocal $extraTarget
Copy link
Member

@ashawley ashawley Dec 24, 2017

Choose a reason for hiding this comment

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

I saw @SethTisue mention this, but I'd rather avoid breaking fix the build for people.

26 changes: 18 additions & 8 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import ScalaModulePlugin._

scalaVersionsByJvm in ThisBuild := {
val v211 = "2.11.11"
val v211 = "2.11.12"
val v212 = "2.12.3"
val v213 = "2.13.0-M2"
Map(
Expand All @@ -25,13 +25,23 @@ lazy val xml = crossProject.in(file("."))
scalacOptions ++= "-deprecation:false -feature -Xlint:-stars-align,-nullary-unit,_".split("\\s+").to[Seq],
scalacOptions in Test += "-Xxml:coalescing",

apiMappings ++= Map(
scalaInstance.value.libraryJar
-> url(s"http://www.scala-lang.org/api/${scalaVersion.value}/"),
// http://stackoverflow.com/questions/16934488
file(System.getProperty("sun.boot.class.path").split(java.io.File.pathSeparator).filter(_.endsWith(java.io.File.separator + "rt.jar")).head)
-> url("http://docs.oracle.com/javase/8/docs/api")
)
apiMappings ++= {
Map(
scalaInstance.value.libraryJar
-> url(s"http://www.scala-lang.org/api/${scalaVersion.value}/")
) ++ {
// http://stackoverflow.com/questions/16934488
Option(System.getProperty("sun.boot.class.path"))
.map(path =>
Map(
file(path
.split(java.io.File.pathSeparator)
.filter(_.endsWith(java.io.File.separator + "rt.jar")).head)
-> url("http://docs.oracle.com/javase/8/docs/api")
))
.getOrElse(Map.empty)
}
}
Copy link
Member

Choose a reason for hiding this comment

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

This refactoring actually causes an NPE to silently succeed with the doc task. It's better if the task still fails, IMO.

This part of the sbt config may get replaced by https://github.com/ThoughtWorksInc/sbt-api-mappings

Copy link
Member

Choose a reason for hiding this comment

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

Sorry, I take this back. We will need to degrade when the Java boostrap classpath is unavailable. I'll be using this PR as a basis for fixing Java 9 including the external doc linking.

)
.jvmSettings(
OsgiKeys.exportPackage := Seq(s"scala.xml.*;version=${version.value}"),
Expand Down