mirror of https://github.com/sbt/sbt.git
parent
84b84ec58d
commit
d582dfc4be
|
|
@ -3594,13 +3594,15 @@ object Classpaths {
|
||||||
depSBV <- (dep.project / scalaBinaryVersion).get(data)
|
depSBV <- (dep.project / scalaBinaryVersion).get(data)
|
||||||
depCross <- (dep.project / crossVersion).get(data)
|
depCross <- (dep.project / crossVersion).get(data)
|
||||||
} yield {
|
} yield {
|
||||||
if (isScala2Scala3Sandwich(sbv, depSBV) && depCross == CrossVersion.binary)
|
depCross match {
|
||||||
depProjId
|
case b: CrossVersion.Binary if isScala2Scala3Sandwich(sbv, depSBV) =>
|
||||||
.withCrossVersion(CrossVersion.constant(depSBV))
|
depProjId
|
||||||
.withConfigurations(dep.configuration)
|
.withCrossVersion(CrossVersion.constant(b.prefix + depSBV))
|
||||||
.withExplicitArtifacts(Vector.empty)
|
.withConfigurations(dep.configuration)
|
||||||
else
|
.withExplicitArtifacts(Vector.empty)
|
||||||
depProjId.withConfigurations(dep.configuration).withExplicitArtifacts(Vector.empty)
|
case _ =>
|
||||||
|
depProjId.withConfigurations(dep.configuration).withExplicitArtifacts(Vector.empty)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,9 @@
|
||||||
|
package app
|
||||||
|
|
||||||
|
import mylib._
|
||||||
|
|
||||||
|
object Main {
|
||||||
|
def main(args: Array[String]): Unit = {
|
||||||
|
println(MyLib.square(5))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,17 @@
|
||||||
|
// TODO use 2.13.4 when it's out
|
||||||
|
ThisBuild / scalaVersion := "2.13.4-bin-d526da6"
|
||||||
|
|
||||||
|
Global / resolvers += "scala-integration".at("https://scala-ci.typesafe.com/artifactory/scala-integration/")
|
||||||
|
|
||||||
|
lazy val scala3code = project
|
||||||
|
.enablePlugins(ScalaJSPlugin)
|
||||||
|
.settings(scalaVersion := "0.27.0-RC1")
|
||||||
|
|
||||||
|
lazy val app = project
|
||||||
|
.enablePlugins(ScalaJSPlugin)
|
||||||
|
.dependsOn(scala3code)
|
||||||
|
.settings(
|
||||||
|
libraryDependencies ~= (_.filterNot(_.name.contains("scalajs-compiler"))),
|
||||||
|
addCompilerPlugin("org.scala-js" % "scalajs-compiler_2.13.3" % scalaJSVersion),
|
||||||
|
scalaJSUseMainModuleInitializer := true,
|
||||||
|
)
|
||||||
|
|
@ -0,0 +1,2 @@
|
||||||
|
addSbtPlugin("ch.epfl.lamp" % "sbt-dotty" % "0.4.3")
|
||||||
|
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.3.0")
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
package mylib
|
||||||
|
|
||||||
|
object MyLib {
|
||||||
|
def square(x: Int): Int = x * x
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
> app/run
|
||||||
Loading…
Reference in New Issue