Commit Graph

6895 Commits

Author SHA1 Message Date
Nicolas Geoffray
b37e2183a3 Merge "Don't strip oat files on host." am: 3799533b87 am: 51ba0cf62a am: 5f1a60b3ff am: 3329a4e764 am: 032c8074b1 am: b603b627a7
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2640035

Change-Id: I05ce41cb4231c763f70c901919c9042e1bb76dcc
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-30 14:54:34 +00:00
Treehugger Robot
ddf027b4a0 Merge "Extract class files from dep_api_srcs instead of java files" am: 043893465c am: e2be65ac9b am: c3f42dcf7b am: 52adedba36 am: c2c0f70a59 am: b87706fec2
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2637669

Change-Id: I448ffec69b79a46af302bf2b6d9fe1e7469db674
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-30 13:34:46 +00:00
Nicolas Geoffray
3799533b87 Merge "Don't strip oat files on host." 2023-06-30 10:49:50 +00:00
Treehugger Robot
8359db9dc0 Merge "Fix FirstUniqueStrings after conversion to generics" am: da169a1ee3 am: e5f8e56262 am: 146391ed48 am: 987869d644 am: cd925b6d9e am: 995c8f610a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2640231

Change-Id: I4e9a477c1257278061ffceb06ef245d28c1432b6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-29 23:49:41 +00:00
Jihoon Kang
ca198c2639 Extract class files from dep_api_srcs instead of java files
Currently, stub java files are extracted from srcjar file provided from
dep_api_srcs in java_api_library module generated in java_sdk_library
per api scope. However, compiling the java files may lead to difference
in the content of the generated class files even if the stub java files
are equivalent, as javac may arbitrarily add overridden methods. Thus,
create a stub jar file instead of creating a stub srcjar file and
compiling it, in order to guarantee stub jar files content equivalence
and thus enable hiddenapi during from-text stub build.

Note that this change does not fully resolve differences between the
full api surface csv and the per sdk_library csv. Instead, it removes
the difference caused by methods arbitrarily added by javac.

This change also renames dep_api_srcs to full_api_surface_stubs to be
more intuitive.

Test: rebase on top of aosp/2617274 and `m --build-from-text-stub`
Bug: 275570206
Change-Id: I22b6d56624633681f5c3b000370b5782655c7b8d
2023-06-29 22:43:05 +00:00
Zi Wang
1604552902 Merge "Use java_library_host bp2build converter for tradefed_java_library_host" am: 187aa29056 am: 001f86f656 am: ce25aa21b9 am: 352cb1966f am: ed875a27ed am: 2cc3fb758e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2640236

Change-Id: I15795b4570424d238f687f4083f10be7c92f6269
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-29 21:09:47 +00:00
Jiakai Zhang
d953e601e5 Merge "Use per-app package list to avoid unnecessary dexpreopt." am: fbc62cfd74 am: 0f39aeae9d am: 19f78bc543 am: b75734b94f am: 81826f0140 am: c7ca76c392
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2637193

Change-Id: I0d508100d1b1187f6dcbac0a73bb86f94c3c3c67
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-29 21:05:55 +00:00
Treehugger Robot
da169a1ee3 Merge "Fix FirstUniqueStrings after conversion to generics" 2023-06-29 18:46:20 +00:00
Zi Wang
187aa29056 Merge "Use java_library_host bp2build converter for tradefed_java_library_host" 2023-06-29 18:03:22 +00:00
Nicolas Geoffray
1ad8a13e47 Don't strip oat files on host.
We need the debugging info for perf.

Test: m
Change-Id: Iceaa72d8b1c7d27ea113ca72c8af1174ce6f05ba
2023-06-29 15:45:39 +01:00
Kenneth Ford
9371cc9d72 Merge "Revert "Enable R8 full mode by default for apps"" am: 510616ca9d am: 7f3b9d34d0 am: 3029a7ebfd am: 97191c39e6 am: cea96b660b am: 9d67c9e161
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2644757

Change-Id: I43bdafba3b4c7153bc4830d92be267a858eefc0a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-29 04:43:45 +00:00
Jared Duke
a0c3f2ce1d Merge "Enable R8 full mode by default for apps" am: 4b566a978f am: f521304597 am: 990328e0df am: 6e43d9a439 am: 540b451da8 am: 615c80eb6f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2084583

