aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/rules/android/AndroidIdeInfoProvider.java
diff options
context:
space:
mode:
authorGravatar Lukacs Berki <lberki@google.com>2015-12-07 11:59:33 +0000
committerGravatar David Chen <dzc@google.com>2015-12-07 21:18:46 +0000
commite605a1e03ef943c863a70a1ab86d67b2b73ddfe8 (patch)
treea791d4df2c74d668c4ad566b49ff6a27525ef31f /src/main/java/com/google/devtools/build/lib/rules/android/AndroidIdeInfoProvider.java
parented7b97e8f09722b960b45626a4b72937b9b77672 (diff)
Remove the unchecked exceptions RuleConfigurationException, InvalidAssetPath and InvalidResourcePath.
Mainly to make the error handling in the Android code more similar to the rest of the code. There are a few more if statements, but I think the fact that AndroidIdeInfoProvider#addResourceSource didn't catch this unchecked exception vindicates this decision. DIFFBASE=108487079 -- MOS_MIGRATED_REVID=109566747
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/android/AndroidIdeInfoProvider.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/android/AndroidIdeInfoProvider.java5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidIdeInfoProvider.java b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidIdeInfoProvider.java
index 4f576d972c..acc4452f91 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidIdeInfoProvider.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidIdeInfoProvider.java
@@ -197,12 +197,11 @@ public final class AndroidIdeInfoProvider implements TransitiveInfoProvider {
}
public Builder addResourceSource(Artifact resource) {
+ PathFragment resourceDir = LocalResourceContainer.Builder.findResourceDir(resource);
resourceDirs.add(
new SourceDirectory(
resource.getRoot().getPath().asFragment(),
- trimTo(
- resource.getRootRelativePath(),
- LocalResourceContainer.Builder.findResourceDir(resource)),
+ trimTo(resource.getRootRelativePath(), resourceDir),
resource.isSourceArtifact()));
return this;
}