Add enum for Java-related env var names

This commit is contained in:
Michael B. Gale
2026-02-17 11:37:25 +00:00
parent ebce69a4b7
commit bff89dcba4
3 changed files with 11 additions and 6 deletions
+4 -4
View File
@@ -52,7 +52,7 @@ import {
initConfig,
runDatabaseInitCluster,
} from "./init";
import { KnownLanguage } from "./languages";
import { JavaEnvVars, KnownLanguage } from "./languages";
import { getActionsLogger, Logger } from "./logging";
import {
downloadOverlayBaseDatabaseFromCache,
@@ -756,13 +756,13 @@ async function run(startedAt: Date) {
// Enable Java network debugging if the FF is enabled.
if (await features.getValue(Feature.JavaNetworkDebugging)) {
// Get the existing value of `JAVA_OPTS`, if any.
// Get the existing value of `JAVA_TOOL_OPTIONS`, if any.
const existingJavaToolOptions =
getOptionalEnvVar("JAVA_TOOL_OPTIONS") || "";
getOptionalEnvVar(JavaEnvVars.JAVA_TOOL_OPTIONS) || "";
// Add the network debugging options.
core.exportVariable(
"JAVA_TOOL_OPTIONS",
JavaEnvVars.JAVA_TOOL_OPTIONS,
`${existingJavaToolOptions} -Djavax.net.debug=all`,
);
}
+5
View File
@@ -19,3 +19,8 @@ export enum KnownLanguage {
rust = "rust",
swift = "swift",
}
/** Java-specific environment variable names that we may care about. */
export enum JavaEnvVars {
JAVA_TOOL_OPTIONS = "JAVA_TOOL_OPTIONS",
}