Change-Id: Ia742863fa9d2ef81bc388d1552d0c3dba5a91a92
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-29 02:50:54 +00:00
Kenneth Ford
ba283992ef Revert "Enable R8 full mode by default for apps"
This reverts commit 93d0bffafe.

Reason for revert: Possible culprit for b/289285719

Change-Id: If818db9d38008ea9d8c7813b9f6fabc2975e8507
2023-06-28 23:29:21 +00:00
Jiakai Zhang
51b2a8b5eb Use per-app package list to avoid unnecessary dexpreopt.
Starting from aosp/2594905, dexpreopt depends on
`$PRODUCT_OUT/product_packages.txt`. When PRODUCT_PACKAGES changes,
dexpreopt has to rerun for all apps. This is not ideal.

After this change, dexpreopt uses a per-app product_packages.txt that is
filtered by the app's dependencies, and it uses `rsync --checksum` to
prevent the file's mtime from being changed if the contents don't change.
This avoids unnecessary dexpreopt reruns.

Bug: 288218403
Test: m
Test: Change PRODUCT_PACKAGES and see no dexpreopt reruns.
Change-Id: I5788a9ee987dfd0abfd7d91cbcef748452290004
2023-06-28 17:59:56 +01:00
Zi Wang
3096e68e64 Use java_library_host bp2build converter for tradefed_java_library_host
Test: presubmit

Bug: 285959156
Change-Id: I18cefd4bf71b674771718411887b140a5d61d3f6
2023-06-27 15:44:10 -07:00
Jared Duke
93d0bffafe Enable R8 full mode by default for apps
This provides significant size savings over the default compatibility
mode, roughly ~20MB in aggregate for a recent Pixel build. Targets can opt out using `proguard_compatibility = true`.

Future work will enable for all targets, not just apps, but this
incremental change yields the most benefit.

Bug: 215530220
Test: m + presubmit
Change-Id: I52a9b27ebe71835849e200e23ae2a250eaf1bbe1
2023-06-27 22:33:58 +00:00
Colin Cross
48016d5a2f Fix FirstUniqueStrings after conversion to generics
The conversion of FirstUniqueStrings to be implemented on top of the
generic firstUnique accidentally used a different threshold to switch
from the list implementation to the map implementation.  Modify the
threshold of firstUnique to match the old value from FirstUniqueStrings
now that it doesn't have the reflection overhead.  While we're at it,
also make firstUnique make a copy of the list, and make FirstUniqueStrings
a pure wrapper around firstUnique.

Test: BenchmarkFirstUniqueStrings
Change-Id: Icc2febea663142c508ff2e4be65a8a68121631d5
2023-06-27 11:07:55 -07:00
Treehugger Robot
67cc9c07d0 Merge "Cleanup remaining android.JavaApiLibraryName() references" am: a41c679fe1 am: e33d11c7ba am: b3aff0670c am: 19ae935ee2 am: 9edadaacdf am: 2939f1301d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2627549

Change-Id: Ifb1c04b769301c768936a9afc8decbee26fa267d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-27 00:45:17 +00:00
Treehugger Robot
a41c679fe1 Merge "Cleanup remaining android.JavaApiLibraryName() references" 2023-06-23 21:35:02 +00:00
Colin Cross
808e4865a0 Merge "Use generics for DepSets" am: 313d32f730 am: 99e192a3c6 am: 1abd6d6d58 am: 93f21b999f am: 84b55792dd am: 5a4ef5695a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2633849

Change-Id: I55351dcaafa90a550d90d2eb2c832960c0880efa
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-23 00:54:04 +00:00
Colin Cross
313d32f730 Merge "Use generics for DepSets" 2023-06-22 20:57:01 +00:00
Eric Miao
1957e6eeb9 Merge "Revert "Revert "Enable compact resource entries for aapt linking""" 2023-06-22 16:49:11 +00:00
Colin Cross
c85750bfe3 Use generics for DepSets
Use Go's generics for DepSets so they don't require a type-specific
wrapper and reflection.

Test: depsets_test.go
Change-Id: I22ba0b7d680d37d2cd05230b0f560d166c4dd20b
2023-06-22 08:18:33 -07:00
Paul Duffin
c0036491cd Remove reference to the deprecated and disabled Typo issue
Metalava no longer looks for common typos. It relies on the code
analyzers that run on Gerrit to detect them.

