summaryrefslogtreecommitdiff
path: root/scalajslib
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 /scalajslib
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 'scalajslib')
-rw-r--r--scalajslib/src/mill/scalajslib/ScalaJSModule.scala24
1 files changed, 8 insertions, 16 deletions
diff --git a/scalajslib/src/mill/scalajslib/ScalaJSModule.scala b/scalajslib/src/mill/scalajslib/ScalaJSModule.scala
index 1596cdb6..1b99f142 100644
--- a/scalajslib/src/mill/scalajslib/ScalaJSModule.scala
+++ b/scalajslib/src/mill/scalajslib/ScalaJSModule.scala
@@ -7,7 +7,7 @@ import coursier.maven.MavenRepository
import mill.eval.{PathRef, Result}
import mill.eval.Result.Success
import mill.scalalib.Lib.resolveDependencies
-import mill.scalalib.{DepSyntax, Lib, TestModule}
+import mill.scalalib.{DepSyntax, Lib, TestModule, TestRunner}
import mill.util.{Ctx, Loose}
trait ScalaJSModule extends scalalib.ScalaModule { outer =>
@@ -27,20 +27,12 @@ trait ScalaJSModule extends scalalib.ScalaModule { outer =>
def sjsBridgeClasspath = T {
val jsBridgeKey = "MILL_SCALAJS_BRIDGE_" + scalaJSBridgeVersion().replace('.', '_')
- val jsBridgePath = sys.props(jsBridgeKey)
- if (jsBridgePath != null) Success(
- Agg(PathRef(Path(jsBridgePath), quick = true))
- ) else resolveDependencies(
- Seq(
- Cache.ivy2Local,
- MavenRepository("https://repo1.maven.org/maven2"),
- MavenRepository("https://oss.sonatype.org/content/repositories/releases")
- ),
- Lib.depToDependency(_, "2.12.4", ""),
- Seq(
- ivy"com.lihaoyi::mill-scalajslib-jsbridges-${scalaJSBridgeVersion()}:${sys.props("MILL_VERSION")}"
- )
- ).map(_.filter(_.path.toString.contains("mill-scalajslib-jsbridges")))
+ mill.modules.Util.millProjectModule(
+ jsBridgeKey,
+ s"mill-scalajslib-jsbridges-${scalaJSBridgeVersion()}",
+ repositories,
+ resolveFilter = _.toString.contains("mill-scalajslib-jsbridges")
+ )
}
def scalaJSLinkerClasspath: T[Loose.Agg[PathRef]] = T{
@@ -190,7 +182,7 @@ trait TestScalaJSModule extends ScalaJSModule with TestModule {
fastOptTest().path.toIO
)
- val (doneMsg, results) = Lib.runTests(
+ val (doneMsg, results) = TestRunner.runTests(
_ => Seq(framework),
runClasspath().map(_.path),
Agg(compile().classes.path),