Skip to content

Commit

Permalink
Fix aapt2 with mobile-install v1
Browse files Browse the repository at this point in the history
    Previously, the resource apk was always built with aapt regardless of configuration. This threads the aapt version into the resource processing action builder.

    Fixes: bazelbuild/bazel#5799

    Ref: bazelbuild/bazel#6814

    RELNOTES: mobile-install now works with aapt2. Try it out with `bazel mobile-install --android_aapt=aapt2 //my:target`
    PiperOrigin-RevId: 224566567
  • Loading branch information
Luca Di Grazia committed Sep 4, 2022
1 parent b835f0a commit 0fa4cf2
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,7 @@ public static ProcessedAndroidData processLocalTestDataFrom(
AndroidResources resources,
AndroidAssets assets,
ResourceDependencies resourceDeps,
AssetDependencies assetDeps,
List<String> noCompressExtensions)
AssetDependencies assetDeps)
throws InterruptedException {

return builderForNonIncrementalTopLevelTarget(
Expand All @@ -194,7 +193,6 @@ public static ProcessedAndroidData processLocalTestDataFrom(
.setCrunchPng(false)
.withResourceDependencies(resourceDeps)
.withAssetDependencies(assetDeps)
.setUncompressedExtensions(noCompressExtensions)
.build(dataContext, resources, assets, manifest, dataBindingContext);
}

Expand Down Expand Up @@ -268,7 +266,7 @@ private static AndroidResourcesProcessorBuilder builderForTopLevelTarget(
.setApplicationId(manifestValues.get("applicationId"))
.setVersionCode(manifestValues.get("versionCode"))
.setVersionName(manifestValues.get("versionName"))
.setThrowOnResourceConflict(dataContext.throwOnResourceConflict())
.setThrowOnResourceConflict(dataContext.getAndroidConfig().throwOnResourceConflict())

// Output
.setProguardOut(
Expand Down

0 comments on commit 0fa4cf2

Please sign in to comment.