From b9824967392e4b674881e5dcec4c4fbb05e6cd9b Mon Sep 17 00:00:00 2001 From: Guillaume Martres Date: Sun, 5 Aug 2018 23:23:12 +0900 Subject: Add support for Dotty projects (#397) * Abstract over the scala compiler organization * Support using a locally published compiler Publishing locally with sbt means publishing ivy-style, which uses a different naming convention than maven, we now handle both cases. * Add minimal support for Dotty projects * Rewrite scalalib.Dep, introduce scalalib.CrossVersion Instead of Dep being a trait with three cases (Java/Scala/Point), it is now a case class where the cross field is an instance of the CrossVersion trait which has three cases (Constant/Binary/Full). This is more versatile since it allows for non-empty constant suffixes which will be used to implement withDottyCompat in the next commit. It's also a cleaner separation of concerns. We also deduplicate various pieces of codes that computed the artifact name: this is now always handled in Dep and CrossVersion. * Add simple way to use Scala 2 deps in a Dotty project This is similar to the withDottyCompat method in the sbt-dotty plugin. * Turn off the Dotty test on Java >= 9 --- scalanativelib/src/mill/scalanativelib/ScalaNativeModule.scala | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'scalanativelib') diff --git a/scalanativelib/src/mill/scalanativelib/ScalaNativeModule.scala b/scalanativelib/src/mill/scalanativelib/ScalaNativeModule.scala index 8613c42f..d3cde4d1 100644 --- a/scalanativelib/src/mill/scalanativelib/ScalaNativeModule.scala +++ b/scalanativelib/src/mill/scalanativelib/ScalaNativeModule.scala @@ -47,6 +47,7 @@ trait ScalaNativeModule extends ScalaModule { outer => trait Tests extends TestScalaNativeModule { override def scalaWorker = outer.scalaWorker + override def scalaOrganization = outer.scalaOrganization() override def scalaVersion = outer.scalaVersion() override def scalaNativeVersion = outer.scalaNativeVersion() override def releaseMode = outer.releaseMode() @@ -223,7 +224,7 @@ trait TestScalaNativeModule extends ScalaNativeModule with TestModule { testOute Lib.resolveDependencies( repositories, Lib.depToDependency(_, scalaVersion(), ""), - transitiveIvyDeps().collect{ case x: Dep.Scala => x }.filter(d => supportedTestFrameworks(d.dep.module.name)) + transitiveIvyDeps().filter(d => d.cross.isBinary && supportedTestFrameworks(d.dep.module.name)) ) } @@ -238,6 +239,7 @@ trait TestScalaNativeModule extends ScalaNativeModule with TestModule { testOute // which knows the names of all the tests and references to invoke them object testRunnerNative extends ScalaNativeModule { override def scalaWorker = testOuter.scalaWorker + override def scalaOrganization = testOuter.scalaOrganization() override def scalaVersion = testOuter.scalaVersion() override def scalaNativeVersion = testOuter.scalaNativeVersion() override def moduleDeps = Seq(testOuter) -- cgit v1.2.3