summaryrefslogtreecommitdiff
path: root/project
diff options
context:
space:
mode:
authorStefan Zeiger <szeiger@novocode.com>2016-11-02 15:55:27 +0100
committerStefan Zeiger <szeiger@novocode.com>2016-11-10 16:31:35 +0100
commitea2451eb40fc24fa29b640d75240fbe72c3d156a (patch)
treeabcf8e3f9d7903af8320827240701b886072a35a /project
parentc39b31cb14a23ba33e669a06cedd4c1be2dc5b60 (diff)
downloadscala-ea2451eb40fc24fa29b640d75240fbe72c3d156a.tar.gz
scala-ea2451eb40fc24fa29b640d75240fbe72c3d156a.tar.bz2
scala-ea2451eb40fc24fa29b640d75240fbe72c3d156a.zip
Don’t include scala-asm.jar in scala-compiler.jar
Fixes https://github.com/scala/scala-dev/issues/254
Diffstat (limited to 'project')
-rw-r--r--project/Osgi.scala13
1 files changed, 9 insertions, 4 deletions
diff --git a/project/Osgi.scala b/project/Osgi.scala
index 3b578572c9..082fd91ed1 100644
--- a/project/Osgi.scala
+++ b/project/Osgi.scala
@@ -37,9 +37,9 @@ object Osgi {
},
jarlist := false,
bundle := Def.task {
- val res = (products in Compile in packageBin).value
- bundleTask(headers.value.toMap, jarlist.value, (products in Compile in packageBin).value,
- (artifactPath in (Compile, packageBin)).value, res, streams.value)
+ val cp = (products in Compile in packageBin).value
+ bundleTask(headers.value.toMap, jarlist.value, cp,
+ (artifactPath in (Compile, packageBin)).value, cp, streams.value)
}.value,
packagedArtifact in (Compile, packageBin) := (((artifact in (Compile, packageBin)).value, bundle.value)),
// Also create OSGi source bundles:
@@ -57,7 +57,12 @@ object Osgi {
val builder = new Builder
builder.setClasspath(fullClasspath.toArray)
headers foreach { case (k, v) => builder.setProperty(k, v) }
- val includeRes = resourceDirectories.filter(_.exists).map(_.getAbsolutePath).mkString(",")
+
+ // https://github.com/scala/scala-dev/issues/254
+ // Must be careful not to include scala-asm.jar within scala-compiler.jar!
+ def resourceDirectoryRef(f: File) = (if (f.isDirectory) "" else "@") + f.getAbsolutePath
+
+ val includeRes = resourceDirectories.filter(_.exists).map(resourceDirectoryRef).mkString(",")
if(!includeRes.isEmpty) builder.setProperty(INCLUDERESOURCE, includeRes)
builder.getProperties.asScala.foreach { case (k, v) => log.debug(s"bnd: $k: $v") }
// builder.build is not thread-safe because it uses a static SimpleDateFormat. This ensures