Bug: 288072162
Test: m checkapi
Change-Id: I08eca8008af39ebe69442db419ebd3d3378aa0de
2023-06-21 15:42:49 +01:00
Christopher Parsons
df9c3441aa Merge "Provide reason for unconverted bp2build modules" 2023-06-16 13:49:49 +00:00
Chris Parsons
39a169721c Provide reason for unconverted bp2build modules
This also changes the expectation of ConvertWithBp2build. Each
implementation must either create one or more Bazel target modules, or
mark the module as unconvertible (with a specific reason).

Manually verified no runtime hit in AOSP
In AOSP, the metrics file size increases from 252K to 1.6M

This changes some effective module counts in bp2build metrics:
 - Removes "package" modules from the module count list in
metrics, as these will not be converted like regular modules.
 - Counts Handcrafted modules as being "unconverted", as bp2build is not
   responsible for them.

Bug: 285631638
Test: Verified generated BUILD.bazel files are bit-for-bit identical
with this change
Test: Manually verified one case of each implemented reasonType

Change-Id: I308dd451d8f28379b15671dae9f931bd0446f5c1
2023-06-16 13:45:17 +00:00
Treehugger Robot
0e7d0fa05c Merge "Dynamically link static libs for sdk_library created java_library" 2023-06-15 23:39:39 +00:00
Jihoon Kang
6c0df88809 Cleanup remaining android.JavaApiLibraryName() references
Since the name of the java_library generated from sdk_library per api
scope does not depend on the build configuration anymore, all
dependency switching "magic" via android.JavaApiLibraryName() can be
removed.

This change also removes from-text-build-specific test cases, as those
test cases depend on build configurations.

Test: m nothing && m nothing --build-from-text-stub
Bug: 287340610
Change-Id: I3bac35259e0cbaa16432a46cb2b128951c9bc075
2023-06-15 19:42:34 +00:00
Jihoon Kang
1147b31eb0 Dynamically link static libs for sdk_library created java_library
Rename java_library created inside sdk_library with the ".from-source"
suffix, and set it as static lib of the top level java_library, which
gets java_api_library instead as static lib during from-text stub build.

Test: m nothing && m nothing --build-from-text-stub
Bug: 286446015
Change-Id: I32e8ea264987e9f9df05e462292bd54e45074912
2023-06-15 18:18:09 +00:00
Chris Parsons
715c417ba3 Remove print statement
I suspect this was accidentally committed. We shouldn't just printf such
a statement every build analysis.

Test: Presubmits
Change-Id: If5ee66ce1b366f28254cd1bfdcaed9e085a60094
2023-06-14 16:24:37 +00:00
Zi Wang
6a66e3d01e Support multiple filters in zipsync
Also applied this feature to kotlinc since it needs both java and kt files.

Test: local test and presubmits

Bug: 287071909
Change-Id: I28c725b03115aef47055448cb75412980015da15
2023-06-14 06:44:49 +00:00
Sorin Basca
5498faf505 Merge "Revert^2 "Add exports needed for Doclava"" 2023-06-12 14:53:14 +00:00
Joe Onorato
175073c472 Make aconfig flags generate a library instead of a srcjar.
Also add unit tests for the rest of device_config

Bug: 283475679
Test: m nothing (soong unit tests)
Change-Id: Iee18a1f2f2cbb23e8c8d84c54e903b32be29a693
2023-06-09 06:16:06 -07:00
Sorin Basca
a7b777f800 Revert^2 "Add exports needed for Doclava"
a39209b565

Change-Id: Ib7c674e5142d2dff719d14092ac5383b6484d54c
2023-06-09 09:19:36 +00:00
Treehugger Robot
f253d23e95 Merge changes from topic "cc_stem"
* changes:
  Remove modules from denylist
  Update runpath for jni libs
  bp2build support for stem
2023-06-08 22:38:34 +00:00
Himanshu Rawat
4ead3a807d Merge "Revert "Add exports needed for Doclava"" 2023-06-08 16:45:02 +00:00
Himanshu Rawat
a39209b565 Revert "Add exports needed for Doclava"
Revert submission 2615972-b-270335653-doclava-search-imports

Reason for revert: DroidMonitor: Potential culprit for Bug 286398320 - verifying through ABTD before revert submission. This is part of the standard investigation process, and does not mean your CL will be reverted

Reverted changes: /q/submissionid:2615972-b-270335653-doclava-search-imports

