From 8247b8f077c96ba9a017b53de4d8062fe428c4a7 Mon Sep 17 00:00:00 2001 From: Lukas Rytz Date: Tue, 30 Jun 2015 12:33:07 +0200 Subject: Prepare build for inclusion of java8-compat

Allow mixed builds in ant

The `JFunction` classes depend on the `FunctionN` traits, so the Java compiler needs the Scala library on the classpath. At the same time, while compiling the Scala library, the symbols for `JFunction` classes need to be available to emit indy-lambda closures. Therefore we pass the `JFunctions` as Java sources while compiling the Scala library.

Upgrade versions of osgi tools

Set the required java version in bnd files (JavaSE-1.8). Introduce `scala-swing.version.osgi` as a quick hack to allow manually deriving an osgi-friendly version number for the `scala-swing.version.number`. The latter is used to resolve the artifact, the osgi version is just so we can generate a bundle that osgi will accept. Bnd 1.50 doesn't work with Java 8 classfiles, so upgrade to 2.4.1. Also upgrade all other tools to make tests pass. For `org.eclipse.osgi` we moved to the group ID `org.eclipse.tycho`, where there's a newer version available. The osgi tests would fail with the most recent version available in the `org.eclipse.osgi` groupID. The new version of bnd only copies *classfiles* from the original into the resulting jar, while the old version also copied all other files. This caused osgi test failure with a `NoClassDefFound`, which was really due to a `NumberFormatException` in `ScalaVersion`, as it couldn't find the properties file to parse the version in... Include resources from source jar into osgi bundle as follows: ``` Include-Resource: @@SOURCE_JARNAME@ ``` This makes bnd copy all resources from the source jar. I ran the following on the osgi artifacts of this branch, and on 2.11.x: ``` for f in `find build/osgi -name '*.jar' -a -not -name '*src.jar'`; do unzip -l $f | grep -v '\.class' ; done ``` Comparing the two file lists, things look OK: https://gist.github.com/lrytz/be08db051a53eded192d --- build.sbt | 1 + 1 file changed, 1 insertion(+) (limited to 'build.sbt') diff --git a/build.sbt b/build.sbt index 03e0e73fc8..4a01ac4549 100644 --- a/build.sbt +++ b/build.sbt @@ -142,6 +142,7 @@ lazy val library = configureAsSubproject(project) .settings(generatePropertiesFileSettings: _*) .settings( name := "scala-library", + compileOrder := CompileOrder.Mixed, // needed for JFunction classes in scala.runtime.java8 scalacOptions in Compile ++= Seq[String]("-sourcepath", (scalaSource in Compile).value.toString), // Workaround for a bug in `scaladoc` that it seems to not respect the `-sourcepath` option // as a result of this bug, the compiler cannot even initialize Definitions without -- cgit v1.2.3