From 282b0f7f517372aa3f03b4e353884698c0eb06c9 Mon Sep 17 00:00:00 2001 From: Eugene Yokota Date: Wed, 15 Nov 2017 23:37:09 -0500 Subject: [PATCH] Split compiler bridge tests to another subproject Splitting compiler bridge tests to another subproject because while the bridge itself can be compiled with just compiler-interface, util-interface, and Scala Compiler as dependencies, the testing introduces more (such as IO). This creates problem for new Scala versions where IO or test libraries do not exist yet (e.g. Scala 2.13.0-M2). This also removes the Mima test due to the lack of 2.13 bridge for Zinc 1.0.0. Compiler bridge just needs to compile itself against the interface and Scala compiler, so there's no need to run Mima test. --- .../scala/sbt/internal/inc/ZincComponentCompiler.scala | 9 ++++++--- .../sbt/internal/inc/ZincComponentCompilerSpec.scala | 5 +++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/internal/zinc-ivy-integration/src/main/scala/sbt/internal/inc/ZincComponentCompiler.scala b/internal/zinc-ivy-integration/src/main/scala/sbt/internal/inc/ZincComponentCompiler.scala index e14e591dee..f64360a5ff 100644 --- a/internal/zinc-ivy-integration/src/main/scala/sbt/internal/inc/ZincComponentCompiler.scala +++ b/internal/zinc-ivy-integration/src/main/scala/sbt/internal/inc/ZincComponentCompiler.scala @@ -42,9 +42,12 @@ private[sbt] object ZincComponentCompiler { def compilerBridgeId(scalaVersion: String) = { // Defaults to bridge for 2.12 for Scala versions bigger than 2.12.x scalaVersion match { - case sc if (sc startsWith "2.10.") => "compiler-bridge_2.10" - case sc if (sc startsWith "2.11.") => "compiler-bridge_2.11" - case _ => "compiler-bridge_2.12" + case sc if (sc startsWith "2.10.") => "compiler-bridge_2.10" + case sc if (sc startsWith "2.11.") => "compiler-bridge_2.11" + case sc if (sc startsWith "2.12.") => "compiler-bridge_2.12" + case sc if (sc startsWith "2.13.0-M") => "compiler-bridge_2.13.0-M2" + case sc if (sc startsWith "2.13.0-RC") => "compiler-bridge_2.13.0-M2" + case _ => "compiler-bridge_2.13" } } import xsbti.ArtifactInfo.SbtOrganization diff --git a/internal/zinc-ivy-integration/src/test/scala/sbt/internal/inc/ZincComponentCompilerSpec.scala b/internal/zinc-ivy-integration/src/test/scala/sbt/internal/inc/ZincComponentCompilerSpec.scala index 3fbd1a24f6..f3245c1ea4 100644 --- a/internal/zinc-ivy-integration/src/test/scala/sbt/internal/inc/ZincComponentCompilerSpec.scala +++ b/internal/zinc-ivy-integration/src/test/scala/sbt/internal/inc/ZincComponentCompilerSpec.scala @@ -11,6 +11,7 @@ class ZincComponentCompilerSpec extends BridgeProviderSpecification { val scala2121 = "2.12.1" val scala2122 = "2.12.2" val scala2123 = "2.12.3" + val scala2130M2 = "2.13.0-M2" val logger = ConsoleLogger() it should "compile the bridge for Scala 2.10.5 and 2.10.6" in { @@ -28,4 +29,8 @@ class ZincComponentCompilerSpec extends BridgeProviderSpecification { IO.withTemporaryDirectory(t => getCompilerBridge(t, logger, scala2122) should exist) IO.withTemporaryDirectory(t => getCompilerBridge(t, logger, scala2123) should exist) } + + it should "compile the bridge for Scala 2.13.0-M2" in { + IO.withTemporaryDirectory(t => getCompilerBridge(t, logger, scala2130M2) should exist) + } }