Skip to content

Commit

Permalink
Enables Scala Version interoperability.
Browse files Browse the repository at this point in the history
Adds 2.11 bundle installation.
  • Loading branch information
wpopielarski committed Apr 26, 2017
1 parent 659a57d commit b7e2db2
Show file tree
Hide file tree
Showing 21 changed files with 289 additions and 58 deletions.
1 change: 1 addition & 0 deletions org.scala-ide.build-toolchain/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
<modules>
<!-- TODO remove back when multiple bundles of Scala are supported -->
<module>../org.scala-ide.scala210.jars</module>
<module>../org.scala-ide.scala211.jars</module>
</modules>
</profile>
</profiles>
Expand Down
13 changes: 13 additions & 0 deletions org.scala-ide.scala211.jars/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Scala 2.11 jars
Bundle-SymbolicName: org.scala-ide.scala211.jars;singleton:=true
Bundle-Version: 4.6.0.qualifier
Bundle-Vendor: scala-ide.org
Bundle-ActivationPolicy: lazy
Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Eclipse-ExtensibleAPI:
true


2 changes: 2 additions & 0 deletions org.scala-ide.scala211.jars/build.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bin.includes = META-INF/,\
target/jars/
141 changes: 141 additions & 0 deletions org.scala-ide.scala211.jars/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.scala-ide</groupId>
<artifactId>org.scala-ide.build-toolchain</artifactId>
<version>4.6.0-SNAPSHOT</version>
<relativePath>../org.scala-ide.build-toolchain/pom.xml</relativePath>
</parent>
<artifactId>org.scala-ide.scala211.jars</artifactId>
<packaging>eclipse-plugin</packaging>

<dependencies>
<!-- toolchain, Scala library -->
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
<version>${scala211.version}</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-reflect</artifactId>
<version>${scala211.version}</version>
<optional>true</optional>
</dependency>
<!-- toolchain, Scala compiler -->
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-compiler</artifactId>
<version>${scala211.version}</version>
<optional>true</optional>
</dependency>
<!-- sources -->
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
<version>${scala211.version}</version>
<classifier>sources</classifier>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-reflect</artifactId>
<version>${scala211.version}</version>
<classifier>sources</classifier>
<optional>true</optional>
</dependency>
<!-- toolchain, Scala compiler -->
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-compiler</artifactId>
<version>${scala211.version}</version>
<classifier>sources</classifier>
<optional>true</optional>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<!-- copy the jars to create a container bundle -->
<id>copy.modules</id>
<phase>initialize</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<!-- toolchain, Scala library -->
<artifactItem>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
<type>jar</type>
<destFileName>scala-library.jar</destFileName>
</artifactItem>
<artifactItem>
<groupId>org.scala-lang</groupId>
<artifactId>scala-reflect</artifactId>
<type>jar</type>
<destFileName>scala-reflect.jar</destFileName>
</artifactItem>
<!-- toolchain, Scala compiler -->
<artifactItem>
<groupId>org.scala-lang</groupId>
<artifactId>scala-compiler</artifactId>
<type>jar</type>
<destFileName>scala-compiler.jar</destFileName>
</artifactItem>
<!-- sources -->
<artifactItem>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
<classifier>sources</classifier>
<type>jar</type>
<destFileName>scala-library-src.jar</destFileName>
</artifactItem>
<artifactItem>
<groupId>org.scala-lang</groupId>
<artifactId>scala-reflect</artifactId>
<classifier>sources</classifier>
<type>jar</type>
<destFileName>scala-reflect-src.jar</destFileName>
</artifactItem>
<!-- toolchain, Scala compiler -->
<artifactItem>
<groupId>org.scala-lang</groupId>
<artifactId>scala-compiler</artifactId>
<classifier>sources</classifier>
<type>jar</type>
<destFileName>scala-compiler-src.jar</destFileName>
</artifactItem>
</artifactItems>
<outputDirectory>${project.build.directory}/jars</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<!-- enable tycho to support eclipse type artifacts -->
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-maven-plugin</artifactId>
<extensions>true</extensions>
</plugin>
<plugin>
<!-- configuration to be able to use maven bundle as osgi bundles -->
<groupId>org.eclipse.tycho</groupId>
<artifactId>target-platform-configuration</artifactId>
<configuration>
<resolver>p2</resolver>
<pomDependencies>consider</pomDependencies>
</configuration>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,11 @@ SUCH DAMAGE.
version="0.0.0"
unpack="true"/>

<plugin
id="org.scala-ide.scala211.jars"
download-size="0"
install-size="0"
version="0.0.0"
unpack="true"/>

</feature>
6 changes: 6 additions & 0 deletions org.scala-ide.scala212.build/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@
<artifactId>org.scala-ide.scala210.jars</artifactId>
<version>${project.version}</version>
</dependency>
<!-- scala 211 -->
<dependency>
<groupId>org.scala-ide</groupId>
<artifactId>org.scala-ide.scala211.jars</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ import org.scalaide.util.internal.eclipse.TextSelectionTest
import org.scalaide.core.sbtbuilder.CompilerBridgeStoreTest
import org.scalaide.ui.internal.preferences.StringListMapperTest
import org.scalaide.core.sbtbuilder.Scala210Compilation
import org.scalaide.core.sbtbuilder.Scala211Compilation
import org.scalaide.core.sbtbuilder.SourcePathFinderTest
import org.scalaide.core.scalaelements.ScalaElementsNameTest

