summaryrefslogtreecommitdiff
path: root/scalalib/src/ScalaModule.scala
diff options
context:
space:
mode:
authorLi Haoyi <haoyi.sg@gmail.com>2018-12-18 21:11:47 -0800
committerGitHub <noreply@github.com>2018-12-18 21:11:47 -0800
commitde175e69977082e35539097a54d381e465dddf8e (patch)
treecedf8de1dde57b7c9f70dfaa4b212906db775684 /scalalib/src/ScalaModule.scala
parentea36ea3da18d3720e124b60235e1153f6c31518c (diff)
downloadmill-de175e69977082e35539097a54d381e465dddf8e.tar.gz
mill-de175e69977082e35539097a54d381e465dddf8e.tar.bz2
mill-de175e69977082e35539097a54d381e465dddf8e.zip
Generalize Zinc Worker (#514)
* Generalize Zinc worker - Compiler bridges can now be either pre-compiled or on-demand-compiled - Scala library/compiler jar discovery is now configurable - Zinc compiler cache is now configurable, rather than being hardcoded at n=1 * . * update constructor args * remove duplicate util/AggWrapper.scala file * fix * fix * fix * cleanup
Diffstat (limited to 'scalalib/src/ScalaModule.scala')
-rw-r--r--scalalib/src/ScalaModule.scala35
1 files changed, 3 insertions, 32 deletions
diff --git a/scalalib/src/ScalaModule.scala b/scalalib/src/ScalaModule.scala
index 9d669bf4..5fad1664 100644
--- a/scalalib/src/ScalaModule.scala
+++ b/scalalib/src/ScalaModule.scala
@@ -8,7 +8,7 @@ import mill.modules.Jvm
import mill.modules.Jvm.createJar
import mill.scalalib.api.Util.isDotty
import Lib._
-import mill.util.Loose.Agg
+import mill.api.Loose.Agg
import mill.api.DummyInputStream
/**
@@ -79,36 +79,7 @@ trait ScalaModule extends JavaModule { outer =>
def scalaDocOptions = T{ scalacOptions() }
- private val Milestone213 = raw"""2.13.(\d+)-M(\d+)""".r
- def scalaCompilerBridgeSources = T {
- val (scalaVersion0, scalaBinaryVersion0) = scalaVersion() match {
- case Milestone213(_, _) => ("2.13.0-M2", "2.13.0-M2")
- case _ => (scalaVersion(), mill.scalalib.api.Util.scalaBinaryVersion(scalaVersion()))
- }
-
- val (bridgeDep, bridgeName, bridgeVersion) =
- if (isDotty(scalaVersion0)) {
- val org = scalaOrganization()
- val name = "dotty-sbt-bridge"
- val version = scalaVersion()
- (ivy"$org:$name:$version", name, version)
- } else {
- val org = "org.scala-sbt"
- val name = "compiler-bridge"
- val version = Versions.zinc
- (ivy"$org::$name:$version", s"${name}_$scalaBinaryVersion0", version)
- }
-
- resolveDependencies(
- repositories,
- Lib.depToDependency(_, scalaVersion0, platformSuffix()),
- Seq(bridgeDep),
- sources = true
- ).map(deps =>
- mill.scalalib.api.Util.grepJar(deps.map(_.path), bridgeName, bridgeVersion, sources = true)
- )
- }
/**
* The local classpath of Scala compiler plugins on-disk; you can add
@@ -159,8 +130,8 @@ trait ScalaModule extends JavaModule { outer =>
compileClasspath().map(_.path),
javacOptions(),
scalaVersion(),
+ scalaOrganization(),
scalacOptions(),
- scalaCompilerBridgeSources(),
scalaCompilerClasspath().map(_.path),
scalacPluginClasspath().map(_.path),
)
@@ -187,7 +158,7 @@ trait ScalaModule extends JavaModule { outer =>
else {
zincWorker.worker().docJar(
scalaVersion(),
- scalaCompilerBridgeSources(),
+ scalaOrganization(),
scalaCompilerClasspath().map(_.path),
scalacPluginClasspath().map(_.path),
files ++ options