Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added new build profile for Scala 2.11

Note that the p2 repo's name of both scalariform and scala-refactoring contain
now the Scala major version they have been compiled with. Doing so will make
our life easier in the future ("trunk" is a moving target, we need a stable
identifier).

Also, since minor Scala releases are binary compatible, it should be ok to use
scalariform and scala-refactoring compiled against Scala 2.10.0 also for
building the IDE for Scala 2.10.1.

The changes in org.scala-ide.scala.compiler/pom.xml needed to support Scala
2.11.x are exact duplicates of what we do for Scala 2.10.x. Unfortunately, it
doesn't seem to be possible to avoid the duplication because of Maven
limitations (e.g., http://jira.codehaus.org/browse/MNG-3328). Furthermore,
consider that once we drop support for Scala 2.9.x, then we will no longer need
to have the above mentioned duplication.

Re #1001256
  • Loading branch information...
commit a88a43a05b619935a27cc024ff13ce0f480cd624 1 parent cf98d4e
Mirco Dotta dotta authored
43 org.scala-ide.scala.compiler/pom.xml
View
@@ -67,6 +67,49 @@
</plugins>
</build>
</profile>
+
+ <profile>
+ <!-- Scala 2.11.x -->
+ <!-- Scala reflect was extracted in a different jar in 2.11 -->
+ <id>scala-2.11.x</id>
+ <dependencies>
+ <dependency>
+ <groupId>org.scala-lang</groupId>
+ <artifactId>scala-reflect</artifactId>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <!-- add the source jar, to be able to attach the source to the Scala container. And the continuation plug-in -->
+ <id>copy.reflect</id>
+ <phase>compile</phase>
+ <goals>
+ <goal>copy</goal>
+ </goals>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+ <groupId>org.scala-lang</groupId>
+ <artifactId>scala-reflect</artifactId>
+ <classifier>sources</classifier>
+ <type>jar</type>
+ <destFileName>scala-reflect-src.jar</destFileName>
+ </artifactItem>
+ </artifactItems>
+ <stripVersion>true</stripVersion>
+ <outputDirectory>${project.build.directory}/lib</outputDirectory>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
</profiles>
<build>
10 org.scala-ide.scala.library/pom.xml
View
@@ -13,21 +13,17 @@
<packaging>bundle</packaging>
<properties>
- <!-- some default values, can be overwritten by profiles -->
+ <!-- default value for Scala 2.10+, can be overwritten by profiles -->
<!-- dirty trick to avoid code duplication -->
- <scala.library.third-part>scala-dbc</scala.library.third-part>
+ <scala.library.third-part>scala-actors</scala.library.third-part>
</properties>
<profiles>
<profile>
<!--- the profile using the default values. Scala 2.9.x -->
<id>scala-2.9.x</id>
- </profile>
- <profile>
- <!-- Scala 2.10.x -->
- <id>scala-2.10.x</id>
<properties>
- <scala.library.third-part>scala-actors</scala.library.third-part>
+ <scala.library.third-part>scala-dbc</scala.library.third-part>
</properties>
</profile>
</profiles>
14 org.scala-ide.sdt.core.tests/src/scala/tools/eclipse/classpath/ClasspathTests.scala
View
@@ -21,6 +21,17 @@ import scala.tools.eclipse.testsetup.SDTTestUtils
object ClasspathTests extends TestProjectSetup("classpath")
+/** This test class relies on JARs located in "test-workspace/classpath/lib/${Scala.shortVersion}.x".
+ * If you need to support a new Scala major version, you'll have to:
+ *
+ * - Add a new folder under "test-workspace/classpath/lib/". Name the folder "${Scala.shortVersion}.x".
+ * - In the freshly created folder:
+ * + Copy "binary-scala-library" from on of the existing "test-workspace/classpath/lib/${Scala.shortVersion}.x/binary-scala-library"
+ * + Inside the copied "binary-scala-library", update the "version.number" in the library.properties.
+ * + Create a JAR of "binary-scala-library" and call it "scala-library.jar"
+ * + Create a copy of the freshly created "scala-library.jar" and name it "my-scala-library.jar"
+ * - Update the logic in `ClasspathTests.createIncompatibleScalaLibraryEntry`
+ */
class ClasspathTests {
import ClasspathTests._
@@ -301,7 +312,8 @@ class ClasspathTests {
(ScalaPlugin.plugin.shortScalaVer match {
case "2.8" => "2.9"
case "2.9" => "2.10"
- case "2.10" => "2.8"
+ case "2.10" => "2.11"
+ case "2.11" => "2.9"
case _ =>
fail("Unsupported embedded scala library version " + ScalaPlugin.plugin.scalaVer +". Please update the test.")
""
2  org.scala-ide.sdt.core.tests/test-workspace/classpath/lib/2.10.x/binary-scala-library/library.properties
View
@@ -1,4 +1,4 @@
-# To test library with a 2.9.x version number
+# To test library with a 2.10.x version number
version.number=2.10.x
copyright.string=Copyright 2002-2011, LAMP/EPFL
3  org.scala-ide.sdt.core.tests/test-workspace/classpath/lib/2.11.x/binary-scala-library/META-INF/MANIFEST.MF
View
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Created-By: 1.6.0_26 (Apple Inc.)
+
4 org.scala-ide.sdt.core.tests/test-workspace/classpath/lib/2.11.x/binary-scala-library/library.properties
View
@@ -0,0 +1,4 @@
+# To test library with a 2.11.x version number
+
+version.number=2.11.x
+copyright.string=Copyright 2002-2011, LAMP/EPFL
BIN  org.scala-ide.sdt.core.tests/test-workspace/classpath/lib/2.11.x/binary-scala-library/scala/Predef.class
View
Binary file not shown
BIN  org.scala-ide.sdt.core.tests/test-workspace/classpath/lib/2.11.x/my-scala-library.jar
View
Binary file not shown
BIN  org.scala-ide.sdt.core.tests/test-workspace/classpath/lib/2.11.x/scala-library.jar
View
Binary file not shown
17 org.scala-ide.sdt.core/src-2.11/scala/tools/eclipse/SymbolsCompatibility.scala
View
@@ -0,0 +1,17 @@
+package scala.tools.eclipse
+
+import scala.reflect.internal.Symbols
+
+/**
+ * Trait used to keep 2.9/2.10/2.11 source compatibility
+ */
+trait SymbolsCompatibility { self: Symbols =>
+
+ /**
+ * This class as been removed in 2.10, but we need its real implementation in 2.9
+ */
+ case class InvalidCompanions(sym1: Symbol, sym2: Symbol) extends Throwable {
+
+ }
+
+}
20 pom.xml
View
@@ -76,7 +76,6 @@
</profile>
<profile>
- <!-- Scala 2.10.x -->
<id>scala-2.10.x</id>
<properties>
<scala.version>2.10.0-SNAPSHOT</scala.version>
@@ -85,13 +84,28 @@
<sbt.compiled.version>2.10</sbt.compiled.version>
<version.suffix>2_10</version.suffix>
- <repo.scala-refactoring>${repo.scala-ide.root}/scala-refactoring-trunk</repo.scala-refactoring>
- <repo.scalariform>${repo.scala-ide.root}/scalariform-trunk</repo.scalariform>
+ <repo.scala-refactoring>${repo.scala-ide.root}/scala-refactoring-210x</repo.scala-refactoring>
+ <repo.scalariform>${repo.scala-ide.root}/scalariform-210x</repo.scalariform>
<repo.typesafe>http://repo.typesafe.com/typesafe/ide-2.10</repo.typesafe>
</properties>
</profile>
<profile>
+ <id>scala-2.11.x</id>
+ <properties>
+ <scala.version>2.11.0-SNAPSHOT</scala.version>
+ <scala.major.minor.version>2.11</scala.major.minor.version>
+ <scala.library.version>${scala.version}</scala.library.version>
+ <sbt.compiled.version>2.11</sbt.compiled.version>
+ <version.suffix>2_11</version.suffix>
+
+ <repo.scala-refactoring>${repo.scala-ide.root}/scala-refactoring-211x</repo.scala-refactoring>
+ <repo.scalariform>${repo.scala-ide.root}/scalariform-211x</repo.scalariform>
+ <repo.typesafe>http://repo.typesafe.com/typesafe/ide-2.11</repo.typesafe>
+ </properties>
+ </profile>
+
+ <profile>
<!-- Eclipse Juno -->
<id>eclipse-juno</id>
<properties>
Please sign in to comment.
Something went wrong with that request. Please try again.