Commit Graph

57044 Commits

Author SHA1 Message Date
Paul Duffin
f7cd863c87 java_sdk_library: Use dist_stem when generating sdk snapshot file names
The API finalization process for platform releases copies various files
from the apistubs/ dist directory into prebuilts/sdk/<n>/...  Having
them use the same name in both places makes that process simpler. For
most modules the name of the file is derived from the name of the
module by appending a suffix but unfortunately, for some modules that
does not work. e.g. the conscrypt.txt file is produced by the
conscrypt.module.public.api module. The dist_stem property was added to
java_sdk_library to allow the stem name of the file to differ from the
module name.

The API finalization process for extension APIs does something similar
as it extracts various files from the snapshots and copies them into
the appropriate extension API specific directory in
prebuilts/sdk/extensions/<n>. Instead of copying files from the
apistubs/ dist directory (which is not built for trains) it copies them
from sdk snapshots that are built as part of the train.

Previously, the sdk snapshot used to derive the name of the files
within the snapshot from the name of the module, it ignored the
dist_stem property. This change causes it to use the dist_stem property
to make it consistent with the apistubs/ dist directory naming.

The file name is created in
sdkLibrarySdkMemberProperties.AddPropertyToSet() which does not have
access to the dist_stem property. So, it has to be supplied in the
sdkLibrarySdkMemberProperties instance in the new Stem property.

Bug: 248258460
Test: m nothing
      BUILD_NUMBER=fixed packages/modules/common/build/mainline_modules_sdks.sh --build-release=latest
      # Ran the previous command before and after and make sure that the
      # conscrypt, art and icu sdk snapshots use the dist_stem value but
      # none of the other snapshots are affected.
Change-Id: Ied52003de63dcdb86a252a39bb8781f85d51a6ff
(cherry picked from commit e840995ac3)
Merged-In: Ied52003de63dcdb86a252a39bb8781f85d51a6ff
2022-09-27 09:06:53 +00:00
Paul Duffin
2f0fddc0d1 Add sdk:"keep" tag support
Fields tagged with `sdk:"keep"` will keep the value even if it would
normally be cleared because it was common across a number of structs.
This will allow a module type to specify the same value across all
structs populated directly from variants and have it be copied into all
common property structs without clearing it from the variant specific
structs.

Bug: 248258460
Test: m nothing
Change-Id: I147d946b11fd8766a7d875d9206e8f5034f585d6
(cherry picked from commit bfdca96828)
Merged-In: I147d946b11fd8766a7d875d9206e8f5034f585d6
2022-09-27 09:06:51 +00:00
Paul Duffin
45fc9b2140 Rename sdk field tag "keep" to "ignore"
"ignore" is a better description of the effect that this tag has on the
optimization that is done as part of the sdk snapshot generation.
"keep" implies that something special is done with the field during the
optimization process but actually the optimization process completely
ignores the property, just as it does with unexported fields.

Bug: 248258460
Test: m nothing
Change-Id: Idfdfd87f927d641d4d301cbbde72b463c89155bf
(cherry picked from commit 02e25c85eb)
Merged-In: Idfdfd87f927d641d4d301cbbde72b463c89155bf
2022-09-27 09:06:47 +00:00
Dennis Shen
96a6997b74 Merge "Cherrypick of aosp/2172270" into tm-mainline-prod 2022-09-23 17:40:17 +00:00
Dennis Shen
f3ec7e0a82 Cherrypick of aosp/2172270
BUG: 241096765
Change-Id: I4b3892508f54b9284c1cc70be83bffc9ee040d90
Merged-In: I2a5e7ea75a6e9a7af1932ff7dccb9dc3a3785db9
2022-09-22 16:25:46 +00:00
Paul Duffin
28e66cac86 Exclude unsupported libraries from sdk snapshot
(cherry picked from commit 1938dba8b6)

When an sdk snapshot is targeted at release X then it cannot include
bootclasspath fragment libraries which are not present in that build as
otherwise it causes build failures. It should also not include any
unsupported libraries, i.e. libraries that cannot work on that release.

