use of com.google.devtools.build.lib.actions.ArtifactOwner in project bazel by bazelbuild.
the class BuildViewTestCase method getImplicitOutputArtifact.
protected Artifact getImplicitOutputArtifact(ConfiguredTarget target, SafeImplicitOutputsFunction outputFunction) {
Rule associatedRule = target.getTarget().getAssociatedRule();
RepositoryName repository = associatedRule.getRepository();
BuildConfiguration configuration = target.getConfiguration();
Root root;
if (associatedRule.hasBinaryOutput()) {
root = configuration.getBinDirectory(repository);
} else {
root = configuration.getGenfilesDirectory(repository);
}
ArtifactOwner owner = new ConfiguredTargetKey(target.getTarget().getLabel(), target.getConfiguration());
RawAttributeMapper attr = RawAttributeMapper.of(associatedRule);
String path = Iterables.getOnlyElement(outputFunction.getImplicitOutputs(attr));
return view.getArtifactFactory().getDerivedArtifact(target.getTarget().getLabel().getPackageFragment().getRelative(path), root, owner);
}
Aggregations