Commit Graph

43915 Commits

Author SHA1 Message Date
Jingwen Chen
11cca671ac Suffix the build ID to the dirname of APK-in-APEX files.
This fixes an issue with package manager's cache invalidation.

Test: CI

Bug: 226559955
Bug: 224589412
Change-Id: I8af49d51ff99cf8184d0e4d1136fff1cdb29c23e
Merged-In: I8af49d51ff99cf8184d0e4d1136fff1cdb29c23e
2022-03-31 16:28:37 +00:00
Paul Duffin
9345773428 Add ignored hidden_api.split_packages/package_prefixes properties
Allow modules upstream to make use of these properties despite
sc-mainline-prod not supporting them.

Bug: 194063708
Test: m nothing
Merged-In: If2f90cfc41b6fff9fa4ac8b9d4973110938b9392
Change-Id: I85c13c115ffafc797566ced6c3672a9b0dca59b1
2022-03-11 14:52:37 +00:00
Paul Duffin
9b4eab604d Use Tiramisu instead of T in supported_build_releases
Make this consistent with how code names are used in the rest of Soong.

Bug: 204763318
Test: m nothing
Change-Id: I1f2f40310df9d619db6aaaad3ed7339bb5e79194
Merged-In: I1f2f40310df9d619db6aaaad3ed7339bb5e79194
(cherry picked from commit e7babdbfe1)
2022-02-11 08:30:41 +00:00
Paul Duffin
7a57bb1063 Only output annotations properties in snapshots for T+
Marks the `scopeProperties.AnnotationsZip` property as only being
supported on T builds and above.

Bug: 204763318
Test: m nothing
Merged-In: Ie59396287c08da77a6a1f15d4be202429e011e17
Change-Id: Ie59396287c08da77a6a1f15d4be202429e011e17
(cherry picked from commit a54016c3ba)
2022-02-10 17:29:58 +00:00
Paul Duffin
56f266d22c Allow pruning of unsupported fields in structs in maps
Adds support for traversing into a field that is of type:
   map[...]*struct{...}

This is needed to allow java_sdk_library to mark scope specific
properties, e.g. public.annotations as being target build release
specific.

It was necessary to change the Scope field from:
   Scope map[*apiScope]scopeProperties
to:
   Scope map[*apiScope]*scopeProperties

That is because there is no way in go to change the field of a struct
value of a map. i.e. you cannot do the following, not even using
reflection:
   Scope[apiScopePublic].AnnotationsZip = nil

Bug: 204763318
Test: m nothing
Merged-In: Id103f70f55d4202971321ef4925cbec4b55f8136
Change-Id: Id103f70f55d4202971321ef4925cbec4b55f8136
(cherry picked from commit 106a3a4bec)
2022-02-10 17:29:58 +00:00
Paul Duffin
2f94ca5475 Refactor build_release and test code
Minor restructuring of the build_release pruning code to make it easier
to add logic for handling fields of maps of structs. That includes:
1. Moving some code that is specific to clearing a selected field
   inside the associated if block.
2. Replacing an if with a switch.
3. Improving the error handling by separating the reporting of the
   container that broke from information about which field could not be
   set. That allows follow up code to provide information about the map
   key instead.

The tests were restructed by:
1. Switching from using AssertDeepEquals to compare the structs to
   comparing the output of marshalling the structs to JSON. That was
   for a couple of reasons. Firstly, because JSON will marshal (and so
   allow comparison of) the contents of pointers to structs whereas
   AssertDeepEquals will just compare the pointers themselves.
   Secondly, because JSON can pretty print the output and make it
   easier to read.
2. Using a func to create a new instance of the input structure for
   each test. That is to allow the test to modify the input structure,
   e.g. by clearing a field in a struct that is pointed to by a map.
   The test previously relied on the input structure being immutable
   and passed by value but a follow up change will change that by
   adding a map field that contains pointers to structs.

Bug: 204763318
Test: m nothing
Merged-In: I84dc99621497b7263e30466895b823eb02cb2b56
Change-Id: I84dc99621497b7263e30466895b823eb02cb2b56
(cherry picked from commit 545c59273d)
2022-02-10 17:29:58 +00:00
Paul Duffin
24c545e317 Support generating sdk snapshot for specific build release
Previously, the sdk snapshot was assumed to be generated for the
current build system. This change adds support for the
SOONG_SDK_SNAPSHOT_TARGET_BUILD_RELEASE environment variable which can
be used to select the target build release in which the generated
snapshot will be used.

