Commit Graph

8756 Commits

Author SHA1 Message Date
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
Jihoon Kang
c14be38f1a Merge changes Ia693c4a5,I8e5620d2 into main
* changes:
  Revert^2 "Implement detecting container violations."
  Define additional container violations
2024-08-28 21:35:16 +00:00
Treehugger Robot
86b818fe76 Merge "Report UnflaggedApi issues as warnings but treat as errors when new" into main am: 5fa409b88e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3248013

Change-Id: Ieeb57fcf4365e1134123f17a16a7ad8d6d5d6bcd
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-28 19:20:05 +00:00
Treehugger Robot
5fa409b88e Merge "Report UnflaggedApi issues as warnings but treat as errors when new" into main 2024-08-28 19:13:24 +00:00
Jihoon Kang
2a88491afc Revert^2 "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: Ia693c4a53369c757a3e96656a769405c759b111c
2024-08-28 18:01:25 +00:00
Paul Duffin
88d3b39846 Report UnflaggedApi issues as warnings but treat as errors when new
The `UnflaggedApi` issue is only reported when doing API linting and
defaults to `Severity.HIDDEN` because AndroidX (among other users) do
not support using `@FlaggedApi` annotations. This change switches it to
be warning by default in the  Android build as there are some existing
instances of it, but will be treated as an error by the "Build Warnings
Aye Aye Analyzer" in a Gerrit change if it occurs on lines that are
modified/added by that change.

Bug: 361582214
Test: m checkapi
Change-Id: Ie5ed23d00dd49454aeb5b43ccd8ad027d9d34fd2
2024-08-28 18:24:02 +01:00
Satish Yalla
b2407feae1 Merge "Revert "Implement detecting container violations."" into main am: f2d6e5004f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3244001

Change-Id: Ibfcf7b1965a52402917a32a203bf55cb82d1626b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-28 05:52:08 +00:00
Satish Yalla
f2d6e5004f Merge "Revert "Implement detecting container violations."" into main 2024-08-28 05:48:21 +00:00
Satish Yalla
b2b1ef63e2 Revert "Implement detecting container violations."
This reverts commit bb678f82d6.

Reason for revert: Droidmonitor created revert due to b/362639013. Will be verifying through ABTD before submission.

Change-Id: I1dcb71672eeb44a17cf176d3731bcaf9aaf81edf
2024-08-28 05:10:31 +00:00
Treehugger Robot
30f3795688 Merge "Implement detecting container violations." into main am: 26f071db92
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3155659

Change-Id: Id60c6920d6c964193b53c8b5f7026472c5fcacb0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-28 04:43:21 +00:00
Treehugger Robot
26f071db92 Merge "Implement detecting container violations." into main 2024-08-28 04:39:12 +00:00
Treehugger Robot
cd08b3bfda Merge "dexpreopt rules for google mainline prebuilts with missing source" into main am: 529da9b897
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3241767

Change-Id: Ic80a3aef33c0b43c1c28e1bc8c8b9501a6bd4799
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-28 01:28:20 +00:00
Treehugger Robot
529da9b897 Merge "dexpreopt rules for google mainline prebuilts with missing source" into main 2024-08-28 01:25:52 +00:00
Treehugger Robot
e1028aa539 Merge changes from topic "ctx_in_ideinfo" into main am: 9cbbafe300
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3246818

Change-Id: Ia2b721e9967c0772acd7dd261ec18315f6c26b5e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-28 00:53:10 +00:00
Treehugger Robot
9cbbafe300 Merge changes from topic "ctx_in_ideinfo" into main
* changes:
  Add ctx argument to IDEInfo()
  Add configurable property support to neverallow
2024-08-28 00:49:13 +00:00
Treehugger Robot
cc02a664cf Merge "Make IdeInfo into a provider" into main am: 78a3761bde
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3245754

Change-Id: If90b650d7e0832de74a858c541277f9658f477c3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-27 23:55:40 +00:00
Treehugger Robot
78a3761bde Merge "Make IdeInfo into a provider" into main 2024-08-27 23:49:10 +00:00
Cole Faust
b36d31d870 Add ctx argument to IDEInfo()
The IDEInfo() methods read properties. To make those properties
configurable, we need a context to evaluate them with.

