diff options
author | Li Haoyi <haoyi.sg@gmail.com> | 2017-11-09 04:56:36 -0800 |
---|---|---|
committer | Li Haoyi <haoyi.sg@gmail.com> | 2017-11-09 04:56:36 -0800 |
commit | fd545a9ae9f41a4bfdc2bf13a4554943f206f92b (patch) | |
tree | bfb76d137529f95026d4b576cd9bef154dabe531 /scalaplugin | |
parent | cdecfeedc1900aff0c4acfd284b07bf36087c3c9 (diff) | |
download | mill-fd545a9ae9f41a4bfdc2bf13a4554943f206f92b.tar.gz mill-fd545a9ae9f41a4bfdc2bf13a4554943f206f92b.tar.bz2 mill-fd545a9ae9f41a4bfdc2bf13a4554943f206f92b.zip |
Make `Applicative` macros able to inject a configurable `Ctx` object, used in `Target` to inject the `dest` folder for the `T{...}` block to use
Diffstat (limited to 'scalaplugin')
-rw-r--r-- | scalaplugin/src/main/scala/forge/scalaplugin/Subproject.scala | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/scalaplugin/src/main/scala/forge/scalaplugin/Subproject.scala b/scalaplugin/src/main/scala/forge/scalaplugin/Subproject.scala index d1433e35..93c341ae 100644 --- a/scalaplugin/src/main/scala/forge/scalaplugin/Subproject.scala +++ b/scalaplugin/src/main/scala/forge/scalaplugin/Subproject.scala @@ -18,21 +18,10 @@ import xsbti.compile.DependencyChanges import scalaz.concurrent.Task object Subproject{ - def compileScala(scalaVersion: T[String], - sources: T[PathRef], - compileClasspath: T[Seq[PathRef]]) : T[PathRef] = { - new Target[PathRef] { - def evaluate(args: Args) = { - compileScala0(args[String](0), args[PathRef](1), args[Seq[PathRef]](2), args.dest) - } - - val inputs = Seq(scalaVersion, sources, compileClasspath) - } - } - def compileScala0(scalaVersion: String, - sources: PathRef, - compileClasspath: Seq[PathRef], - outputPath: Path): PathRef = { + def compileScala(scalaVersion: String, + sources: PathRef, + compileClasspath: Seq[PathRef], + outputPath: Path): PathRef = { val binaryScalaVersion = scalaVersion.split('.').dropRight(1).mkString(".") def grepJar(s: String) = { compileClasspath @@ -189,7 +178,7 @@ abstract class Subproject extends Cacher{ def sources = T{ PathRef(basePath() / 'src) } def resources = T{ PathRef(basePath() / 'resources) } def compiled = T{ - compileScala(scalaVersion, sources, compileDepClasspath) + compileScala(scalaVersion(), sources(), compileDepClasspath(), Target.ctx().dest) } def classpath = T{ Seq(resources(), compiled()) } |