-
-
Notifications
You must be signed in to change notification settings - Fork 347
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Consolidate and document Mill environment variables (#3378)
Also got rid of `MILL_TEST_DEST_FOLDER` since #3347 makes `os.pwd` sufficient. There are also a few other `MILL_*` things that look like env vars but are actually system properties, so I left them out of this PR
- Loading branch information
Showing
11 changed files
with
64 additions
and
20 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,4 +49,4 @@ public void simple() throws IOException { | |
); | ||
assertEquals("Other Hello World File", otherFileText); | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -1,6 +1,7 @@ | ||
package mill.api | ||
|
||
import os.Path | ||
import mill.main.client.EnvVars | ||
object WorkspaceRoot { | ||
val workspaceRoot: Path = sys.env.get("MILL_WORKSPACE_ROOT").fold(os.pwd)(os.Path(_, os.pwd)) | ||
val workspaceRoot: os.Path = | ||
sys.env.get(EnvVars.MILL_WORKSPACE_ROOT).fold(os.pwd)(os.Path(_, os.pwd)) | ||
} |
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,43 @@ | ||
package mill.main.client; | ||
|
||
/** | ||
* Central place containing all the environment variables that Mill uses | ||
*/ | ||
public class EnvVars { | ||
// USER FACING ENVIRONMENT VARIABLES | ||
|
||
/** | ||
* Available in test modules for users to find the test resource folder on disk | ||
* in a convenient fashion. If multiple resource folders are provided on the classpath, | ||
* they are provided as a comma-separated list | ||
*/ | ||
public static final String MILL_TEST_RESOURCE_FOLDER = "MILL_TEST_RESOURCE_FOLDER"; | ||
|
||
/** | ||
* How long the Mill background server should run before timing out from inactivity | ||
*/ | ||
public static final String MILL_SERVER_TIMEOUT_MILLIS = "MILL_SERVER_TIMEOUT_MILLIS"; | ||
|
||
|
||
public static final String MILL_JVM_OPTS_PATH = "MILL_JVM_OPTS_PATH"; | ||
|
||
// INTERNAL ENVIRONMENT VARIABLES | ||
/** | ||
* Used to pass the Mill workspace root from the client to the server, so | ||
* the server code can access it despite it not being os.pwd | ||
*/ | ||
public static final String MILL_WORKSPACE_ROOT = "MILL_WORKSPACE_ROOT"; | ||
|
||
/** | ||
* Used to indicate to Mill that it is running as part of the Mill test suite, | ||
* e.g. to turn on additional testing/debug/log-related code | ||
*/ | ||
public static final String MILL_TEST_SUITE = "MILL_TEST_SUITE"; | ||
|
||
/** | ||
* Used to indicate to the Mill test suite which libraries should be resolved from | ||
* the local disk and not from Maven Central | ||
*/ | ||
public static final String MILL_BUILD_LIBRARIES = "MILL_BUILD_LIBRARIES"; | ||
|
||
} |
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
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