Commit Graph

8031 Commits

Author SHA1 Message Date
Treehugger Robot
535f739153 Merge "Disable prebuilt apps without an apk later" into main 2024-01-16 18:25:30 +00:00
Treehugger Robot
ce8d254149 Merge "Implicitly bump up Java target to 1.8" into main 2024-01-16 18:09:41 +00:00
Sorin Basca
d567a514ee Implicitly bump up Java target to 1.8
Bug: 320294595
Test: m
Change-Id: I693e564c67d17254d68f3a9c16664c1da93b9488
2024-01-15 16:38:46 +00:00
David Srbecky
3150c8fee1 Merge "Revert^7 "Enable dex container (DEX v41) for the whole system"" into main am: cf33b025d9 am: 3f4aab9266 am: 1c5557d198
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2898928

Change-Id: I8a02e14be924a2927e48fc0ea3251f9ae60c25be
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-15 12:53:47 +00:00
David Srbecky
cf33b025d9 Merge "Revert^7 "Enable dex container (DEX v41) for the whole system"" into main 2024-01-15 11:10:45 +00:00
Yanning Jia
43668c6f13 Revert^7 "Enable dex container (DEX v41) for the whole system"
This reverts commit 7022550d0e.

Reason for revert: Breaks app's DRM

Bug: 317744117
Change-Id: I539e6ec037db1c297fe7cf85d294bebe963ab214
2024-01-15 11:09:32 +00:00
Jihoon Kang
0b5da4eb6f Merge changes from topic "hiddenapi_exportable" into main am: 7e9343b889 am: cf38079804 am: 5aea28265a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2897486

Change-Id: Iac2820fecdb0bb91040879461dd8a4de012c3ade
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-13 03:27:25 +00:00
Jihoon Kang
4243511709 Enable hiddenapi check for exportable stubs am: bd093457e2 am: c32db5a7ad am: e1678131d3
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2889892

Change-Id: Idb07d662b8e37dcd0138f4e7d086ef2eefb9d23b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-13 03:27:21 +00:00
Jihoon Kang
5bfd7373a1 Add defaults support for bootclasspath_fragment module type am: 9272dccb1e am: 9604b5571f am: 34d7b23631
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2906878

Change-Id: I1c133dfefc6743decef09ebba754636b9ce2cc39
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-13 03:27:13 +00:00
Jihoon Kang
c32db5a7ad Enable hiddenapi check for exportable stubs am: bd093457e2
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2889892

Change-Id: If6c32bbf60f9105164e145ee186247de779c26eb
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-13 01:33:10 +00:00
Jihoon Kang
9604b5571f Add defaults support for bootclasspath_fragment module type am: 9272dccb1e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2906878

Change-Id: Ia17f45a63c30986af63fe18b39ba62cae6ee1247
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-13 01:33:08 +00:00
Cole Faust
97494b197e Disable prebuilt apps without an apk later
Currently, android_app_import modules get disabled during their load
hook if they don't have a set `apk` property. This causes them to be
disabled before soong config variables can be applied, which would've
set the apk property.

Move the disabling into a DefaultableHook, which will run after the
soong config variables.

Bug: 319897584
Test: m nothing --no-skip-soong-tests
Change-Id: Ia0f6a39c35b3b11249bfa74ad532858189be24b1
2024-01-12 17:02:58 -08:00
Jihoon Kang
7e9343b889 Merge changes from topic "hiddenapi_exportable" into main
* changes:
  Copy exportable artifacts to module sdk snapshot
  Enable hiddenapi check for exportable stubs
  Add defaults support for bootclasspath_fragment module type
2024-01-12 23:50:37 +00:00
Jihoon Kang
f55a5f7b37 Copy exportable artifacts to module sdk snapshot
This change modifies the copy rules of the sdk_library when generating
the module sdk snapshots so that the exportable artifacts (annotations
zip, api file, removed api file, srcjar file) are copied instead of the
everything artifacts.

