Skip to content

Commit cab913f

Browse files
A Googlercopybara-github
authored andcommitted
Use the minimum SDK from manifest_values when bumping the sdk of a provided
manifest PiperOrigin-RevId: 793618880 Change-Id: Ie1d9d3f42f40135e826ce403661b0fd114abe460
1 parent 0e70238 commit cab913f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

rules/android_local_test/impl.bzl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,21 +67,23 @@ def _process_manifest(ctx, java_package, **_unused_sub_ctxs):
6767
ctx,
6868
ctx.attr.manifest_values,
6969
)
70+
min_sdk = int(manifest_values.get("minSdkVersion", min_sdk_version.DEPOT_FLOOR))
7071
if ctx.file.manifest == None:
7172
# No manifest provided, generate one
7273
manifest = ctx.actions.declare_file("_generated/" + ctx.label.name + "/AndroidManifest.xml")
7374
resources.generate_dummy_manifest(
7475
ctx,
7576
out_manifest = manifest,
7677
java_package = java_package,
77-
min_sdk_version = int(manifest_values.get("minSdkVersion", min_sdk_version.DEPOT_FLOOR)),
78+
min_sdk_version = min_sdk,
7879
)
7980
manifest_ctx = struct(processed_manifest = manifest, processed_manifest_values = manifest_values)
8081
else:
8182
manifest_ctx = resources.bump_min_sdk(
8283
ctx,
8384
manifest = ctx.file.manifest,
8485
manifest_values = ctx.attr.manifest_values,
86+
floor = min_sdk,
8587
)
8688

8789
return ProviderInfo(

0 commit comments

Comments
 (0)