Commit graph

7125 commits

Author SHA1 Message Date
Inseob Kim
34dc4cd738 Add support for auto-generated characteristics RRO
Setting Generate_product_characteristics_rro will automatically generate
an RRO package which contains resources with
'product="{PRODUCT_CHARACTERISTICS}"'. The RRO package will be installed
to /product partition. The app will be compiled with '--product
default', making the app identical to all targets.

Motivation for this change is to minimize divergence of system.img.

Bug: 294799593
Test: boot and idmap2 dump
Change-Id: I1371f7410a1ecf337e1f73214b024af39aa6d57a
2023-11-17 11:15:32 +09:00
Alyssa Ketpreechasawat
378c7a3953 Merge "Skip unknown check in bootclasspath_fragment (source version) if prebuilt version is in use." into main 2023-11-14 19:13:32 +00:00
Treehugger Robot
34778a9301 Merge "Change OnlyPreoptBootImageAndSystemServer to OnlyPreoptArtBootImage." into main 2023-11-10 18:47:19 +00:00
Jiakai Zhang
2398442ec0 Change OnlyPreoptBootImageAndSystemServer to OnlyPreoptArtBootImage.
OnlyPreoptBootImageAndSystemServer was for making the eng build faster.
This change makes it even faster.

Bug: 309011617
Test: Presubmit
Change-Id: If9001e99593b57deafa7b56f0ca6b3d4d80f56d3
2023-11-09 16:50:58 +00:00
Alyssa Ketpreechasawat
a0cf0a4a66 Skip unknown check in bootclasspath_fragment (source version) if prebuilt version is in use.
Following aosp/2822531, when MediaProvider prebuilt is enabled, framework-pdf (new jar) will be removed from PRODUCT_APEX_BOOT_JARS. Subsequently there will be an error around the inconsistency (unknown) between bootclasspath_fragment (source version of MP with framework-pdf in its content) and PRODUCT_APEX_BOOT_JARS (framework-pdf removed). Since the source version of bootclasspath_fragment is not in use, we should ignore this check. See more detail in go/stale-mainline-prebuilts (issue from changes in framework/service jars in existing apexes).

Bug: 304719212
Test: lunch cf_x86_phone-next-userdebug & m
Test: lunch cf_x86_phone-trunk-userdebug & m
Change-Id: I0f62277a9e65522bf5a4ea1ae33c166f996c37d5
2023-11-09 12:54:09 +00:00
Spandan Das
fc12d2f494 Special-case java_sdk_library in source vs prebuilt selection
If a java_sdk_library is listed in `contents`, then restrict the source
vs prebuilt selection superseding to only the internal stub libraries.

Defer the source vs prebuilt selection mechanism of the top-level
library to the existing mechanisms for now. This is necessary because
this top-level library acts as a hook for
- hiddenapi: boot jars are deapxed from the prebuilt apex
- dexpreopt: system server jars are deapexed from the prebuilt apex and
  installed via required

If `next` uses `framework-foo` and `service-foo` as the top-level
library instead of the prebuilt equivalents, then the bootjars installed
in out/soong/dexpreopt_x86_64/apex_bootjars will come from source. And
the *.odex files of the system server jars will come from source.

Bug: 308174768
Test: Added a java_sdk_library unit test to assert that the new
mechanism supersedes the `prefer` flag

Change-Id: Ib43198a3b547c58b54f1f0966e95584215096d32
2023-11-08 18:37:24 +00:00
Jiakai Zhang
04445d5443 Merge "Use the correct mainline BCP jars for app dexpreopt." into main 2023-11-08 10:56:58 +00:00
Anton Hansson
d69b5ff1b2 Merge "Stop suppressing the ChangedDefault error" into main 2023-11-08 10:23:42 +00:00
Anton Hansson
59ef1ec1f5 Stop suppressing the ChangedDefault error
This will prevent future breakages of this kind, so reenable the check.

Bug: 223382732
Test: m checkapi
Change-Id: I5e67ed45e3a78b90de6884a0d7b0b1c91d58b6f5
2023-11-07 15:44:14 +00:00
Anton Hansson
fd1c0d2eaa Add a new flag to stop disabling lint errors
java_sdk_library has historically suppressed a few legitimate lint
errors. Make it possible to remove these suppressions via a flag.