This change causes sdk snapshot to exclude libraries that have a
    min_sdk_version > target build release

It also ensures that hidden API flags do not include any information
from excluded libraries.

Bug: 240406019
Test: BUILD_NUMBER=fixed packages/modules/common/build/mainline_modules_sdks.sh
      # Ran the previous command with and without this change to make
      # sure that this change excludes framework-connectivity-t library from the
      # tethering sdk snapshot for S, including from the hidden API flag files.
Merged-In: I57969b85a12e9e5a3fc76c055b260cec5d5f7d7f
Change-Id: Ie142db49aad8e82ada21c343a7563102e74566a2
2022-09-22 13:59:50 +01:00
Paul Duffin
311210cd65 Separate hidden API flag info for sdk from platform_bootclasspath
Previously, the sdk snapshot and platform_bootclasspath both used the
HiddenAPIInfo/Provider to retrieve the hidden API related information
they needed. This change separates them by adding a new
HiddenAPIInfoForSdk/Provider that is used to provide the information
needed by the sdk snapshot. This allows a follow up change to generate
different information for the sdk and for the platform depending on the
target build release of the sdk snapshot.

Bug: 240406019
Test: packages/modules/common/build/mainline_modules_sdks.sh
      # Ran the previous command with and without this change to make
      # sure that this change does not change the sdk snapshot
      # contents.
Change-Id: I30cea6cf8dae1be467b7063430d6197e5baa684b
(cherry picked from commit 887efdd779)
Merged-In: I30cea6cf8dae1be467b7063430d6197e5baa684b
2022-09-21 12:42:51 +00:00
Paul Duffin
722e5ccb51 Separate hidden API flag generation from encoding
Previously, the rules for encoding hidden API flags into dex files were
generated in the hiddenAPIRulesForBootclasspathFragment alongside the
rules for creating the hidden API flag files.

This change separates the encoding from the generation of the flags.
This will allow a follow up change to generate API flags for the sdk
snapshot separately without affecting the encoded dex files.

Bug: 240406019
Test: m nothing
Change-Id: I3ab3ff5780e7b2e322665d3ea15f1438f2e403bd
(cherry picked from commit af70518189)
Merged-In: I3ab3ff5780e7b2e322665d3ea15f1438f2e403bd
2022-09-21 12:42:44 +00:00
Paul Duffin
91c1676c8e Revert "bootclasspath_fragment: Treat some specific modules as test"
This reverts commit ff9b6faba2.

Reason for revert: No longer needed
Bug: 194063708
Test: m nothing
Change-Id: Ic2f6761c9a0a00a612724cb429f002a16522e53f
(cherry picked from commit d0fe1307aa)
Merged-In: Ic2f6761c9a0a00a612724cb429f002a16522e53f
2022-09-17 09:03:01 +00:00
Bob Badour
0fcd2f3d99 Integrate gen_notice with Make for dist.
Most exempt module types have no output. Support exempt module types
with output by requiring they must be 0p and have no license metadata.

Disallow `licenses: []` property on gen_notice.

Test: m cts dist

Change-Id: Ic992bd6420fa6898495866eac43495002ef4b6c8
Merged-in: Ic992bd6420fa6898495866eac43495002ef4b6c8
2022-09-16 19:18:36 +00:00
TreeHugger Robot
3fd5d95c61 Merge "add jacocoagent by default to Java modules" into tm-mainline-prod 2022-09-16 18:31:11 +00:00
Colin Cross
27bf106c58 Move embedded notice file path above aapt rule generation
The embedded notice file generation for apps was moved below the aapt
rules, which meant the added asset path was ignored.  Move the code
to pick the notice file path selection back above the aapt rules,
and leave the code to generate the notice file rule where it is.

