diff options
Diffstat (limited to 'scalalib')
-rw-r--r-- | scalalib/src/mill/scalalib/GenIdea.scala | 18 | ||||
-rw-r--r-- | scalalib/src/mill/scalalib/ScalaWorkerApi.scala | 5 | ||||
-rw-r--r-- | scalalib/src/mill/scalalib/publish/Ivy.scala | 2 | ||||
-rw-r--r-- | scalalib/src/mill/scalalib/publish/Pom.scala | 2 |
4 files changed, 21 insertions, 6 deletions
diff --git a/scalalib/src/mill/scalalib/GenIdea.scala b/scalalib/src/mill/scalalib/GenIdea.scala index a6551535..7fa2536d 100644 --- a/scalalib/src/mill/scalalib/GenIdea.scala +++ b/scalalib/src/mill/scalalib/GenIdea.scala @@ -1,8 +1,10 @@ package mill.scalalib import ammonite.ops._ +import coursier.Cache +import coursier.maven.MavenRepository import mill.define._ -import mill.eval.{Evaluator, PathRef} +import mill.eval.{Evaluator, PathRef, Result} import mill.scalalib import mill.util.Ctx.LogCtx import mill.util.{Loose, PrintLogger, Strict} @@ -32,7 +34,19 @@ object GenIdea { .collect{ case x: scalalib.ScalaModule => (x.millModuleSegments, x)} .toSeq - val buildLibraryPaths = Agg.from(sys.props("MILL_BUILD_LIBRARIES").split(',').map(Path(_)).distinct) + val buildLibraryPaths = sys.props.get("MILL_BUILD_LIBRARIES") match { + case Some(found) => Agg.from(found.split(',').map(Path(_)).distinct) + case None => + val artifactNames = Seq("moduledefs", "core", "scalalib", "scalajslib") + val Result.Success(res) = scalalib.Lib.resolveDependencies( + Seq(Cache.ivy2Local, MavenRepository("https://repo1.maven.org/maven2")), + "2.12.4", + "2.12", + for(name <- artifactNames) + yield Dep("com.lihaoyi", s"mill-${name}", "0.0.1-SNAPSHOT") + ) + res.items.toSeq.map(_.path) + } val resolved = for((path, mod) <- modules) yield { val Seq(resolvedCp: Loose.Agg[PathRef], resolvedSrcs: Loose.Agg[PathRef]) = diff --git a/scalalib/src/mill/scalalib/ScalaWorkerApi.scala b/scalalib/src/mill/scalalib/ScalaWorkerApi.scala index 43b82460..8ff45a48 100644 --- a/scalalib/src/mill/scalalib/ScalaWorkerApi.scala +++ b/scalalib/src/mill/scalalib/ScalaWorkerApi.scala @@ -4,6 +4,7 @@ import java.lang.reflect.{InvocationHandler, Method} import java.net.URI import ammonite.ops.Path +import coursier.Cache import coursier.maven.MavenRepository import mill.Agg import mill.scalalib.TestRunner.Result @@ -19,10 +20,10 @@ object ScalaWorkerApi extends mill.define.BaseModule(ammonite.ops.pwd){ if (scalaWorkerJar != null) Loose.Agg.from(scalaWorkerJar.split(',').map(Path(_))) else { val mill.eval.Result.Success(v) = resolveDependencies( - Seq(MavenRepository("https://repo1.maven.org/maven2")), + Seq(Cache.ivy2Local, MavenRepository("https://repo1.maven.org/maven2")), "2.12.4", "2.12", - Seq(ivy"com.lihaoyi::mill-scalaworker:0.1-SNAPSHOT") + Seq(ivy"com.lihaoyi::mill-scalaworker:0.0.1-SNAPSHOT") ) v.map(_.path) } diff --git a/scalalib/src/mill/scalalib/publish/Ivy.scala b/scalalib/src/mill/scalalib/publish/Ivy.scala index b0b6443e..644e2c53 100644 --- a/scalalib/src/mill/scalalib/publish/Ivy.scala +++ b/scalalib/src/mill/scalalib/publish/Ivy.scala @@ -33,7 +33,7 @@ object Ivy { <artifact name={artifact.id} type="src" ext="jar" conf="compile" e:classifier="sources"/> <artifact name={artifact.id} type="doc" ext="jar" conf="compile" e:classifier="javadoc"/> </publications> - <dependencies>{dependencies.map(renderDependency)}</dependencies> + <dependencies>{dependencies.map(renderDependency).toSeq}</dependencies> </ivy-module> val pp = new PrettyPrinter(120, 4) diff --git a/scalalib/src/mill/scalalib/publish/Pom.scala b/scalalib/src/mill/scalalib/publish/Pom.scala index 74dc6e8f..895e1686 100644 --- a/scalalib/src/mill/scalalib/publish/Pom.scala +++ b/scalalib/src/mill/scalalib/publish/Pom.scala @@ -39,7 +39,7 @@ object Pom { {pomSettings.developers.map(renderDeveloper)} </developers> <dependencies> - {dependencies.map(renderDependency)} + {dependencies.map(renderDependency).toSeq} </dependencies> </project> |