Bug: 306806877
Test: checkapi
Merged-In: I10577dacbd7ea8063c6e1e02f3b6c60a2bee5094
Change-Id: I10577dacbd7ea8063c6e1e02f3b6c60a2bee5094
2023-11-07 10:14:50 +00:00
Jiakai Zhang
c6879f3ddd Use the correct mainline BCP jars for app dexpreopt.
Before this change, the build system had special logic to find mainline
BCP jars and copy them to a special location for app dexpreopt. This
logic doesn't work on `next`. In fact, we don't need this logic anymore.
Since we are now generating the mainline boot image extension, we can
reference the inputs of the mainline boot image extension, which are
exactly the mainline BCP jars needed for app dexpreopt.

Bug: 309302263
Test: atest art_standalone_dexpreopt_tests (on next)
Test: m --no-skip-soong-tests nothing

Change-Id: I055018ffbc5d7e5678f305e65a7f1c7e73bf3b99
2023-11-06 18:44:52 +00:00
Alyssa Ketpreechasawat
98e555c842 Merge "Disable verify_overlaps test instead of hiddenapi check." into main 2023-11-06 10:53:31 +00:00
Alyssa Ketpreechasawat
7daf2786b6 Disable verify_overlaps test instead of hiddenapi check.
Disabling hiddenapi check entirely can be dangerous and it might change the
accessibility of @hide Api too. We should only disable verify_overlaps
test which is required for module_sdk and apexes mismatch.

Test: atest CtsInlineMockingTestCases
Bug: 308187068
Bug: 307480026
Change-Id: I44f48e85d802b3a8f2711bc2047bdab721369f08
2023-11-06 09:49:16 +00:00
Michael Stokes
2e09e68e56 Merge "Revert "Use R8 for resource shrinking"" into main 2023-11-03 12:12:40 +00:00
Treehugger Robot
0978d6a4b1 Merge "Update checkapi error message to provide more guidance" into main 2023-11-03 11:13:02 +00:00
Rico Wind
a9fd59a7f2 Revert "Use R8 for resource shrinking"
Revert submission 2816534-r8resourceshrinking

Reason for revert: b/309075997

Reverted changes: /q/submissionid:2816534-r8resourceshrinking

Change-Id: Ic173491eaf22967fbad14fbcc85f6ddb2cf54d23
2023-11-03 10:26:38 +00:00
Rico Wind
4ea88503e4 Merge "Use R8 for resource shrinking" into main 2023-11-03 07:29:45 +00:00
Spandan Das
3e75cfa795 Remove retrieveLegacyEncodedBootDexFiles
Seems to be an unused function

Test: TH
Change-Id: Ic0b352afc16ccaf450dadb5b13d9fb6c694e72e6
2023-11-03 00:46:29 +00:00
Jihoon Kang
3ea6467c1c Update checkapi error message to provide more guidance
With from-text stub feature, checkapi is also used for checking the
sanity of the stubs. Therefore, this change adds more explanatory
message about how the user can rebuild the target when their build
failed with stub validation after local API change.

Test: m nothing
Bug: 309027703
Change-Id: If7c9c287266f3da82edde663619b9f08ee05530d
2023-11-03 00:40:26 +00:00
Rico Wind
b56fe2825d Use R8 for resource shrinking
We are moving the resource shinking pipeline into r8 (gennerally, not just for platform)

This disables the usage of the resource shrinker cli from cmd-line tools

Bug: 308710394

Test: Existing, validated that resource table on SystemUI was byte<>byte equal.
Change-Id: Ia36b5e5970cbdcff519a5f05d672b44dc145ea32
2023-11-02 20:35:20 +01:00
Colin Cross
f96b001064 Don't call android.PathForModuleSrc(ctx).String() to get ModuleDir
ctx.ModuleDir is much cheaper than android.PathForModuleSrc(ctx).String().

Test: builds
Change-Id: I81819088d9564b06a0336a59a45f2b110b0bd9d6
2023-11-02 19:07:49 +00:00
Jihoon Kang
412dc7c488 Merge changes from topic "core-lambda-stubs-source" into main
* changes:
  Remove TxtStubLibraries.bp
  Move core.module_lib.stubs.from-text closer to source
