diff --git a/src/main/java/com/google/devtools/build/lib/runtime/CommandLineEvent.java b/src/main/java/com/google/devtools/build/lib/runtime/CommandLineEvent.java index 97a6e924e758ed..bd1fbb8326bfca 100644 --- a/src/main/java/com/google/devtools/build/lib/runtime/CommandLineEvent.java +++ b/src/main/java/com/google/devtools/build/lib/runtime/CommandLineEvent.java @@ -145,6 +145,17 @@ private Option createOption( return option.build(); } + Option createStarlarkOption(String starlarkFlag, @Nullable Object value) { + String combinedForm = String.format("--%s=%s", starlarkFlag, value); + Option.Builder option = Option.newBuilder(); + option.setCombinedForm(combinedForm); + option.setOptionName(starlarkFlag); + if (value != null) { + option.setOptionValue(String.valueOf(value)); + } + return option.build(); + } + /** * Returns the startup option section of the command line for the startup options as the server * received them at its startup. Since not all client options get passed to the server as @@ -251,11 +262,16 @@ private CommandLineSection getExplicitCommandOptions() { parsedOptionDescription.getPriority().getPriorityCategory() == OptionPriority.PriorityCategory.COMMAND_LINE) .collect(Collectors.toList()); + List