Search in sources :

Example 1 with Options

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);
}
Also used : BuildRequestOptions(com.google.devtools.build.lib.buildtool.BuildRequest.BuildRequestOptions) ExecutionOptions(com.google.devtools.build.lib.exec.ExecutionOptions) LoadingOptions(com.google.devtools.build.lib.pkgcache.LoadingOptions) BuildOptions(com.google.devtools.build.lib.analysis.config.BuildOptions) PackageCacheOptions(com.google.devtools.build.lib.pkgcache.PackageCacheOptions) Options(com.google.devtools.common.options.Options) ExecutionOptions(com.google.devtools.build.lib.exec.ExecutionOptions) BuildRequestOptions(com.google.devtools.build.lib.buildtool.BuildRequest.BuildRequestOptions) InvocationPolicyEnforcer(com.google.devtools.build.lib.flags.InvocationPolicyEnforcer) PackageCacheOptions(com.google.devtools.build.lib.pkgcache.PackageCacheOptions)

Aggregations

BuildOptions (com.google.devtools.build.lib.analysis.config.BuildOptions)1 BuildRequestOptions (com.google.devtools.build.lib.buildtool.BuildRequest.BuildRequestOptions)1 ExecutionOptions (com.google.devtools.build.lib.exec.ExecutionOptions)1 InvocationPolicyEnforcer (com.google.devtools.build.lib.flags.InvocationPolicyEnforcer)1 LoadingOptions (com.google.devtools.build.lib.pkgcache.LoadingOptions)1 PackageCacheOptions (com.google.devtools.build.lib.pkgcache.PackageCacheOptions)1 Options (com.google.devtools.common.options.Options)1