Skip to content

Commit

Permalink
Only replace shrunk resource apk and optimized resource apk with non-…
Browse files Browse the repository at this point in the history
…null artifacts provided by AndroidOptimizationInfo from Starlark.

PiperOrigin-RevId: 567004129
Change-Id: I977c9443d08297f365ada2fba870ca2cc5809928
  • Loading branch information
Zhaoqing Xu authored and copybara-github committed Sep 20, 2023
1 parent 0e58b0d commit 7f60def
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,11 @@ public static RuleConfiguredTargetBuilder createAndroidBinary(
optimizationInfo.getConfig(),
optimizationInfo.getRewrittenStartupProfile(),
optimizationInfo.getRewrittenMergedBaselineProfile());
resourceApk = resourceApk.withApk(optimizationInfo.getOptimizedResourceApk());
if (optimizationInfo.getOptimizedResourceApk() != null) {
resourceApk = resourceApk.withApk(optimizationInfo.getOptimizedResourceApk());
} else if (optimizationInfo.getShrunkResourceApk() != null) {
resourceApk = resourceApk.withApk(optimizationInfo.getShrunkResourceApk());
}
symlinkOptimizationOutputs(
ruleContext,
androidSemantics,
Expand Down

0 comments on commit 7f60def

Please sign in to comment.