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
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
Currently, we have ~4 of these modules which are all defined in
prebuilts/ndk. However, using ctx.ModuleDir() instead has the following
advantages
- makes bp2build simpler since we do not need to relativize this path
- prevents soong modules from reaching into another directory (as the
test setups were doing).
Test: m nothing
Change-Id: I780e2564cb37ebf4b800f0cd184789f3fc6f2fc8
Use Go's generics for DepSets so they don't require a type-specific
wrapper and reflection.
Test: depsets_test.go
Change-Id: I22ba0b7d680d37d2cd05230b0f560d166c4dd20b
There was a reference to the static library provider, but only the
transitive static deps were used, so only store that part. Other members
were stored but unused anywhere.
Test: go test soong tests
Test: m nothing
Change-Id: I12a6b94806c052c3f0df3cab0a10f17042af1c38
Dependencies from common arch modules like java libraires to cc modules
may need to retrieve the Target of the library, add it to
SharedLibraryInfo.
Bug: 176593487
Test: cc_test.go
Change-Id: I93ab9da5fab2ccc42c6b483a6d83c071b541d1e6
Native bridge modules never need to build against NDK stubs, so
don't create SDK variants. Also clear the sdk_version property
for modules that don't have SDK variants so that later code doesn't
use it to trigger SDK behaviors.
Test: m checkbuild
Change-Id: I1920fa82e9fab06235f01a62624382efa16cc6e3
Export information about static libraries, shared libraries and
exported flags through Providers instead of accessing the module
directly. Much more is left to be converted, but this significantly
simplifies the dependencies on libraries with stubs by making it easy
for a module to masquerade as another by simply exporting the
providers from the other module. Instead of depending on all the
versions of a library and then picking which one to use later, it
can depend only on the implementation variant and then select the
right SharedLibraryInfo from the variant.
Test: m checkbuild
Test: only expected changes to build.ninja
Change-Id: I1fd9eb4d251cf96ed8398d586efc3e0817663c76
Enforce min_sdk_version for every payload dependency of updatable
APEX/APKs.
android.CheckMinSdkVersion() calls ApexModule.ShouldSupportSdkVersion
for every transitive dependency from APEX/APK modules to see if it
meets the min_sdk_version requirements.
The common implementation for apex/android_app is provided in
android/apex.go.
Bug: 145796956
Bug: 152655956
Bug: 153333044
Test: m nothing
Change-Id: I4a947dc94026df7cebd552b6e8ccdb4cc1f67170
Revert submission 1242911-sdk_version_variant
Reason for revert: b/153394225
Reverted Changes:
Ife99745fb:Use libnativewindow for platform variant of libagq...
I1bae84c43:Use libnativewindow for platform variant of androi...
I6e6021ed3:Use stl to depend on libc++
Ife99745fb:Use libnativewindow for platform variant of libRSS...
I2c9f439b9:Fix static dependency on libprotobuf-cpp-lite-ndk
Iff2aff9cf:Set sdk_version for cc_genrules used by modules wi...
I7d72934aa:Add sdk mutator for native modules
Ief378a007:Use sdk variant of Soong modules when LOCAL_SDK_VE...
Bug: 149591340
Change-Id: I798fa902c779469c6382b6699351e5d12bf14785
Fixes: 153394225
Compiling native modules against the NDK disables platform features
like ASAN. For anything shipped on the system image there is no
reason to compile against the NDK. Add a new mutator to Soong that
creates a platform and an SDK variant for modules that set
sdk_version, and ignore sdk_version for the platform variant. The
SDK variant will be used for embedding in APKs that may be installed
on older platforms. Apexes use their own variants that enforce
backwards compatibility.
Test: sdk_test.go
Test: TestJNIPackaging
Bug: 149591340
Change-Id: I7d72934aaee2e1326cc0ba5f29f51f14feec4521
The NDK prebuilts are implicitly used when building with sdk_version set.
Make the module types be available to any apex so that we don't need to
manually add apex_available property to the module definitions manually.
Bug: 150999716
Test: m
Change-Id: I0870afa4c74b4a06ab1273dff84615778561ecc9
Because aidl_interface depends on some ndk modules, their factories are
exposed so that aidl_test.go can use them.
Bug: n/a
Test: m
Change-Id: I98d282cc77310d5896a7abaf3936456a14d56ccf
Exported includes have been maintained along with other C/C++ flags.
This makes dependencies unclear, and users have had to parse flags to
get exported directories. This separates exported includes and
exported flags, thus making data more structured and explicit.
Bug: 132818174
Test: m
Change-Id: I5c25ac2224988c4a67e4db6fd6e4d39090b74041
When it is set to c++_shared, the added dependency should be
libc++_shared, not libc++.
Fixes: 130891985
Test: app_test.go, atest 'CtsNdkBinderTestCases' w/ conversion CL
Change-Id: I0e50e0d5bf511aa6e52d16cd715a185721011255
The ndk_library, ndk_prebuilt_object and ndk_prebuilt_static_stl
modules are natural targets to have native bridge support enabled,
since they build user facing object which have to be supported for
translated architectures.
Bug: http://b/77159578
Test: make
Change-Id: Ic556f4c1c41e5b3dc92f9c290b4482dee8faed33
Added synopsis to the following modules under cc package:
* ndk_prebuilt_object
* ndk_prebuilt_static_stl
* ndk_prebuilt_shared_stl
Bug: b/128337482
Test: Generated the documentation and verified that the synopsis was
added to each of the module.
Change-Id: Icca7418268a0328b622014da8a077b26800075fd
The double space is confusing compdb.go. compdb.go should be fixed,
but the double space is unnecessary so remove it.
Also make -isystem consistently followed by a space.
Bug: 117124308
Test: m checkbuild
Change-Id: I5ce7530d2ef66be8d8285e252d60a39299984a06
This is common to binaries and libraries, so move it from library.link
and binary.link to baseLinker.linkerFlags and baseLinker.linkerDeps.
Test: make checkbuild
Bug: None
Change-Id: I5fb24118e601673ae0713a6adc773a1565749be8
* The extra STL libs are:
libc++abi.a [needed for ndk_libc++_static]
libandroid_support.a [always needed in NDK r16]
libunwind.a [needed for ARM32]
* The existing STL-dependency logic in linkShared only applies to shared
libraries. By moving it to STL deps, the extra STL libs are linked into
both shared libraries and executables.
* Remove the ndk_prebuilt_library/ndkPrebuiltLibraryFactory module type,
which is unused now.
* Reuse the ndk_prebuilt_static_stl module type to describe the extra
static libraries that are linked with both the static and shared libc++
STLs.
Bug: b/73133405
Test: manual
Change-Id: I3f73e4f882d39e6efa470073bb4fc8c42dff8253
Without this any module exposed to make that uses an NDK STL will
have unsatisfied dependencies.
Test: make native
Bug: None
Change-Id: Ia456cdc230d5ebf5e1256ab131ab78248b790bc8
Change module factories from returning a blueprint.Module and a list
of property structs to returning an android.Module, which holds the
list of property structs.
Test: build.ninja identical except for Factory: comment lines
Change-Id: Ica1d823f009db812c518f271a386fbff39c9766f
Hides:
In file included from frameworks/rs/cpu_ref/rsCpuExecutable.cpp:4:
In file included from prebuilts/ndk/current/sources/cxx-stl/llvm-libc++/include/fstream:169:
In file included from prebuilts/ndk/current/sources/cxx-stl/llvm-libc++/include/ostream:138:
In file included from prebuilts/ndk/current/sources/cxx-stl/llvm-libc++/include/ios:216:
In file included from prebuilts/ndk/current/sources/cxx-stl/llvm-libc++/include/__locale:21:
prebuilts/ndk/current/sources/android/support/include/locale.h:97:9: error: 'LC_GLOBAL_LOCALE' macro redefined [-Werror,-Wmacro-redefined]
^
out-soong/ndk/sysroot/usr/include/locale.h:115:9: note: previous definition is here
^
Test: builds
Change-Id: I766e8645db33e6e71f44a131aa0b1649d83e8c51
library.static() was being used to determine if a library was static,
shared, or header only, which resulted in header only libraries
behaving like shared libraries, when they should be treated as static
libraries with no sources. Explicitly use library.static(),
library.shared(), and library.header() instead.
Bug: 35228396
Test: builds, manually examine changes to build.ninja and Android.mk
Change-Id: I51729992cc6338deda1396b86f12bc9f73e674d8
Pass a DepsContext that embeds android.BottomUpMutatorContext
instead of android.BaseContext so that dependency methods can
directly add dependencies.
Test: m -j
Change-Id: Id4c157975d3d6f03efd99785d217bef486a76139
NewLibrary is going to be used for header only libraries. Instead
of adding more boolean arguments, replace the existing ones with
BuildOnlyStatic and BuildOnlyShared calls on the libraryDecorator
returned by NewLibrary.
Test: m -j, compare build.ninja
Change-Id: Id390b66cbf2a5f0932b32f40a5e18eb9e3852ee7
So that we can represent other files that get generated along with the
objects, like the gcno coverage information, and per-file clang-tidy
runs.
Test: Soong's build.ninja identical before/after
Change-Id: I5c553a153c436d5403549f62c73fe79c5f101779
Mutator registration is tightly coupled with the android package, move
all registration from the soong package to the android package.
Test: build.ninja identical
Change-Id: Ie183d0b52cc7431c9e05b231934d189208ef1efe
For example , instead of trying to have libraryLinker inherit from
baseLinker and libraryCompiler inherit from baseCompiler, create a
single decorator object that wraps both baseLinker and baseCompiler.
Test: Builds, no unexpected changes to build.ninja
Change-Id: I2468adaea8466c203a240259ba5694b8b1df7a52
compiler, linker, and installer interfaces may be implemented by a
single decorator object, rename their methods to be unique to avoid the
same method being called multiple times.
Test: out/soong/build.ninja unchanged
Change-Id: I1608c41cd68f614ba99c11bb9fcc7936f618d9aa
Split cc.go into files per module type, plus files for the compiler,
linker, and installer stages.
Change-Id: Id44c03f42fcd180950ccd008d4de0c144ea3597b