summaryrefslogtreecommitdiff
path: root/scalalib/worker/src
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 /scalalib/worker/src
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 'scalalib/worker/src')
-rw-r--r--scalalib/worker/src/mill/scalalib/worker/ScalaWorker.scala53
1 files changed, 0 insertions, 53 deletions
diff --git a/scalalib/worker/src/mill/scalalib/worker/ScalaWorker.scala b/scalalib/worker/src/mill/scalalib/worker/ScalaWorker.scala
index cebef9b7..9b14757c 100644
--- a/scalalib/worker/src/mill/scalalib/worker/ScalaWorker.scala
+++ b/scalalib/worker/src/mill/scalalib/worker/ScalaWorker.scala
@@ -23,59 +23,6 @@ case class MockedLookup(am: File => Optional[CompileAnalysis]) extends PerClassp
Locate.definesClass(classpathEntry)
}
-object ScalaWorker{
-
- def main(args: Array[String]): Unit = {
- try{
- var i = 0
- def readArray() = {
- val count = args(i).toInt
- val slice = args.slice(i + 1, i + count + 1)
- i = i + count + 1
- slice
- }
- val frameworks = readArray()
- val classpath = readArray()
- val arguments = readArray()
- val outputPath = args(i + 0)
- val colored = args(i + 1)
- val testCp = args(i + 2)
- val homeStr = args(i + 3)
- val ctx = new Ctx.Log with Ctx.Home {
- val log = PrintLogger(
- colored == "true",
- if(colored == "true") Colors.Default
- else Colors.BlackWhite,
- System.out,
- System.err,
- System.err,
- System.in
- )
- val home = Path(homeStr)
- }
- val result = Lib.runTests(
- frameworkInstances = TestRunner.frameworks(frameworks),
- entireClasspath = Agg.from(classpath.map(Path(_))),
- testClassfilePath = Agg(Path(testCp)),
- args = arguments
- )(ctx)
-
- // Clear interrupted state in case some badly-behaved test suite
- // dirtied the thread-interrupted flag and forgot to clean up. Otherwise
- // that flag causes writing the results to disk to fail
- Thread.interrupted()
- ammonite.ops.write(Path(outputPath), upickle.default.write(result))
- }catch{case e: Throwable =>
- println(e)
- e.printStackTrace()
- }
- // Tests are over, kill the JVM whether or not anyone's threads are still running
- // Always return 0, even if tests fail. The caller can pick up the detailed test
- // results from the outputPath
- System.exit(0)
- }
-}
-
class ScalaWorker(ctx0: mill.util.Ctx,
compilerBridgeClasspath: Array[String]) extends mill.scalalib.ScalaWorkerApi{
@volatile var scalaClassloaderCache = Option.empty[(Long, ClassLoader)]