diff options
author | Li Haoyi <haoyi.sg@gmail.com> | 2018-02-03 23:21:01 -0800 |
---|---|---|
committer | Li Haoyi <haoyi.sg@gmail.com> | 2018-02-03 23:28:43 -0800 |
commit | 7e44da8a8b97f2a2e5d2de489369d5075a6e1ea7 (patch) | |
tree | 08b8678d16e26c379e0788e94a78edb505686cb1 /core/test/src/mill/eval/JavaCompileJarTests.scala | |
parent | 91345fce118b67d9ca334a5f3cc973b458e01fc2 (diff) | |
download | mill-7e44da8a8b97f2a2e5d2de489369d5075a6e1ea7.tar.gz mill-7e44da8a8b97f2a2e5d2de489369d5075a6e1ea7.tar.bz2 mill-7e44da8a8b97f2a2e5d2de489369d5075a6e1ea7.zip |
flexiblize T.sources and use it widely, which lets us fix --watch
Diffstat (limited to 'core/test/src/mill/eval/JavaCompileJarTests.scala')
-rw-r--r-- | core/test/src/mill/eval/JavaCompileJarTests.scala | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/core/test/src/mill/eval/JavaCompileJarTests.scala b/core/test/src/mill/eval/JavaCompileJarTests.scala index a67d669d..71feebda 100644 --- a/core/test/src/mill/eval/JavaCompileJarTests.scala +++ b/core/test/src/mill/eval/JavaCompileJarTests.scala @@ -35,11 +35,11 @@ object JavaCompileJarTests extends TestSuite{ // | // v // resourceRoot ----> jar - def sourceRoot = T.source{ sourceRootPath } - def resourceRoot = T.source{ resourceRootPath } - def allSources = T{ ls.rec(sourceRoot().path).map(PathRef(_)) } + def sourceRoot = T.sources{ sourceRootPath } + def resourceRoot = T.sources{ resourceRootPath } + def allSources = T{ sourceRoot().flatMap(p => ls.rec(p.path)).map(PathRef(_)) } def classFiles = T{ compileAll(allSources()) } - def jar = T{ Jvm.createJar(Loose.Agg(resourceRoot().path, classFiles().path)) } + def jar = T{ Jvm.createJar(Loose.Agg(classFiles().path) ++ resourceRoot().map(_.path)) } def run(mainClsName: String) = T.command{ %%('java, "-cp", classFiles().path, mainClsName) @@ -108,12 +108,12 @@ object JavaCompileJarTests extends TestSuite{ val jarContents = %%('jar, "-tf", evaluator.outPath/'jar/'dest/"out.jar")(evaluator.outPath).out.string val expectedJarContents = """META-INF/MANIFEST.MF - |hello.txt |test/Bar.class |test/BarThree.class |test/BarTwo.class |test/Foo.class |test/FooTwo.class + |hello.txt |""".stripMargin assert(jarContents == expectedJarContents) |