From c820e54a2c5bab47627f9ddcc05252660f9ce8e7 Mon Sep 17 00:00:00 2001 From: Li Haoyi Date: Sun, 11 Feb 2018 02:03:49 -0800 Subject: more tidying up --- scalalib/src/mill/scalalib/ScalaModule.scala | 23 ++++++++++++----------- scalalib/src/mill/scalalib/ScalaWorkerApi.scala | 1 - 2 files changed, 12 insertions(+), 12 deletions(-) (limited to 'scalalib/src') diff --git a/scalalib/src/mill/scalalib/ScalaModule.scala b/scalalib/src/mill/scalalib/ScalaModule.scala index 339c6623..b7810246 100644 --- a/scalalib/src/mill/scalalib/ScalaModule.scala +++ b/scalalib/src/mill/scalalib/ScalaModule.scala @@ -33,12 +33,9 @@ trait ScalaModule extends mill.Module with TaskModule { outer => def scalacOptions = T{ Seq.empty[String] } def javacOptions = T{ Seq.empty[String] } - def repositories: Seq[Repository] = Seq( - Cache.ivy2Local, - MavenRepository("https://repo1.maven.org/maven2") - ) - def moduleDeps = Seq.empty[ScalaModule] + + def transitiveModuleDeps: Seq[ScalaModule] = { Seq(this) ++ moduleDeps.flatMap(_.transitiveModuleDeps).distinct } @@ -66,9 +63,15 @@ trait ScalaModule extends mill.Module with TaskModule { outer => ) } + + def repositories: Seq[Repository] = Seq( + Cache.ivy2Local, + MavenRepository("https://repo1.maven.org/maven2") + ) + def platformSuffix = T{ "" } - def compilerBridgeSources = T{ + def scalaCompilerBridgeSources = T{ resolveDependencies( repositories, scalaVersion(), @@ -96,17 +99,16 @@ trait ScalaModule extends mill.Module with TaskModule { outer => def sources = T.sources{ millSourcePath / 'src } def resources = T.sources{ millSourcePath / 'resources } - def generatedSources = T.sources() + def generatedSources = T{ Seq.empty[PathRef] } def allSources = T{ sources() ++ generatedSources() } def compile: T[CompilationResult] = T.persistent{ mill.scalalib.ScalaWorkerApi.scalaWorker().compileScala( scalaVersion(), allSources().map(_.path), - compilerBridgeSources().map(_.path), + scalaCompilerBridgeSources().map(_.path), compileClasspath().map(_.path), scalaCompilerClasspath().map(_.path), - scalacPluginClasspath().map(_.path), scalacOptions(), scalacPluginClasspath().map(_.path), javacOptions(), @@ -137,11 +139,10 @@ trait ScalaModule extends mill.Module with TaskModule { outer => ) } - def localClasspath = T{ resources() ++ Seq(compile().classes) } def jar = T{ createJar( - localClasspath().map(_.path).filter(exists), + (resources() ++ Seq(compile().classes)).map(_.path).filter(exists), mainClass() ) } diff --git a/scalalib/src/mill/scalalib/ScalaWorkerApi.scala b/scalalib/src/mill/scalalib/ScalaWorkerApi.scala index b01409c1..03cd7d9d 100644 --- a/scalalib/src/mill/scalalib/ScalaWorkerApi.scala +++ b/scalalib/src/mill/scalalib/ScalaWorkerApi.scala @@ -51,7 +51,6 @@ trait ScalaWorkerApi { compileBridgeSources: Agg[Path], compileClasspath: Agg[Path], compilerClasspath: Agg[Path], - pluginClasspath: Agg[Path], scalacOptions: Seq[String], scalacPluginClasspath: Agg[Path], javacOptions: Seq[String], -- cgit v1.2.3