2023-11-02 17:08:11 +00:00
Colin Cross
f2c51919ad Merge "Remove obsolete java version environment variables" into main 2023-11-02 17:05:06 +00:00
Treehugger Robot
a741e88489 Merge "Remove sdkPreSingleton and overlaySingleton" into main 2023-11-02 03:43:15 +00:00
Jihoon Kang
6416a71211 Remove TxtStubLibraries.bp
The modules defined in TxtStubLibraries.bp are currently not in the
critical path of the from-text stub build, because the from-text vs
from-source switching is encapsulated within the stub library modules.
Therefore, remove the modules altogether.

Test: m nothing --build-from-text-stub
Bug: 287522618
Change-Id: I249edcdf596c8a82058e1bfb17da863c2b5dd7a7
2023-11-02 01:02:40 +00:00
Jihoon Kang
bfa2f9ec69 Move core.module_lib.stubs.from-text closer to source
This change moves the core.module_lib.stubs.from-text closer to its
from-source equivalents and its top level module core/module_lib.stubs.

Test: m nothing --build-from-text-stub
Bug: 287522618
Change-Id: Ida6dd613834b36490b1ad79773b9404b1d0d9efc
2023-11-02 01:02:28 +00:00
Treehugger Robot
9ae2999dab Merge changes I7bc4d8d4,I8158c0b9 into main
* changes:
  Use merge_zips instead of ziptime for resetting timestamps in jacoco outputs
  Always reset timestamps in merge_zips
2023-11-01 23:38:29 +00:00
Cole Faust
9bef67488d Remove sdkPreSingleton and overlaySingleton
These were the only 2 pre-singletons in soong. sdkPreSingleton is
totally unused. overlaySingleton can be done during
GenerateAndroidBuildActions instead.

Test: m nothing --no-skip-soong-tests
Change-Id: Ieb5ab92f18cb56be4049c0842f61df8aa02dc52c
2023-11-01 15:29:09 -07:00
Colin Cross
c8c2cee06a Use merge_zips instead of ziptime for resetting timestamps in jacoco outputs
ziptime doesn't support ZIP64 so it is limited to 65535 entries in
a zip file.  Use the newly added support in merge_zips to reset the
timestamp instead.

Bug: 308765940
Test: builds
Change-Id: I7bc4d8d4943e7417af1783a63ac5b5904d2aa751
2023-11-01 14:41:48 -07:00
Colin Cross
f059b2f2fc Remove obsolete java version environment variables
jdk9 and jdk11 are no longer used, remove ANDROID_JAVA9_HOME and
ANDROID_JAVA11_HOME.

Bug: 221270882
Test: treehugger
Change-Id: Iad566bff21055c5e2acd62642ccd579507e21fef
2023-11-01 20:58:30 +00:00
Spandan Das
eb852927d4 Merge "Add the name of the sdk library to dynamically generated java modules" into main 2023-11-01 17:31:58 +00:00
Sam Delmerico
d9569528bd Merge "transitive r8 flags for installable {android,java}_libraries" into main 2023-11-01 15:29:11 +00:00
Spandan Das
2cc80ba145 Add the name of the sdk library to dynamically generated java modules
The name of the sdk library will be used in source vs prebuilt
selection. For soong modules that are not dynamically created from a
java_sdk_library, the value will be nil.

Bug: 308174768
Test: TH
Change-Id: Ic7e9889f00c6184992b663a7124967bb0794d475
2023-10-31 20:57:56 +00:00
Sam Delmerico
c8e040c70f transitive r8 flags for installable {android,java}_libraries
Only android_apps were actually applying transitive proguard flags files
to their r8 invocation. This CL ensures that this also occurs for
installable android_libraries and java_libraries.

Bug: 302342049
Test: go test ./java
Change-Id: Ie94d688d04367ee3d39e7e760fb3003df5829951
2023-10-31 18:59:04 +00:00
Alix Espino
a9ead6ef2b Merge "add manifest_values application id property to soong" into main 2023-10-31 14:17:53 +00:00
Jared Duke
efb6d60210 Update transitive lib propagation
Only propagate transitive libs by way of library-like references. This
avoids inclusion of transitive deps from tools like lint modules that
are unncessary for R8.