In order to satisfy the prebuilts compatibility, this feature is flag
guarded by the build flag "RELEASE_HIDDEN_API_EXPORTABLE_STUBS"

Test: m --no-skip-soong-tests
Bug: 315027929
Change-Id: I8bf5bb1f196aa9b5db78ba4677caa5f4337e3021
2024-01-12 01:50:19 +00:00
Jihoon Kang
bd093457e2 Enable hiddenapi check for exportable stubs
This change modifies the dependencies of the hiddenapi to always depend
on the exportable stubs, instead of the currently utilized everything
stubs.

To support this, the full api surface exportable stubs are defined in a
separate change at the `frameworks/base` project. Note that the full api
surface exportable stubs are only used for the hiddenapi purpose, and
`sdk_version` continues to utilize the currently existing everything
stubs.

Currently, this feature is hidden behind the build flag
"RELEASE_HIDDEN_API_EXPORTABLE_STUBS". This feature will be fully
enabled once metalava fully supports handling of the flagged apis.

Test: ENABLE_HIDDENAPI_FLAGS=true m
Bug: 317426356
Change-Id: I109b7cd27b20ceffcdf1766ab8106b0c276be2b3
2024-01-12 01:03:10 +00:00
Jihoon Kang
9272dccb1e Add defaults support for bootclasspath_fragment module type
This change transforms the bootclsspath_fragment module into a
defaultable module, in order to modify the "art-bootclasspath-fragment"
module definition based on the build flag in
https://r.android.com/2897389

Test: m nothing
Bug: 315027929
Change-Id: I01ba7b15e4fcdea9bd31c369110a3c9ee38bc9f6
2024-01-12 01:02:45 +00:00
LaMont Jones
ed89443a0f Merge changes Iaf6d45a4,Ic56e8ef3,I11f0a0b5 into main am: 15b031e10e am: 0f2753094a am: 82cf614b7e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2901516

Change-Id: Iafb7bcff23771b8342fc9adb99f679645f83b83c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-10 21:14:15 +00:00
Dennis Shen
cdb407e795 Merge "Enforce one aconfig_declaration per aconfig package" into main am: 2127887e32 am: 31a87f5977 am: 8c0e06052d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2901767

Change-Id: Ib99cde6b13bf0f64910cf693aa6cb315fc546be4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-10 14:39:50 +00:00
LaMont Jones
afe7baf47d Propagate aconfig providers for more modules.
Bug: 308625757
Test: manual
Change-Id: Iaf6d45a4259f1c6c34476c34c431344283ae2830
2024-01-10 14:03:30 +00:00
LaMont Jones
acae2d7656 move SetAconfigFileMkEntries to android
This will need to be called by some modules handled in android.

Bug: 308625757
Test: manual
Change-Id: Ic56e8ef3a453c59866aab6d39a21108cf8536b56
2024-01-10 14:03:29 +00:00
Dennis Shen
2127887e32 Merge "Enforce one aconfig_declaration per aconfig package" into main 2024-01-10 12:46:06 +00:00
Treehugger Robot
e97a38947f Merge "Update released flagged apis rule" into main am: d06bdb0310 am: 690b099a4c am: 1744b8d43a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2901995

Change-Id: I199da491a72ab2a8ee4484c372b98ee582aa02d3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-10 03:56:03 +00:00
Treehugger Robot
6fa5af612e Merge "Replace panic with ModuleErrorf" into main am: ec3887ad2f am: db7220eb70 am: 1ef21535e7
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2901513

Change-Id: I3e894707ca4a3866046de2f53d7c8c1ebd59477b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-10 02:17:46 +00:00
Treehugger Robot
d06bdb0310 Merge "Update released flagged apis rule" into main 2024-01-10 02:00:54 +00:00
Dennis Shen
4e7773d81e Enforce one aconfig_declaration per aconfig package
Bug: b/319121098
Change-Id: Ibe3f1587ed7754f00f464cf385ce51ee9a142412
2024-01-10 01:53:49 +00:00
Jihoon Kang
125b0a7639 Update released flagged apis rule
The aconfig command has been recently updated to fully specify the
output format instead of passing the keyword format (e.g., bool). This
change reflects the change in the aconfig tool.