Change-Id: Ibc3bdb301110b564e1427432a1b530e07bb840cd
2023-06-08 16:12:31 +00:00
Treehugger Robot
02761e58a0 Merge "Add exports needed for Doclava" 2023-06-08 15:35:48 +00:00
Jihoon Kang
346a117921 Create bp2build converter for platform_compat_config module type
This change adds bp2build converter for platform_compat_config module
type and its corresponding test case.

Bug: 269202028
Test: bp2build unit tests
Change-Id: I17d560c8f0e725efe69e151685d003c3dcb11f2f
2023-06-06 19:35:36 +00:00
Jihoon Kang
4190764669 Merge changes from topic "android_stubs_current_refactor"
* changes:
  Cleanup android.JavaApiLibraryName references
  Redefine core and core platform API surface java_library
  Introduce product variable Build_from_text_stub
  Introduce "Exclude_static_libs" property for Java modules
2023-06-06 19:16:25 +00:00
Anton Hansson
efd18370b0 Merge "Allow Bluetooth to use privapp_allowlist" 2023-06-06 18:29:07 +00:00
Sorin Basca
23741cac4d Add exports needed for Doclava
Bug: 270335653
Test: m doclava docs dist
Change-Id: Id46c877ddfd64b36f1ee96a7678076af69d91cdb
2023-06-06 09:43:53 +01:00
Spandan Das
5dba0ec98c Update runpath for jni libs
To support stem, cc libraries will be generated in
<pacakge_name>/<label.name>. Update RUNPATH of java binaries so that it
can find its jni deps

Test: bp2build
Test: TH
Bug: 240563612
Change-Id: Ia2f70f0424a8526ee35856225c1a8cd1067a8570
2023-06-06 00:07:40 +00:00
Spandan Das
91a8820688 Merge changes from topics "xsd_config_bp2build_cc_rdeps", "xsd_config_bp2build_java_rdeps"
* changes:
  bp2build for cc libraries that use xsd_config as gen srcs
  bp2build for java libraries using xsd_config srcs
2023-06-05 22:23:37 +00:00
Jihoon Kang
91c839566e Cleanup android.JavaApiLibraryName references
This change cleans up references to android.JavaApiLibraryName() so that
rdeps link against "android_*_stubs_current" instead of
"android_*_stubs_current.from-text".

Bug: 284995489
Test: m
Change-Id: Ibdf33b15981317c43e468dbc1657229d54bbd226
2023-06-05 21:45:01 +00:00
Jihoon Kang
67b6443258 Redefine core and core platform API surface java_library
Redefined core and core platform API surface java_library using the
product variable build_from_text_stub so that the correct static libs
are linked based on build configuration

Test: m --build-from-text-stub and verify no ninja path between "core.current.stubs" and "core.current.stubs.from-source"
Bug: 285410821
Change-Id: I26febc65697be6278624a504ffbb61be0953d798
2023-06-05 21:44:33 +00:00
Jihoon Kang
381c2fa27c Introduce "Exclude_static_libs" property for Java modules
Exclude_static_libs property can be used to specify static libs that
should not be used to build the module. The list acts as filter for
static_libs.

Bug: 285410821
Test: go test ./java
Change-Id: Iee7f160ba88b5f64bdd265c30d47c9f51feb0f5e
2023-06-05 21:42:48 +00:00
Mark Teffeteller
3bc9c57dc4 Merge "Add use_platform_libs to fuzz config" 2023-06-05 14:41:51 +00:00
Anton Hansson
e3f31cfd1e Allow Bluetooth to use privapp_allowlist
Apparently there's some special case-code in package manager that
scans apps as privileged regardless of their location. BT is one
such app -- so allow it to specify a privapp allowlist even though
it isn't in priv-app.

Bug: 284500052
Test: use privapp_allowlist in Bluetooth and its overriddes
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:a91268a690e2aa98a0fa7b376a948a48f41b1265)
Merged-In: Ib9ac86ebc45087a176100fe8df07db7bf81a85a7
Change-Id: Ib9ac86ebc45087a176100fe8df07db7bf81a85a7
2023-06-03 08:53:47 +00:00
Jiakai Zhang
48203e3dee Add an allowlist for modules that have broken optional_uses_libs.
Bug: 282877248
Test: m nothing
Change-Id: I1afe9d523af0633f0428d4c15e1417db1dae4e93
2023-06-02 23:42:53 +01:00