diff options
author | Li Haoyi <haoyi.sg@gmail.com> | 2018-01-28 22:43:40 -0800 |
---|---|---|
committer | Li Haoyi <haoyi.sg@gmail.com> | 2018-01-28 22:43:40 -0800 |
commit | bc777b3c4e83149f45df7edda245868e22495eb3 (patch) | |
tree | b2e58f641bc9db34d17193b495cf07e76a9e13a5 /core/test/resources/examples | |
parent | 42d24a0b59fa21bfa79040c2cd51a1f7384eee12 (diff) | |
download | mill-bc777b3c4e83149f45df7edda245868e22495eb3.tar.gz mill-bc777b3c4e83149f45df7edda245868e22495eb3.tar.bz2 mill-bc777b3c4e83149f45df7edda245868e22495eb3.zip |
Extract out `ScriptTestSuite` from `IntegrationTestSuite` and use it to create a version of `JavaCompilerJarTests` that runs through our main method & script runner.
This should let us catch a lot of bugs with `MainRunner` and friends quickly, without needing to run the slow integration tests
Diffstat (limited to 'core/test/resources/examples')
-rw-r--r-- | core/test/resources/examples/javac/build.sc | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/core/test/resources/examples/javac/build.sc b/core/test/resources/examples/javac/build.sc new file mode 100644 index 00000000..4a0882c6 --- /dev/null +++ b/core/test/resources/examples/javac/build.sc @@ -0,0 +1,23 @@ +import ammonite.ops._ +import mill.T +import mill.eval.JavaCompileJarTests.compileAll +import mill.eval.PathRef +import mill.modules.Jvm +import mill.util.Loose + +def sourceRootPath = basePath / 'src +def resourceRootPath = basePath / 'resources + +// sourceRoot -> allSources -> classFiles +// | +// v +// resourceRoot ----> jar +def sourceRoot = T.source{ sourceRootPath } +def resourceRoot = T.source{ resourceRootPath } +def allSources = T{ ls.rec(sourceRoot().path).map(PathRef(_)) } +def classFiles = T{ compileAll(allSources()) } +def jar = T{ Jvm.createJar(Loose.Agg(resourceRoot().path, classFiles().path)) } + +def run(mainClsName: String) = T.command{ + %%('java, "-cp", classFiles().path, mainClsName)(T.ctx().dest) +} |