Test: m art.module.public.api && inspect the generate released-flagged-apis-exportable.txt output
Change-Id: I620b7f34c346288ca87342448f50a0e90813304f
2024-01-10 00:59:12 +00:00
Treehugger Robot
ec3887ad2f Merge "Replace panic with ModuleErrorf" into main 2024-01-10 00:16:52 +00:00
Spandan Das
59a4a2b8d2 Replace panic with ModuleErrorf
This is a followup cleanup for aosp/2876754 and replaces panic with
ctx.ModuleErrorf. The latter creates a more expressive build error.

Implementation details
- export moduleErrorf interface from build/soong/android. This minimal
  interface will be used as a parameter for `DexJarBuildPath`
- Add ModuleErrorf to the function signature of DexJarBuildPath. This
  parameter only gets used for Import and SdkLibraryImport structs.
  These two can have duplicate deapexer definitions, and ModuleErrorf
  will be used to report that error
- Create a minimal implementation of `ModuleErrorf` in tests of java and
  apex

Test: m nothing --no-skip-soong-tests
Change-Id: I0febec651f40c3f04deb957e64133c94b80fbd78
2024-01-09 22:53:52 +00:00
Treehugger Robot
89274cc495 Merge "Fix the static rule for generating the revert annotations" into main am: 8f17189ced am: ea51ab0e78 am: f2a891cfb2
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2901993

Change-Id: I9cd78c67203196cb8a121c067e46246ccc96701a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-09 22:16:15 +00:00
Jihoon Kang
150d87fce0 Fix the static rule for generating the revert annotations
While the static rule depends on the keep-flagged-apis binary, the
command deps was mistakenly not specified. This change fixes the rule.

Test: m
Change-Id: I4875ac516e0e03389eb6a09d720c94f28710fbc9
2024-01-09 19:23:36 +00:00
Jihoon Kang
ba264d8285 Merge "Generate "exportable" stubs library in java_sdk_library" into main am: 539b46b6bd am: 3d1d1d4e39 am: 8a85649b99
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2883427

Change-Id: I5b6f7d5232f7d233d8c8db2fd9b03656d51c5f63
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-09 08:06:49 +00:00
Jihoon Kang
3247e442b3 Merge "Enable droidstubs to export "exportable" artifacts" into main am: 0d2afbbfc0 am: 6530b21ec5 am: 746573a8dd
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2890315

Change-Id: If9fb92eab12bc4b2021fcb569a8d1d12af2aba6e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-09 08:06:38 +00:00
Jihoon Kang
0aab39830d Merge "Generate "exportable" stubs in droidstubs" into main am: 9d800859f4 am: 45741e98db am: e30605bd45
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2884166

Change-Id: Ib328f5dd01c010001ceb5f723de5a7a5cbd8039d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-09 08:06:21 +00:00
Jihoon Kang
539b46b6bd Merge "Generate "exportable" stubs library in java_sdk_library" into main 2024-01-09 06:02:12 +00:00
Jihoon Kang
0d2afbbfc0 Merge "Enable droidstubs to export "exportable" artifacts" into main 2024-01-09 06:01:51 +00:00
Jihoon Kang
9d800859f4 Merge "Generate "exportable" stubs in droidstubs" into main 2024-01-09 06:01:34 +00:00
Jihoon Kang
0ccc3c5b03 Merge "Add aconfig_declarations property to droidstubs and java_sdk_library" into main am: 0f5162161d am: 788241f5ac am: a3864d2d7b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2881153