Bug: 236006463
Test: m NetworkStack ALWAYS_EMBED_NOTICES=true
Change-Id: I1421fb0dbcdb759281259abfae7bddc9aecdaa56
Merged-in: I1421fb0dbcdb759281259abfae7bddc9aecdaa56
(cherry picked from commit 3d6cfd14d3)
2022-09-15 17:11:47 +00:00
Sam Delmerico
7ec5dfb8ca Merge "disable usage of plugins as static libs" into tm-mainline-prod 2022-09-13 13:21:07 +00:00
TreeHugger Robot
b4a469a2fe Merge "Fix gen_notice init to support arch and dist." into tm-mainline-prod 2022-09-12 21:06:05 +00:00
Bob Badour
d6714adb8c Fix gen_notice init to support arch and dist.
Incorrect init function was called so Stem property was not handled
correctly and the dist properties were treated as unknown.

Test: m droid dist

Change-Id: I5eb8771afb4fda332df08cf1560df5c17d1316cc
Merged-in: I5eb8771afb4fda332df08cf1560df5c17d1316cc
2022-09-12 18:17:43 +00:00
Sam Delmerico
f15716ffab add jacocoagent by default to Java modules
On coverage builds, R8 will fail to properly optimize and fail the build
if ignore_warnings: false, because jacoco injects dependencies on
jacocoagent classes, but the jacocoagent library is not part of the
classpath libraries passed in to R8 in its arguments.

Instead we can add jacocoagent as a libs dependency for these modules so
that it will get pulled into the r8 flags.

Bug: 243903417
Test: cherry-pick ag/19866767 &&
  make SKIP_ABI_CHECKS=true PRODUCT=cf_x86_phone-userdebug
  EMMA_INSTRUMENT=true EMMA_INSTRUMENT_FRAMEWORK=true
  CLANG_COVERAGE=true COVERAGE_PATHS=""
  TARGET_USERDATAIMAGE_PARTITION_SIZE=17179869184
  SKIP_BOOT_JARS_CHECK=true service-uwb
Change-Id: Icc24cc260b896fc800125a0318308d823ccf7a83
(cherry picked from commit 1e3f78f866)
Merged-In: Icc24cc260b896fc800125a0318308d823ccf7a83
2022-09-12 13:59:18 +00:00
Sam Delmerico
969f8f0a25 disable usage of plugins as static libs
Test: m auto_value_plugin
Test: m androidx.appsearch_appsearch-compiler
Test: m intdef-annotation-processor-test
Test: atest intdef-annotation-processor-test
Test: m view-inspector-annotation-processor-test
Test: atest view-inspector-annotation-processor-test
Test: m Robolectric_processor_tests
Test: atest Robolectric_processor_tests
Bug: 225388628
Change-Id: I9e3dd81f44333b680f2e81283c02a9be5a4de15b
(cherry picked from commit 0d1c4a0fee)
Merged-In: I9e3dd81f44333b680f2e81283c02a9be5a4de15b
2022-09-09 21:44:23 +00:00
William Escande
72da93e188 Bluetooth available hack
The first hack has been introduced to facilitate the creation of the
com.android.btservices apex without the need to upload 100+ cl close to
the release date.
We now want to delete com.android.bluetooth apex and replace all the
apex_available rules to target the new apex name
It will be way much easier to do this in separate CL and without forcing
us into a single topic.

Bug: 243054261
Bug: 245214856
Test: Build
Change-Id: Ia03698db839db4684871eb38c088f88d6bdcba4b
(cherry picked from commit 2ad6e84d60)
Merged-In: Ia03698db839db4684871eb38c088f88d6bdcba4b
2022-09-06 18:15:16 +00:00
Sam Delmerico
cfd0caaf78 jacoco libs dependency for instrumented libraries
On coverage builds, R8 will fail to properly optimize and fail the build
if ignore_warnings: false, because jacoco injects dependencies on
jacocoagent classes, but the jacocoagent library is not part of the
classpath libraries passed in to R8 in its arguments.

Instead we can add jacocoagent as a libs dependency for these modules so
that it will get pulled into the r8 flags.