At the moment this will only affect the properties that are output but
if/when it becomes necessary it can also be used to control more
aspects of the snapshots such as supported member types or even
members.

This change does not modify any properties that are build release
specific. That will come in following changes. However, it does add a
test that targets build release S which defines a baseline for
properties that will be affected in following changes. That baseline
makes it easier to see the effect of those follow up changes.

Bug: 197842263
Test: m nothing
Change-Id: I5cfde5e9e86af522b0d5030d301e116b0233fd62
Merged-In: I5cfde5e9e86af522b0d5030d301e116b0233fd62
(cherry picked from commit ef2df587be)
2022-02-10 17:29:55 +00:00
Paul Duffin
3ea9205285 Support pruning properties by build release
Adds a general mechanism for pruning selected sdk member properties
(i.e. setting their fields to their zero value) and uses that to prune
any properties that do not support a specified target build release.

Follow up changes will use that to allow building an sdk snapshot that
is compatible with previous release S.

Bug: 197842263
Test: m nothing
Merged-In: Ib949a9cfe85fff30f86228eeb15d3a45c073b037
Change-Id: Ib949a9cfe85fff30f86228eeb15d3a45c073b037
(cherry picked from commit 0c3acbfd72)
2022-02-10 16:55:22 +00:00
Paul Duffin
49171a4a70 Support handling build releases in sdk snapshot
Adds the following:
1. A buildRelease type to represent a single build release.
2. A buildReleaseSet type to represent a set of build releases.
3. Methods to create parse and use the previous new types.
4. Tests for the above.

Bug: 197842263
Test: m nothing
Merged-In: Ib0dd4fc32851a4fffde3fa02ea22c8369f8c2995
Change-Id: Ib0dd4fc32851a4fffde3fa02ea22c8369f8c2995
(cherry picked from commit 1812294f32)
2022-02-10 16:55:22 +00:00
Paul Duffin
3e7d3ca127 Insert imageVariantSpecificInfo between arch and link info
Previously, the archTypeSpecificInfo included an array of
*linkTypeSpecificInfo. This change replaces that array with an array of
*imageVariantSpecificInfo which themselves contain an array of
*linkTypeSpecificInfo.

That allows the sdk snapshot to handle image variants correctly, i.e.
collate their properties, optimize their properties and then detect if
there are any image variant specific properties for any image variant
other than the CoreImageVariant ("") and report it as an error.

The latter case is treated as an error because while Soong needs to
handle image specific variants there is currently no requirement to
handle generating a prebuilt with image specific properties. A follow
up change will test the error handling.

Image specific variants are needed because the "jni_headers"
cc_library_headers module provides a number of image variants (e.g.
recovery) that are used outside the ART module. Therefore, the sdk
snapshot needs to do the same.

At the moment image variants like the recovery variant are supported by
copying the property that creates the variant (e.g. recovery_available)
through to the prebuilt but that is not safe for a couple of reasons:
1. It ignores any differences between the recovery variant and the
   other variants which could cause compatibility issues in modules
   that build against the prebuilts.
2. It marks modules in the snapshot with recovery_available even when
   they do not need it.

This change will allow follow up changes to address both those issues.

Bug: 195754365
Test: m nothing
Merged-In: I1c187d814f44b2cb7607cd43a6b215134be0faad
Change-Id: I1c187d814f44b2cb7607cd43a6b215134be0faad
(cherry picked from commit b42fa67a47)
2022-02-10 16:55:21 +00:00
Paul Duffin
c566255300 Move setting of link type properties to linkPropertyInfo
Bug: 195754365
Test: m nothing
Merged-In: Ica90a42cd8e4a79251271164f137dcdf60b3bd55
Change-Id: Ica90a42cd8e4a79251271164f137dcdf60b3bd55
(cherry picked from commit f68f85a3ca)
2022-02-10 16:55:21 +00:00
Wei Li
d9100a56e6 Add new property "exclude_kotlinc_generated_files" for excluding files generated by kotlinc from the output files of Java related modules.
Bug: 204888276
Test: m service-permission
Change-Id: I9f6113834826358b0e3af22ed1dd63a43c255452
Merged-In: I9f6113834826358b0e3af22ed1dd63a43c255452
(cherry picked from commit 1e73c6573e)
2022-01-25 04:59:51 +00:00
Jiakai Zhang
9d92964ddd Ignore some properties for T and above.
As requested by reminv@, their team wants the source code in
sc-mainline-prod to be strictly the same as the code in AOSP. Therefore,
we need to ignore `standalone_contents` in the
`systemserverclasspath_fragment` module and
`systemserverclasspath_fragments` in the `sdk` module in order to merge
aosp/1925682 into sc-mainline-prod.

