diff options
author | 2015-09-24 08:19:30 +0000 | |
---|---|---|
committer | 2015-09-24 14:21:53 +0000 | |
commit | d6f6b7dac79d122ba81d7e2b0f53feac7b225f1d (patch) | |
tree | 5c0b422fac65faa0643404fea5c08b2a45ac9dbf /src/test | |
parent | 574646c670ddee337258718303dedde30e546fbe (diff) |
Add a main_dex_proguard_specs attribute to android_binary that lets users specify which classes should go into the main dex.
This mode uses Proguard to determine the dependencies of these classes, which means that no error-prone manual listing required like in multidex="manual" mode.
RELNOTES: android_binary now has a main_dex_proguard_specs attribute to specify which classes should be in the main dex.
--
MOS_MIGRATED_REVID=103824119
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/java/com/google/devtools/build/lib/analysis/util/BuildViewTestCase.java | 20 |
1 files changed, 16 insertions, 4 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 3d9b5d3509..ff22af1993 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 @@ -749,7 +749,7 @@ public abstract class BuildViewTestCase extends FoundationTestCase { String... lines) throws Exception { eventCollector.clear(); ConfiguredTarget target = scratchConfiguredTarget(packageName, ruleName, - lines); + lines); assertFalse( "Rule '" + "//" + packageName + ":" + ruleName + "' did contain an error", view.hasErrors(target)); @@ -1411,7 +1411,7 @@ public abstract class BuildViewTestCase extends FoundationTestCase { protected String getErrorMsgWrongAttributeValue(String value, String... expected) { return String.format("has to be one of %s instead of '%s'", - StringUtil.joinEnglishList(ImmutableSet.copyOf(expected), "or", "'"), value); + StringUtil.joinEnglishList(ImmutableSet.copyOf(expected), "or", "'"), value); } protected String getErrorMsgMandatoryProviderMissing(String offendingRule, String providerName) { @@ -1535,9 +1535,21 @@ public abstract class BuildViewTestCase extends FoundationTestCase { */ protected Artifact artifactByPath(Iterable<Artifact> artifacts, String... suffixes) { Artifact artifact = getFirstArtifactEndingWith(artifacts, suffixes[0]); - + Action action = null; for (int i = 1; i < suffixes.length; i++) { - artifacts = getGeneratingAction(artifact).getInputs(); + if (artifact == null) { + if (action == null) { + throw new IllegalStateException("No suffix " + suffixes[0] + " among artifacts: " + + ActionsTestUtil.baseArtifactNames(artifacts)); + } else { + throw new IllegalStateException("No suffix " + suffixes[i] + + " among inputs of action " + action.describe() + ": " + + ActionsTestUtil.baseArtifactNames(artifacts)); + } + } + + action = getGeneratingAction(artifact); + artifacts = action.getInputs(); artifact = getFirstArtifactEndingWith(artifacts, suffixes[i]); } |