diff options
author | 2016-09-23 16:36:26 +0000 | |
---|---|---|
committer | 2016-09-26 07:46:39 +0000 | |
commit | b4ac0713bfbe0aaf323a04f411fbd574879e07bd (patch) | |
tree | 19c6690e9711bd2e070eb0d99d60a72e3806a4a7 /src/main | |
parent | 78b9cab45de2a32158cd4306cd40208045cf6f85 (diff) |
Add manifest merger output log.
RELNOTES: When using android_binary.manifest_merger="android" the merger produces a summary log next to the merged manifest artifact.
--
MOS_MIGRATED_REVID=134082985
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/android/ApplicationManifest.java | 4 | ||||
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/android/ManifestMergerActionBuilder.java | 11 |
2 files changed, 15 insertions, 0 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/android/ApplicationManifest.java b/src/main/java/com/google/devtools/build/lib/rules/android/ApplicationManifest.java index 8db19e0ff2..9329e4aaec 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/android/ApplicationManifest.java +++ b/src/main/java/com/google/devtools/build/lib/rules/android/ApplicationManifest.java @@ -231,6 +231,9 @@ public final class ApplicationManifest { Artifact outputManifest = ruleContext.getUniqueDirectoryArtifact( ruleContext.getRule().getName() + "_merged", "AndroidManifest.xml", ruleContext.getBinOrGenfilesDirectory()); + Artifact mergeLog = ruleContext.getUniqueDirectoryArtifact( + ruleContext.getRule().getName() + "_merged", "manifest_merger_log.txt", + ruleContext.getBinOrGenfilesDirectory()); new ManifestMergerActionBuilder(ruleContext) .setManifest(getManifest()) .setMergeeManifests(mergeeManifests) @@ -238,6 +241,7 @@ public final class ApplicationManifest { .setManifestValues(manifestValues) .setCustomPackage(AndroidCommon.getJavaPackage(ruleContext)) .setManifestOutput(outputManifest) + .setLogOut(mergeLog) .build(ruleContext); return new ApplicationManifest(ruleContext, outputManifest); } diff --git a/src/main/java/com/google/devtools/build/lib/rules/android/ManifestMergerActionBuilder.java b/src/main/java/com/google/devtools/build/lib/rules/android/ManifestMergerActionBuilder.java index 4d480579df..ab1dd8d95b 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/android/ManifestMergerActionBuilder.java +++ b/src/main/java/com/google/devtools/build/lib/rules/android/ManifestMergerActionBuilder.java @@ -43,6 +43,7 @@ public class ManifestMergerActionBuilder { private Map<String, String> manifestValues; private String customPackage; private Artifact manifestOutput; + private Artifact logOut; public ManifestMergerActionBuilder(RuleContext ruleContext) { this.ruleContext = ruleContext; @@ -79,6 +80,11 @@ public class ManifestMergerActionBuilder { return this; } + public ManifestMergerActionBuilder setLogOut(Artifact logOut) { + this.logOut = logOut; + return this; + } + public void build(ActionConstructionContext context) { NestedSetBuilder<Artifact> inputs = NestedSetBuilder.naiveLinkOrder(); ImmutableList.Builder<Artifact> outputs = ImmutableList.builder(); @@ -118,6 +124,11 @@ public class ManifestMergerActionBuilder { builder.addExecPath("--manifestOutput", manifestOutput); outputs.add(manifestOutput); + if (logOut != null) { + builder.addExecPath("--log", logOut); + outputs.add(logOut); + } + ruleContext.registerAction( this.spawnActionBuilder .addTransitiveInputs(inputs.build()) |