use of com.google.devtools.build.lib.analysis.config.ConfigurationEnvironment in project bazel by bazelbuild.
the class ConfigurationFragmentFunction method compute.
@Override
public SkyValue compute(SkyKey skyKey, Environment env) throws InterruptedException, ConfigurationFragmentFunctionException {
ConfigurationFragmentKey configurationFragmentKey = (ConfigurationFragmentKey) skyKey.argument();
BuildOptions buildOptions = configurationFragmentKey.getBuildOptions();
ConfigurationFragmentFactory factory = getFactory(configurationFragmentKey.getFragmentType());
try {
PackageProviderForConfigurations packageProvider = new SkyframePackageLoaderWithValueEnvironment(env, ruleClassProvider);
ConfigurationEnvironment confEnv = new ConfigurationBuilderEnvironment(packageProvider);
Fragment fragment = factory.create(confEnv, buildOptions);
if (env.valuesMissing()) {
return null;
}
return new ConfigurationFragmentValue(fragment);
} catch (InvalidConfigurationException e) {
// exception with missing Skyframe dependencies.
if (env.valuesMissing()) {
return null;
}
throw new ConfigurationFragmentFunctionException(e);
}
}
Aggregations