summaryrefslogtreecommitdiff
path: root/build.sc
diff options
context:
space:
mode:
authorLi Haoyi <haoyi.sg@gmail.com>2018-01-06 23:25:29 -0800
committerLi Haoyi <haoyi.sg@gmail.com>2018-01-07 00:21:37 -0800
commit7cd18fd936b95410274be031a8231e5a3d9866a4 (patch)
treec3d9a1f4a110dc5f25824eb9f118ea8ebfcd2b37 /build.sc
parenta6febe05a5650274110301a09bb97e4770ea0400 (diff)
downloadmill-7cd18fd936b95410274be031a8231e5a3d9866a4.tar.gz
mill-7cd18fd936b95410274be031a8231e5a3d9866a4.tar.bz2
mill-7cd18fd936b95410274be031a8231e5a3d9866a4.zip
First pass at implicitly propagating a `def basePath: Path` up the `Module` hierarchy, which each module receives and extends.
One constraint is that now must define your abstract modules as `trait`s rather than `class`es, or otherwise add an implicit `ctx: ModuleCtx` parameter to your class definition. So far this lets us remove some explicit `basePath` definitions in `build.sc`. Proper handling of `basePath` in `CrossModule`s is future work
Diffstat (limited to 'build.sc')
-rwxr-xr-xbuild.sc12
1 files changed, 0 insertions, 12 deletions
diff --git a/build.sc b/build.sc
index 16642f6e..490fe55f 100755
--- a/build.sc
+++ b/build.sc
@@ -10,7 +10,6 @@ import mill.modules.Jvm.createAssembly
object moduledefs extends SbtModule{
def scalaVersion = "2.12.4"
- def basePath = pwd / 'moduledefs
def ivyDeps = Seq(
Dep.Java("org.scala-lang", "scala-compiler", scalaVersion()),
Dep("com.lihaoyi", "sourcecode", "0.1.4")
@@ -59,8 +58,6 @@ object core extends MillModule {
Dep.Java("org.scala-sbt", "test-interface", "1.0")
)
- def basePath = pwd / 'core
-
def generatedSources = T{
mkdir(T.ctx().dest)
shared.generateSources(T.ctx().dest)
@@ -87,13 +84,7 @@ case class BridgeModule(crossVersion: String) extends PublishModule {
def publishName = "mill-bridge"
def publishVersion = "0.1"
- def basePath = pwd / 'bridge
def scalaVersion = crossVersion
- def sources = T.source {
- val path = basePath / 'src
- mkdir(path)
- path
- }
def allSources = T{
Seq(PathRef(shared.downloadBridgeSource(T.ctx().dest, crossVersion)))
}
@@ -116,7 +107,6 @@ case class BridgeModule(crossVersion: String) extends PublishModule {
object scalalib extends MillModule {
def projectDeps = Seq(core)
- def basePath = pwd / 'scalalib
def bridgeCompiles = mill.define.Task.traverse(bridges.items)(_._2.compile)
def testArgs = T{
@@ -146,7 +136,6 @@ case class JsBridgeModule(scalajsBinary: String) extends MillModule{
object scalajslib extends MillModule {
def projectDeps = Seq(scalalib)
- def basePath = pwd / 'scalajslib
def bridgeClasspath(runDepClasspath: Seq[PathRef], classes: PathRef) =
(runDepClasspath :+ classes).map(_.path).mkString(File.pathSeparator)
@@ -171,7 +160,6 @@ def testRepos = T{
object integration extends MillModule{
def projectDeps = Seq(moduledefs, scalalib, scalajslib)
- def basePath = pwd / 'integration
def testArgs = T{
for((k, v) <- testRepos()) yield s"-D$k=$v"
}