diff options
author | Li Haoyi <haoyi.sg@gmail.com> | 2017-11-09 08:01:31 -0800 |
---|---|---|
committer | Li Haoyi <haoyi.sg@gmail.com> | 2017-11-09 08:01:55 -0800 |
commit | c7ab7da7ccd21c63740f6494811a09722a0d2ce0 (patch) | |
tree | cf11362f1fc13ed53eaf85d92d8bec0c304a822a /core/src/test | |
parent | fd545a9ae9f41a4bfdc2bf13a4554943f206f92b (diff) | |
download | mill-c7ab7da7ccd21c63740f6494811a09722a0d2ce0.tar.gz mill-c7ab7da7ccd21c63740f6494811a09722a0d2ce0.tar.bz2 mill-c7ab7da7ccd21c63740f6494811a09722a0d2ce0.zip |
Move `JavaCompilerJarTests` over to new `Target.ctx()` syntax
Diffstat (limited to 'core/src/test')
-rw-r--r-- | core/src/test/scala/forge/JavaCompileJarTests.scala | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/core/src/test/scala/forge/JavaCompileJarTests.scala b/core/src/test/scala/forge/JavaCompileJarTests.scala index 081290ca..4c3ce06c 100644 --- a/core/src/test/scala/forge/JavaCompileJarTests.scala +++ b/core/src/test/scala/forge/JavaCompileJarTests.scala @@ -1,7 +1,8 @@ package forge -import ammonite.ops._, ImplicitWd._ +import ammonite.ops._ +import ImplicitWd._ import forge.define.Target import forge.discover.Discovered import forge.eval.{Evaluator, PathRef} @@ -10,14 +11,12 @@ import forge.util.OSet import utest._ object JavaCompileJarTests extends TestSuite{ - def compileAll(sources: Target[Seq[PathRef]]) = { - new Target.Subprocess( - Seq(sources), - args => - Seq("javac") ++ - args[Seq[PathRef]](0).map(_.path.toString) ++ - Seq("-d", args.dest.toString) - ).map(_.dest) + def compileAll(dest: Path, sources: Seq[PathRef]) = { + mkdir(dest) + import ammonite.ops._ + %("javac", sources.map(_.path.toString()), "-d", dest)(wd = dest) + PathRef(dest) +// } @@ -42,7 +41,7 @@ object JavaCompileJarTests extends TestSuite{ 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 classFiles = T{ compileAll(Target.ctx().dest, allSources()) } def jar = T{ jarUp(resourceRoot, classFiles) } @forge.discover.Router.main @@ -153,7 +152,7 @@ object JavaCompileJarTests extends TestSuite{ val (runOutput2, evalCount2) = eval(Build.run("test.BarFour")) assert( runOutput2.out.string == "New Cls!\n", - evalCount2 == 5 + evalCount2 == 4 ) val (runOutput3, evalCount3) = eval(Build.run("test.BarFour")) assert( |