This yields build speedups for a number of targets, including:
 * services.jar:            -22% (66s -> 51s)
 * telephony-common.jar:    -27% (29s -> 21s)
 * updatable-media.jar:     -41% (17s -> 10s)
 * framework-appsearch.jar: -46% (13s ->  7s)

Bug: 302383328
Bug: 307273642
Test: m
Change-Id: I60bb30e84dabe522ea9ac9333f00e739962ea91d
2023-10-27 22:48:13 +00:00
Anton Hansson
8e586ab8b3 Merge "Remove UnavailableSymbol from warnings to disable" into main 2023-10-27 07:36:35 +00:00
Anton Hansson
f9a2bc0e4b Remove HiddenTypeParameter from warnings to disable
Bug: 306806877
Test: m checkapi
Change-Id: I68036ad7fc24cda8673379a218ecbb26aa48ad8f
2023-10-26 15:13:26 +00:00
Anton Hansson
70f74de4cb Remove UnavailableSymbol from warnings to disable
Bug: 306806877
Test: m checkapi
Change-Id: If8ad3cf37d84ec30c886a0e6d094ea451c4c3d75
2023-10-26 14:35:39 +00:00
Mythri Alle
4b9f618a76 Don't minimize debug information if module explicitly asks for it
In some configurations (for ex: go, auto) we minimize debug information
to reduce disk and memory usage. However some tests need the debug
information to work as expected. If a test explicitly requests for debug
information by passing "-g" to javac flags don't add "-g:source,lines"
to minimize debug information. Javac gives priority to -g:source,lines
and doesn't respect the order. So check if there is a -g flag before
adding flags to minimize debug information.

Test: atest CtsJvmtiRunTest1912HostTestCases android.jvmti.cts.JvmtiHostTest1912#testJvmti
Change-Id: I45e0f5fa9e79c16c2ff6e9413941a9a637753653
2023-10-25 16:50:41 +00:00
Anton Hansson
05eabd9c4d Merge "Created empty framework-location non-updatable module" into main 2023-10-24 12:43:36 +00:00
Anton Hansson
af1c929943 Merge "SdkTestCore for non-updatable modules" into main 2023-10-24 10:06:54 +00:00
Alix
96ea8845c5 add manifest_values application id property to soong
Bug:278905106
Test: go test ./java --run TestManifestValuesApplicationIdSetsPackageName
	and locally built a module and checked manifest pacakge_name
Change-Id: I5c8fd27c177b9e255dce197706f62580894008cb
2023-10-23 18:26:53 +00:00
Alan Viverette
ec26327735 Handle Android.bp files in subdirectories of androidx
Bug: 304263344
Test: m droid
Change-Id: I473d017ed3169137cc234f7fbd5f01d5ad889cb2
2023-10-23 13:25:13 -04:00
Mark White
9421c4ceb9 SdkTestCore for non-updatable modules
Provides SdkTestCore/test_core_current sdk_version for non-updatable
modules that have their test scope dependent on test apis from
framework-minus-apex.

Ignore-AOSP-First: Change in topic with internal-first projects
Bug: 289776578
Test: m checkapi | go test ./java

Merged-In: Iba3213e8c34ea75ac9dd8532a95ef62fb5455e6c
Change-Id: Iba3213e8c34ea75ac9dd8532a95ef62fb5455e6c
2023-10-23 15:25:55 +00:00
Anas Sulaiman
f76b3267d5 Merge "support toggling compare mode for rbe actions" into main 2023-10-20 14:41:18 +00:00
Jihoon Kang
04803d4767 Merge "Disable from-text stub build for coverage build" into main 2023-10-19 19:22:33 +00:00
Cole Faust
14c1ed8d7d Merge "gofmt soong" into main 2023-10-19 03:48:45 +00:00
Cole Faust
06ea531ab3 gofmt soong
Test: Presubmits
Change-Id: Ia76c35ba51685eca29df51738000eacd3f43ce20
2023-10-18 17:42:59 -07:00
Treehugger Robot
8e592ad109 Merge changes from topic "revert-2786699-import-sdk-version-none-WYNCDQGHTE" into main
* changes:
  Revert "Don't use java_library for java_import neverlink"
  Revert "Do not convert sdk_version: "none""
2023-10-18 23:38:27 +00:00