Bug: 243903417
Test: add optimize.ignore_warnings: false to NetworkStackAppDefaults &&
  make SKIP_ABI_CHECKS=true PRODUCT=cf_x86_phone-userdebug \
  EMMA_INSTRUMENT=true EMMA_INSTRUMENT_FRAMEWORK=true \
  CLANG_COVERAGE=true COVERAGE_PATHS="" \
  TARGET_USERDATAIMAGE_PARTITION_SIZE=17179869184 \
  SKIP_BOOT_JARS_CHECK=true \
  NetworkStack
Change-Id: I71313b1fd35437ec52890f5c30b3fd1381c7c3d2
(cherry picked from commit c75937264b)
Merged-In: I71313b1fd35437ec52890f5c30b3fd1381c7c3d2
2022-09-05 04:20:55 +00:00
Paul Duffin
4eed981670 Add current build release
Previously, the build releases only included named releases so did not
have a way to represent the latest build release. This adds the current
build release (named after the current API level) to represent that.

Bug: 240406019
Test: m nothing
Change-Id: Ib8336da716b447448b23bc9684ce3be1ab78648a
(cherry picked from commit 42a49f1278)
Merged-In: Ib8336da716b447448b23bc9684ce3be1ab78648a
2022-08-21 12:18:12 +00:00
Paul Duffin
b5e3c9802a Add hidden API properties to java_sdk_library modules
Previously, hidden API properties were only allowed on
bootclasspath_fragment and platform_bootclasspath module types. This
change allows them to be specified on java_sdk_library modules too. It
involves the following changes:

1. Add the properties to the java.Module.
2. Populate and provide a HiddenAPIPropertyInfo struct from
   java_sdk_library modules.
3. Modify bootclasspath_fragment to merge information gathered from its
   content libraries as if it was specified on the fragment itself.

Bug: 240406019
Test: m nothing
      packages/modules/common/build/mainline_modules_sdks.sh
      # Ran the previous command with and without this change to make
      # sure that this change does not change the sdk snapshot
      # contents.
Change-Id: I64eb71c2039ddc14cf380689d0cec7ec221f5b88
(cherry picked from commit 3f1ae0b55a)
Merged-In: I64eb71c2039ddc14cf380689d0cec7ec221f5b88
2022-08-21 12:18:06 +00:00
TreeHugger Robot
067e12f46a Merge "Dedup apiFile and removedApiFile fields" into tm-mainline-prod 2022-08-19 17:31:31 +00:00
Paul Duffin
6cdfd3fcfb Dedup apiFile and removedApiFile fields
Previously, there were two separate fields for each of the API and
removed API files because in some cases it needed a WritablePath and in
other cases it could only be a Path.

This change refactors the code so that the WritablePath is no longer
needed, the duplicate fields deleted and the remaining field is changed
to Path. It also removes a few unused fields.

Bug: 234113632
Test: m nothing
Change-Id: If81f5fe2aa05d9d7b2bc23869fdb2397649d67b3
(cherry picked from commit c71d2b7629)
Merged-In: If81f5fe2aa05d9d7b2bc23869fdb2397649d67b3
2022-08-19 15:26:33 +00:00
Paul Duffin
04beaabb46 Push Hidden_api inside HiddenAPIFlagFileProperties
All usages of HiddenAPIFlagFileProperties use it as the type of a
Hidden_api field. This change pushes the field inside the struct and
just embeds the struct inside the structs that need it making it
simpler and more consistent with how the HiddenApiPackageProperties
struct is used.

This is extracted as a separate change as while the change is simple
it does affect a lot of lines. Keeping it separate makes it easier to
review the changes.

Bug: 240406019
Test: packages/modules/common/build/mainline_modules_sdks.sh
      # Ran the previous command with and without this change to make
      # sure that this change does not change the sdk snapshot
      # contents.
