summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
Diffstat (limited to 'main')
-rw-r--r--main/src/mill/Main.scala53
-rw-r--r--main/src/mill/modules/Jvm.scala4
2 files changed, 2 insertions, 55 deletions
diff --git a/main/src/mill/Main.scala b/main/src/mill/Main.scala
index 4a2ccba0..6c10f6f2 100644
--- a/main/src/mill/Main.scala
+++ b/main/src/mill/Main.scala
@@ -5,63 +5,10 @@ import java.io.{InputStream, PrintStream}
import ammonite.main.Cli._
import ammonite.ops._
import ammonite.util.Util
-import mill.clientserver.{Client, FileLocks}
import mill.eval.Evaluator
import mill.util.DummyInputStream
-object ClientMain {
- def initServer(lockBase: String) = {
- val selfJars = new java.lang.StringBuilder
- var current = getClass.getClassLoader
- while(current != null){
- getClass.getClassLoader match{
- case e: java.net.URLClassLoader =>
- val urls = e.getURLs
- var i = 0
- while(i < urls.length){
- if (selfJars.length() != 0) selfJars.append(':')
- selfJars.append(urls(i))
- i += 1
- }
- case _ =>
- }
- current = current.getParent
- }
-
- val l = new java.util.ArrayList[String]
- l.add("java")
- val props = System.getProperties
- val keys = props.stringPropertyNames().iterator()
- while(keys.hasNext){
- val k = keys.next()
- if (k.startsWith("MILL_")) l.add("-D" + k + "=" + props.getProperty(k))
- }
- l.add("-cp")
- l.add(selfJars.toString)
- l.add("mill.ServerMain")
- l.add(lockBase)
- new java.lang.ProcessBuilder()
- .command(l)
- .redirectOutput(new java.io.File(lockBase + "/logs"))
- .redirectError(new java.io.File(lockBase + "/logs"))
- .start()
- }
- def main(args: Array[String]): Unit = {
- val exitCode = Client.WithLock(1) { lockBase =>
- val c = new Client(
- lockBase,
- () => initServer(lockBase),
- new FileLocks(lockBase),
- System.in,
- System.out,
- System.err
- )
- c.run(args)
- }
- System.exit(exitCode)
- }
-}
object ServerMain extends mill.clientserver.ServerMain[Evaluator.State]{
def main0(args: Array[String],
stateCache: Option[Evaluator.State],
diff --git a/main/src/mill/modules/Jvm.scala b/main/src/mill/modules/Jvm.scala
index 5e297072..57e02dd4 100644
--- a/main/src/mill/modules/Jvm.scala
+++ b/main/src/mill/modules/Jvm.scala
@@ -7,7 +7,7 @@ import java.nio.file.attribute.PosixFilePermission
import java.util.jar.{JarEntry, JarFile, JarOutputStream}
import ammonite.ops._
-import mill.clientserver.{ClientInputPumper, ClientServer}
+import mill.clientserver.{ClientServer, InputPumper}
import mill.define.Task
import mill.eval.PathRef
import mill.util.{Ctx, Loose}
@@ -62,7 +62,7 @@ object Jvm {
)
for((std, dest) <- sources){
- new Thread(new ClientInputPumper(std, dest)).start()
+ new Thread(new InputPumper(std, dest, false)).start()
}
process
}else{