summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/src/main/scala/forge/Main.scala6
-rw-r--r--core/src/main/scala/forge/define/Target.scala1
-rw-r--r--scalaplugin/src/main/scala/forge/scalaplugin/Subproject.scala24
3 files changed, 21 insertions, 10 deletions
diff --git a/core/src/main/scala/forge/Main.scala b/core/src/main/scala/forge/Main.scala
index a06d7d6f..e66f5fd8 100644
--- a/core/src/main/scala/forge/Main.scala
+++ b/core/src/main/scala/forge/Main.scala
@@ -24,9 +24,9 @@ object Main {
else{
val (obj, discovered) = result.asInstanceOf[Res.Success[(Any, Discovered[Any])]].s
- val consErrors = Discovered.consistencyCheck(obj, discovered)
- pprint.log(consErrors)
- if (consErrors.nonEmpty) println("Failed Discovered.consistencyCheck: " + consErrors)
+ val consistencyErrors = Discovered.consistencyCheck(obj, discovered)
+ pprint.log(consistencyErrors)
+ if (consistencyErrors.nonEmpty) println("Failed Discovered.consistencyCheck: " + consistencyErrors)
else {
val mapping = Discovered.mapping(obj)(discovered)
val workspacePath = pwd / 'out
diff --git a/core/src/main/scala/forge/define/Target.scala b/core/src/main/scala/forge/define/Target.scala
index 753a63e8..9cb2dd1a 100644
--- a/core/src/main/scala/forge/define/Target.scala
+++ b/core/src/main/scala/forge/define/Target.scala
@@ -6,6 +6,7 @@ import forge.eval.PathRef
import forge.util.{Args, JsonFormatters}
import play.api.libs.json.{Format, Json}
+import scala.annotation.compileTimeOnly
import scala.language.experimental.macros
import scala.reflect.macros.blackbox.Context
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()) }