From 60726ed5ee030cbe925dee363170d67a1aba176b Mon Sep 17 00:00:00 2001 From: Mirco Dotta Date: Tue, 13 Aug 2013 16:02:17 +0200 Subject: [PATCH] Added a source bundle for the sbt library. This commit allows debugging, hyperlinking, etc. towards sbt sources. Useful when working on the Sbt builder. * create a source bundle for the sbt library. I needed to inline the contents of sbt jars in order to get Eclipse to correctly associate sources with classfiles * created a new compiler.interface bundle, only for the compiler interface, together with the matching `compiler.interface.sources` bundle. Sbt requires this to be a separate jar and there was no way to build a single sbt bundle with only some of the dependencies inlined. A similar approach could be used for the Scala library/compiler bundles, but we should investigate the possibility of having the Scala team publish source bundles too (Re #1001889). (this was originally a commit from @dragos, which I have adapted based on the comments in https://github.com/scala-ide/scala-ide/pull/482) Fixes #1001888 --- .gitignore | 1 + org.scala-ide.build-toolchain/pom.xml | 15 +- .../pom.xml | 63 ++++++ org.scala-ide.sbt.compiler.interface/pom.xml | 62 ++++++ org.scala-ide.sbt.full.library.source/pom.xml | 189 ++++++++++++++++++ org.scala-ide.sbt.full.library/pom.xml | 30 +-- org.scala-ide.sdt.build/pom.xml | 15 ++ org.scala-ide.sdt.core/META-INF/MANIFEST.MF | 1 + .../src/scala/tools/eclipse/ScalaPlugin.scala | 4 +- org.scala-ide.sdt.feature/feature.xml | 7 + org.scala-ide.sdt.source.feature/feature.xml | 14 ++ 11 files changed, 374 insertions(+), 27 deletions(-) create mode 100644 org.scala-ide.sbt.compiler.interface.source/pom.xml create mode 100644 org.scala-ide.sbt.compiler.interface/pom.xml create mode 100644 org.scala-ide.sbt.full.library.source/pom.xml diff --git a/.gitignore b/.gitignore index 8a3d5600f3..4c7889b424 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ **/.cache +target/ diff --git a/org.scala-ide.build-toolchain/pom.xml b/org.scala-ide.build-toolchain/pom.xml index 652d283482..af9a9484f6 100644 --- a/org.scala-ide.build-toolchain/pom.xml +++ b/org.scala-ide.build-toolchain/pom.xml @@ -7,15 +7,28 @@ org.scala-ide.build 4.0.0-SNAPSHOT - + org.scala-ide.build-toolchain The Scala Toolchain for Scala Eclipse plugins pom 4.0.0-SNAPSHOT + + + + + typesafe-ide + Typesafe IDE repository + ${repo.typesafe} + + + ../org.scala-ide.scala.library ../org.scala-ide.scala.compiler ../org.scala-ide.sbt.full.library + ../org.scala-ide.sbt.full.library.source + ../org.scala-ide.sbt.compiler.interface + ../org.scala-ide.sbt.compiler.interface.source diff --git a/org.scala-ide.sbt.compiler.interface.source/pom.xml b/org.scala-ide.sbt.compiler.interface.source/pom.xml new file mode 100644 index 0000000000..33e9541998 --- /dev/null +++ b/org.scala-ide.sbt.compiler.interface.source/pom.xml @@ -0,0 +1,63 @@ + + + 4.0.0 + + org.scala-ide + org.scala-ide.build-toolchain + 4.0.0-SNAPSHOT + ../org.scala-ide.build-toolchain/pom.xml + + org.scala-ide.sbt.compiler.interface.source + bundle + + + + sbt-new + + + com.typesafe.sbt + compiler-interface-precompiled + ${sbt.ide.version} + sources + true + + + + + + sbt-legacy + + + org.scala-sbt + compiler-interface_${sbt.compiled.version} + ${sbt.version} + sources + true + + + + + + + + + + org.apache.felix + maven-bundle-plugin + + ${project.build.directory}/src + + Sbt Compiler Interface Sources for Eclipse + ${project.artifactId} + ${sbt.version}.${version.tag}-${version.suffix}-${maven.build.timestamp} + + org.scala-ide.sbt.compiler.interface;version="${sbt.version}.${version.tag}-${version.suffix}-${maven.build.timestamp}";roots:="." + + classifier=sources;inline=true + + + + + + diff --git a/org.scala-ide.sbt.compiler.interface/pom.xml b/org.scala-ide.sbt.compiler.interface/pom.xml new file mode 100644 index 0000000000..1280e45599 --- /dev/null +++ b/org.scala-ide.sbt.compiler.interface/pom.xml @@ -0,0 +1,62 @@ + + + 4.0.0 + + org.scala-ide + org.scala-ide.build-toolchain + 4.0.0-SNAPSHOT + ../org.scala-ide.build-toolchain/pom.xml + + org.scala-ide.sbt.compiler.interface + bundle + + + + sbt-new + + + com.typesafe.sbt + compiler-interface-precompiled + true + + + + + + sbt-legacy + + + org.scala-sbt + compiler-interface_${sbt.compiled.version} + true + + + + + + + + + + org.apache.felix + maven-bundle-plugin + + ${project.build.directory}/lib + + scala-ide.org + ${project.artifactId} + Sbt ${sbt.ide.version} Compiler Interface for Eclipse + + ${sbt.version}.${version.tag}-${version.suffix}-${maven.build.timestamp} + *;scope=compile|runtime;inline=true + <_exportcontents>xsbt.*;version=${sbt.version} + true + !org.apache.ivy.*,!org.bouncycastle.*,!org.scalatools.testing.*,!com.craft.*,!com.jcraft.*,!sun.misc,!org.apache.commons.vfs,!org.apache.commons.vfs.impl,!org.apache.oro.text,!org.apache.oro.text + .regex,* + + + + + + diff --git a/org.scala-ide.sbt.full.library.source/pom.xml b/org.scala-ide.sbt.full.library.source/pom.xml new file mode 100644 index 0000000000..ea8cde224d --- /dev/null +++ b/org.scala-ide.sbt.full.library.source/pom.xml @@ -0,0 +1,189 @@ + + + 4.0.0 + + org.scala-ide + org.scala-ide.build-toolchain + 4.0.0-SNAPSHOT + ../org.scala-ide.build-toolchain/pom.xml + + org.scala-ide.sbt.full.library.source + bundle + + + + sbt-new + + + com.typesafe.sbt + sbt-interface + ${sbt.ide.version} + sources + true + + + com.typesafe.sbt + incremental-compiler + ${sbt.ide.version} + sources + true + + + + + + sbt-legacy + + + org.scala-sbt + classpath_${sbt.compiled.version} + ${sbt.version} + sources + true + + + org.scala-sbt + logging_${sbt.compiled.version} + ${sbt.version} + sources + true + + + org.scala-sbt + io_${sbt.compiled.version} + ${sbt.version} + sources + true + + + org.scala-sbt + control_${sbt.compiled.version} + ${sbt.version} + sources + true + + + org.scala-sbt + classfile_${sbt.compiled.version} + ${sbt.version} + sources + true + + + org.scala-sbt + process_${sbt.compiled.version} + ${sbt.version} + sources + true + + + org.scala-sbt + relation_${sbt.compiled.version} + ${sbt.version} + sources + true + + + org.scala-sbt + interface_${sbt.compiled.version} + ${sbt.version} + sources + true + + + org.scala-sbt + persist_${sbt.compiled.version} + ${sbt.version} + sources + true + + + org.scala-sbt + api_${sbt.compiled.version} + ${sbt.version} + sources + true + + + org.scala-sbt + compiler-integration_${sbt.compiled.version} + ${sbt.version} + sources + true + + + org.scala-sbt + incremental-compiler_${sbt.compiled.version} + ${sbt.version} + sources + true + + + org.scala-sbt + compile_${sbt.compiled.version} + ${sbt.version} + sources + true + + + + jline + jline + ${jline.version} + sources + true + + + + + + + + + + + + maven-clean-plugin + + true + + + ./ + + META-INF/**/* + META-INF + target/**/* + target + + false + + + + + + org.apache.felix + maven-bundle-plugin + + ${project.build.directory}/src + + scala-ide.org + ${project.artifactId} + Sbt ${sbt.ide.version} Library Sources for Eclipse + ${sbt.version}.${version.tag}-${version.suffix}-${maven.build.timestamp} + + org.scala-ide.sbt.full.library;version="${sbt.version}.${version.tag}-${version.suffix}-${maven.build.timestamp}";roots:="." + + classifier=sources;inline=true + + + + + + diff --git a/org.scala-ide.sbt.full.library/pom.xml b/org.scala-ide.sbt.full.library/pom.xml index bf41b1a565..db44559be9 100644 --- a/org.scala-ide.sbt.full.library/pom.xml +++ b/org.scala-ide.sbt.full.library/pom.xml @@ -11,15 +11,6 @@ org.scala-ide.sbt.full.library bundle - - - - typesafe-ide - Typesafe IDE repository - ${repo.typesafe} - - - @@ -48,11 +39,6 @@ sbt-interface true - - com.typesafe.sbt - compiler-interface-precompiled - true - com.typesafe.sbt incremental-compiler @@ -129,11 +115,6 @@ compile_${sbt.compiled.version} true - - org.scala-sbt - compiler-interface_${sbt.compiled.version} - true - jline @@ -161,8 +142,6 @@ ./ - lib/**/* - lib META-INF/**/* META-INF target/**/* @@ -178,14 +157,15 @@ org.apache.felix maven-bundle-plugin + ${project.build.directory}/lib ${basedir}/META-INF + scala-ide.org org.scala-ide.sbt.full.library - Sbt ${sbt.version} Library for Eclipse - ${sbt.version}-${version.suffix}-${maven.build.timestamp} - *;scope=compile|runtime;inline=false + Sbt ${sbt.ide.version} Library for Eclipse + ${sbt.version}.${version.tag}-${version.suffix}-${maven.build.timestamp} + *;scope=compile|runtime;inline=true <_exportcontents>sbt.*;version=${sbt.version},xsbt.*;version=${sbt.version},xsbti.*;version=${sbt.version},sbinary.*;version=${sbt.version} - lib true !org.apache.ivy.*,!org.bouncycastle.*,!org.scalatools.testing.*,!com.craft.*,!com.jcraft.*,!sun.misc,!org.apache.commons.vfs,!org.apache.commons.vfs.impl,!org.apache.oro.text,!org.apache.oro.text .regex,* diff --git a/org.scala-ide.sdt.build/pom.xml b/org.scala-ide.sdt.build/pom.xml index 3edeef832d..73cb902bb0 100644 --- a/org.scala-ide.sdt.build/pom.xml +++ b/org.scala-ide.sdt.build/pom.xml @@ -90,6 +90,21 @@ org.scala-ide.sbt.full.library ${project.version} + + org.scala-ide + org.scala-ide.sbt.full.library.source + ${project.version} + + + org.scala-ide + org.scala-ide.sbt.compiler.interface + ${project.version} + + + org.scala-ide + org.scala-ide.sbt.compiler.interface.source + ${project.version} + diff --git a/org.scala-ide.sdt.core/META-INF/MANIFEST.MF b/org.scala-ide.sdt.core/META-INF/MANIFEST.MF index 989712efd3..b890dde89c 100644 --- a/org.scala-ide.sdt.core/META-INF/MANIFEST.MF +++ b/org.scala-ide.sdt.core/META-INF/MANIFEST.MF @@ -43,6 +43,7 @@ Require-Bundle: org.scala-ide.scala.compiler, org.scala-refactoring.library, org.scala-ide.sbt.full.library;bundle-version="[0.13,0.14)", + org.scala-ide.sbt.compiler.interface;bundle-version="[0.13,0.14)", scalariform, org.eclipse.ui.browser;bundle-version="3.3.0" Import-Package: diff --git a/org.scala-ide.sdt.core/src/scala/tools/eclipse/ScalaPlugin.scala b/org.scala-ide.sdt.core/src/scala/tools/eclipse/ScalaPlugin.scala index 0cca9d707d..7b0f3fe8b7 100644 --- a/org.scala-ide.sdt.core/src/scala/tools/eclipse/ScalaPlugin.scala +++ b/org.scala-ide.sdt.core/src/scala/tools/eclipse/ScalaPlugin.scala @@ -109,6 +109,7 @@ class ScalaPlugin extends AbstractUIPlugin with PluginLogConfigurator with IReso def compilerPluginId = "org.scala-ide.scala.compiler" def libraryPluginId = "org.scala-ide.scala.library" def sbtPluginId = "org.scala-ide.sbt.full.library" + def sbtCompilerInterfaceId = "org.scala-ide.sbt.compiler.interface" def wizardPath = pluginId + ".wizards" def wizardId(name: String) = wizardPath + ".new" + name @@ -189,7 +190,8 @@ class ScalaPlugin extends AbstractUIPlugin with PluginLogConfigurator with IReso } lazy val sbtCompilerBundle = Platform.getBundle(sbtPluginId) - lazy val sbtCompilerInterface = allPathsInBundle(sbtCompilerBundle, "/lib", "compiler-interface*.jar").toIterable.headOption + lazy val sbtCompilerInterfaceBundle = Platform.getBundle(sbtCompilerInterfaceId) + lazy val sbtCompilerInterface = pathInBundle(sbtCompilerInterfaceBundle, "/") // Disable for now, until we introduce a way to have multiple scala libraries, compilers available for the builder //lazy val sbtScalaLib = pathInBundle(sbtCompilerBundle, "/lib/scala-" + shortScalaVer + "/lib/scala-library.jar") //lazy val sbtScalaCompiler = pathInBundle(sbtCompilerBundle, "/lib/scala-" + shortScalaVer + "/lib/scala-compiler.jar") diff --git a/org.scala-ide.sdt.feature/feature.xml b/org.scala-ide.sdt.feature/feature.xml index f150e631d9..c18003a38a 100644 --- a/org.scala-ide.sdt.feature/feature.xml +++ b/org.scala-ide.sdt.feature/feature.xml @@ -138,4 +138,11 @@ SUCH DAMAGE. version="0.0.0" unpack="false"/> + + diff --git a/org.scala-ide.sdt.source.feature/feature.xml b/org.scala-ide.sdt.source.feature/feature.xml index 8fecbb7594..02b215afdf 100644 --- a/org.scala-ide.sdt.source.feature/feature.xml +++ b/org.scala-ide.sdt.source.feature/feature.xml @@ -64,6 +64,20 @@ SUCH DAMAGE. version="0.0.0" unpack="false"/> + + + +