Commit Graph

8756 Commits

Author SHA1 Message Date
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
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
Spandan Das
1679192d7d Skip contents validation of source bootclasspath fragments
... if prebuilts are selected.

This is a special case of b/361771739 where a apex starts contributing a
jar to the BCP. `disableSourceApexVariant` uses
`PrebuiltSelectionInfoProvider` and this gets populated via the
following dep chain
```
source --> prebuilt --> all_apex_contributions
```

This runs into issues if a prebuilt bootclasspath_fragment does not
exist.

This CL creates a dependency edge between the source module and
all_apex_contributions singleton module so that
`PrebuiltSelectionInfoProvider` is available for
`disableSourceApexVariant`

Bug: 361771739
Test: lunch cf_x86_64-next-userdebug
Test: m nothing with ag/28851886
Change-Id: I92d88199a27579d3c9879d40fd354653370efcce
2024-09-06 05:10:29 +00:00
Cole Faust
6265120cd2 Remove asset dir glob files
I'm rewriting how globs work in soong to make them compatible with
hash-based ninja implementations. As part of this, I'm removing this
unnecessary usage of globs to make them simpler.

In this case, since we're already globbing the directory at analysis
time and causing soong to rerun, we can ensure the aapt2 action also
reruns by putting a hash of the glob results onto the command line.

Bug: 364749114
Test: m framework-res, touch frameworks/base/core/res/assets/test1.txt, m framework-res rebuilt framework-res.apk, rm frameworks/base/core/res/assets/test1.txt, m framework-res rebuilt framework-res.apk again
Change-Id: I4f666367a9a0fd0dfa42dc51ef3a788a02b41747
2024-09-05 16:36:32 -07:00
Cole Faust
b749347fa5 Make the java static_libs property configurable
Bug: 362579941
Test: m nothing --no-skip-soong-tests
Change-Id: Iccc93cf14753aae1adb26c6eedd00aabf1c2f6a6
2024-09-05 14:16:37 -07:00
Colin Cross
392aae7702 Merge "Remove obsolete robolectric test runner integration" into main am: 151446cb41
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3254252

Change-Id: Ib1d5f7a2fa7491e1ecbb4873513c182d309275f1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-09-05 21:07:40 +00:00
Colin Cross
c9b4f6b502 Use transitive header jars in classpaths
Skip combining jars into turbine-combined, combined, and withres jars
and instead collect transitive jars to use in the classpath and to
produce the final dexed jar.

This reduces the size of a `m checkbuild` in git_main by 11%, from
1300 KiB to 1154 KiB.  It may also improve caching and reduce uplink
network bandwidth when building with RBE, as now the classpath inputs
to rules are themselves outputs of previous rules and so already in
the RBE CAS.

The downside is that the classpath inputs to each rule are now much
longer, increasing the Soong ninja file size 11%, from 4.6 GiB to
5.1 GiB.  This could be mitigated in the future by supporting something
like depsets in the generated ninja file to reduce duplication.

Bug: 308016794
Test: TestSimple, TestKotlin, TestClasspath
Flag: build.RELEASE_USE_TRANSITIVE_JARS_IN_CLASSPATH
Change-Id: I2b7b4261375494370da70f98597c8719f1d561cf
2024-09-04 16:13:46 -07:00
Colin Cross
fdaa672ad1 Remove obsolete robolectric test runner integration
The `m Run*RoboTests` test runner is no longer supported, remove the
code to generate the Make rules for it.

Also reduce the number of combining steps by passing the extra jars
that need to be combined into the compile step.

This relands Icf05079bf570bed7a10962cbf03459bd53c51f99 with a fix to
reorder the instrumented app classes after dependency classes.

Test: atest --host SystemUiRoboTests
Flag: EXEMPT refactor
Change-Id: I174ceb95af5557e1859eeb12a2f5fac2332975a8
2024-09-04 15:47:11 -07:00
Yu Liu
246315e4fd Merge "Move the caching/restoring code from soong to blueprint to fully skip build actions." into main am: c55b25f125
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3249489

Change-Id: I43e2ee71097e95e313eab8631742acb8048e36d4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-09-04 22:07:50 +00:00
Yu Liu
c55b25f125 Merge "Move the caching/restoring code from soong to blueprint to fully skip build actions." into main 2024-09-04 22:01:33 +00:00
Treehugger Robot
e6a426338a Merge "Revert "Remove obsolete robolectric test runner integration"" into main am: b94fef7278
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3255302

Change-Id: I0a94ada98ac9fbcc396fc95456be8f6c31e0b02a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-09-04 21:46:52 +00:00
Treehugger Robot
b94fef7278 Merge "Revert "Remove obsolete robolectric test runner integration"" into main 2024-09-04 21:36:08 +00:00
Priyanka Advani (xWF)
72853677e8 Revert "Remove obsolete robolectric test runner integration"
This reverts commit ef5739ed64.

Reason for revert: Droidmonitor created revert due to b/364665936.

Change-Id: Ia18f642492eafdbe2e78d9f753d87f243d529037
2024-09-04 20:15:58 +00:00
Yu Liu
26a716d5e5 Move the caching/restoring code from soong to blueprint to fully skip build actions.
Bug: 358425833
Test: Manually verified the generated ninja and mk files and CI.
Change-Id: Ieebb822c46f37c0ff55fad08531e9870a76cbd7b
2024-09-04 19:59:55 +00:00
Colin Cross
0b98048d32 Merge "Rename collectTransitiveHeaderJars and friends to mention R8" into main am: 13d8e82c5e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3216678

Change-Id: I8a425dc292fd5ce81a2e5343fd18f21fa3d472d6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-09-04 17:45:05 +00:00
Colin Cross
13d8e82c5e Merge "Rename collectTransitiveHeaderJars and friends to mention R8" into main 2024-09-04 17:34:03 +00:00
Colin Cross
2a3878da24 Merge "Remove obsolete robolectric test runner integration" into main am: b09e8ec23c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3238457

Change-Id: Icbf2db1a86565385705723197edd3103453baddd
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-09-04 17:24:02 +00:00