Skip to content

Commit

Permalink
Added new build profile for Scala 2.11
Browse files Browse the repository at this point in the history
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
dotta committed Oct 3, 2012
1 parent cf98d4e commit a88a43a
Show file tree
Hide file tree
Showing 11 changed files with 101 additions and 12 deletions.
43 changes: 43 additions & 0 deletions org.scala-ide.scala.compiler/pom.xml
Expand Up @@ -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>
Expand Down
10 changes: 3 additions & 7 deletions org.scala-ide.scala.library/pom.xml
Expand Up @@ -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>
Expand Down
Expand Up @@ -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._
Expand Down Expand Up @@ -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.")
""
Expand Down
@@ -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
@@ -0,0 +1,3 @@
Manifest-Version: 1.0
Created-By: 1.6.0_26 (Apple Inc.)

@@ -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
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -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 changes: 17 additions & 3 deletions pom.xml
Expand Up @@ -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>
Expand All @@ -85,12 +84,27 @@
<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>
Expand Down

0 comments on commit a88a43a

Please sign in to comment.