Change-Id: Icc2bcb2c392b49743142c775318a358b666af4c8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-09 01:32:19 +00:00
Jihoon Kang
0f5162161d Merge "Add aconfig_declarations property to droidstubs and java_sdk_library" into main 2024-01-08 23:52:27 +00:00
Jihoon Kang
fa4a90d434 Generate "exportable" stubs library in java_sdk_library
Given that now the droidstubs module generates the "exportable" stubs,
this change modifies java_sdk_library to generate the java_library
modules that compiles the "exportable" stubs per api scope.
The detailed naming scheme of the generated modules are available in the
bug linked in the footer.

Similar to the from-text java_api_library vs from-source java_library
static lib selection for the "everything" stubs, the "exportable" stubs
module can also toggle between the stubs java_api_library and the
java_library module. However, given that the "exportable" stubs
generation has not been implemented for from-text stubs, the module
always default to depend on the from-source "exportable" stubs compiling
java_library module.

Test: go test ./java
Bug: 315495926
Change-Id: I5798312c1338c55625b2030da728b056385171a4
2024-01-08 09:20:48 +00:00
Jihoon Kang
78f8914fed Enable droidstubs to export "exportable" artifacts
This change adds support for the droidstubs module to export the
"exportable" artifacts via OutputFiles(tag string) method, while
supporting the current behavior of exporting "everything" artifacts via
a tag. With the support, a rdep module can depend on the "exportable"
(and "runtime" in the long run) artifacts by prepending the stubs type
in the tag. For instance, given that the currently supported tag
{.annotations.zip} exports the everything annotations.zip file,
{.exportable.annotations.zip} tag will export the exportable
annotations.zip file. For an unsupported combination (e.g. all runtime
stubs related artifacts as of now), an error will be thrown.

Test: m nothing --no-skip-soong-tests
Bug: 315490657
Change-Id: Idcefd9cdc02d323306fb8d7be2a2b34f67501f56
2024-01-08 09:20:13 +00:00
Jihoon Kang
3c89f04777 Generate "exportable" stubs in droidstubs
This change generates rules for "exportable" stubs in the droidstubs
module.

Given that there are a lot of overlap between the currently existing
"everything" stubs rule and the newly introducing "exportable" stubs
rule, the currently existing metalava rule commands are modularized to
be utilized in the "exportable" stubs rule commands.

The currently existing build actions are modularized in the followings:
- commonMetalavaStubCmd(...): metalava commands that are required for
  generation of both "everything", "exportable", and potentially
  "runtime" stubs
- everythingOptionalCmd(...): metalava commands that are dependent on
  "everything" stubs and not dependent on flagged apis annotations, such
  as api lint, released api check

Based on this modularization, the "everything" stubs are now generated
in everythingStubCmd(...), which calls commonMetalavaStubCmd(...) and
everythingOptionalCmd(...).
Similarly, the "exportable" stubs are generated in
optionalStubCmd(stubsType=Exportable, ...), which calls
commonMetalavaStubCmd(...) and appends additional flags. Runtime stubs
can be generated similarly in the future with
optionalStubCmd(stubsType=Runtime, ...).

"everything"-related artifacts will now  be created in
`everything/` subdirectory, and "exportable"-related artifacts will be
created in `exportable/` subdirectory. For example, the outdir of a
droidstubs module "foo" would look like below:
```
foo
  |-- everything
  | |-- foo_api.txt
  | |-- foo-stubs.srcjar
  |
  |-- exportable
    |-- foo_api.txt
    |-- foo-stubs.srcjar
```

The module generates the build rules for the "exportable" stubs
regardless of whether the module defines the `aconfig_declarations`
property or not. All APIs marked with `@FlaggedApis` annotations are
stripped out for the "exportable" stubs when the `aconfig_declarations`
property is not defined. On the other hand, only the `@FlaggedApis` that
are specified in the aconfig_declarations module and are enabled will be
included (and all others are stripped) when the `aconfig_declarations`
propety is defined.

