Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up Mill Server code #3370

Merged
merged 34 commits into from
Aug 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -762,6 +762,9 @@ object main extends MillStableScalaModule with BuildInfo {
}
}

object server extends MillPublishScalaModule {
def moduleDeps = Seq(client, api)
}
object graphviz extends MillPublishScalaModule {
def moduleDeps = Seq(main, scalalib)
def ivyDeps = Agg(Deps.graphvizJava, Deps.jgraphtCore)
Expand Down Expand Up @@ -1434,7 +1437,7 @@ def launcherScript(
cmdClassPath: Agg[String]
) = {

val millMainClass = "mill.main.client.MillClientMain"
val millMainClass = "mill.runner.client.MillClientMain"

Jvm.universalScript(
shellCommands = {
Expand Down Expand Up @@ -1545,7 +1548,14 @@ def launcherScript(
}

object runner extends MillPublishScalaModule {
def moduleDeps = Seq(scalalib, scalajslib, scalanativelib, bsp, linenumbers, main.codesig)
object client extends MillPublishJavaModule{
def buildInfoPackageName = "mill.runner.client"
def moduleDeps = Seq(main.client)
}

def moduleDeps = Seq(
scalalib, scalajslib, scalanativelib, bsp, linenumbers, main.codesig, main.server, client
)
def skipPreviousVersions: T[Seq[String]] = Seq("0.11.0-M7")

object linenumbers extends MillPublishScalaModule {
Expand Down
1 change: 1 addition & 0 deletions main/client/src/mill/main/client/FileToStreamTailer.java
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ public void flush() {

@Override
public void close() throws Exception {
flush();
interrupt();
}
}
7 changes: 6 additions & 1 deletion main/client/src/mill/main/client/InputPumper.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,12 @@ public void run() {
}
else if (checkAvailable && src.available() == 0) Thread.sleep(2);
else {
int n = src.read(buffer);
int n;
try{
n = src.read(buffer);
} catch (Exception e){
n = -1;
}
if (n == -1) {
running = false;
}
Expand Down

This file was deleted.

174 changes: 0 additions & 174 deletions main/client/src/mill/main/client/MillServerLauncher.java

This file was deleted.

7 changes: 7 additions & 0 deletions main/client/src/mill/main/client/ServerCouldNotBeStarted.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package mill.main.client;

public class ServerCouldNotBeStarted extends Exception {
public ServerCouldNotBeStarted(String msg) {
super(msg);
}
}
3 changes: 2 additions & 1 deletion main/client/src/mill/main/client/ServerFiles.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* and documentation about what they do
*/
public class ServerFiles {
final public static String serverId = "serverId";
final public static String sandbox = "sandbox";

/**
Expand All @@ -30,7 +31,7 @@ public class ServerFiles {
*/
public static String pipe(String base) {
try {
return base + "/mill-" + Util.md5hex(new java.io.File(base).getCanonicalPath()) + "-io";
return base + "/mill-" + Util.md5hex(new java.io.File(base).getCanonicalPath()).substring(0, 8) + "-io";
}catch (Exception e){
throw new RuntimeException(e);
}
Expand Down
Loading
Loading