From 5679159827afbb34fac272d3b71824e43da2705c Mon Sep 17 00:00:00 2001 From: Tobias Roeser Date: Wed, 23 Apr 2014 19:35:01 +0200 Subject: Restrict Import-Package for scala.* Restrict the Import-Package OSGi manifest entry to match only binary compatible scala.* packages. This is necessary, because the Scala OSGi versions do not match the OSGi semantic versioning policy and are not binary compatible between their OSGi minor versions. This means that e.g. the scala-compiler-2.11 bundle will never work if it imports a scala.* package from 2.10 or 2.12. Thus this patch enforces a tight version range, only accepting versions within the same minor version. E.g. Applied to version 2.11.1 the range would expand to "[2.11,2.12)". Additionally, a Java 6 execution environment will be enforced for OSGi. All module bundles need to have their own version numbers. This was not the case before this commit. Although these module bundles were only build for testing, they are needed to be correct, now, that we have stricter package import constraints and some test cases rely on them. --- src/build/bnd/scala-actors.bnd | 2 ++ src/build/bnd/scala-compiler-doc.bnd | 4 +++- src/build/bnd/scala-compiler-interactive.bnd | 4 +++- src/build/bnd/scala-compiler.bnd | 5 +++++ src/build/bnd/scala-continuations-library.bnd | 5 ++++- src/build/bnd/scala-continuations-plugin.bnd | 5 ++++- src/build/bnd/scala-library.bnd | 2 ++ src/build/bnd/scala-parser-combinators.bnd | 5 ++++- src/build/bnd/scala-reflect.bnd | 6 +++++- src/build/bnd/scala-swing.bnd | 5 ++++- src/build/bnd/scala-xml.bnd | 5 ++++- 11 files changed, 40 insertions(+), 8 deletions(-) (limited to 'src/build') diff --git a/src/build/bnd/scala-actors.bnd b/src/build/bnd/scala-actors.bnd index 8d0555777f..ea0ac52145 100644 --- a/src/build/bnd/scala-actors.bnd +++ b/src/build/bnd/scala-actors.bnd @@ -3,3 +3,5 @@ Bundle-SymbolicName: org.scala-lang.scala-actors ver: @VERSION@ Bundle-Version: ${ver} Export-Package: *;version=${ver} +Import-Package: scala.*;version="${range;[==,=+);${ver}}",* +Bundle-RequiredExecutionEnvironment: JavaSE-1.6 diff --git a/src/build/bnd/scala-compiler-doc.bnd b/src/build/bnd/scala-compiler-doc.bnd index 4910e5fcb0..a68c938315 100644 --- a/src/build/bnd/scala-compiler-doc.bnd +++ b/src/build/bnd/scala-compiler-doc.bnd @@ -3,4 +3,6 @@ Bundle-SymbolicName: org.scala-lang.modules.scala-compiler-doc_@SCALA_BINARY_VER ver: @SCALA_COMPILER_DOC_VERSION@ Bundle-Version: ${ver} Export-Package: *;version=${ver} -Import-Package: * +Import-Package: scala.*;version="${range;[==,=+);@VERSION@}",* +Bundle-RequiredExecutionEnvironment: JavaSE-1.6 + diff --git a/src/build/bnd/scala-compiler-interactive.bnd b/src/build/bnd/scala-compiler-interactive.bnd index 34d2f2956d..8869aeb811 100644 --- a/src/build/bnd/scala-compiler-interactive.bnd +++ b/src/build/bnd/scala-compiler-interactive.bnd @@ -3,4 +3,6 @@ Bundle-SymbolicName: org.scala-lang.modules.scala-compiler-interactive_@SCALA_BI ver: @SCALA_COMPILER_INTERACTIVE_VERSION@ Bundle-Version: ${ver} Export-Package: *;version=${ver} -Import-Package: * +Import-Package: scala.*;version="${range;[==,=+);@VERSION@}",* +Bundle-RequiredExecutionEnvironment: JavaSE-1.6 + diff --git a/src/build/bnd/scala-compiler.bnd b/src/build/bnd/scala-compiler.bnd index dc30513db4..98b743b2af 100644 --- a/src/build/bnd/scala-compiler.bnd +++ b/src/build/bnd/scala-compiler.bnd @@ -5,4 +5,9 @@ Bundle-Version: ${ver} Export-Package: *;version=${ver} Import-Package: jline.*;resolution:=optional, \ org.apache.tools.ant.*;resolution:=optional, \ + scala.util.parsing.*;version="${range;[===,=+);@PARSER_COMBINATORS_VERSION@}", \ + scala.xml.*;version="${range;[===,=+);@XML_VERSION@}", \ + scala.*;version="${range;[==,=+);${ver}}", \ * +Bundle-RequiredExecutionEnvironment: JavaSE-1.6 + diff --git a/src/build/bnd/scala-continuations-library.bnd b/src/build/bnd/scala-continuations-library.bnd index bb505b60a9..6d81973438 100644 --- a/src/build/bnd/scala-continuations-library.bnd +++ b/src/build/bnd/scala-continuations-library.bnd @@ -1,5 +1,8 @@ Bundle-Name: Scala Delimited Continuations Library Bundle-SymbolicName: org.scala-lang.plugins.scala-continuations-library -ver: @VERSION@ +ver: @CONTINUATIONS_LIBRARY_VERSION@ Bundle-Version: ${ver} Export-Package: *;version=${ver} +Import-Package: scala.*;version="${range;[==,=+);@VERSION@}",* +Bundle-RequiredExecutionEnvironment: JavaSE-1.6 + diff --git a/src/build/bnd/scala-continuations-plugin.bnd b/src/build/bnd/scala-continuations-plugin.bnd index cd66614a22..40ea2e8511 100644 --- a/src/build/bnd/scala-continuations-plugin.bnd +++ b/src/build/bnd/scala-continuations-plugin.bnd @@ -1,5 +1,8 @@ Bundle-Name: Scala Delimited Continuations Compiler Plugin Bundle-SymbolicName: org.scala-lang.plugins.scala-continuations-plugin -ver: @VERSION@ +ver: @CONTINUATIONS_PLUGIN_VERSION@ Bundle-Version: ${ver} Export-Package: *;version=${ver} +Import-Package: scala.*;version="${range;[==,=+);@VERSION@}",* +Bundle-RequiredExecutionEnvironment: JavaSE-1.6 + diff --git a/src/build/bnd/scala-library.bnd b/src/build/bnd/scala-library.bnd index 03aff45672..ff78c52701 100644 --- a/src/build/bnd/scala-library.bnd +++ b/src/build/bnd/scala-library.bnd @@ -4,3 +4,5 @@ ver: @VERSION@ Bundle-Version: ${ver} Export-Package: *;version=${ver} Import-Package: sun.misc;resolution:=optional, * +Bundle-RequiredExecutionEnvironment: JavaSE-1.6 + diff --git a/src/build/bnd/scala-parser-combinators.bnd b/src/build/bnd/scala-parser-combinators.bnd index 6ffc3b2760..bdaff5fb0d 100644 --- a/src/build/bnd/scala-parser-combinators.bnd +++ b/src/build/bnd/scala-parser-combinators.bnd @@ -1,5 +1,8 @@ Bundle-Name: Scala Parser Combinators Library Bundle-SymbolicName: org.scala-lang.modules.scala-parser-combinators -ver: @VERSION@ +ver: @PARSER_COMBINATORS_VERSION@ Bundle-Version: ${ver} Export-Package: *;version=${ver} +Import-Package: scala.*;version="${range;[==,=+);@VERSION@}",* +Bundle-RequiredExecutionEnvironment: JavaSE-1.6 + diff --git a/src/build/bnd/scala-reflect.bnd b/src/build/bnd/scala-reflect.bnd index 6cda346d3a..a8afca4af0 100644 --- a/src/build/bnd/scala-reflect.bnd +++ b/src/build/bnd/scala-reflect.bnd @@ -3,4 +3,8 @@ Bundle-SymbolicName: org.scala-lang.scala-reflect ver: @VERSION@ Bundle-Version: ${ver} Export-Package: *;version=${ver} -Import-Package: scala.tools.nsc;resolution:=optional, * +Import-Package: scala.*;version="${range;[==,=+);${ver}}", \ + scala.tools.nsc;resolution:=optional;version="${range;[==,=+);${ver}}", \ + * +Bundle-RequiredExecutionEnvironment: JavaSE-1.6 + diff --git a/src/build/bnd/scala-swing.bnd b/src/build/bnd/scala-swing.bnd index 7cccb1343b..62e198dc34 100644 --- a/src/build/bnd/scala-swing.bnd +++ b/src/build/bnd/scala-swing.bnd @@ -1,5 +1,8 @@ Bundle-Name: Scala Swing Bundle-SymbolicName: org.scala-lang.modules.scala-swing -ver: @VERSION@ +ver: @SCALA_SWING_VERSION@ Bundle-Version: ${ver} Export-Package: *;version=${ver} +Import-Package: scala.*;version="${range;[==,=+);@VERSION@}",* +Bundle-RequiredExecutionEnvironment: JavaSE-1.6 + diff --git a/src/build/bnd/scala-xml.bnd b/src/build/bnd/scala-xml.bnd index 5d64c05e65..2789b0e01c 100644 --- a/src/build/bnd/scala-xml.bnd +++ b/src/build/bnd/scala-xml.bnd @@ -1,5 +1,8 @@ Bundle-Name: Scala XML Library Bundle-SymbolicName: org.scala-lang.modules.scala-xml -ver: @VERSION@ +ver: @XML_VERSION@ Bundle-Version: ${ver} Export-Package: *;version=${ver} +Import-Package: scala.*;version="${range;[==,=+);@VERSION@}",* +Bundle-RequiredExecutionEnvironment: JavaSE-1.6 + -- cgit v1.2.3