Test: go test ./java && BUILD_FROM_SOURCE_STUBS=true m
Bug: 315490657
Change-Id: I300273cd2a62fa978b046c0268e3a67c35e22b08
2024-01-08 07:56:07 +00:00
Jihoon Kang
6592e87dbf Add aconfig_declarations property to droidstubs and java_sdk_library
In consideration of the incremental build performance, this change let
droidstubs and java_sdk_library (which generates droidstubs per api
scope) modules to specify `aconfig_declaration` modules where the
dependent flags are defined in via the "aconfig_declarations" property,
opposed to passing uniform "all_aconfig_declaration"-generated flag
arguments to metalava.

When "aconfig_declarations" property is defined for java_sdk_library
modules, the property is passed to the generated droidstubs modules.

When "aconfig_declarations" property is defined for droidstubs modules,
the all aconfig_declaration modules listed in the property are listed as
deps, all cache protobuf files are gathered and metalava-consumable
flags are generated in "revert-annotations.txt".

Although this change introduces scalable implementation to easily
support generation of the "runtime" stubs corresponding flags, actual
support of the runtime flags/stubs will be done in future changes. This
change mostly focuses on the generation of the "exportable" flags.

Utilization of the generated "exportable" flags will be done in future
changes.

Test: go test ./java
Bug: 315485740
Change-Id: I37becd1b9dd9069d7ac4abed130906df30b3fdf4
2024-01-08 07:55:49 +00:00
Jiyong Park
18fcc89571 Revert "Revert "Limit System SDK to 34 for Java modules in the v..." am: 7416d67f28 am: abdc2a962b am: c4d518459b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2897683

Change-Id: I4575cb0fb74de6cc17c1fef33ac644f1aa78ffdf
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-06 18:53:05 +00:00
Jiyong Park
abdc2a962b Revert "Revert "Limit System SDK to 34 for Java modules in the v..." am: 7416d67f28
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2897683

Change-Id: Ib01190e49e9ac9d86fbfd542a8362fdb5be2f499
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-06 18:02:11 +00:00
Treehugger Robot
208444ce5d Merge changes from topics "revert-2897484-revert-2897682-dont_limit_systemsdk-JCOOOXGAIF-BSJGJAJAWC", "revert-2897568-revert-2894701-limit_systemsdk-WNEMOTGMRS-ROJNXPXKUV" into main
* changes:
  Revert^2 "Add BUILD_BROKEN_DONT_CHECK_SYSTEMSDK"
  Revert "Revert "Limit System SDK to 34 for Java modules in the v..."
2024-01-06 17:53:41 +00:00
Colin Cross
b4de45f8f4 Add per-module phony targets for lint checks am: b9176417eb am: 158a988779 am: 912eabc92b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2898793

Change-Id: I03e442fdc1d8f676e010830103bea4fbf2f4e451
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-06 00:28:17 +00:00
Colin Cross
b9176417eb Add per-module phony targets for lint checks
Simplify running lint on a module by adding a per-module phony target,
e.g. Gallery2-lint.

Bug: 216462289
Test: m Gallery2-lint
Change-Id: I9d4ab362bb116d49f00fc3f79d61d7239528d575
2024-01-05 21:09:20 +00:00
Colin Cross
40db91ff2e Merge "Translate --custom-package aapt2 flag for ResourceProcessorBusyBox" into main am: cf132236e7 am: 596302d0db am: 6a71422822
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2896210

Change-Id: I161f63e529f3a6b7b0c4f81ab5fc99530fa62990
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-05 19:53:45 +00:00
Colin Cross
cf132236e7 Merge "Translate --custom-package aapt2 flag for ResourceProcessorBusyBox" into main 2024-01-05 18:10:47 +00:00
Kiyoung Kim
7a1e22b9fe Merge "Generate image variation without version" into main am: 6284e0a935 am: b562b4a727 am: a073285ee6
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2894623

Change-Id: Idf03fc8ac2d339814abd8f2cd2b17c5e1137a826
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-05 06:48:47 +00:00