diff options
author | Rumou Duan <rduan@google.com> | 2015-06-03 20:27:57 +0000 |
---|---|---|
committer | Florian Weikert <fwe@google.com> | 2015-06-05 09:37:34 +0000 |
commit | 5b0b3106b5c8e251cb93d35ce00e10dfba1df9c2 (patch) | |
tree | de351bcae79f6b7d7f722ec3aab2faa61135d926 /src/test/java/com/google/devtools/build/lib | |
parent | ad993f7fbd219e8cdbb3b048ebcdac72d2c4eae5 (diff) |
Description redacted.
--
MOS_MIGRATED_REVID=95135804
Diffstat (limited to 'src/test/java/com/google/devtools/build/lib')
-rw-r--r-- | src/test/java/com/google/devtools/build/lib/analysis/util/BuildViewTestCase.java | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/analysis/util/BuildViewTestCase.java b/src/test/java/com/google/devtools/build/lib/analysis/util/BuildViewTestCase.java index 361e71d579..383037a341 100644 --- a/src/test/java/com/google/devtools/build/lib/analysis/util/BuildViewTestCase.java +++ b/src/test/java/com/google/devtools/build/lib/analysis/util/BuildViewTestCase.java @@ -868,6 +868,23 @@ public abstract class BuildViewTestCase extends FoundationTestCase { /** * Gets a derived Artifact for testing in the subdirectory of the {@link + * BuildConfiguration#getGenfilesDirectory()} corresponding to the package of {@code owner}, + * where the given artifact belongs to the given ConfiguredTarget together with the given Aspect. + * So to specify a file foo/foo.o owned by target //foo:foo with an apsect from FooAspect, + * {@code packageRelativePath} should just be "foo.o", and aspectOfOwner should be + * FooAspect.class. This method is necessary when an Apsect of the target, not the target itself, + * is creating an Artifact. + */ + protected Artifact getGenfilesArtifact(String packageRelativePath, ConfiguredTarget owner, + Class<? extends ConfiguredAspectFactory> creatingAspectFactory) { + return getPackageRelativeDerivedArtifact(packageRelativePath, + owner.getConfiguration().getGenfilesDirectory(), + (AspectValue.AspectKey) AspectValue.key( + owner.getLabel(), owner.getConfiguration(), creatingAspectFactory).argument()); + } + + /** + * Gets a derived Artifact for testing in the subdirectory of the {@link * BuildConfiguration#getGenfilesDirectory()} corresponding to the package of {@code owner}. * So to specify a file foo/foo.o owned by target //foo:foo, {@code packageRelativePath} should * just be "foo.o". |