From 80c8ad730132145fc33b790657b14669f282d5b0 Mon Sep 17 00:00:00 2001 From: Li Haoyi Date: Fri, 2 Feb 2018 21:48:35 -0800 Subject: - Rename `basePath` -> `millSourcePath` - Make `T.worker`s not flush out their directories between instantiations --- scalalib/src/mill/scalalib/GenIdea.scala | 2 +- scalalib/src/mill/scalalib/MiscModule.scala | 26 +++++++++++++------------- scalalib/src/mill/scalalib/ScalaModule.scala | 6 +++--- 3 files changed, 17 insertions(+), 17 deletions(-) (limited to 'scalalib/src') diff --git a/scalalib/src/mill/scalalib/GenIdea.scala b/scalalib/src/mill/scalalib/GenIdea.scala index 99b820b0..60153f1f 100644 --- a/scalalib/src/mill/scalalib/GenIdea.scala +++ b/scalalib/src/mill/scalalib/GenIdea.scala @@ -116,7 +116,7 @@ object GenIdea { val normalSourcePaths = (allSourcesPathRefs.map(_.path).toSet -- generatedSourcePaths.toSet).toSeq val paths = Evaluator.resolveDestPaths( - evaluator.workspacePath, + evaluator.outPath, mod.compile.ctx.segments ) diff --git a/scalalib/src/mill/scalalib/MiscModule.scala b/scalalib/src/mill/scalalib/MiscModule.scala index e20fe7be..440b7dcd 100644 --- a/scalalib/src/mill/scalalib/MiscModule.scala +++ b/scalalib/src/mill/scalalib/MiscModule.scala @@ -14,7 +14,7 @@ object CrossModuleBase{ } trait CrossModuleBase extends mill.Module{ def crossScalaVersion: String - override def basePath = super.basePath / ammonite.ops.up + override def millSourcePath = super.millSourcePath / ammonite.ops.up implicit def crossSbtModuleResolver: Resolver[CrossModuleBase] = new Resolver[CrossModuleBase]{ def resolve[V <: CrossModuleBase](c: Cross[V]): V = { crossScalaVersion.split('.') @@ -37,14 +37,14 @@ trait CrossModuleBase extends mill.Module{ trait CrossScalaModule extends ScalaModule with CrossModuleBase{ outer => override def sources = T.input{ super.sources() ++ - CrossModuleBase.scalaVersionPaths(crossScalaVersion, s => basePath / s"src-$s" ) + CrossModuleBase.scalaVersionPaths(crossScalaVersion, s => millSourcePath / s"src-$s" ) } trait Tests extends super.Tests { override def sources = T.input{ super.sources() ++ - CrossModuleBase.scalaVersionPaths(crossScalaVersion, s => basePath / s"src-$s" ) + CrossModuleBase.scalaVersionPaths(crossScalaVersion, s => millSourcePath / s"src-$s" ) } } } @@ -52,20 +52,20 @@ trait CrossScalaModule extends ScalaModule with CrossModuleBase{ outer => trait SbtModule extends ScalaModule { outer => override def sources = T.input{ Agg( - PathRef(basePath / 'src / 'main / 'scala), - PathRef(basePath / 'src / 'main / 'java) + PathRef(millSourcePath / 'src / 'main / 'scala), + PathRef(millSourcePath / 'src / 'main / 'java) ) } - override def resources = T.input{ Agg(PathRef(basePath / 'src / 'main / 'resources)) } + override def resources = T.input{ Agg(PathRef(millSourcePath / 'src / 'main / 'resources)) } trait Tests extends super.Tests { - override def basePath = outer.basePath + override def millSourcePath = outer.millSourcePath override def sources = T.input{ Agg( - PathRef(basePath / 'src / 'test / 'scala), - PathRef(basePath / 'src / 'test / 'java) + PathRef(millSourcePath / 'src / 'test / 'scala), + PathRef(millSourcePath / 'src / 'test / 'java) ) } - override def resources = T.input{ Agg(PathRef(basePath / 'src / 'test / 'resources)) } + override def resources = T.input{ Agg(PathRef(millSourcePath / 'src / 'test / 'resources)) } } } @@ -76,17 +76,17 @@ trait CrossSbtModule extends SbtModule with CrossModuleBase{ outer => super.sources() ++ CrossModuleBase.scalaVersionPaths( crossScalaVersion, - s => basePath / 'src / 'main / s"scala-$s" + s => millSourcePath / 'src / 'main / s"scala-$s" ) } trait Tests extends super.Tests { - override def basePath = outer.basePath + override def millSourcePath = outer.millSourcePath override def sources = T.input{ super.sources() ++ CrossModuleBase.scalaVersionPaths( crossScalaVersion, - s => basePath / 'src / 'main / s"scala-$s" + s => millSourcePath / 'src / 'main / s"scala-$s" ) } } diff --git a/scalalib/src/mill/scalalib/ScalaModule.scala b/scalalib/src/mill/scalalib/ScalaModule.scala index 47326c6c..47309350 100644 --- a/scalalib/src/mill/scalalib/ScalaModule.scala +++ b/scalalib/src/mill/scalalib/ScalaModule.scala @@ -126,8 +126,8 @@ trait ScalaModule extends mill.Module with TaskModule { outer => def prependShellScript: T[String] = T{ "" } - def sources = T.input{ Agg(PathRef(basePath / 'src)) } - def resources = T.input{ Agg(PathRef(basePath / 'resources)) } + def sources = T.input{ Agg(PathRef(millSourcePath / 'src)) } + def resources = T.input{ Agg(PathRef(millSourcePath / 'resources)) } def generatedSources = T { Agg.empty[PathRef] } def allSources = T{ sources() ++ generatedSources() } @@ -249,7 +249,7 @@ trait ScalaModule extends mill.Module with TaskModule { outer => // publish artifact with name "mill_2.12.4" instead of "mill_2.12" def crossFullScalaVersion: T[Boolean] = false - def artifactName: T[String] = basePath.last.toString + def artifactName: T[String] = millSourcePath.last.toString def artifactScalaVersion: T[String] = T { if (crossFullScalaVersion()) scalaVersion() else Lib.scalaBinaryVersion(scalaVersion()) -- cgit v1.2.3