Bug: 362579941
Test: m nothing --no-skip-soong-tests
Change-Id: I26d4b7084439b3006e50b02277298f74a929e1aa
2024-08-27 16:04:28 -07:00
Cole Faust
08c7f86575 Make IdeInfo into a provider
In order to keep the changes minimal, call the old IdeInfo method right
after GenerateAndroidBuildActions and then set the result of that
into a provider.

Test: Diff'd ninja files and saw no difference.
Change-Id: Ic706e7dbcb7c6e3d2a381ddae383eb87e105f385
2024-08-27 15:50:35 -07:00
Spandan Das
8a2c56c516 dexpreopt rules for google mainline prebuilts with missing source
AddFarVariationDependencies runs into issues in partner workspaces which
do not contain the sources of google mainline prebuilts, since the
prebuilt would be renamed in a prior prebuilt_rename mutator. To account
for this rename, add `prebuilt_` prefix in
`addDependenciesOntoSelectedBootImageApexes` to ensure that the prebuilt
apex does not get elided

Test: m nothing --no-skip-soong-tests
Test: in v-aml-prebuilt dev,
aninja -t query out/soong/dexpreopt_arm64/dex_bootjars_input/okhttp.jar | head -n3
out/soong/dexpreopt_arm64/dex_bootjars_input/okhttp.jar:
  input: g.android.Cp
    out/soong/.intermediates/vendor/partner_modules/ArtPrebuilt/prebuilt_com.google.android.art_compressed.deapexer/android_common/deapexer/javalib/okhttp.jar
(uses the prebuilt deapexed boot jar, and no the source apex boot jar)

Bug: 362163831
Change-Id: Ie94a36911ab40ac09a470efe505fd00ef3a5bf9c
2024-08-27 22:01:11 +00:00
Spandan Das
8bd23c11bd Merge "Contents validation of override_apex's bootclasspath fragments" into main am: 39d61f53ff
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3241777

Change-Id: Ib59bb6607b8b35a3fe4e85815d5d2c325f9b4899
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-27 20:41:11 +00:00
Spandan Das
ed7a030c6c Contents validation of override_apex's bootclasspath fragments
https://r.android.com/3083813 added support for overriding
min_sdk_version, and creating separate variants of transitive
dependencies of override apexes. This causes issues when there is a skew
between apex boot jars of source and prebuilt mainline modules. For
mediaprovider google apex, we now have _two_ source variants of
mediaprovider bcp fragment module.

This CL uses ApexInfo.BaseApexName to skip the check on both variants of
bootclasspath/systemserverclasspath fragments.

This CL also removes the prefix based check to determine if prebuilts
are active. If RELEASE_APEX_CONTRIBUTIONS for a specific mainline module
is set, it will be assumed that prebuilts for that mainline module are
active.

Test: go test ./apex ./java
Bug: 361771739

Change-Id: I01f7ef437df8f10b74ffa397ba461ff4f1f9bed6
2024-08-27 18:48:46 +00:00
Jihoon Kang
bb678f82d6 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: I36e9cd956c5a076a53635be0c6ff27f77725516e
2024-08-27 17:30:42 +00:00
Spandan Das
3f90d0bfe6 Merge "Move installation rules of dexpreopt'd apex systemserver jars to soong" into main am: 18c2607bde
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3237119

Change-Id: I340ad00b8bff36520f3335f11fec8b307531f1ec
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-26 22:36:51 +00:00
Spandan Das
18c2607bde Merge "Move installation rules of dexpreopt'd apex systemserver jars to soong" into main 2024-08-26 22:27:57 +00:00
Treehugger Robot
b354c61de5 Merge "Guarantee frameworks.aidl stability." into main am: 7389ad5c18
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3236516

Change-Id: Ife4978df1cc8bd8272a4ea4ce36f197ee93c4fb5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-26 21:29:22 +00:00
Treehugger Robot
7389ad5c18 Merge "Guarantee frameworks.aidl stability." into main 2024-08-26 21:21:19 +00:00