use of com.google.devtools.build.lib.bazel.dash.DashProtos.BuildData in project bazel by bazelbuild.
the class DashModule method gotOptions.
@Subscribe
public void gotOptions(GotOptionsEvent event) {
BuildData.Builder builder = BuildData.newBuilder();
BuildData.CommandLine.Builder cmdLineBuilder = BuildData.CommandLine.newBuilder();
for (UnparsedOptionValueDescription option : event.getStartupOptions().asListOfUnparsedOptions()) {
cmdLineBuilder.addStartupOptions(getOption(option));
}
for (UnparsedOptionValueDescription option : event.getOptions().asListOfUnparsedOptions()) {
if (option.getName().equals("client_env")) {
String[] env = option.getUnparsedValue().split("=");
if (env.length == 1) {
builder.addClientEnv(EnvironmentVar.newBuilder().setName(env[0]).setValue("true").build());
} else if (env.length == 2) {
builder.addClientEnv(EnvironmentVar.newBuilder().setName(env[0]).setValue(env[1]).build());
}
} else {
cmdLineBuilder.addOptions(getOption(option));
}
}
for (String residue : event.getOptions().getResidue()) {
cmdLineBuilder.addResidue(residue);
}
builder.setCommandLine(cmdLineBuilder.build());
// This can be called before handleOptions, so the BuildData is stored until we know if it
// should be sent somewhere.
optionsBuildData = builder.build();
}
Aggregations