Change-Id: I664453029574ef68dc5712f7bf137a1a6e78e864
(cherry picked from commit 9b61abbd84)
Merged-In: I664453029574ef68dc5712f7bf137a1a6e78e864
2022-08-19 15:19:32 +00:00
Paul Duffin
710a9edf21 Refactor handling of hidden API property provided information
In preparation for adding hidden API properties to individual
java_sdk_library modules this change refactors the handling of that
information.

1. Renames HiddenApiPackageProperties to HiddenAPIPackageProperties
   to be consistent with other similar structs.

2. Creates a new HiddenAPIPropertyInfo struct to be used to provide
   property derived information from one module to another. It includes
   both flag files as well as the information about which packages are
   used.

3. The HiddenAPIPropertyInfo is embedded within the existing
   HiddenAPIFlagInput in place of the existing flag files field.

4. The fields in the HiddenAPIPropertyInfo struct are populated from
   the HiddenAPI*Properties structs.

5. Access to package information is retrieved from the info struct
   instead of directly from the properties. That means that no changes
   will be needed to this code when info from other modules is merged
   into the struct in a follow up change.

Bug: 240406019
Test: packages/modules/common/build/mainline_modules_sdks.sh
      # Ran the previous command with and without this change to make
      # sure that this change does not change the sdk snapshot
      # contents.
Change-Id: I773279a4b621bcc3c40e3bfe193f2c7b0caeccd6
(cherry picked from commit 1e9e9388d8)
Merged-In: I773279a4b621bcc3c40e3bfe193f2c7b0caeccd6
2022-08-19 15:19:26 +00:00
Paul Duffin
719cc628ce Revert "Check that API is up-to-date when building java_sdk_library"
This reverts commit c166b68589.

Bug: 234113632
Bug: 236187167
Reason for revert: causes problems with update-api, see b/236187167

Change-Id: I4c88151cb5e2c86bb6c1a955c5065966a4fbb3e0
(cherry picked from commit e7a8664a6a)
Merged-In: I4c88151cb5e2c86bb6c1a955c5065966a4fbb3e0
2022-08-17 09:19:32 +00:00
Ante Culo
8bfefc0e75 Merge "rust: Allow rust_ffi_shared in jni_libs" into tm-mainline-prod 2022-08-16 21:38:55 +00:00
Ivan Lozano
be6873f813 rust: Allow rust_ffi_shared in jni_libs
Allow listing rust_ffi_shared modules as a jni_libs dependency
in conjunction with platform_api: true. This allows inclusion by
android_app modules.

Bug: 237304791
Test: android_app module builds with a rust_ffi_shared dependency.
Change-Id: I3a28e1baa522ad8f9c2aa86f1d23b19ce9f967e1
Merged-In: I3a28e1baa522ad8f9c2aa86f1d23b19ce9f967e1
2022-08-16 19:46:25 +00:00
Artur Satayev
79b1f25dc2 Merge "Set targetSdkVersion to 10000 for MTS tests targeting current" into tm-mainline-prod 2022-08-08 08:57:04 +00:00
Spandan Das
cf9b0070c0 Set targetSdkVersion to 10000 for MTS tests targeting current
MTS tests built on unstable branches (e.g. git_master) should be testable on
old system images (e.g. S). However, they run into an error during installation
on older images:
`Requires development platform $<current_codename>, but this is a
release platform`

This CL fixes this issue by updating the target_sdk_version of MTS test apps
targeting current to the magical sdk_version 10000

Bug: 227473065
Test: go build ./java
Test: TH
Change-Id: Ic0358a48a19dc239defbb4ee8ec99225cce75584
Merged-In: Ic0358a48a19dc239defbb4ee8ec99225cce75584
2022-08-07 20:11:18 +00:00
Remi NGUYEN VAN
4987e7e397 Make ignorewarnings optional in optimize
This allows targets to opt-in to running R8 without the -ignorewarnings
flag. Ignored warnings can cause code to be optimized incorrectly, so
this makes the build safer for such targets.

Ideally ignore_warnings should default to false, but all targets need to
be fixed for that to happen. As a first step, provide a mechanism for
individual targets to ensure they do not introduce regressions.

