Commit Graph

8732 Commits

Author SHA1 Message Date
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
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
Colin Cross
b09e8ec23c Merge "Remove obsolete robolectric test runner integration" into main 2024-09-04 17:21:47 +00:00
Colin Cross
5f0561e24d Merge "Move checkbuild targets of Soong modules into Soong" into main am: ca3bf2be39
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3237626

Change-Id: Id72a093f81785ece92211cc63a73c0a53576fb7b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-09-04 17:15:12 +00:00
Colin Cross
ca3bf2be39 Merge "Move checkbuild targets of Soong modules into Soong" into main 2024-09-04 17:12:03 +00:00
Yihan Dong
b5c5c1a8de Merge "Apply apimapper instrument tool on android tests" into main am: a596b12878
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3249673

Change-Id: Ifd8f3a190c3794aed0dec5d872915fa294440db7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-09-04 00:59:51 +00:00
Yihan Dong
a596b12878 Merge "Apply apimapper instrument tool on android tests" into main 2024-09-04 00:52:09 +00:00
Colin Cross
ef5739ed64 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.

Test: atest --host SystemUiRoboTests
Flag: EXEMPT refactor
Change-Id: Icf05079bf570bed7a10962cbf03459bd53c51f99
2024-09-03 14:52:26 -07:00
Colin Cross
9ffaf28f5f Rename collectTransitiveHeaderJars and friends to mention R8
collectTransitiveHeaderJarsForR8 visits direct dependencies and collects
all transitive libs and static_libs header jars.  The semantics of the
collected jars are odd (it collects combined jars that contain the static
libs, but also the static libs, and it collects transitive libs dependencies
of static_libs), so these are only used to expand the --library arguments
to R8.  Rename the method and all the fields it uses with a "ForR8"
suffix to avoid confusion when more transitive header jar collection is
added to support transitive classpaths.

Bug: 308016794
Test: all soong tests pass
Change-Id: I291a86fbbc2e2f088598fb309d1b992080d60941
2024-09-03 14:52:26 -07:00
Colin Cross
a6182ab2fa Move checkbuild targets of Soong modules into Soong
Pass the name of Soong's checkbuild target for each module to
Make so that it can depend on it from the main checkbuild rule.
This will give better control over which files get built, allowing
checkbuild to skip the jar combining step when transitive classpath
jars are enabled.  The per-module checkbuild targets are passed to
make instead of added directly as a dependency of checkbuild in order
to maintain the existing behavior of only building modules exposed
to make in checkbuild.

Also tweak the existing calls to CheckbuildFile and add
InstallFileWithoutCheckbuild to match the files that are
in the Make-based checkbuild.

Bug: 308016794
Test: m checkbuild
Change-Id: Ic5140819381d58f4d00f23a7a12447950c4cf268
2024-09-03 14:52:19 -07:00
Yihan Dong
8be09c2075 Apply apimapper instrument tool on android tests
Apimapper is a tool to instrument android tests to log potentail API calls at the run time.

The real tool is developed internally. We use a placeholder binary in
AOSP before the real tool is ready.

The tool will only take affect when the enviroment var EMMA_API_MAPPER
is set to true.

Test: m cts
Bug: 328699028

Change-Id: Iece53b8afdb9803334b7393527f4fa24e22f71a8
2024-09-02 09:02:08 +08:00
Jihoon Kang
9e40f8f9b4 Merge "Revert^4 "Implement detecting container violations."" into main am: 7344482ff3
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3248019

Change-Id: I440053bd684fa56172b82b4012348bd0a93e84c5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-30 20:21:28 +00:00
Jihoon Kang
7344482ff3 Merge "Revert^4 "Implement detecting container violations."" into main 2024-08-30 20:18:53 +00:00
Paul Duffin
cf2b25eef6 Retry: Allow modules to override --error-when-new UnflaggedApi am: c540beef74
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3251391

Change-Id: I9fe7fa27e39e932fab60434540d0b88240df814c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-30 17:16:59 +00:00
Paul Duffin
c540beef74 Retry: Allow modules to override --error-when-new UnflaggedApi
Some `java_sdk_library` and `droidstubs` modules already specify
`--error UnflaggedApi` but they are currently ignored because they are
added before the `--error-when-new UnflaggedApi` automatically added by
Soong and Metalava uses the last setting. That means adding
`--error-when-new UnflaggedApi` in change https://r.android.com/3248013
actually reduced the severity of the issue for those modules making it
more likely that they would be missed.

