Commit Graph

8771 Commits

Author SHA1 Message Date
Liana Kazanova
5c1283460c Merge "Revert "pass read new storage parameter to java codegen"" into main 2024-09-23 22:51:13 +00:00
Liana Kazanova
df1c59a657 Revert "pass read new storage parameter to java codegen"
This reverts commit 9cf2e8e140.

Reason for revert:DroidMonitor - Potential culprit for http://b/369200837 - Verifying through ABTD before submission. 

Change-Id: I635ba732fba40b7c73b5c419ef204fb14e857cb2
2024-09-23 21:54:04 +00:00
Spandan Das
e2860d9db6 Merge changes I0edb681b,I0ea2327f into main
* changes:
  Remove internal deapexer module
  Remove deapex support from java_*_import
2024-09-23 20:28:36 +00:00
Zhi Dou
168b3f8581 Merge "pass read new storage parameter to java codegen" into main 2024-09-23 19:49:07 +00:00
Zhi Dou
9cf2e8e140 pass read new storage parameter to java codegen
When RELEASE_READ_FROM_NEW_STORAGE is true, enable reading from new
storage. So that we can ensure nextfood is not impacted.

Test: m and check cf
Bug: 349874828
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:c98032785339de11e34ee3d4f94b3ec3ed70d324)
Merged-In: Id12816206a16b17c23e3a53832d268f1600107b3
Change-Id: I95ad9457e6d9c07a5a5b3074045a383f004113a9
2024-09-23 19:29:41 +00:00
Spandan Das
52c01a1897 Remove internal deapexer module
The build ations will be created by the top-level apex.

Details
1. In GenerateAndroidBuildActions, do a graph walk to determine if the
   apex has exported deps.
2. If there are exported deps, call the newly introduced `deapex`
   function. This registers the build rules and returns a DeapexerInfo
