summaryrefslogtreecommitdiff
path: root/core/src/test/scala/forge/JavaCompileJarTests.scala
diff options
context:
space:
mode:
authorLi Haoyi <haoyi.sg@gmail.com>2017-11-04 09:09:02 -0700
committerLi Haoyi <haoyi.sg@gmail.com>2017-11-04 09:09:02 -0700
commit3b10725ee3a1f84855a0654c5e386bc7465816d3 (patch)
treedeb6574654db3aab8c855a31c475c94233678a98 /core/src/test/scala/forge/JavaCompileJarTests.scala
parentc5f3cb7fdcc610bd167460b75b22863f61d6fb4b (diff)
downloadmill-3b10725ee3a1f84855a0654c5e386bc7465816d3.tar.gz
mill-3b10725ee3a1f84855a0654c5e386bc7465816d3.tar.bz2
mill-3b10725ee3a1f84855a0654c5e386bc7465816d3.zip
First experiment using `Cacher interface` combined with `Caller` implicits to turn `def foo = T{}` into pseudo-`lazy val`s, that we can override in subclasses using stackable traits
Diffstat (limited to 'core/src/test/scala/forge/JavaCompileJarTests.scala')
-rw-r--r--core/src/test/scala/forge/JavaCompileJarTests.scala19
1 files changed, 9 insertions, 10 deletions
diff --git a/core/src/test/scala/forge/JavaCompileJarTests.scala b/core/src/test/scala/forge/JavaCompileJarTests.scala
index c1a055ea..8b292a88 100644
--- a/core/src/test/scala/forge/JavaCompileJarTests.scala
+++ b/core/src/test/scala/forge/JavaCompileJarTests.scala
@@ -50,27 +50,26 @@ object JavaCompileJarTests extends TestSuite{
mkdir(pwd / 'target / 'workspace / 'javac)
cp(javacSrcPath, javacDestPath)
- object Build {
- val sourceRootPath = javacDestPath / 'src
- val resourceRootPath = javacDestPath / 'resources
+ object Build extends Target.Cacher{
+ def sourceRootPath = javacDestPath / 'src
+ def resourceRootPath = javacDestPath / 'resources
// sourceRoot -> allSources -> classFiles
// |
// v
// resourceRoot ----> jar
- val sourceRoot = Target.path(sourceRootPath)
- val resourceRoot = Target.path(resourceRootPath)
- val allSources = T{
- ls.rec(sourceRoot().path).map(PathRef(_))
- }
- val classFiles = compileAll(allSources)
- val jar = jarUp(resourceRoot, classFiles)
+ def sourceRoot = T{ Target.path(sourceRootPath) }
+ def resourceRoot = T{ Target.path(resourceRootPath) }
+ def allSources = T{ ls.rec(sourceRoot().path).map(PathRef(_)) }
+ def classFiles = T{ compileAll(allSources) }
+ def jar = T{ jarUp(resourceRoot, classFiles) }
}
import Build._
val mapping = Discovered.mapping(Build)
def check(targets: OSet[Target[_]], expected: OSet[Target[_]]) = {
val evaluator = new Evaluator(workspacePath, mapping)
+
val evaluated = evaluator.evaluate(targets).evaluated.filter(mapping.contains)
assert(evaluated == expected)
}