diff options
author | 2018-03-20 07:25:33 -0700 | |
---|---|---|
committer | 2018-03-20 07:26:45 -0700 | |
commit | 0acc6a7a989949635524424d0c88d7dbf32f38f8 (patch) | |
tree | 37af844ef8ca55c045602aa2e7183e35cce4be18 /src/tools/android/java/com/google/devtools/build/android/AndroidResourceMergingAction.java | |
parent | 191add5b0e32c39faca09c25e6da6683a79dd8f7 (diff) |
Have the Android R class generators add the target label to the class jar.
This re-enables support for add_deps.
RELNOTES: None
PiperOrigin-RevId: 189737607
Diffstat (limited to 'src/tools/android/java/com/google/devtools/build/android/AndroidResourceMergingAction.java')
-rw-r--r-- | src/tools/android/java/com/google/devtools/build/android/AndroidResourceMergingAction.java | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/src/tools/android/java/com/google/devtools/build/android/AndroidResourceMergingAction.java b/src/tools/android/java/com/google/devtools/build/android/AndroidResourceMergingAction.java index c67806088f..cbd53a512e 100644 --- a/src/tools/android/java/com/google/devtools/build/android/AndroidResourceMergingAction.java +++ b/src/tools/android/java/com/google/devtools/build/android/AndroidResourceMergingAction.java @@ -193,6 +193,26 @@ public class AndroidResourceMergingAction { help = "If passed, resource merge conflicts will be treated as errors instead of warnings" ) public boolean throwOnResourceConflict; + + @Option( + name = "targetLabel", + defaultValue = "null", + category = "input", + documentationCategory = OptionDocumentationCategory.UNCATEGORIZED, + effectTags = {OptionEffectTag.UNKNOWN}, + help = "A label to add to the output jar's manifest as 'Target-Label'" + ) + public String targetLabel; + + @Option( + name = "injectingRuleKind", + defaultValue = "null", + category = "input", + documentationCategory = OptionDocumentationCategory.UNCATEGORIZED, + effectTags = {OptionEffectTag.UNKNOWN}, + help = "A string to add to the output jar's manifest as 'Injecting-Rule-Kind'" + ) + public String injectingRuleKind; } public static void main(String[] args) throws Exception { @@ -267,7 +287,11 @@ public class AndroidResourceMergingAction { } if (options.classJarOutput != null) { - AndroidResourceOutputs.createClassJar(generatedSources, options.classJarOutput); + AndroidResourceOutputs.createClassJar( + generatedSources, + options.classJarOutput, + options.targetLabel, + options.injectingRuleKind); logger.fine( String.format( "Create classJar finished at %sms", timer.elapsed(TimeUnit.MILLISECONDS))); |