-
-
Notifications
You must be signed in to change notification settings - Fork 358
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move inline file paths to static helper methods so we can describe th…
…em and document them (#3361) This makes the documentation somewhat discoverable: both grepping the codebase would pull it up, as would jump-to-definition from any of the use sites in the code (which is why this is better than having it in some readme file or docsite page). We could also link to it from the docs to make it more discoverable. Pull request: #3361
- Loading branch information
Showing
8 changed files
with
137 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package mill.main.client; | ||
|
||
/** | ||
* Central place containing all the files that live inside the `out/` folder | ||
* and documentation about what they do | ||
*/ | ||
public class OutFiles { | ||
/** | ||
* Path of the Mill "meta-build", used to compile the `build.sc` file so we can | ||
* run the primary Mill build. Can be nested for multiple stages of bootstrapping | ||
*/ | ||
public static String millBuild(){ | ||
return "mill-build"; | ||
} | ||
|
||
/** | ||
* A parallel performance and timing profile generated for every Mill execution. | ||
* Can be loaded into the Chrome browser chrome://tracing page to visualize where | ||
* time in a build is being spent | ||
*/ | ||
public static String millChromeProfile(){ | ||
return "mill-chrome-profile.json"; | ||
} | ||
|
||
/** | ||
* A sequential profile containing rich information about the tasks that were run | ||
* as part of a build: name, duration, cached, dependencies, etc.. Useful to help | ||
* understand what tasks are taking time in a build run and why those tasks are | ||
* being executed | ||
*/ | ||
public static String millProfile(){ | ||
return "mill-profile.json"; | ||
} | ||
|
||
/** | ||
* Long lived metadata about the Mill bootstrap process that persists between runs: | ||
* workers, watched files, classpaths, etc. | ||
*/ | ||
public static String millRunnerState(){ | ||
return "mill-runner-state.json"; | ||
} | ||
|
||
/** | ||
* Subfolder of `out/` that contains the machinery necessary for a single Mill background | ||
* server: metadata files, pipes, logs, etc. | ||
*/ | ||
public static String millWorker(){ | ||
return "mill-worker-"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
package mill.main.client; | ||
|
||
/** | ||
* Central place containing all the files that live inside the `out/mill-worker-*` folder | ||
* and documentation about what they do | ||
*/ | ||
public class ServerFiles { | ||
|
||
/** | ||
* Lock file used to ensure a single server is running in a particular | ||
* mill-worker folder. | ||
*/ | ||
public static String processLock(String base){ | ||
return base + "/processLock"; | ||
} | ||
|
||
public static String clientLock(String base){ | ||
return base + "/clientLock"; | ||
} | ||
|
||
public static String serverLock(String base){ | ||
return base + "/serverLock"; | ||
} | ||
|
||
|
||
/** | ||
* The pipe by which the client snd server exchange IO | ||
* | ||
* Use uniquely-named pipes based on the fully qualified path of the project folder | ||
* because on Windows the un-qualified name of the pipe must be globally unique | ||
* across the whole filesystem | ||
*/ | ||
public static String pipe(String base) { | ||
try { | ||
return base + "/mill-" + Util.md5hex(new java.io.File(base).getCanonicalPath()) + "-io"; | ||
}catch (Exception e){ | ||
throw new RuntimeException(e); | ||
} | ||
} | ||
|
||
/** | ||
* Log file containing server housekeeping information | ||
*/ | ||
public static String serverLog(String base){ | ||
return base + "/server.log"; | ||
} | ||
|
||
/** | ||
* File that the client writes to pass the arguments, environment variables, | ||
* and other necessary metadata to the Mill server to kick off a run | ||
*/ | ||
public static String runArgs(String base){ | ||
return base + "/runArgs"; | ||
} | ||
|
||
/** | ||
* File the server writes to pass the exit code of a completed run back to the | ||
* client | ||
*/ | ||
public static String exitCode(String base){ | ||
return base + "/exitCode"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters