Output min_sdk_version to snapshot

The min_sdk_version was added to the java_import in Tiramisu. This
change will propagate the min_sdk_version set on a java_library to the
java_import snapshot. If possible the min_sdk_version will be resolved
into a numerical version to ensure consistent behavior across build
releases.

Bug: 260560424
Test: m nothing
      BUILD_NUMBER=fixed packages/modules/common/build/mainline_modules_sdks.sh
      # Ran above before and after this change and made sure that only
      # Tiramisu, UpsideDownCake and latest were changed and those changes
      # were the addition of a min_sdk_version property.
      #
      # Ran the following command in tm-mainline-prod:
      #     lunch cf_x86_64_phone-userdebug
      #     m ART_MODULE_BUILD_FROM_SOURCE=false nothing`.
      #
      # It failed with:
      #     module "prebuilt_okhttp-norepackage" variant "android_common": should support min_sdk_version(33) for "AdServicesApk": min_sdk_version is not specified.
      #
      # Unpacked the Tiramisu art snapshot generated with this change into
      # tm-mainline-prod and reran the previous command and it succeeded.
Change-Id: I9d9d730845554fc175d17f38c038e4e3c7d39e07
This commit is contained in:
Paul Duffin
2022-11-26 13:36:38 +00:00
parent 9fd9129b57
commit bb638eba50
4 changed files with 85 additions and 0 deletions

View File

@@ -358,6 +358,7 @@ java_import {
visibility: ["//visibility:public"],
apex_available: ["myapex"],
jars: ["java_boot_libs/snapshot/jars/are/invalid/mybootlib.jar"],
min_sdk_version: "2",
permitted_packages: ["mybootlib"],
}
@@ -877,6 +878,7 @@ java_import {
visibility: ["//visibility:public"],
apex_available: ["myapex"],
jars: ["java_boot_libs/snapshot/jars/are/invalid/mybootlib.jar"],
min_sdk_version: "1",
permitted_packages: ["mybootlib"],
}