diff options
author | 2015-10-06 11:16:31 +0000 | |
---|---|---|
committer | 2015-10-06 11:41:00 +0000 | |
commit | beccb9bfee87fb4869b5c00abd9400ebaf647bf0 (patch) | |
tree | ee8bfb4adb21ef6076044f7b6e1e11795c5bb111 /src/main/java/com/google/devtools/build/lib/rules/android | |
parent | fb8ee791d3b39f294bf4e083b972aee2ac6f8e27 (diff) |
Implement the prefix stripping for Java resources.
This CL sure works, but it leaves a few call sites for JavaSemantics#getJavaResourcePath() which make me uncomfortable.
RELNOTES: Java rules now support a resource_strip_prefix attribute that allows the removal of path prefixes from Java resources.
--
MOS_MIGRATED_REVID=104748537
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/android')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/android/AndroidCommon.java | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidCommon.java b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidCommon.java index 598d121146..59f7ac7770 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/android/AndroidCommon.java +++ b/src/main/java/com/google/devtools/build/lib/rules/android/AndroidCommon.java @@ -19,7 +19,6 @@ import static com.google.devtools.build.lib.analysis.config.BuildConfiguration.S import com.google.common.base.Optional; import com.google.common.collect.ImmutableList; -import com.google.common.collect.ImmutableMap; import com.google.devtools.build.lib.actions.Artifact; import com.google.devtools.build.lib.actions.ResourceSet; import com.google.devtools.build.lib.analysis.AnalysisUtils; @@ -67,9 +66,7 @@ import com.google.devtools.build.lib.vfs.PathFragment; import java.util.ArrayList; import java.util.Collection; -import java.util.LinkedHashMap; import java.util.List; -import java.util.Map; import javax.annotation.Nullable; @@ -471,10 +468,6 @@ public class AndroidCommon { JackCompilationHelper initJack(JavaTargetAttributes attributes, JavaSemantics javaSemantics) throws InterruptedException { - Map<PathFragment, Artifact> resourcesMap = new LinkedHashMap<>(); - for (Artifact resource : attributes.getResources()) { - resourcesMap.put(javaSemantics.getJavaResourcePath(resource.getRootRelativePath()), resource); - } AndroidSdkProvider sdk = AndroidSdkProvider.fromRuleContext(ruleContext); return new JackCompilationHelper.Builder() // blaze infrastructure @@ -488,7 +481,7 @@ public class AndroidCommon { .addJavaSources(attributes.getSourceFiles()) .addSourceJars(attributes.getSourceJars()) .addCompiledJars(attributes.getJarFiles()) - .addResources(ImmutableMap.copyOf(resourcesMap)) + .addResources(attributes.getResources()) .addProcessorNames(attributes.getProcessorNames()) .addProcessorClasspathJars(attributes.getProcessorPath()) .addExports(JavaCommon.getExports(ruleContext)) |