Bug: 229727645
Bug: 180878971
Bug: 226127213
Bug: 239990030
Test: m (runs dex_test)
Change-Id: Ic0eef29598c1ee47e958da8a5048d9696165a235
(cherry picked from commit bdad314f97)
Merged-In: Ic0eef29598c1ee47e958da8a5048d9696165a235
2022-08-05 01:27:10 +00:00
Bob Badour
c4d437c6bf Keep Notice property from erasing license texts.
Remove "default to file in directory". Use explicit applicable license.

Bug: 192434786
Bug: 240342946

Test: m droid dist

Change-Id: Id3d845b2073f151a8c0bad874e7ab005771bdfcb
Merged-in: Id3d845b2073f151a8c0bad874e7ab005771bdfcb
2022-08-03 21:51:19 +00:00
Bob Badour
c2b6dec6d1 Fix escaping for package_name
Bug: 235333302
Bug: 240342946

Test: m droid dist

Change-Id: I6e52b960be4171a9510edd4f2857f13cc3f54bc0
Merged-in: I6e52b960be4171a9510edd4f2857f13cc3f54bc0
2022-08-03 14:02:39 -07:00
Bob Badour
877d5ee596 Tool to create license metadata for copied target.
Bug: 213388645
Bug: 240342946

Test: m copy_license_metadata
Test: m cts dist reportmissinglicenses

Change-Id: I75c196ceca221effb2d6c972e250f5d42854e42f
Merged-in: I75c196ceca221effb2d6c972e250f5d42854e42f
2022-08-03 14:02:37 -07:00
Bob Badour
65ebcd772e Make sure dist files have license metadata.
Bug: 151177513
Bug: 210912771
Bug: 240342946

Test: m droid dist reportmissinglicenses

Change-Id: I0c85f6c49a3e9d9bb3219ed6ddfb939d90f80656
Merged-in: I0c85f6c49a3e9d9bb3219ed6ddfb939d90f80656
2022-08-03 14:02:35 -07:00
Bob Badour
919855091c Add gen_notice module.
Refactor notices to support notices for multiple modules.

Enforce visibility and handle missing dependencies.

Test: m cts dist reportmissinglicenses

Test: m droid dist

Bug: 213388645
Bug: 240342946

Change-Id: Id6a81987f087419ad37d0cce57a71e8a7c4cd6e0
Merged-in: Id6a81987f087419ad37d0cce57a71e8a7c4cd6e0
Merged-in: I07963c83eaddfe363a04871e813b56fe7f1465ad
Merged-in: Ib2f8d0ad46ffe795d392166a74a7c6309b1246e2
Merged-in: I1d630c3d14d27b7605ab13d204d34b6851a24d33
2022-08-03 14:02:33 -07:00
Paul Duffin
9bcfe69743 Revert "Patch to fix Aug train issue with tethering"
Revert "[automerge] Patch to fix Aug train issue with tethering ..."

Revert submission 19432194-presubmit-am-5e598b33be884d9f98a29ce1c3c575fb

Reason for revert: Not needed in tm-mainline-prod and breaks bluetooth.
Reverted Changes:
I57969b85a:Patch to fix Aug train issue with tethering
Ie6560f201:[automerge] Patch to fix Aug train issue with teth...

Change-Id: If44d16a00847a554862aa139c04370ad30166c74
2022-07-28 10:07:30 +00:00
Paul Duffin
a649ad5b31 Patch to fix Aug train issue with tethering
A temporary patch to fix issues with the tethering module sdk in the
August train. This will be reverted immediately and only used for
specific builds for the August train and possibly the September train
if this has not been fixed properly by then. The proper fix will be
implemented under b/238472881.

This patch removes framework-tethering-t from the snapshot's Android.bp
file and removes its effect on the hidden API flag files too.