Expand Down Expand Up @@ -139,6 +140,7 @@ import org.scalaide.core.scalaelements.ScalaElementsNameTest
classOf[ScalaJavaDepTwoScopesTest],
classOf[Scala210Compilation],
classOf[SourcePathFinderTest],
classOf[ScalaElementsNameTest]
classOf[ScalaElementsNameTest],
classOf[Scala211Compilation]
))
class TestsSuite
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
package org.scalaide.core.classpath

import java.io.File

import scala.tools.nsc.settings.ScalaVersion

import org.eclipse.core.runtime.IPath
import org.eclipse.core.runtime.Path
import org.eclipse.jdt.core.IClasspathContainer
import org.eclipse.jdt.core.JavaCore
import org.junit.After
import org.junit.AfterClass
import org.junit.Assert.assertTrue
import org.junit.Test
import org.scalaide.core.IScalaPlugin
import org.scalaide.core.IScalaProject
import org.scalaide.util.internal.CompilerUtils
import org.scalaide.util.eclipse.EclipseUtils
import org.eclipse.core.runtime.IPath
import java.io.File
import org.junit.AfterClass
import org.scalaide.core.SdtConstants
import org.scalaide.core.testsetup.SDTTestUtils
import org.scalaide.core.internal.project.ScalaProject
import org.junit.Ignore
import org.scalaide.core.testsetup.SDTTestUtils
import org.scalaide.util.eclipse.EclipseUtils
import org.scalaide.util.internal.CompilerUtils

object ClasspathContainersTests {
private var projects: List[IScalaProject] = List()
Expand Down Expand Up @@ -155,15 +156,15 @@ class ClasspathContainersTests {
}

@Test
@Ignore("Investigate why maven fails it")
def source_level_reversal_reverses_container_to_newer(): Unit = {
if (IScalaPlugin().scalaVersion >= ScalaVersion("2.11.0")) {val project = createProject()
val reversalReason = "explicit call : source level reversal to newer"
project.setDesiredSourceLevel(ScalaVersion(previousScalaVer), reversalReason)
val container_before = getLibraryContainer(project)
project.setDesiredSourceLevel(IScalaPlugin().scalaVersion, reversalReason)
project.setDesiredSourceLevel(ScalaVersion(previousScalaVer), reversalReason)
val container_after = getLibraryContainer(project)
if (IScalaPlugin().scalaVersion >= ScalaVersion("2.12.0")) {
val project = createProject()
val reversalReason = "explicit call : source level reversal to newer"
project.setDesiredSourceLevel(ScalaVersion(previousScalaVer), reversalReason)
val container_before = getLibraryContainer(project)
project.setDesiredSourceLevel(IScalaPlugin().scalaVersion, reversalReason)
project.setDesiredSourceLevel(ScalaVersion(previousScalaVer), reversalReason)
val container_after = getLibraryContainer(project)
assertTrue("Going to an older source level and back again should set the original container", extensionallyEqual(container_before, container_after))
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import org.eclipse.jdt.core.IClasspathEntry
import org.eclipse.core.resources.IMarker
import org.scalaide.core.IScalaPlugin
import org.junit.After
import org.junit.Ignore
import org.scalaide.core.IScalaProject
import org.scalaide.ui.internal.preferences.CompilerSettings
import org.scalaide.core.testsetup.SDTTestUtils
Expand Down Expand Up @@ -185,7 +184,6 @@ class ClasspathTests {
setRawClasspathAndCheckMarkers(newRawClasspath :+ newLibraryEntry("specs2_%s.2-0.12.3.jar".format(majorMinor)), expectedWarnings = 0, expectedErrors = 0)
}

@Ignore("Needs investigation")
@Test
def subsequentLibraryWithXsource(): Unit = {
val majorMinor = testShortSubsequentScalaVersion
Expand Down Expand Up @@ -226,10 +224,9 @@ class ClasspathTests {
val majorMinor = getIncompatibleScalaVersion
val newRawClasspath = cleanRawClasspath :+ createPreviousScalaLibraryEntry()

setRawClasspathAndCheckMarkers(newRawClasspath :+ newLibraryEntry("specs2_%s.2-0.12.3.jar".format(majorMinor)), expectedWarnings = 0, expectedErrors = 1)
setRawClasspathAndCheckMarkers(newRawClasspath :+ newLibraryEntry("specs2_%s.2-0.12.3.jar".format(majorMinor)), expectedWarnings = 0, expectedErrors = 0)
}

@Ignore("Needs investigation")
@Test
def subsequentLibraryWithXsourceAndBadBinary(): Unit = {
enableProjectSpecificSettings()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import org.eclipse.jdt.core.JavaCore
import org.junit.After
import org.junit.AfterClass
import org.junit.Assert.assertTrue
import org.junit.Ignore
import org.junit.Test
import org.scalaide.core.IScalaPlugin
import org.scalaide.core.IScalaProject
Expand Down Expand Up @@ -162,7 +161,6 @@ class DesiredScalaInstallationTests {
assertTrue(s"Switching to a former bundle should show that bundle's version on the library classpath Container. Found ${newVersion map {_.unparse}}. Expected ${otherInstallation.map(_.version)}", newVersion == otherInstallation.map{_.version})
}

@Ignore("Needs investigation")
@Test
def change_to_legacy_registers_on_compiler_classpath(): Unit ={
val project = createProject()
Expand Down
Loading

0 comments on commit b7e2db2

Please sign in to comment.