summaryrefslogtreecommitdiff
path: root/build.sc
diff options
context:
space:
mode:
authorLi Haoyi <haoyi.sg@gmail.com>2018-05-25 10:12:22 -0700
committerGitHub <noreply@github.com>2018-05-25 10:12:22 -0700
commit605be45b4d674b7a6f318f2c765dc69d605a69d5 (patch)
tree3fbcef33c9a9334aa456c05fd7db6a60dd22638e /build.sc
parent02436b4000cc16683984244ca272b93c1ff015c7 (diff)
downloadmill-605be45b4d674b7a6f318f2c765dc69d605a69d5.tar.gz
mill-605be45b4d674b7a6f318f2c765dc69d605a69d5.tar.bz2
mill-605be45b4d674b7a6f318f2c765dc69d605a69d5.zip
Add a `visualize` command to render portions of the build graph as SVG (#349)
* Transitive reduction of visualized graph via jgrapht now works ``` out/dev/launcher/dest/run -i visualize __.compile _ out/dev/launcher/dest/run -i visualize core.__ ``` * Move test running logic from scalaworker into scalalib This is to try and reduce the size of the classpath we are passing to the test runner subprocess, in an attempt to fix the command-line-too-long errors we're getting in Appveyor. Now the test runner subprocess should no longer need Zinc or all of it's transitive dependencies * - Break out `GraphvizTools` into a separate Mill module, to avoid bloating the main jar and try to shorten the `MILL_SCALA_WORKER` classpath being sent to scalajslib.test (which is blowing up on windows as the CLI command is too long) - Move the meat of `resolveDependencies` from `scalalib` to `main`, to support resolving mill modules - DRY up resolution of mill modules in `Util.millProjectModule` * fix mill module resolution * Tweaks to try and make zinc work again... * Tweak `Module#reflect` to try and make it happy with `visualize` module... * fix integration test classpath * move visualization into it's own module
Diffstat (limited to 'build.sc')
-rwxr-xr-xbuild.sc21
1 files changed, 20 insertions, 1 deletions
diff --git a/build.sc b/build.sc
index ac6c2ea9..c3dd8fa8 100755
--- a/build.sc
+++ b/build.sc
@@ -9,6 +9,7 @@ import mill._
import mill.scalalib._
import publish._
import mill.modules.Jvm.createAssembly
+
import upickle.Js
trait MillPublishModule extends PublishModule{
@@ -124,6 +125,18 @@ object main extends MillModule {
def ivyDeps = Agg(ivy"com.novocode:junit-interface:0.11")
}
}
+
+ object graphviz extends MillModule{
+ def moduleDeps = Seq(main, scalalib)
+
+ def ivyDeps = Agg(
+ ivy"guru.nidi:graphviz-java:0.2.3",
+ ivy"org.jgrapht:jgrapht-core:1.2.0"
+ )
+ def testArgs = Seq(
+ "-DMILL_GRAPHVIZ=" + runClasspath().map(_.path).mkString(",")
+ )
+ }
}
@@ -148,7 +161,12 @@ object scalalib extends MillModule {
genTask(scalajslib)()
worker.testArgs() ++
- Seq("-Djna.nosys=true") ++ Seq("-DMILL_BUILD_LIBRARIES=" + genIdeaArgs.map(_.path).mkString(","))
+ main.graphviz.testArgs() ++
+ Seq(
+ "-Djna.nosys=true",
+ "-DMILL_BUILD_LIBRARIES=" + genIdeaArgs.map(_.path).mkString(","),
+ "-DMILL_SCALA_LIB=" + runClasspath().map(_.path).mkString(",")
+ )
}
object worker extends MillModule{
@@ -229,6 +247,7 @@ object integration extends MillModule{
Seq(
"-DMILL_TESTNG=" + testng.runClasspath().map(_.path).mkString(","),
"-DMILL_VERSION=" + build.publishVersion()._2,
+ "-DMILL_SCALA_LIB=" + scalalib.runClasspath().map(_.path).mkString(","),
"-Djna.nosys=true"
) ++
(for((k, v) <- testRepos()) yield s"-D$k=$v")