object. This was previously provided by the internal deapexer
dependency.
3. Update `dexpreoptSystemServerJars and `provideApexExportsInfo` to use
   the DeapexerInfo object from (2).

A lot of unit tests that relied on the legacy mechanism of deapexing
have been updated.

Test: go test ./apex
Test: lunch cf_x86_64_phone-next-userdebug (uses mainline prebuilts)
Test: verified no diff in file_list.txt
Bug: 368337090
Change-Id: I0edb681beccac4d2a9ceb73f9a506c081a8a96e0
2024-09-20 23:47:36 +00:00
Spandan Das
a326b320ab Remove deapex support from java_*_import
prebuilt_apex/apex_set currently supports its deapexed contents to be
returned via a sibling java_import/java_sdk_import module. This is
necesssary for
1. dexpreopt/hiddenapi processing
2. usage as shared library

(1) is no longer necessary. this information is provided by the
top-level prebuilt apexes now

(2) is no longer possible since `exported_java_libs` has been removed in
https://r.android.com/3272110

This CL uses a hack for java_sdk_library_improt. Even though (1) is
provided by the top-level apex, there are still some places where
dexpreopt/hiddenapi processing visits the import modules. This CL uses
a bogus path to make analysis work. If this bogus path gets used, there
will be an error during ninja execution

Test: go test ./apex
Test: in internal lunch cf_x86_64_phone-next-userdebug (uses mainline
prebuilts)
Test: verified that file_list.txt is same
Bug: 368337090

Change-Id: I0ea2327f648f0fc60e337b232f7265e140772ffd
2024-09-20 23:33:09 +00:00
Jihoon Kang
da923b0ae3 Revert^2 "Remove java_sdk_library "magic""
This change removes the java_sdk_library to submodule calculus logic,
i.e. the "magic". The "magic" is no longer being used, as all existing
usages have been fixed to specify the submodule that it actually depends
on.

Test: m nothing --no-skip-soong-tests
Bug: 368144555
Change-Id: Ica0cb5a51d7a8192c2402c0c50ac35cb0b4df0a2
2024-09-20 21:57:19 +00:00
Jihoon Kang
c4db1092a8 Revert^2 "Restrict java_sdk_library in libs of java_import and droidstubs modules"
These are all remaining usages of "magic", which are being removed with
this change. The follow up change will remove the "magic".

Test: m nothing --no-skip-soong-tests
Bug: 366069293
Change-Id: If432cdc6621ac00564e14acbaefca53db1723686
2024-09-20 21:56:08 +00:00
Jihoon Kang
28c9657e24 Revert^2 "Restrict java_sdk_library in libs"
Instead, the module should specify the submodule it actually depends on.
This is a prereq change to removing the java_sdk_library "magic"

Test: m nothing --no-skip-soong-tests
Bug: 366069293
Change-Id: Idb4b0b0a953f5391c24e50294c940522b73c34f2
2024-09-20 21:55:23 +00:00
Jihoon Kang
6c0a5d9d30 Merge changes from topic "revert-3271699-IARRNEVQHI" into main
* changes:
  Revert "Restrict java_sdk_library in libs of java_import and dro..."
  Revert "Remove java_sdk_library "magic""
2024-09-20 17:17:32 +00:00
Jihoon Kang
46e0613992 Merge "Revert "Restrict java_sdk_library in libs"" into main 2024-09-20 17:17:32 +00:00
Liana Kazanova
6a32dfdb86 Revert "Restrict java_sdk_library in libs of java_import and dro..."
Revert submission 3271699

Reason for revert: DroidMonitor: Potential culprit for http://b/368606825 - verifying through ABTD before submission. 

Reverted changes: /q/submissionid:3271699

Change-Id: I65f0e10eb775fd08dd958b699ce1191da7ce0669
2024-09-20 17:09:21 +00:00
Liana Kazanova
4340863ed9 Revert "Remove java_sdk_library "magic""
Revert submission 3271699

Reason for revert: DroidMonitor: Potential culprit for http://b/368606825 - verifying through ABTD before submission. 

Reverted changes: /q/submissionid:3271699

Change-Id: If40f7956e699246cf1d72ffc50ffffa4696504df
2024-09-20 17:09:21 +00:00
Jihoon Kang
33cbd37c00 Revert "Restrict java_sdk_library in libs"
This reverts commit 125efc6c30.

Reason for revert: b/368606825

Change-Id: Ia24f637db202f24be2ee13c7fe78e19a69576ffa
2024-09-20 17:09:09 +00:00
Jihoon Kang
25dc02902a Remove java_sdk_library "magic"
This change removes the java_sdk_library to submodule calculus logic,
i.e. the "magic". The "magic" is no longer being used, as all existing
usages have been fixed to specify the submodule that it actually depends
on.

Test: m nothing --no-skip-soong-tests
Bug: 368144555
Change-Id: I653bd734959c3366a40f003274c921b012be24ca
2024-09-19 21:45:01 +00:00
Jihoon Kang
0d28fd30e5 Restrict java_sdk_library in libs of java_import and droidstubs modules
These are all remaining usages of "magic", which are being removed with
this change. The follow up change will remove the "magic".

Test: m nothing --no-skip-soong-tests
Bug: 366069293
Change-Id: I4762682cb8696b435b9f0fb0f4c55ba2fa865f05
2024-09-19 21:44:40 +00:00
Jihoon Kang
125efc6c30 Restrict java_sdk_library in libs
Instead, the module should specify the submodule it actually depends on.
This is a prereq change to removing the java_sdk_library "magic"

Test: m nothing --no-skip-soong-tests
Bug: 366069293
Change-Id: I9137c079afc7abf201e597e323ae7de415eea0dc
2024-09-19 21:44:20 +00:00
Cole Faust
eb03246f6f Make dexpreopt properties configurable
Spurred by ag/27778860

Test: m nothing --no-skip-soong-tests
Change-Id: I0e48144172eee1c589f46875cd94e3aa19d43873
2024-09-19 11:12:54 -07:00
Cole Faust
16d227a725 Add default_visibility for soong modules
So that we don't get surprise usages.

Bug: 348717861
Test: m nothing
Change-Id: I47319a727092c1bd936cca88f5713ee977a48b48
2024-09-18 17:41:30 -07:00
Makoto Onuki
1fa2cf0f88 Merge "Fix resource-apk inclusion" into main 2024-09-18 19:12:56 +00:00
Treehugger Robot
feeb6d1e7b Merge "Align CLC add context behavior between java_sdk_library and its impl lib" into main 2024-09-18 17:34:00 +00:00
Jihoon Kang
ddda6ea7d3 Align CLC add context behavior between java_sdk_library and its impl lib
This change allows the impl lib of java_sdk_library to call AddContext(...) instead of AddContextMap(...) and ensure that the behavior between the top level java_sdk_library and the impl lib is identical when creating the class loader context.

Test: CI && ABTD
Bug: 366572133
Change-Id: Ia0bc7558ca737fcd3ad4ed62b3190aa567aa103f
2024-09-18 16:46:38 +00:00
Rico Wind
15c5e54de7 Merge "Launch flag guarded always on optimized resource shrinking" into main 2024-09-18 07:31:54 +00:00
Makoto Onuki
a191ef3c54 Merge "Make compat-config to generate output files too" into main 2024-09-17 18:29:23 +00:00
Treehugger Robot
1c8c5698ec Merge "Pass the common sources rsp file as --common_srcs to extractor" into main 2024-09-17 17:49:54 +00:00
Makoto Onuki
ed392f7097 Fix resource-apk inclusion
- We used to include the "install" files, but we really should be using
"output" files instead.

- Also supports a new "inst_resource_apk" property, which is another APK
that's loaded as resources of the instrumentation app itself.

Flag: EXEMPT host test change only
Bug: 292141694
Test: m nothing --no-skip-soong-tests
Test: manual test with a local test module change and make sure
    the second apk exists

Change-Id: Ibd3f9d4a1cbc0f805b2294605ae8bc06fdf53b75
2024-09-17 10:03:24 -07:00
Makoto Onuki
ca678c4a36 Make compat-config to generate output files too
Flag: EXEMPT host test change only
Bug: 367706429
Test: m nothing --no-skip-soong-tests
Test: `m ravenwood-runtime` and make sure out/host/linux-x86/testcases/ravenwood-runtime/ravenwood-data/
    has framework-platform-compat-config.xml and services-platform-compat-config.xml
Change-Id: I92b545c480890815cd886b8ecf50ed99ffe7eea1
2024-09-17 09:53:33 -07:00
Ulya Trofimovich
9d96d1f186 Merge "Revert^12 "Enable dex container (DEX v41) for the whole system"" into main 2024-09-17 14:01:55 +00:00
Ulya Trofimovich
5bb46810a5 Revert^12 "Enable dex container (DEX v41) for the whole system"
This reverts commit 78fccd9380.

Reason for revert: test failure in can no longer be reproduced.

Bug: 353452237
Change-Id: I7cf926342efc612b4026d89df12078c018ede7b9
2024-09-16 18:58:53 +00:00
Spandan Das
67136e14f3 Pass the common sources rsp file as --common_srcs to extractor
This additional metadata allows the indexer to differentiate between
platform specific and platform agnostic kotlin code.

Bug: 3266381
Test: ran the indexer on `kotlinx_serialization_core` java_library
Change-Id: I860552808198cafa95fe0d5b6faa725b985e24d0
2024-09-13 22:12:45 +00:00
John Wu
680cd73e1a [Ravenwood] Support fonts files and data files
Add support to include font files into ravenwood_libgroup. Also make ravenwood data property to accept paths instead of module name. 

Bug: 292141694
Flag: EXEMPT host side change only
Test: $ANDROID_BUILD_TOP/frameworks/base/ravenwood/scripts/run-ravenwood-tests.sh
Change-Id: Ida5ef0230d2cc59fa1209199168c6c35e4842fbd
2024-09-13 20:59:05 +00:00
Rico Wind
a7b38592f8 Launch flag guarded always on optimized resource shrinking
This will use the RELEASE_USE_OPTIMIZED_RESOURCE_SHRINKING_BY_DEFAULT flag - default enabling in trunk staging will be done in a follow up cl

To disable optimized resource shrinking on an app basis one can opt out with
  optimized_shrink_resources: false
bug please file a bug for us to find out why (so that we can remove legacy mode)

Bug: 325905703
Test: Existing
Change-Id: Idb57b8e6bba26f06c044657492ff4ae89ec81254
2024-09-13 09:12:56 +00:00
Treehugger Robot
c379ea0fd4 Merge "Don't evaluate the enabled property in a defaultable hook" into main 2024-09-12 20:15:20 +00:00
Spandan Das
a7b916b50c Merge "Use -language-version 1.9 in the kotlinKythe build rule" into main 2024-09-12 19:52:30 +00:00
Cole Faust
8eeae4bbbe Don't evaluate the enabled property in a defaultable hook
So that we can decide the configuration after defaults are evaluated.
Instead, pass the enabled property on to submodules.

Bug: 361816274
Test: m nothing --no-skip-soong-tests
Change-Id: I853d557ed022f7434287cea0a2a19e684b59e145
2024-09-12 11:51:04 -07:00
Spandan Das
3d6c6d9c76 Use -language-version 1.9 in the kotlinKythe build rule
There are some instances of .kt code in android platform that are not
fully compatible with kotlinc > 2. To account for this version skew when
generating xrefs, implicitly add `-language-version 1.9` to the args in
the .kzip file. The main kotlinc build rules remain the same.

This value has been picked manually by running
`external/kotlinc/bin/kotlinc -version` at ToT

Bug: 265428637
Test: verified that `-language-version 1.9` is added to the build
command of the .kzip files
Test: ran the indexer locally on the .kzip of `PermissionController-lib`
(this android_library contains .kt code that does not compile with
verison >2)

Change-Id: Icfb72800404d83f63204de23a1ec34b40ee05847
2024-09-12 18:20:59 +00:00
Spandan Das
6556d043bd Merge changes from topic "kotlin_kythe" into main
* changes:
  Add kotlin kzips to build_kzip.bash
  Create .kzip files for kotlin translation units
2024-09-12 18:14:14 +00:00
Treehugger Robot
8996dbc91c Merge "Remove unused property naming_scheme in java_sdk_library" into main 2024-09-12 01:43:15 +00:00
Jihoon Kang
2261a82dbd Remove unused property naming_scheme in java_sdk_library
The property was introduced as an interim solution, and is currently
unused.

Test: m nothing --no-skip-soong-tests
Bug: 366071058
Change-Id: I57abdb64fabdb34fbbd1190851bc528dbb88c7f8
2024-09-12 00:10:37 +00:00
Spandan Das
1028d5a53f Create .kzip files for kotlin translation units
This CL creates the build rules to invoke the standalone kotlin
extractor and create .kzip files for each kotlin translation unit. These
will be indexed by the internal g3 kotlin indexers

Implementation details
- Create a `kotlinKytheExtract` static rule. Its inputs will be source
  .kt/.srcjar files and other verbatim args passed to kotlinc. The
extrator will serialize this information into a .kzip file. The .kzip
file should contain the necessary information to "replay" the
compilation
- Create a xref_kotlin phony rule to build all .kzip files corresponding
  to kotlin translation units.

This implementation has one limitation. Since the kotlin indexers
"replay" the compilation using its own version of kotlinc-jvm, there
might be indexing issues caused by kotlinc version skew between android
builds and indexing builds. `-kotlin-home` can likely solve that, but
this CL defers that for now.

Bug: 265428637
Test: Built the phony `xref_kotlin`, and ran the indexer locally using go/kythe-git-local-run#indexing-to-local-xrefs-server

Change-Id: Ifb370f2df8aa46f71df3fe1ae7d7aa5da773cc8b
2024-09-11 21:16:24 +00:00
Cole Faust
e8a8783154 Rename ConfigAndErrorContext to ConfigurableEvaluatorContext
I'm going to be adding some methods to this interface, give it
a name based on how it's going to be used, not based on what methods
it contains.

Bug: 323382414
Test: m nothing --no-skip-soong-tests
Change-Id: I9bba04ba756c4dbe00625e2d04af81e78a11cae9
2024-09-11 11:35:46 -07:00
Xin Li
aa8ceca851 Merge "Merge 24Q3 to AOSP main" into main 2024-09-07 01:12:30 +00:00
Treehugger Robot
2618069b9f Merge "Fix ravenizer when transitive classpath is enabled" into main 2024-09-06 23:06:52 +00:00
Colin Cross
7e86385f1b Fix ravenizer when transitive classpath is enabled
Ravenizer and the other rules that modify the output jar also need to
replace the implementation jar depset with the modified output jar.

Bug: 308016794
Test: atest CtsOsTestCasesRavenwood
Flag: build.RELEASE_USE_TRANSITIVE_JARS_IN_CLASSPATH
Change-Id: I87ec143431c09ed878f8e1c3541b56d8077e23b5
2024-09-06 14:42:38 -07:00
Cole Faust
219009f606 Merge "Make the java static_libs property configurable" into main 2024-09-06 18:36:35 +00:00
Treehugger Robot
f2c204c655 Merge "Remove asset dir glob files" into main 2024-09-06 16:22:06 +00:00
Colin Cross
399ff4019d Merge "Use transitive header jars in classpaths" into main 2024-09-06 16:19:41 +00:00
Treehugger Robot
fae5ec8bbc Merge changes I505a7ad8,I92d88199 into main
* changes:
  Disable source apex variant using apex_available_name
  Skip `contents` validation of source bootclasspath fragments
2024-09-06 06:07:42 +00:00
Spandan Das
003452ff9c Disable source apex variant using apex_available_name
There are two versions of aosp extservices - one for Tplus and one for
Sminus. When prebuilts are active, the `contents` validation of both
variants of extservices bootclasspath fragments should be disabled to
account for BCP jar skew.

This CL adds ApexAvailableName to ApexInfo to achive that. If an
api_domain matching the ApexAvailableName has been selected in
`all_apex_contributions`, the source apex variants will be disabled.

Bug: 361771739

Test: lunch cf_x86_64_phone-next-userdebug
Test: m nothing with ag/28851886
Change-Id: I505a7ad8295c258e2eeef7f183669f7a75a1c88e
2024-09-06 05:10:41 +00:00