- `standalone_contents` in the `systemserverclasspath_fragment` module
  does nothing but adds its contents as dependencies of the APEX.
- `systemserverclasspath_fragments` in the `sdk` module does nothing.

Bug: 203198541
Test: TARGET_BUILD_APPS=com.android.tethering vendor/google/build/mainline_modules_bundles.sh
Change-Id: I56ca22aa91a807cd113dfda2fabaeb49ecabe289
Merged-In: I09a6fd1d3db85c194330da9b751702a9bf069e26
2022-01-21 16:30:44 +00:00
Ken Chen
6320efb56e [NETD-BPF#34] Add a tag for bpf to specify the install folder
Currently, the bpf module netd.o (source system/netd/bpf_progs/netd.c)
will be built to /system/etc/bpf/netd.o. In Android T, it will be moved
to mainline module com.android.tethering.

The expected behavior is:
- In T device, it uses the netd.o in mainline module.
- In pre-T devices, it uses the original netd, built from platform.

However, netd.o will be double loaded if the tethering module is
installed in Pre-T devices. Because:
1. bpf in apex is packed into /apex/MAINLINE_MODULE/etc/bpf/
2. bpf in platform is packed into /system/etc/bpf/
3. bpfloader in pre-T loads ANY bpf modules under
/apex/com.android.tethering/etc/bpf/ and /system/etc/bpf/.

We can't change the behavior of bpfloader in pre-T devices. We can't
delete the /system/etc/bpf/netd.o from pre-T devices. Both of them are
not mainline modules. So the mainlined netd.o needs to be packed into a
folder other than /apex/com.android.tethering/etc/bpf/ or
/system/etc/bpf/.

This commit adds a tag 'sub_dir' for bpf module. The installation path
of bpf modules will be:
- /system/etc/bpf/SUB_DIR/     (for platform code)
- /apex/MAINLINE_MODULE/etc/bpf/SUB_DIR/     (for mainline module)

Bug: 202086915
Test: add test in apex_test.go and build
Merged-In: Icc6619768ab006de9f86620a7df1bb2853eaba13
Change-Id: Icc6619768ab006de9f86620a7df1bb2853eaba13
2022-01-19 08:04:00 +00:00
Ivan Lozano
ab1f1ac6e8 rust: Fix exported MinSdkVersion
The exported rust.MinSdkVersion always returns an empty string. Instead
it should return the Min_sdk_version property like rust.minSdkVersion.

This CL renames minSdkVersion to MinSdkVersion so the exported function
has the correct behavior.

Bug: 211858959
Bug: 214625677
Test: m
Change-Id: I4fecfba711c0d3d7a22f4fdf7684924a9457b464
Merged-In: I4fecfba711c0d3d7a22f4fdf7684924a9457b464
2022-01-14 19:56:28 -05:00
Colin Cross
b6b3b0d229 Merge changes from topic "presubmit-am-7cab244dfd894a60b70da0836519d8e0" into sc-mainline-prod
* changes:
  [automerge] Revert "Time out and dump stacks from R8 processes after 30 minutes" 2p: b18a037fc6
  Revert "Time out and dump stacks from R8 processes after 30 minutes"
2022-01-11 21:12:31 +00:00
Maciej Żenczykowski
8c207a0d1f Merge changes from topic "canned_fs_config_sc_mainline_prod" into sc-mainline-prod
* changes:
  Merge changes from topic "canned_fs_config" am: ae9cf26353 am: 33fd601118 am: a214351987 am: 7cc9a75156
  Merge "Improve handling of errors from zipinfo" am: b02043b84d am: 4b3afb7798 am: 0bbc2d0229 am: ce2624cf88 am: d0cfac1546
2022-01-11 20:06:36 +00:00
Ken Chen
0349649423 Remove global bpf include path system/bpf/progs/include
Delete it because there is only one user left
(system/bpfprogs/time_in_state.c). It can be specified locally.

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

Bug: 202086915
Test: build and boot
Change-Id: I1cb0ceb7b8e3fb63af34e11e5fece11fa038b24e
Merged-In: I1cb0ceb7b8e3fb63af34e11e5fece11fa038b24e
2022-01-05 20:30:51 +00:00
TreeHugger Robot
d4965d411c Merge "[NETD-BPF#21] Move a few headers to frameworks/libs/net" into sc-mainline-prod 2022-01-04 22:49:13 +00:00
Jiyong Park
b90099d84e Merge changes from topic "canned_fs_config" am: ae9cf26353 am: 33fd601118 am: a214351987 am: 7cc9a75156
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1918606
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1918605


Change-Id: I484e46ff819a5266c1e8046dae337e18ef3fefea
Merged-In: I484e46ff819a5266c1e8046dae337e18ef3fefea
Merged-In: I7f2576ff99c65bdb6c9ce4ace61bc783eea2f0d4
(cherry picked from commit 755e3808b2)
2022-01-04 12:54:44 +00:00
LaMont Jones
5d8246e2c9 Merge "Improve handling of errors from zipinfo" am: b02043b84d am: 4b3afb7798 am: 0bbc2d0229 am: ce2624cf88 am: d0cfac1546
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1790956

Change-Id: Ib60578ead4ccaa7ba09f628a6c9281c0cc70e6ce
Merged-In: Ib60578ead4ccaa7ba09f628a6c9281c0cc70e6ce
(cherry picked from commit c3fc0cdb16)
2022-01-04 12:41:12 +00:00
Ken Chen
96ad98b40e [NETD-BPF#21] Move a few headers to frameworks/libs/net
BPF headers used by both platform and mainline modules should be in
frameworks/libs/net.

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

Bug: 202086915
Test: build and boot
Test: cd packages/modules/Connectivity/netd; atest
Change-Id: I5a86ccd44a673a18138201f186b104f5214fd449
Merged-In: I5a86ccd44a673a18138201f186b104f5214fd449
2021-12-24 04:24:15 +00:00
Matt Banda
fad1a98822 Java used-by API list generation
Update the java used by script to fix the xml format when dexdeps processing resource only APKs

Test: TARGET_BUILD_APPS=com.android.adbd m dist apps_only
Change-Id: I61a58d7c739e74a571e97166a7c9b4091e6f8da0
Merged-In: I61a58d7c739e74a571e97166a7c9b4091e6f8da0
(cherry picked from commit bc82ba55c5)
2021-12-22 20:45:42 +00:00
Matt Banda
d1ed1de63a Java used-by API list generation
Wrap the dexdeps output content with "<externals></externals>" to
simplify backend xml parsing.

Test: TARGET_BUILD_APPS=com.android.adbd m dist apps_only
Change-Id: I1457eb9558763e50911dc9c689b9bc3fb833a52c
Merged-In: I1457eb9558763e50911dc9c689b9bc3fb833a52c
(cherry picked from commit 65a981569f)
2021-12-21 19:37:23 +00:00
Sophie Zheng
3ff621ed60 Merge "NDK API coverage" into sc-mainline-prod 2021-12-13 18:36:55 +00:00
sophiez
8c6937c6ba NDK API coverage
Fixed typo in dist path for backed by.

Test: TARGET_BUILD_APPS=com.android.adbd m dist apps_only

Change-Id: Ic67c0bd5644dec11829f0dc2535016fec788a067
Merged-In: Ic67c0bd5644dec11829f0dc2535016fec788a067
Bug: b/210034014
2021-12-11 01:16:42 +00:00
Remi NGUYEN VAN
efb49afc8a Relax apex package restriction for T+ jars
The ART AOT exemption only applies to Q/R/S, so module jars that have
min_sdk T+ do not need to follow the module package restriction, even if
they are part of a Q/R/S module (but not loaded on Q/R/S).

Relax the restriction to only apply to jars that have min_sdk before T.

(clean cherry-pick)

Bug: 208773835
Change-Id: Ib41ab443e36a694e3fac5f2ab0acabb3009f40a9
Test: m (runs apex tests)
Merged-In: I2c3ad8984ca05ad763bf6162bd478f93ab4ee650
2021-12-10 10:52:01 +00:00
TreeHugger Robot
aa7b36e681 Merge changes from topics "presubmit-am-0a046d9514b34cc1a3b2b3584e857f6c", "presubmit-am-22410ea0b46e4a3d961d51518c65514d", "presubmit-am-2646dd78e751450296e76a7e6fac60eb", "presubmit-am-2762d254a366481180c66eefcb7b8c53", "presubmit-am-36ef44194069468da39e59065e3b9d39", "presubmit-am-6e59a6b21a5047bd940a9bff59c79228", "presubmit-am-855c4e732f2645568065c3c870ecd0da", "presubmit-am-dae9703bfd65425b8b44605c42e9d5b9" into sc-mainline-prod
* changes:
  Allow java_sdk_library in an APEX to have higher min_sdk_version.
  Perform CheckMinSdkVersion for java_sdk_library.
  Add MinSdkVersion(ctx) method to ModuleWithMinSdkVersionCheck interface.
  Add ModuleWithMinSdkVersionCheck type.
  Use textproto format for classpaths.proto generation.
  Propagate min and max sdk versions to classpaths.proto configs.
  Introduce max_sdk_version device property.
  Test SdkSpecForm.
2021-12-09 15:54:26 +00:00
satayev
812683ec25 Allow java_sdk_library in an APEX to have higher min_sdk_version.
Inidividual boot or system server jars may have higher min_sdk_version
than the contianing apex, since the runtime respects the values of
min/max_sdk_version; e.g. runtime would not load a boot jar with
higher min_sdk_version. This allows shipping new boot jars via apexes
that target older platforms.

Bug: 190818041
Test: presubmit
Change-Id: I08ec0b4463a17bc8265b948fe09da55eb4e52ac3
Merged-In: I08ec0b4463a17bc8265b948fe09da55eb4e52ac3
(cherry picked from commit 758968a700)
2021-12-09 14:35:32 +00:00
satayev
531330e5ab Perform CheckMinSdkVersion for java_sdk_library.
In a follow up, apex would expect that any module that implements
ModuleWithMinSdkVersionCheck to have performed appropate checks on
min_sdk_version, to allow relaxing some of the existing conditions.

This change moves the responsibility of checking min_sdk_version
of java_sdk_library to java_sdk_library itself.

Bug: 205923322
Test: presubmit
Change-Id: I79b5a1fc34098fff60221e416db6e6e69e01f531
Merged-In: I79b5a1fc34098fff60221e416db6e6e69e01f531
(cherry picked from commit 8f088b09d8)
2021-12-09 14:35:32 +00:00
satayev
477a7baa79 Add MinSdkVersion(ctx) method to ModuleWithMinSdkVersionCheck interface.
Bug: 205923322
Test: presubmit
Change-Id: I469d655823e12a14bc0abaeb544a5dd2a6d3622f
Merged-In: I469d655823e12a14bc0abaeb544a5dd2a6d3622f
(cherry picked from commit ad99149a62)
2021-12-09 14:35:32 +00:00
satayev
cb0977f67e Add ModuleWithMinSdkVersionCheck type.
This is to help following refactor for individual modules to have their
own version of checking where needed.

For example, apk in apex may want to enforce it's own version of
CheckMinSdkVersion.

Bug: 205923322
Test: presubmit
Change-Id: Ia2fad6c52af39e21f65385bcb283f1e3adab5548
Merged-In: Ia2fad6c52af39e21f65385bcb283f1e3adab5548
(cherry picked from commit b3fd411465)
2021-12-09 14:35:32 +00:00
satayev
3f6bbd9d56 Use textproto format for classpaths.proto generation.
Test: presubmit
Change-Id: I3fea94153939f05329f02091ca4fa838ee9df93f
Merged-In: I3fea94153939f05329f02091ca4fa838ee9df93f
(cherry picked from commit 48dae67a76)
2021-12-09 14:35:32 +00:00
satayev
747d1066bd Propagate min and max sdk versions to classpaths.proto configs.
These attributed define a range for dessert releases where the jars
should be active, and included in corresponding CLASSPATH varibles by
derive_classpath.

Bug: 190818041
Test: presubmit
Change-Id: Ieb9aef29657ad0694d48a63019f93faca2678252
Merged-In: Ieb9aef29657ad0694d48a63019f93faca2678252
(cherry picked from commit cca4ab762e)
2021-12-09 14:35:32 +00:00
satayev
e9b63a8ae0 Introduce max_sdk_version device property.
Artifacts that go into apexes should only be active on certain SDK
versions. There is now a need to upper bound the range to support
expressiong statements like "this jar should only run on platforms
30-31".

Bug: 190818041
Test: presubmit
Change-Id: I6985ebb671841cdd9f0f37f916267ac5ed76e4f4
Merged-In: I6985ebb671841cdd9f0f37f916267ac5ed76e4f4
(cherry picked from commit 0a420e771a)
2021-12-09 14:35:32 +00:00
satayev
fba70bc07f Test SdkSpecForm.
Bug: 190818041
Test: presubmit
Change-Id: Ib8cd891f03537712d709ed063dd76dee55221118
Merged-In: Ib8cd891f03537712d709ed063dd76dee55221118
(cherry picked from commit 0ee2f913ef)
2021-12-09 14:35:32 +00:00
Colin Cross
a88b88e2be [automerge] Revert "Time out and dump stacks from R8 processes after 30 minutes" 2p: b18a037fc6
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/16426547

Bug: 207767452
Change-Id: I4148ddbce303a0294385342bc5018b3dc1b260b4
2021-12-09 05:19:49 +00:00
Colin Cross
b18a037fc6 Revert "Time out and dump stacks from R8 processes after 30 minutes"
This reverts commit 29c294b2cf.

The deadlock in R8 was fixed, and the timeout causes problems when
RBE is enabled and the R8 action gets stuck in a queue for 30
minutes.

Bug: 207767452
Test: checkbuild
Change-Id: Ia0c3826aea3288e9db3bdbd4955e1e16c0a38fe3
Merged-In: Ia0c3826aea3288e9db3bdbd4955e1e16c0a38fe3
(cherry picked from commit a832a04db2)
2021-12-08 21:19:10 -08:00
sophiez
2965f45751 Java APIs used by Mainline modules.
Add scripts to generate java APIs used by Mainline modules. This is
aosp/1879177 with fixed build error that caused by dexdeps analyzing
resource only APKs which doesn't contains any .dex files. Now skip the
error generates in that case in gen_java_usedby_apex.sh

Test: TARGET_BUILD_APPS=com.android.adbd m dist apps_only
Change-Id: Id539cbe1b7306ace69c047f95ffc02265a467511
Merged-In: Id539cbe1b7306ace69c047f95ffc02265a467511
2021-12-08 07:35:37 +00:00
Anton Hansson
f8f68e8ffa Merge cherrypicks of [1879682] into sc-mainline-prod.
Make PrebuiltStubsSources support srcjar properly

Initially prebuilt stub sources only supported directories as input, but
support has been added for packaging them up in srcjar as well. However
the build action was not updated accordingly.

Add support to determine if our input is a srcjar, and if so just use
it directly.

Bug: 204978699
Test: m sdk (with prebuilts)
(cherry picked from commit 86758ac94c)

Merged-In: Iedf5bf3444f1bb7249825e76d2aaa65269dd081f
Change-Id: Iedf5bf3444f1bb7249825e76d2aaa65269dd081f
2021-11-05 15:57:13 +00:00
Anton Hansson
fb41d46368 Make PrebuiltStubsSources support srcjar properly
Initially prebuilt stub sources only supported directories as input, but
support has been added for packaging them up in srcjar as well. However
the build action was not updated accordingly.

Add support to determine if our input is a srcjar, and if so just use
it directly.

Bug: 204978699
Test: m sdk (with prebuilts)
Change-Id: I302cd34ebd55414d35c4f936cd563a4af89b22c6
(cherry picked from commit 86758ac94c)
2021-11-05 15:48:45 +00:00
Anton Hansson
3adf3c52eb Add annotations.zip support to java_sdk_library
The annotations zip file is produced by the "main" sdk build and is
primarily consumed by android studio.

In order to support building the main SDK without requiring the sources
of all modules, we are adding module SDK artifacts that allows
reconstructing these outputs. The annotations zip contains XML files
which should be fairly easy to merge from all the individual parts.

Bug: 187397779
Test: unit tests in this CL
Test: m sdkextensions-sdk and inspect output
Merged-In: I955cae720e6f1382936836ee1d8fb11003f51b7d
Change-Id: I955cae720e6f1382936836ee1d8fb11003f51b7d
2021-10-15 15:39:31 +01:00
Paul Duffin
d446d282ed Always perform permitted package check when building a library
Previously, the permitted package check was designed to only be run
when building checkbuild. Although, that appears to now be broken.

This change uses a Validation dependency to ensure that the package
check is performed whenever the output file of a java_library is built
as part of the build. The package check runs in parallel with any other
rules that depend on the file.

Bug: 201753898
Test: - change the permitted_packages property in
        frameworks/base/test-mock so that the package check will fail.
      m out/soong/.intermediates/frameworks/base/test-mock/android.test.mock/android_common/package-check.stamp
      - as expected the package check failed.
      m droid
      - as expected the package check did not fail.
      # Made these changes then:
      m droid
      - as expected the package check now failed.
Merged-In: Id38fe280c79e5505ee4555b845c6da2ae6747bc4
Change-Id: Id38fe280c79e5505ee4555b845c6da2ae6747bc4
(cherry picked from commit 08a18bf74a)
2021-10-05 10:01:56 +01:00
Jerome Gaillard
0fa984e5d6 Fix script for package check to work on macOS
The behaviour of shell parameter expansion on linux and macOS is
different:
- on linux "\/" in the replaced string is interpreted as simply "/"
- on macOS it is interpreted as the full string "\/"
For example, "android.package.example" would be changed to:
- "android/package/example" on linux
- "android\/package\/example" on macOS

The character / is not a special character for pattern matching in bash,
so it doesn't need to be escaped. Hence using / instead of \/ in the
replaced string works on both linux and macOS.

Test: in sdk_mac continuous build.
Merged-In: Id6a5cf32afc53d5ffd989c0ac8aa0b9e0fcbaf82
Change-Id: Id6a5cf32afc53d5ffd989c0ac8aa0b9e0fcbaf82
Fixes: 201947033
(cherry picked from commit 03c64c87a4)
2021-10-05 10:01:08 +01:00
Anton Hansson
b727c1e0ba Add back the api_srcs argument
This arg provides the ability to pass sources to the metalava
invocations that are part of a java_sdk_library without affecting
the runtime library.

This is useful in various scenarios, e.g.: when javadoc in some source
files affects the metalava behavior. For example, the javadoc-generation
javadoc tags @paramDoc, @returnDoc etc. Passing these as a library does
not work because class files do not contain javadoc.

Bug: 186197911
Test: manually inspect module stub src for doc enhancements
Change-Id: I2ce98f891283514e1896c52d9335550c1f5435fb
2021-09-17 14:21:24 +01:00
Kousik Kumar
bc59b3091e Merge "Revert "Revert "Load env variables before c.config()""" into rvc-dev am: 9ecad7478f am: ecd9666a57 am: 2bdd2b278e
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/15778291

Change-Id: I5fcaf5c206fda035d1b7934730b03dd08d1ec048
2021-09-09 21:20:06 +00:00
Kousik Kumar
48d9fb62a6 Merge "Revert "Revert "Load env variables before c.config()""" into rvc-dev am: 9ecad7478f am: dd28ec5116 am: ea62b3d743
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/15778291

Change-Id: Idcf4325f0c3235961f15944fef3bbfcde9b255ec
2021-09-09 21:19:55 +00:00
Kousik Kumar
2bdd2b278e Merge "Revert "Revert "Load env variables before c.config()""" into rvc-dev am: 9ecad7478f am: ecd9666a57
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/15778291

Change-Id: I7ebf5bccaf33afa666eb593e3abffaad818e61a3
2021-09-09 21:06:56 +00:00
Kousik Kumar
ea62b3d743 Merge "Revert "Revert "Load env variables before c.config()""" into rvc-dev am: 9ecad7478f am: dd28ec5116
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/15778291

Change-Id: I67da3dc3c8c11d25ebc59ab01681029e5682f072
2021-09-09 21:01:43 +00:00
Kousik Kumar
ecd9666a57 Merge "Revert "Revert "Load env variables before c.config()""" into rvc-dev am: 9ecad7478f
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/15778291

Change-Id: I16a1ac3a5fac8be17ff4ef923422797cd4dff026
2021-09-09 20:44:48 +00:00