Allow modules to vary their properties based on product variables.
For now, DEVICE_USES_LOGD, DEVICE_USES_JEMALLOC, and DEVICE_USES_DLMALLOC,
and BOARD_MALLOC_ALIGNMENT are supported.
Product variables can provide a value (only bool and int supported for
now), and if any of the product variable properties contains a "%d"
then Sprintf will be called with the property value as the format
and the product variable value convert to an int as the only argument.
For example:
product_variables: {
dlmalloc_alignment: {
cflags: ["-DMALLOC_ALIGNMENT=%d"],
},
},
will cause -DMALLOC_ALIGNMENT=16 to be added to any top level
properties called "cflags".
Change-Id: I74882a6ab4914d3e222f8d06cfac371b7b829ae5
If resources and java files were compiled from the same directory,
ctx.Glob could try to create a glob file that had the same name
as the directory containing another glob file. Namespace each
call to ctx.Glob so they never conflict.
Change-Id: I4db73af568a2ff2e708e9db64798073b1ed2ff61
Instead of putting all the blueprint registrations in soong_build,
put them all in init() functions. This puts the registration next
to the implementation.
Change-Id: Ide1a749518f5e9d1367a18ab3bb1d91da3310c76
To align with the current make build system, add exclude_srcs and
exclude_java_resource_dirs. These replace the functionality of
arch_subtract and glob exclusions that use "-file" to exclude a file.
Change-Id: I91c23d5e3c9409f2d9f7921f950153a03a68ad61
Improve the comments associated with properties to work better with
Blueprint's auto-documenting feature.
Make all properties structs into named types so that thet types can be
found using reflection and cross-referenced to the source code to
auto-extract docs.
Remove the leading <property>: text from properties, the documentation
will include the lowercased name of the property.
Add filter tags to the nested arch properties.
Change-Id: I4ef5db86358886fe61456c24eb2dbe6f7b876115
So that we generate the Android.mk file if it is removed. Adding
Android.mk files is already handled by the implicit dependencies in
common.Glob
Change-Id: I568e24b7bc44ecadbbe01c1f7c6a97afd819c7db
This finds any Android.bp files with Android modules defined, and if
there isn't an Android.mk file in the same directory, it will run
androidbp to generate one in $OUT
Change-Id: Ie8aef492e8cd28f6c314ce1254730975a1b8991f
Make common.Glob take an interface that is the intersection of
blueprint.ModuleContext and blueprint.SingletonContext used by
Glob and GlobRule, allowing it to be called on either. Also
move ExpandSources and Glob into AndroidModuleContext.
Change-Id: I8d1a3160c5dd201033afdb37210e82d8065b137d
Build a map of blueprint directory to modules built from that
directory, and then add phony rules to build.ninja that emulate
the behavior of mma in the current build system.
Also fixes checkbuild to depend on checkbuild files and installable
files, but not installed files.
Change-Id: I8bad6e93387940df7439dbd4554f6d79f924c65f
Take HostOrDevice out of Arch, and put it into AndroidModuleBase
instead. Also separate out the host vs. device mutator from
ArchMutator. This will make it possible for genrules to depend
on a host tool, regardless of which host arches it is compiled
for.
Change-Id: I22bbfd28b65c3eebdfa101a712f90dd615148dc8
Support -file or -path/glob in file lists that contain globs to
subtract files from the resulting glob. Also move source file
prefixing and handling into a common function.
Change-Id: Ib6d74ce22f53cae7348c4ba35b779976d90359a6
Using ctx.Config().(Config) everywhere is a mouthful, and it is
inefficient to do the type assertion. Put the Config interface into
the context, and provide an AConfig() to return the Config already
converted to the right type.
Change-Id: I301a1fd7d2a005580aabca7866a37c5d42ad8c69
Add support for yacc (.y or .yy) and lex (.l or .ll) files. Also
tweak locations of .o files for normal and generated sources to
makes sure they don't collide.
Change-Id: I03172cddbdc022525bf392a81d72050406b8cdb3
Add support for compiling java libraries (.jar files with
or without .dex), java binaries (.jar files with a wrapper
script to run them), and java prebuilts (for the SDK .jars)
Change-Id: Id624da64c92cf20c6d9577c6bb06e5b212af0d1b
Use the config to get paths to install to, allow installing
a file to a different file name than the intermediate file,
and allow dependencies between installed files.
Change-Id: I37ac32d2fa1458150b6d54f6ec9cdac70a0259e8
Instead of setting a string property to magic default value and then
checking for it later, call ctx.ContainsProperty to determine if it
was set. Use the same method on the clang bool property, which
couldn't be set to a magic value.
blueprint's ModuleContext.ContainsProperty only works on a single
property, not on all arch variant properties -
ModuleContext.ContainsProperty("clang") will return false if
clang was not set but arch.arm.clang was set - so track which
properties were extended inside extendProperties, and override
ModuleContext.ContainsProperty in AndroidModuleContext to also
check the extended properties.
Change-Id: I03cbe71dc69344972e23d6c794da9be05e720c45
The context checkbuild files were not copied to the module checkbuild
files before calling generateModuleTarget, which would cause them
to not be considered, and in the case of a module with a single
variant, cause a build failure when the checkbuild target was skipped.
Change-Id: I77faafdc1a8a866e3c2c1157f987015b553acf01
Ninja can't depend on environment variables, so modifying build
behavior based on environment variables requires coordinating
between the soong script that invokes ninja and the soong_build
manifest generator.
Allow any module to call Config.Getenv to get the contents of an
environment variable while registering a dependency on it.
After all modules have been processed write out the state of
all used environment variables to a JSON file called
.soong.environment. During the next build the soong script
will use the soong_env tool to compare the contents of
.soong.environment to the current environment, and force a
build manifest regeneration by deleting the .soong.environment
file if any variables have changed.
Change-Id: Id0d81933a857bc2fc1cd7a393a3c6cec73dc4824
Add Host(), Device(), and Debug() to AndroidModuleContext to allow
build rule generators to easily determine build options.
Change-Id: Ib93a462cb45189399063f641b3a8df175db0592e
Refactor common code out of NewCC* to initialize the ccBase,
ccDynamic, and ccLibrary structures. Also adds an enum for the
default multilib values.
Change-Id: Iaeffe86bf2568b6054be4ddcee725818af45e14f
Modules can choose to add "installed files", which are files that
a product can depend on to cause the module to build, and "checkbuild
files", which will only be built if another module that needs to build
depends on them. For every target, add a module-install and a
module-checkbuild target that create dependencies on those files,
and then add a global checkbuild target that depends on all the
module-checkbuild targets. Also add a module target for each module
that depends on module-install and module-checkbuild.
Change-Id: I801389ad6ab9806b71d92cd327a0f9cb7582e0df
Initial build logic for building android with soong. It can build
a variety of C and C++ files for arm/arm64 and host.
Change-Id: I10eb37c2c2a50be6af1bb5fd568c0962b9476bf0