This no-op refactoring facilitates some upcoming functional changes for
"bp2build allowlist v2". The work requires that the bp2build conversion
mutator be changed from a TopDown mutator to a BottomUp mutator.
Refactoring all bp2build-related methods so that they use Bp2buildMutatorContext
makes it easier to make this functional change without touching tens of
files and multiple projects.
Bug: 285631638
Test: m bp2build
Change-Id: I3d1ef3064146e959c6f0dc315350fc9764bf2bd2
So that ... and :all target patterns don't pick it up.
Test: b build //bionic/libc/... and check that none of the filegroups
are built.
Change-Id: I79cd6fb6f7559409ae3e5b95b8b260970810cf7f
Instead, we return an error. This allows us to access some product
variable information earlier when it will not be used as an attribute
without panicing
Test: m nothing
Change-Id: Id094b2b9e1364a8d174d99b3824fa149fb235b3e
Test: go test bp2build conversion tests
Test: enable modules build from prebuilt and m nothing
Bug: 300640274
Change-Id: I8c015aec546d052bef6c42869e12db4e87d39780
Test: go tests
Test: CI
Test: patch in CL using prebuilts for mainline modules and build
Bug: 300640274
Change-Id: I73f70dac679e341670e1484ce57bc984f413d409
Allowlist v2 will change bp2build by automatically disabling rdeps of
unconvertible modules. Many bp2build tests create bp2build stub modules
without an implementation,
This CL changes setup of such tests to also contain a BUILD file with
"stub implementations" of equivalent targets, to keep these test targets
convertible.
To verify this change in-place, this CL removes `bp2build_available:
false` from these dependencies.
This is a test-only change for bp2build tests.
Bug: 285631638
Test: m bp2build
Change-Id: I489480cbc4158a416b7abf57c35a6e2bc2ad6173
Because we're going to start generating partition images for the
product, and the partitions will eventually be checked in, we want
them to be in sensible locations. And the platform should be there as
well so all the targets for a product are co-located.
Bug: 297269187
Test: m nothing && b build --config=android //build/bazel/examples/apex/minimal:build.bazel.examples.apex.minimal
Change-Id: Iaa25c44aa00295ada279d5fd49b5498bbafb89d5
android_test is just an android_app, but the test bits are handled
purely in Starlark (tradefed_test_impl).
This enables building HelloWorldTests (android_test) with Bazel.
Bug: 297030120
Bug: 297029612
Test: WIP
Change-Id: I6d287c94b31698ea247da48e4cd6b5a75bc71e11
If a dependency has ndk stubs, then the sdk variant of the library
should link against the ndk stub variant and not the impl/apex_stubs variant
Unlike module-libapi, the depdendency does not go through an
@api_surfaces external repo indirection. This indirection was created to
support Multi-tree, and will likely be removed in the future
Test: Added a unit test
Bug: 298085502
Change-Id: Ie081e153fa586b6c22db0b8e42f91149fd8e5d9b
ndk_libary will be converted to a cc_stub_suite target. Its api_surface
attribute will be publicapi
The headers corresponding to this stub target will be added in a followup bug
(tracked in b/300504837)
Bug: 298085502
Test: Added a unit test
Change-Id: If9745083b18e0bcf5ecb89229a0f709b949d401c
Ignore-AOSP-First: ag/24746588, in the same topic, is in an internal repo. This CL will be cherry-picked to AOSP afterward.
Test: go test
Bug: 277091218
Change-Id: I389d9535ea176991a1faa9beb46352b93363acd2
Merged-In: I389d9535ea176991a1faa9beb46352b93363acd2
This involves some minor changes to testing infrastructure.
This is a rollforward of aosp/2628496 with a couple of minor changes:
- In ParseBuildFiles, filter out all build files that are kept due
to ShouldKeepExistingBuildFileForDir
- Add some minor test infrastructure for StubbedBuildDefinitions, with a
couple of proof of concept tests used to demonstrate its usage. This
pattern will become immensely more common as we implement allowlist v2
(as we will need to update all tests which today simulate build
definitions that have missing deps)
Bug: 285631638
Fixes: 286545783
Test: bp2build.sh
Test: m nothing
Change-Id: I7c3a03b02098e39dd8e51d327482b440f294478f
cc_stub_suite now has an additional attribute correponding to the api
surface. This attribute will be used to pass additional args to the stub
generator.
Update bp2build to set the api_surface of the apex stubs. This ensures
that its stubs are generated with "--systemapi --apex"
Test: unit tests
Bug: 298085502
Change-Id: If4c479f85e6e485b5c795a565a0c559f1f013bf5
This module type will be converted to a cc_prebuilt_* bazel target. It
will provide
1. a prebuilt (.a/.so) file
2. headers (as -isystem)
Test: added a bp2build unit test
Bug: 298088835
Change-Id: Ib58cc7f6fde8f4ca34516f6f18a4c048a02a049a
We've had some incrementality issues with the symlink forest since
aosp/2673616, clear old symlink forests to get rid of the bad symlinks.
Bug: 300129912
Test: Presubmit
Change-Id: Ic23c980b68ebcc8b8788d56e53435f0a89d82b28
Previously, partners were required to add an
android_certificate_directory filegroup in their certificate
directories, and allowlist that BUILD file. Now, we generate the
filegroup automatically.
We're using a different name, generated_android_certificate_directory,
to avoid conflicts with already-checked-in filegroups.
Bug: 285777389
Test: b test //build/bazel/rules/apex/...
Change-Id: Ib1bde487acd79d58368faf0aad02ded0bcdaceb4
java_library doesn't accept deps when there are no srcs because
no compilation happens, but it accepts exports.
The deps from the module are not necessary for compiling the protos,
in which case they are unnecessary as deps on the java_library as well
since they are not be propagated to any dependencies.
So we can put the deps to exports and drop deps here.
Test: CI and added unit test
Bug: 285952385
Change-Id: Ie54a4ac0db592fb96fede64f0e67df309dca9c1d
Also add script to remove the Bazel output base.
This will assist with supporting movable checkouts alongside
mixed builds.
Bug: 259191764
Test: m && (move topic and prepare_moved_top.sh) && m
Test: m && prepare_moved_top.sh && m
Test: build/soong/tests/relative_symlinks_test.sh
Change-Id: I0f53da8d99f752fad496cf3ac61b01f001b7296d
To maintain good backwards compatibility with the legacy partition
building behavior, allow actions to read
BUILD_BROKEN_INCORRECT_PARTITION_IMAGES so that we don't have to rerun
analysis.
Bug: 205632228
Test: Presubmits
Change-Id: I2b55c0143cbdaf010e6b5fd0c3d51d6930a94eff
Previously we would convert to java_resources when there were no
resources and get an error.
Test: b build //external/libphonenumber/... --config=android
Change-Id: I86f30b993a3ffdb20000f6a4c5261e2c4c74263c
Soong adds "--no-ndk" to cc stubs for apexes if the library is not an
NDK library. In order to port this logic, emit the list to a .bzl file.
We cannot use the exportedVars.Export* soong_injection api for this
since we need to visit all modules to get this list.
Test: m nothing
Bug: 299501496
Change-Id: If8487db85e08b32b9b40aef3371d9f3f7d5a77e0