This change only adds the `--error-when-new UnflaggedApi` if it does
not already appear in the metalava command.

Bug: 361582214
Test: m checkapi
Change-Id: I7228bf9794b1c7e27d7acf7a461956b30f3335f5
2024-08-30 15:27:07 +01:00
Priyanka Advani (xWF)
c420be6e76 Merge "Revert "Allow modules to override --error-when-new UnflaggedApi"" into main am: 2075155076
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3247908

Change-Id: I697bdf0d2391b838d7a59a6db409b7baa7196871
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-29 19:07:07 +00:00
Priyanka Advani (xWF)
2075155076 Merge "Revert "Allow modules to override --error-when-new UnflaggedApi"" into main 2024-08-29 18:56:17 +00:00
Priyanka Advani (xWF)
b09c0d25c9 Revert "Allow modules to override --error-when-new UnflaggedApi"
This reverts commit 3001ce3bf5.

Reason for revert: Droidmonitor created revert due to b/363016109

Change-Id: Iaf3ca41520b4328fc727af8837e5dff6def41f2b
2024-08-29 18:48:14 +00:00
Treehugger Robot
bcd2eb039e Merge "Allow modules to override --error-when-new UnflaggedApi" into main am: f016b08ece
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3248195

Change-Id: Ibc31a18dbefa39ec6eacae8165c4b76cc240ac9f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-29 18:02:09 +00:00
Treehugger Robot
f016b08ece Merge "Allow modules to override --error-when-new UnflaggedApi" into main 2024-08-29 17:58:56 +00:00
Jihoon Kang
85bc193805 Revert^4 "Implement detecting container violations."
This change introduces a method to detect violating inter-container
dependencies between modules. The method is run in
`ModuleBase.GenerateBuildActions`, after the container info provider is
set. Given that the provider of the direct dependencies would have been
set at this time, the method utilizes this information to determine
the violations, which are introduced in https://r.android.com/3141104.

Note that this enforcement does not turn all inter-container
dependencies as errors. Instead, it will only turn dependencies that
matches the pre-defined violations into errors. Even if the dependency
matches the violation, an error will not be thrown if the dependency
satisfies any of the exception functions (e.g. the dependent module is
stubs, or the two modules belong to the same apexes).

Test: m nothing --no-skip-soong-tests
Bug: 338660802
Change-Id: Ib9ddc0761fa46f1309b1a1a4f759d9a4e04fd70e
2024-08-29 17:55:00 +00:00
Paul Duffin
3001ce3bf5 Allow modules to override --error-when-new UnflaggedApi
Some `java_sdk_library` and `droidstubs` modules already specify
`--error UnflaggedApi` but they are currently ignored because they are
added before the `--error-when-new UnflaggedApi` automatically added by
Soong and Metalava uses the last setting. That means adding
`--error-when-new UnflaggedApi` in change https://r.android.com/3248013
actually reduced the severity of the issue for those modules making it
more likely that they would be missed.

This change only adds the `--error-when-new UnflaggedApi` if it does
not already appear in the metalava command.

Bug: 361582214
Test: m checkapi
Change-Id: I499183276c7520605cca7acc6e6e9ab535feaa86
2024-08-29 15:35:58 +01:00
Priyanka Advani (xWF)
c2ba6683c5 Merge "Revert^3 "Implement detecting container violations."" into main am: 88a8daf8ca
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3248525

Change-Id: I7969a4be11e013e100f4be9fb13914244b094b7f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-28 23:30:03 +00:00
Priyanka Advani (xWF)
88a8daf8ca Merge "Revert^3 "Implement detecting container violations."" into main 2024-08-28 23:20:03 +00:00
Priyanka Advani (xWF)
33b3a638a5 Revert^3 "Implement detecting container violations."
2a88491afc

Change-Id: Iba4527f391a093703978fe01177b56fec4604b28
2024-08-28 23:10:29 +00:00
Jihoon Kang
4e373a7904 Merge changes Ia693c4a5,I8e5620d2 into main am: c14be38f1a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3247222

Change-Id: Id0c06c93eda0e4978d9df052542370f28e64da38
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-28 21:43:02 +00:00