From a0328883af6c1f8195afcec3582b0f52a45ec10f Mon Sep 17 00:00:00 2001 From: "Aaron S. Hawley" Date: Mon, 27 Jun 2016 11:25:33 -0400 Subject: [PATCH 1/3] Scala 2.12.x branch Add 2.12.0-M4 as a Scala version. Scala-swing needs to be 2.0.x --- README.md | 8 +++++++- maven-sample/pom.xml | 31 ++++++++++++++++++++++++++++++- sbt-sample/build.sbt | 6 +++--- 3 files changed, 40 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index c86b51d..19fb18d 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,12 @@ This sample demonstrates how to conditionally depend on all modules. If use only // taken from: http://github.com/scala/scala-module-dependency-sample libraryDependencies := { CrossVersion.partialVersion(scalaVersion.value) match { + // if scala 2.12+ is used, use scala-swing 2.x + case Some((2, scalaMajor)) if scalaMajor >= 12 => + libraryDependencies.value ++ Seq( + "org.scala-lang.modules" %% "scala-xml" % "1.0.3", + "org.scala-lang.modules" %% "scala-parser-combinators" % "1.0.3", + "org.scala-lang.modules" %% "scala-swing" % "2.0.0-M2") // if scala 2.11+ is used, add dependency on scala-xml module case Some((2, scalaMajor)) if scalaMajor >= 11 => libraryDependencies.value ++ Seq( @@ -57,4 +63,4 @@ This to depend on scala-xml module with assumption that you have `scalaBinaryVer ### Scala cross-versioning with Maven The snippet provided above allows you to declare dependencies on modules shipped against Scala 2.11. If you would like to -support building your project with both Scala 2.10 and 2.11 at the same time you'll need to use [Maven profiles](http://maven.apache.org/guides/introduction/introduction-to-profiles.html). Check the `pom.xml` file in the sample project for details how to set up Maven profiles for supporting different Scala versions. +support building your project with both Scala 2.10, 2.11 and 2.12 at the same time you'll need to use [Maven profiles](http://maven.apache.org/guides/introduction/introduction-to-profiles.html). Check the `pom.xml` file in the sample project for details how to set up Maven profiles for supporting different Scala versions. diff --git a/maven-sample/pom.xml b/maven-sample/pom.xml index 5c4397d..8d0e74c 100644 --- a/maven-sample/pom.xml +++ b/maven-sample/pom.xml @@ -8,10 +8,39 @@ the right dependencies for modules specified for each version separately --> - scala-2.11 + scala-2.12 true + + 2.12.0-M4 + 2.12.0-M4 + + + + org.scala-lang + scala-library + ${scalaVersion} + + + org.scala-lang.modules + scala-xml_${scalaBinaryVersion} + 1.0.5 + + + org.scala-lang.modules + scala-parser-combinators_${scalaBinaryVersion} + 1.0.4 + + + org.scala-lang.modules + scala-swing_${scalaBinaryVersion} + 2.0.0-M2 + + + + + scala-2.11 2.11.8 2.11 diff --git a/sbt-sample/build.sbt b/sbt-sample/build.sbt index 47ab5f1..3de9464 100644 --- a/sbt-sample/build.sbt +++ b/sbt-sample/build.sbt @@ -4,9 +4,9 @@ organization := "sample" version := "1.0" -crossScalaVersions := Seq("2.11.8", "2.10.5") +crossScalaVersions := Seq("2.12.0-M4", "2.11.8", "2.10.5") -scalaVersion := "2.11.8" +scalaVersion := "2.12.0-M4" // add scala-xml dependency when needed (for Scala 2.11 and newer) in a robust way // this mechanism supports cross-version publishing @@ -17,7 +17,7 @@ libraryDependencies := { libraryDependencies.value ++ Seq( "org.scala-lang.modules" %% "scala-xml" % "1.0.5", "org.scala-lang.modules" %% "scala-parser-combinators" % "1.0.4", - "org.scala-lang.modules" %% "scala-swing" % "1.0.2") + "org.scala-lang.modules" %% "scala-swing" % "2.0.0-M2") case _ => // or just libraryDependencies.value if you don't depend on scala-swing libraryDependencies.value :+ "org.scala-lang" % "scala-swing" % scalaVersion.value From 2e67c01ec0644ca977b9393d706d8473fa384d96 Mon Sep 17 00:00:00 2001 From: "Aaron S. Hawley" Date: Tue, 20 Sep 2016 22:34:16 -0400 Subject: [PATCH 2/3] Update scalaVersion to 2.12.0-RC1 and 2.10.6 --- maven-sample/pom.xml | 6 +++--- sbt-sample/build.sbt | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/maven-sample/pom.xml b/maven-sample/pom.xml index 8d0e74c..699f931 100644 --- a/maven-sample/pom.xml +++ b/maven-sample/pom.xml @@ -4,7 +4,7 @@ sample scala-module-dependency-sample 1.0-SNAPSHOT - @@ -13,8 +13,8 @@ true - 2.12.0-M4 - 2.12.0-M4 + 2.12.0-RC1 + 2.12.0-RC1 diff --git a/sbt-sample/build.sbt b/sbt-sample/build.sbt index 3de9464..74e1365 100644 --- a/sbt-sample/build.sbt +++ b/sbt-sample/build.sbt @@ -4,9 +4,9 @@ organization := "sample" version := "1.0" -crossScalaVersions := Seq("2.12.0-M4", "2.11.8", "2.10.5") +crossScalaVersions := Seq("2.12.0-RC1", "2.11.8", "2.10.6") -scalaVersion := "2.12.0-M4" +scalaVersion := "2.12.0-RC1" // add scala-xml dependency when needed (for Scala 2.11 and newer) in a robust way // this mechanism supports cross-version publishing From 45c5c94ac0c1115868267172f46cc382e38598ea Mon Sep 17 00:00:00 2001 From: "Aaron S. Hawley" Date: Wed, 5 Oct 2016 13:54:53 -0400 Subject: [PATCH 3/3] Bump scala-xml and scala-parser-combinators to 1.0.6 and 1.0.4, respectively --- README.md | 16 ++++++++-------- maven-sample/pom.xml | 4 ++-- sbt-sample/build.sbt | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 19fb18d..d1290aa 100644 --- a/README.md +++ b/README.md @@ -19,15 +19,15 @@ libraryDependencies := { // if scala 2.12+ is used, use scala-swing 2.x case Some((2, scalaMajor)) if scalaMajor >= 12 => libraryDependencies.value ++ Seq( - "org.scala-lang.modules" %% "scala-xml" % "1.0.3", - "org.scala-lang.modules" %% "scala-parser-combinators" % "1.0.3", + "org.scala-lang.modules" %% "scala-xml" % "1.0.6", + "org.scala-lang.modules" %% "scala-parser-combinators" % "1.0.4", "org.scala-lang.modules" %% "scala-swing" % "2.0.0-M2") // if scala 2.11+ is used, add dependency on scala-xml module case Some((2, scalaMajor)) if scalaMajor >= 11 => libraryDependencies.value ++ Seq( - "org.scala-lang.modules" %% "scala-xml" % "1.0.3", - "org.scala-lang.modules" %% "scala-parser-combinators" % "1.0.3", - "org.scala-lang.modules" %% "scala-swing" % "1.0.1") + "org.scala-lang.modules" %% "scala-xml" % "1.0.6", + "org.scala-lang.modules" %% "scala-parser-combinators" % "1.0.4", + "org.scala-lang.modules" %% "scala-swing" % "1.0.2") case _ => // or just libraryDependencies.value if you don't depend on scala-swing libraryDependencies.value :+ "org.scala-lang" % "scala-swing" % scalaVersion.value @@ -44,17 +44,17 @@ This to depend on scala-xml module with assumption that you have `scalaBinaryVer org.scala-lang.modules scala-xml_${scalaBinaryVersion} - 1.0.3 + 1.0.6 org.scala-lang.modules scala-parser-combinators_${scalaBinaryVersion} - 1.0.3 + 1.0.4 org.scala-lang.modules scala-swing_${scalaBinaryVersion} - 1.0.1 + 1.0.2 ``` diff --git a/maven-sample/pom.xml b/maven-sample/pom.xml index 699f931..060305b 100644 --- a/maven-sample/pom.xml +++ b/maven-sample/pom.xml @@ -25,7 +25,7 @@ org.scala-lang.modules scala-xml_${scalaBinaryVersion} - 1.0.5 + 1.0.6 org.scala-lang.modules @@ -54,7 +54,7 @@ org.scala-lang.modules scala-xml_${scalaBinaryVersion} - 1.0.5 + 1.0.6 org.scala-lang.modules diff --git a/sbt-sample/build.sbt b/sbt-sample/build.sbt index 74e1365..90b1de7 100644 --- a/sbt-sample/build.sbt +++ b/sbt-sample/build.sbt @@ -15,7 +15,7 @@ libraryDependencies := { // if scala 2.11+ is used, add dependency on scala-xml module case Some((2, scalaMajor)) if scalaMajor >= 11 => libraryDependencies.value ++ Seq( - "org.scala-lang.modules" %% "scala-xml" % "1.0.5", + "org.scala-lang.modules" %% "scala-xml" % "1.0.6", "org.scala-lang.modules" %% "scala-parser-combinators" % "1.0.4", "org.scala-lang.modules" %% "scala-swing" % "2.0.0-M2") case _ =>