diff options
author | Li Haoyi <haoyi.sg@gmail.com> | 2017-11-09 03:59:35 -0800 |
---|---|---|
committer | Li Haoyi <haoyi.sg@gmail.com> | 2017-11-09 03:59:35 -0800 |
commit | cdecfeedc1900aff0c4acfd284b07bf36087c3c9 (patch) | |
tree | b0ce149f551d211103c62eee45c4fce5bc109657 /scalaplugin | |
parent | a861ea9dd39ab3c4cc74ec3e1cf73355219d1836 (diff) | |
download | mill-cdecfeedc1900aff0c4acfd284b07bf36087c3c9.tar.gz mill-cdecfeedc1900aff0c4acfd284b07bf36087c3c9.tar.bz2 mill-cdecfeedc1900aff0c4acfd284b07bf36087c3c9.zip |
make scalaplugin.Subproject use the builtin destination folder
Diffstat (limited to 'scalaplugin')
-rw-r--r-- | scalaplugin/src/main/scala/forge/scalaplugin/Subproject.scala | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/scalaplugin/src/main/scala/forge/scalaplugin/Subproject.scala b/scalaplugin/src/main/scala/forge/scalaplugin/Subproject.scala index eb71203e..d1433e35 100644 --- a/scalaplugin/src/main/scala/forge/scalaplugin/Subproject.scala +++ b/scalaplugin/src/main/scala/forge/scalaplugin/Subproject.scala @@ -8,6 +8,7 @@ import coursier.{Cache, Dependency, Fetch, MavenRepository, Module, Repository, import forge.define.Target import forge.define.Target.Cacher import forge.eval.PathRef +import forge.util.Args import play.api.libs.json._ import sbt.internal.inc.{FreshCompilerCache, ScalaInstance, ZincUtil} import sbt.internal.util.{ConsoleOut, MainAppender} @@ -17,10 +18,21 @@ import xsbti.compile.DependencyChanges import scalaz.concurrent.Task object Subproject{ - def compileScala(scalaVersion: String, - sources: PathRef, - compileClasspath: Seq[PathRef], - outputPath: Path): PathRef = { + 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 = { val binaryScalaVersion = scalaVersion.split('.').dropRight(1).mkString(".") def grepJar(s: String) = { compileClasspath @@ -175,11 +187,9 @@ abstract class Subproject extends Cacher{ } def sources = T{ PathRef(basePath() / 'src) } - def outputPath = T{ basePath() / 'out } def resources = T{ PathRef(basePath() / 'resources) } - def compiledPath = T{ outputPath() / 'classpath } def compiled = T{ - compileScala(scalaVersion(), sources(), compileDepClasspath(), outputPath()) + compileScala(scalaVersion, sources, compileDepClasspath) } def classpath = T{ Seq(resources(), compiled()) } |