Skip to content

Commit 7c0c0a1

Browse files
committed
Update native test to 0.5.0-RC2
1 parent a17873d commit 7c0c0a1

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

build.sc

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ object Dependencies {
7272
def scalaJsSbtTestAdapter1 = ivy"org.scala-js::scalajs-sbt-test-adapter:$scalaJs1Version"
7373
def scalaJsLogging1 = ivy"org.scala-js::scalajs-logging:1.1.1"
7474
def scalaNativeTools04 = ivy"org.scala-native::tools:0.4.17"
75+
def scalaNativeTools04 = ivy"org.scala-native::tools:0.5.0-RC2"
7576
def scalazCore = ivy"org.scalaz::scalaz-core:7.3.8"
7677
def snailgun = ivy"io.github.alexarchambault.scala-cli.snailgun::snailgun-core:0.4.1-sc2"
7778
def sourcecode = ivy"com.lihaoyi::sourcecode:0.3.1"
@@ -401,6 +402,7 @@ class Frontend(val crossScalaVersion: String) extends BloopCrossSbtModule with B
401402
| def zincVersion = "${Dependencies.zinc.dep.version}"
402403
| def snailgunVersion = "0.4.1-sc2"
403404
| def nativeBridge04 = "${bridges.`scala-native-04`().artifactId()}"
405+
| def nativeBridge05 = "${bridges.`scala-native-05`().artifactId()}"
404406
| def jsBridge1 = "${bridges.`scalajs-1`().artifactId()}"
405407
|}
406408
|""".stripMargin
@@ -538,15 +540,16 @@ object bridges extends Module {
538540
}
539541
}
540542

541-
object `scala-native-04` extends Cross[ScalaNative04](Dependencies.scalaVersions: _*)
542-
class ScalaNative04(val crossScalaVersion: String)
543+
object `scala-native-04` extends Cross[ScalaNative](4, Dependencies.scalaVersions: _*)
544+
object `scala-native-05` extends Cross[ScalaNative](5, Dependencies.scalaVersions: _*)
545+
class ScalaNative(nativeMajorVersion: Int, val crossScalaVersion: String)
543546
extends BloopCrossSbtModule
544547
with BloopPublish {
545-
def artifactName = "bloop-native-bridge-0-4"
548+
def artifactName = s"bloop-native-bridge-0-$nativeMajorVersion"
546549

547550
private def updateSources(originalSources: Seq[PathRef]): Seq[PathRef] =
548-
if (millSourcePath.endsWith(os.rel / "scala-native-04")) {
549-
val updatedSourcePath = millSourcePath / os.up / "scala-native-0.4"
551+
if (millSourcePath.endsWith(os.rel / s"scala-native-0$nativeMajorVersion")) {
552+
val updatedSourcePath = millSourcePath / os.up / s"scala-native-0.$nativeMajorVersion"
550553
originalSources.map {
551554
case pathRef if pathRef.path.startsWith(millSourcePath) =>
552555
PathRef(updatedSourcePath / pathRef.path.relativeTo(millSourcePath))
@@ -563,9 +566,10 @@ object bridges extends Module {
563566
shared(),
564567
backend()
565568
)
566-
def compileIvyDeps = super.compileIvyDeps() ++ Agg(
567-
Dependencies.scalaNativeTools04
568-
)
569+
def compileIvyDeps = super.compileIvyDeps() ++ Agg {
570+
if (nativeMajorVersion == 4) Dependencies.scalaNativeTools04
571+
else Dependencies.scalaNativeTools05
572+
}
569573

570574
object test extends Tests {
571575
def sources = T.sources(updateSources(super.sources()))

frontend/src/test/resources/cross-test-build-scala-native-0.5/project/plugins.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "1.0.0")
2-
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.5.0-RC1")
2+
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.5.0-RC2")
33

44
val pluginVersion = sys.props.getOrElse(
55
"bloopVersion",

0 commit comments

Comments
 (0)