This change supports passing multiple last api files to metalava,
instead of emitting an error when multiple files are passed as inputs.
The last api file providing modules are filegroups or genrule modules
that output exactly one output file. This change modifies that behavior
so that the filegroups can output multiple api files.
The last api file providing modules are (mostly) generated from the
`prebuilt_apis` sdk module. However, these modules only provide a single
api scope txt files (e.g. system api scope last api file filegroup
would only provide last system api file, not system + public). This
change modifies `prebuilt_apis` by generating "combine" filegroup
modules, that include api files of the subset api scopes as well.
The ordering of the files are handled when generating the combined api
filegroup modules, and droidstubs module does not check whether the
passed api files are in order from the narrowest api scope to the widest
api scope.
Submission of this change will be done once metalava fully supports
handling multiple api files input for api lint and nullness migration.
Test: m nothing
Bug: 321827591
Change-Id: I2066e7ceb7ee7c6d0fd87cd43bfd08db906d4b8f
A follow-up change broke `TestSnapshotWithJavaSystemModules()` during
development. The code was fixed but it revealed an issue with the test
coverage of that test. That test only supported `public` APIs and the
fix could have had different behavior on `system` and `module-lib`
APIs. This change adds them to the test to make sure that the follow-up
change works correctly for them too.
Test: m --no-skip-soong-tests nothing
Bug: 321827591
Change-Id: I3b5570f5d4f0764ae365bfc448f287b50b9c2686
* changes:
Bootstrap out/release-config early
Add crunch-flags and build-flag binaries
release_config: cleanup how we emit results
Print a warning on redundant overrides
Add description to release_config_map message
When looking at more details of modules that are marked test-only, I saw
that `java_test_host` modules were not in the list.
The test I wrote for it passes, but in a real run, there are two variants (one
windows, one linux) which causes it to fail. The `all_teams` code visis
all variants, even not enabled ones. The windows variant, for which
GenerateAndroidBuildActions was not being called, did not have a
provider and its empty data was overriding the variant for which we had
data.
I changed the code to prefer variants where it is true.
Generally for "test-only", the value is logically true independent of variant, so
if one variant sets it true, it should be considered true for all
variants.
I think this is a slightly better check than preferring a variant with a
provider or that is enabled.
Prev CL
% gqui from "flatten(~/aosp-main-with-phones/out/soong/ownership/all_teams.pb, teams)" proto team.proto:AllTeams 'select teams.kind, count(*) where teams.test_only = true and teams.kind not like "%cc_%" group by teams.kind'
+--------------------------+----------+
| teams.kind | count(*) |
+--------------------------+----------+
| android_test | 1382 |
| android_test_helper_app | 1680 |
| java_fuzz | 5 |
| java_test | 774 |
| java_test_helper_library | 29 |
+--------------------------+----------+
After
gqui from "flatten(~/aosp-main-with-phones/out/soong/ownership/all_teams.pb, teams)" proto ~/aosp-main-with-phones/build/soong/android/team_proto/team.proto:AllTeams ' select teams.kind, count(*) where teams.test_only = true and teams.kind not like "%cc_%" group by teams.kind'
+--------------------------+----------+
| teams.kind | count(*) |
+--------------------------+----------+
| android_test | 1382 |
| android_test_helper_app | 1680 |
| csuite_test | 16 |
| java_fuzz | 10 |
| java_test | 774 |
| java_test_helper_library | 35 |
| java_test_host | 495 |
+--------------------------+----------+
Test: go test ./android
Test: m all_teams
Test: m blueprint_tests
Change-Id: Idc5ed1c0375dc7390a0d58fcb4bf0d7fe1c7ab4f
- crunch-flags automates converting build flags from starlark to protobuf.
- build-flag is used to set, get and trace flag values.
Bug: 328495189
Test: manual
Change-Id: I941a4420a8bdfa2df73d94e52b3f34a6d1ea3278
- Allow each of the formats (json, pb, textproto) to be individually
controlled.
- Include product and release in the name of the aritfact.
Bug: 328495189
Test: manual
Change-Id: Ia08e7224200a48994bea882a61b8199d53576d38
aosp/2984037 disabled dexperopt of the source apex system server jars
when prebuilts are selected. This was done to prevent duplicate
installation and dex2oat deps.
AOSP art has some additional variants like com.android.art.debug. In
source builds, this apex should contain service-art.jar and
service-art.jar.prof (a dexpeopt artifact). We have a test to check this
(`art_apex_test.py`). If we disable dexpreopt of source sdlib when
prebuilts are selected, this test needs to be disabled. This is the
behavior at ToT.
This CL changes the behavior to enable running this test even when
com.google.android.art prebuilt is active in a specific release
configuraiton. To prevent collisions that prompted aosp/2984037, this CL
special-cases the installation and dex2oat rules instead of disabling
dexpreopt of the source sdklib altogether.
b/331665856 tracks the principled solution to prevent duplicate
dexpreopt rules.
Implementation:
Add a new copyApexSystemServerJarDex arg to GenerateDexpreoptRule API.
If true, the dexjar file will be copied to
out/soong/system_server_jars/. For soong modules, the value of this will
be the inverse of disableSourceApexVariant. Since none of the apex
system server jars are in make, this will be a noop in dexpreopt_gen
Bug: 331665856
Test: modified trunk_staging.scl locally to select
art.google.contributions.prebuilt; mmma art; (with the sibling CL in
topic)
Change-Id: Idb59e424f83d126cdc8b1671dde358745979bd8d
This change introduces a generic version of Shard*(...) utility
functions to prevent future digressions of the methods.
Test: m nothing --no-skip-soong-tests
Change-Id: I825214f0d79fb0549573ce01f298eea5eb87cf17
* changes:
Remove sort from mergeApexVariations
Support reading Providers from TransitionMutator IncomingTransition and OutgoingTransition
Set DebugMutators and DebugVariations when creating Transition variations
Fix more tests when ANDROID_BUILD_TOP is set
Remove the sort from mergeApexVariations, and instead sort before
calling it as sorting will break the next change that calls
mergeApexVariations on a provider field that must not be modified.
Also remove the unused ctx PathContext parameter, and use
slices.SortFunc.
Bug: 319288033
Test: Test_mergeApexVariations
Change-Id: I4a044e86a8eb262b54af50afe14c678616c499d1
Add a provider method to IncomingTransitionContext and
OutgoingTransitionContext so they implement ModuleProviderContext
and can be passed to android.ModuleProvider.
Bug: 319288033
Test: go test ./...
Change-Id: Ibf8b0feb78e4062fc044c321a23adcb68373e2f8
DebugMutators and DebugVariations are set by CreateVariations, but
TransitionMutators don't call CreateVariations. Set them in
TransitionMutators.Mutate instead.
Bug: 319288033
Test: go test ./...
Change-Id: I2e1d7ac7a04f1ae669602f6c0642cfa5333ada3c
The bpfix code (also used by androidmk) reads the ANDROID_BUILD_TOP
environment variable, causing the tests to fail when it is set. Clear
it in the bpfix and partner androidmk tests the same way the main
androidmk tests do.
Test: go test ./...
Change-Id: Icc61f2c3ebdbecab34c1d18399c6846db207c6dd
This will allow the `build-flag` command to use release_config_lib code.
Bug: 328495189
Test: manual
Change-Id: If068597b1d68c52c941788931997b7f77c73d2b3
When testing test-only validations, I noticed that some cc_test modules
where not reporting that they were test-only.
This happened because test-per-src variations were short-circuiting
writing out the provider.
The `all_teams` target is using the first variation for a module, but
it possibly should see if any variation is test-only.
For now, just making this fix to cc.
Test: m all_teams && gqui from "flatten(out/soong/ownership/all_teams.pb, teams)" proto build/soong/android/team_proto/team.proto:AllTeams ' where teams.kind = "cc_test" and teams.target_name="libnativebridge-tests"'
Test: go test ./cc
Change-Id: I6d44a521f5f2457527049399509d979559d7dc17
flag_declaration needs to include the namespace, and origin is not
needed.
Bug: 328495189
Test: manual
Change-Id: Icbadbe6d9888323874c07d84ccd6f50c284e1a1c
Bug: 331528424
Test: m --no-skip-soong-tests
Ignore-AOSP-First: Depends on internal changes. Will cherry-pick once merged.
Merged-In: Ied2821f11b6a5056ecf577e1e25765bc6dd212c0
Change-Id: Ied2821f11b6a5056ecf577e1e25765bc6dd212c0
This is a no-op change for a majority of cases.
Before this change, the contruction of the manifest check inputs is
confusing. It mutates uses_libs properties in place just for the
manifest check, by replacing module names with library names for
direct dependencies and merging library names from CLC for both direct
denpendencies and transitive denpendencies, and then constructs manifest
check inputs from those mutated uses_libs properties. This is
error-prone and leads to insistency: the goal is to check that the CLC
matches the manifest, but the inputs to the check don't reflect the CLC.
After this change, we no longer mutate uses_libs properties in place.
Instead, we maintain a separate list of missing denpendencies, and then
construct manifest check inputs directly from the CLC for all existing
libraries, no matter they are direct or transtive, and from the separate
list of missing libraries. This change makes the logic more
consistent and straightforward, and it also allows us to easily do the
next change, which is to propagate transtive missing denpendencies.
In fact, this change revealed several bugs around library optionality
and order in CLC construction, and fixed them.
Bug: 331528424
Test: m --no-skip-soong-tests
Ignore-AOSP-First: Depends on internal changes. Will cherry-pick once merged.
Merged-In: I0de82e76c47995b54aba9efd41538d950256a95f
Change-Id: I0de82e76c47995b54aba9efd41538d950256a95f
Previously, addRequiredDeps directly called RequiredModuleNames directly on
ModuleBase. As a result, it failed to correctly track the dependencies
for the modules which are overriding RequiredModuleNames. cc_* were
those.
Fixing this by calling RequiredModuleNames via the Module interface.
Bug: 321626681
Test: go test ./... under filesystem
Change-Id: I79de616606b88277da0b3e86b21316ee83e0ec71