Bug: 238472881
Test: build train
Change-Id: I57969b85a12e9e5a3fc76c055b260cec5d5f7d7f
2022-07-28 09:31:28 +00:00
Paul Duffin
f33bea357e Export any platform_compat_config used by apex to sdk snapshot
Previously, the platform_compat_config modules needed to be explicitly
listed in the sdk snapshot and the apex. This change will automatically
export them to the sdk snapshot when the apex is listed in its apexes
property.

Bug: 232401814
Test: m tethering-module-sdk
      # Before this change the generated snapshot did not contain the
      # platform_compat_config, after this change it did.
      m art-module-sdk
      # As that explicitly specifies the platform_compat_config in its
      # compat_configs property this change has no effect.
Change-Id: Ia854b9a52db2b1619fca41a387ce98d7f9f9efe9
(cherry picked from commit fcf79850d8)
Merged-In: Ia854b9a52db2b1619fca41a387ce98d7f9f9efe9
2022-07-21 10:41:38 +00:00
Paul Duffin
43d56de71a Sort files in sdk snapshot zip to ensure consistent behavior
The order of the files in the sdk snapshot was stable but depended on
how the sdk was built. If the snapshot was created directly then the
files have one order, if it was created by merging in files from other
zips then it has a different order.

This change ensures files are in alphabetical order no matter how the
snapshot zip is constructed.

Bug: 232401814
Test: m media-module-sdk
      # Check the contents of the following zips to ensure that they are sorted
      # after this change.
      # out/soong/.intermediates/packages/modules/Media/apex/media-module-sdk/common_os/media-module-sdk-current.unmerged.zip
      # out/soong/mainline-sdks/media-module-sdk-current.zip
Change-Id: Ie97e0119c07a1f34a2b1d3ea6895f0e76cd195a8
(cherry picked from commit 74f1dcd1ab)
Merged-In: Ie97e0119c07a1f34a2b1d3ea6895f0e76cd195a8
2022-07-19 09:28:56 +00:00
Paul Duffin
14910d7847 [automerger skipped] Use implementation jar for updatable-media in snapshot for S am: 8a61b59e17 -s ours
am skip reason: Merged-In Ib49484d00a60b4ed7f8268e04f9c10a3498edb56 with SHA-1 be75059999 is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/19290569

Change-Id: If723e19d906332e2cb4a81e0167ddd4b9227ebec
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-07-18 15:34:05 +00:00
Paul Duffin
8a61b59e17 Use implementation jar for updatable-media in snapshot for S
While enabling prebuilts in T we hit b/229932396 which was caused by
some parts of the build depending on the prebuilt updatable-media jar
which used to be a full implementation jar but which is now an invalid
jar as the snapshot must not be including implementation details. We
fixed the issue in T but we are hitting the same problem in S with the
M-2022-07.

That is the first train in which the prebuilt updatable-media module
provides an invalid jar, prior to that it was always providing an
implementation jar. This change tweaks the sdk snapshot generation
code to use an implementation jar for updatable-media in the S
snapshot to avoid partners having to cherry pick changes similar to
those needed to fix b/229932396 in T.

Bug: 239121291
Test: packages/modules/common/build/mainline_modules_sdks.sh
      # Check that S media snapshot includes implementation jar.
      # Check that S art snapshot includes invalid jar.
      # Check that T media snapshot includes invalid jar.
Change-Id: Ib49484d00a60b4ed7f8268e04f9c10a3498edb56
(cherry picked from commit 1364891fad)
Merged-In: Ib49484d00a60b4ed7f8268e04f9c10a3498edb56
2022-07-16 00:05:58 +00:00
Paul Duffin
be75059999 Use implementation jar for updatable-media in snapshot for S
While enabling prebuilts in T we hit b/229932396 which was caused by
some parts of the build depending on the prebuilt updatable-media jar
which used to be a full implementation jar but which is now an invalid
jar as the snapshot must not be including implementation details. We
fixed the issue in T but we are hitting the same problem in S with the
M-2022-07.

