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
This change prevents duplicate paths from being returned when resolving
filepath, glob and ":name{.tag}" syntax to android.Paths. Once all
existing modules are cleaned up to remove duplicates in the source
files, the duplicates removal can be converted into an error so that
passing duplicate source files in the module definition is restricted.
Test: patch to git_main, inspect ninja commands
Bug: 326674683
Change-Id: I38a4ce9238da25cd67968f6bc8058bc9facc4551
As part of aosp/3022586 where we added the idea of "test-only" modules
and top_level_test_targets, this CL implements that for java modules.
We let users set "test-only" on java_library, but not on other modules
where the module kind is implicitly test-only, like java_test.
The implementation, not the user decides it is test-only.
We also exclude it from java_defaults.
% 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 |
+--------------------------+----------+
% gqui from "flatten(~/aosp-main-with-phones/out/soong/ownership/all_teams.pb, teams)" proto team.proto:AllTeams 'select teams.kind, count(*) where teams.top_level_target = true and teams.kind not like "%cc_%" group by teams.kind'
+--------------+----------+
| teams.kind | count(*) |
+--------------+----------+
| android_test | 1382 |
| java_fuzz | 5 |
| java_test | 774 |
+--------------+----------+
Test: m nothing --no-skip-soong-tests
Test: go test ./java
Test: m all_teams
Bug: b/327280661
Change-Id: I9c3ad947dc3d68d6427abada27449526d69daa6b
This allows us to add dependencies only for debuggable builds.
Bug: N/A
Test: add product_variables.debuggable.deps to the android_system_image
module.
Change-Id: Id90646fff8a8a91c5e768418b9881e93228ec2a5
The __BIONIC_NO_PAGE_SIZE_MACRO flag has to be passed to
the build system because there are C/C++ libraries using
__BIONIC_NO_PAGE_SIZE_MACRO to decide whether to use getpagesize()
or PAGE_SIZE macro.
Bug: 333973679
Test: Build manually
Change-Id: Ie5d71f4b2b256ab8f429ed4724b8d249b364d5da
As part of aosp/3022586 where we added the idea of "test-only" modules
and top_level_test_targets, this CL implements that for cc_ modules.
We let users set "test-only" on cc_library, but not on other modules
where the module kind is implicitly test-only, like cc_test.
Here the implementation, not the user decides it is test-only.
% gqui from "flatten(~/aosp-main-with-phones/out/soong/ownership/all_teams.pb, teams)" proto team.proto:AllTeams 'select teams.kind, count(*) where teams.top_level_target = true group by teams.kind' aosp_shiba[6:15:47]/0
+--------------+----------+
| teams.kind | count(*) |
+--------------+----------+
| art_cc_test | 56 |
| cc_benchmark | 68 |
| cc_fuzz | 515 |
| cc_test | 3518 |
| cc_test_host | 6 |
+--------------+----------+
% 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 group by teams.kind' aosp_shiba[6:16:26]/0
+--------------------------+----------+
| teams.kind | count(*) |
+--------------------------+----------+
| art_cc_test | 56 |
| art_cc_test_library | 13 |
| cc_benchmark | 68 |
| cc_fuzz | 515 |
| cc_test | 3518 |
| cc_test_host | 6 |
| cc_test_library | 484 |
+--------------------------+----------+
Bug: b/327280661
Test: m nothing --no-skip-soong-tests
Test: go test ./cc
Test: m all_teams
Change-Id: I344436c424a9dfbdcf27e10f42f5cebc3d2b1261
androidx.annotation_annotation is used as a test data file, and
converting it from a java_library to a java_library_import causes
the relative path used in the test data path to change. Clear the
relative path in java_import the same way that other java based
modules do.
Bug: 288358614
Test: TestJavaLibraryOutputFileRel
Change-Id: I1f494110da32e916043ca94ac6ebeeafccc06f9a
This reverts commit 8a038ed871.
Reason for revert: investigate breaking test suits Avatar and BumbleBluetoothTests
Change-Id: I8e4498fb5854bf62df6d161ac0c6cce49d471afe
This reverts commit eaa475107d.
Reason for revert: This cl broke AOSP build, read more b/333846153
Change-Id: I5538a3c78617d7c2db98a11b60cb61269dcec8d3
Move -Wno-error=format from noOverrideGlobalCflags to
commonGlobalCflags so that projects can re-enable it with
"-Werror=format"
Bug: 315250603
Test: Add -Werror=format to bluetooth_cflags
Change-Id: I677cee5373c670c1a3b0eceeea1b7c35d28a17c2
Use the `WriteFileRule` to write the permissions file for shared
libraries instead of generating a custom bash rule.
Test: TH
Change-Id: I904cf0742bfec46ed45ec7801bb9bd3dc3047185
This commit fixes the incomplete ABI dumps for libc. The ABI checker
counts export_system_include_dir in the exported headers. It writes the
functions and types defined in the system headers to the dump files.
Test: make
Bug: 314010764
Change-Id: Ieae48d13b4fc4381c87a017213019e940d498967
This includes
1. the prebuilt javac binary
2. the input .java files
3. the jars that are placed on the classpath during javac
(2) is passed via ${out}.rsp. This rsp file gets populated with the
input java files
For (3), this CL creates a new intermediate file whose content is
comma separated jars available on the classpath (this is the format
expected by rewrapper). This file is then registered in RSPFiles of
javacRE command, so that it gets passed to the rewrapper cmd as
`--input_list_paths`
(rspfiles are necesary for modules like framework-minus-apex to avoid
exceeding cmd line limits)
Bug: 308687455
Test: m framework-minus-apex; # verified that the relevant files are
added as `--inputs` of javac
Change-Id: I2ab9277fc394eb00454ef503c78a9f3451e596ac
The `test-only` flag designates the module contains test-only, not
production code. In order to generate code-coverage reports, we wanted
a way to filter out code (like java_library) that is test-only and
doesn't need to be in the report.
The XXX_test modules will have test-only set automatically.
For modules like `java_library`, users will be a able to set this in
the Android.bp file.
As a follow-up, I'll run some queries to find modules that are only
reachable from top level test targets and mark them test-only as
appropriate.
`test-only` is being added to the team.proto and will be written via the
`all_teams` target.
Currently, it is challenging to find "all top level test targets".
I'm adding another field to mark the target as a "top level test
target" if it is a XXX_test or XXX_test_host module. The goal is to
mark all modules the user intended to run as a test, either with
tradefed or directly as a native test.
I added 'module-type/kind' to the proto so I can do some queries:
gqui from "flatten(out/soong/ownership/all_teams.pb, teams)" proto team.proto:AllTeams 'select teams.kind, count(*) where teams.top_level_target = true group by teams.kind'
+--------------+----------+
| teams.kind | count(*) |
+--------------+----------+
| android_test | 1379 |
| art_cc_test | 56 |
| cc_benchmark | 68 |
| cc_fuzz | 515 |
| cc_test | 3519 |
| cc_test_host | 6 |
| java_fuzz | 5 |
| java_test | 773 |
+--------------+----------+
% 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 group by teams.kind'
+--------------------------+----------+
| teams.kind | count(*) |
+--------------------------+----------+
| android_test | 1379 |
| android_test_helper_app | 1678 |
| art_cc_test | 56 |
| art_cc_test_library | 13 |
| cc_benchmark | 68 |
| cc_fuzz | 515 |
| cc_test | 3519 |
| cc_test_host | 6 |
| cc_test_library | 484 |
| java_library | 2 |
| java_test | 773 |
| java_test_helper_library | 29 |
+--------------------------+----------+
All modules can be seen here: https://docs.google.com/spreadsheets/d/1Zqbh7lDDdlI1xVmrN9fZ8bm8XD7EoORjjiPqbMvAKgQ/edit#gid=396553017
FOLLOW UP cls:
*) Add more top level tests, like sh_test and python_test
*) Add validation so that only modules currently marked test-only
can depend on modules marked test-only
*) Remove test_spec, code_metadata, TestModuleProviderKey: aosp/2928500
Test: go test ./java ./cc ./android
Test: m blueprint_tests
Test: m nothing --no-skip-soong-tests
!! android already failing on selects_test
Test: m all_teams && gqui from "flatten(out/soong/ownership/all_teams.pb, teams)"
Change-Id: Ib97dca60989aa9d7f000727c92af2e354926f072
There was infrastructure to export ninja variables to bazel. Now that
the bazel migration is cancelled, we don't need it anymore.
Bug: 315353489
Test: m nothing
Change-Id: I298cc2ac7ebd004557be3b30d75f7357cab0b7a0
This commit changes the parameters to create LLNDK ABI dumps for 202404
and later versions. Soong invokes header-abi-linker with LLNDK headers
and version script rather than the implementation library's parameters.
The output dump contains more precise ABI information.
When soong compares the ABI with the prebuilt dumps in old versions,
it creates the source ABI dumps with the old parameters.
Test: make findlsdumps
Bug: 314010764
Change-Id: I228736188d07029ee1588b3502fd7c0061c104b9
android_systemimage_defaults is deleted and android_filesystem_defaults
is created so that we can have defaults not only for
android_system_image, but also all android_filesystem modules and its
derivatives.
Also, change adds a check which ensures that the partition_type of the
filesystem and its defaults are the same.
Bug: 330665150
Test: m
Change-Id: If635c794534ed89d264eaf7dfc406a8245b8e9f0