use of com.google.devtools.common.options.Options in project bazel by bazelbuild.
the class AnalysisTestCase method useConfiguration.
/**
* Sets host and target configuration using the specified options, falling back to the default
* options for unspecified ones, and recreates the build view.
*/
protected final void useConfiguration(String... args) throws Exception {
optionsParser = OptionsParser.newOptionsParser(Iterables.concat(Arrays.asList(ExecutionOptions.class, PackageCacheOptions.class, BuildRequestOptions.class, BuildView.Options.class), ruleClassProvider.getConfigurationOptions()));
optionsParser.parse(new String[] { "--default_visibility=public" });
optionsParser.parse(args);
if (defaultFlags().contains(Flag.DYNAMIC_CONFIGURATIONS)) {
optionsParser.parse("--experimental_dynamic_configs=on");
} else if (defaultFlags().contains(Flag.DYNAMIC_CONFIGURATIONS_NOTRIM)) {
optionsParser.parse("--experimental_dynamic_configs=notrim");
}
InvocationPolicyEnforcer optionsPolicyEnforcer = analysisMock.getInvocationPolicyEnforcer();
optionsPolicyEnforcer.enforce(optionsParser);
}
Aggregations