That is the first train in which the prebuilt updatable-media module
provides an invalid jar, prior to that it was always providing an
implementation jar. This change tweaks the sdk snapshot generation
code to use an implementation jar for updatable-media in the S
snapshot to avoid partners having to cherry pick changes similar to
those needed to fix b/229932396 in T.

Bug: 239121291
Test: packages/modules/common/build/mainline_modules_sdks.sh
      # Check that S media snapshot includes implementation jar.
      # Check that S art snapshot includes invalid jar.
      # Check that T media snapshot includes invalid jar.
Change-Id: Ib49484d00a60b4ed7f8268e04f9c10a3498edb56
(cherry picked from commit 1364891fad)
Merged-In: Ib49484d00a60b4ed7f8268e04f9c10a3498edb56
2022-07-15 22:34:28 +00:00
Alexei Nicoara
a3096cd6c1 Cleaning up comment removal and version replacement
jsonmodify is now responsible for striping the comments and replacing the placeholder  version with the defaule one. Cleaning up the old code.

Test: presubmit
Bug: 231691643
Change-Id: I09af00199aefec09b2d5995b2923525a3a42c362
(cherry picked from commit 0a3892031e)
Merged-In: I09af00199aefec09b2d5995b2923525a3a42c362
2022-07-13 16:14:32 +00:00
Wei Li
e26ebc8675 JSON format doesn't support comments, so a JSONWithCommentsDecoder is added to support line comments start with // that used in apex_manifest.json files. This fixes the CI errors reported in b/238399517.
Bug: 238399517
Test: build/bazel/ci/bp2build.sh
Change-Id: Iaa3c2ab319eb7a52cbedaddd057646fc089d745a
(cherry picked from commit 18b7a2e8a2)
Merged-In: Iaa3c2ab319eb7a52cbedaddd057646fc089d745a
2022-07-13 13:39:12 +00:00
Alexei Nicoara
8396d07202 Merge changes from topic "cherrypicker-L32800000955443217:N86800001279016908" into tm-mainline-prod
* changes:
  Cleaning up the version sed rule
  Adding support to conditionally replace a value
2022-07-13 09:22:01 +00:00
TreeHugger Robot
f285e54c6f Merge changes from topic "cherrypicker-L07900000955432058:N23200001279006695" into tm-mainline-prod
* changes:
  bootclasspath_fragment: Require at least one hidden_api package property
  bootclasspath_fragment: Treat some specific modules as test
  bootclasspath_fragment: Add test specific module type
2022-07-12 14:25:54 +00:00
Alexei Nicoara
ceefda1312 Cleaning up the version sed rule
Bug: 231691643
Test: presubmit, checked itermediary jsons
Change-Id: Ibcf908d9365ab41e5a19211f5a60305a0896dea5
(cherry picked from commit d887e24260)
Merged-In: Ibcf908d9365ab41e5a19211f5a60305a0896dea5
2022-07-12 13:53:24 +00:00
Alexei Nicoara
221f5734aa Adding support to conditionally replace a value
Bug: 231691643
Test: presubmit
Change-Id: I786ab152a94126ebc8a9d7dea0bb68e07d789a0b
(cherry picked from commit 7d69b1d8e6)
Merged-In: I786ab152a94126ebc8a9d7dea0bb68e07d789a0b
2022-07-12 13:53:21 +00:00
Paul Duffin
3532c556ed bootclasspath_fragment: Require at least one hidden_api package property
Previously, the split_packages, single_packages and package_prefixes
properties were all optional and the split_packages defaulted to ["*"].
As that value conflicted with the other package properties that meant
that split_packages always had to be specified even if it was to just
set it to an empty array.

This change requires at least one of them to be specified and defaults
split_packages to an empty list which means it is not required,
although it can be helpful to make that explicit.

Bug: 194063708
Test: m nothing
Change-Id: I5a4c2d68e72e39f5c4a2441326dfce8685fc8ff2
(cherry picked from commit 9fd564711e)
Merged-In: I5a4c2d68e72e39f5c4a2441326dfce8685fc8ff2
2022-07-12 12:01:02 +00:00