We're already going to load the .ninja_deps file, so we may as well use
it. These are the only two files in our build that don't.
Test: dump the .ninja_deps file, see the dependencies
Allow the primary builder to stop bootstrap between
ResolveDependencies and PrepareBuildActions so that it can
use the build graph to write customized documentation.
Change-Id: I67ee5e6e438a0c2c3ec844c4c453d223971e60a2
Move the docs to the main stage and make a phony rule to build
them. This will allow the primaray builder to choose not to
build them so that it can use its own rule instead.
Change-Id: Ib788f74717ccdcd85c2e5b6a581cc744d439341a
Separate the extraction of documentation-related info from writing
it out so that the primary builder can choose to write it out in
a customized format.
Change-Id: If2c91d6f13b8cea2e9e1cca75d8c2d684ad7f6df
Glob names were appending every excluded file, which could result
in too many / characters for ninja to handle. Use a hash if the
result contains too many / characters.
Change-Id: I88920f0596df49639a6c2b4f8af47ea8fdc1ee5a
Bug: 65683273
Test: build/soong/scripts/diff_build_graphs.sh \
'build/blueprint:work^^^' 'build/blueprint:work'
Test: put a syntax error in a file and see that the
reported error reports the location of the violation
Change-Id: Iaeedb91ea8e816cb8e9ee954f21cd6c6bc4afa48
To allow it to validate that the filename equals Android.bp
Bug: 65683273
Test: m -j nothing # which runs tests
Change-Id: I171dddd102590df558053b615d39c75c00b6ac6e
in facilitate moving name resolution to Soong
Bug: 65683273
Test: build/soong/scripts/diff_build_graphs.sh \
--products=aosp_arm \
'build/blueprint:work^' 'build/blueprint:work'
# and see that the only changes were:
# 1. adding the name_interface.go file
# 2. changing some line numbers
Change-Id: Ifa7603cca59b3b3d592f2f146fdafe57012bd4b9
Export pathtools.Match so that tools that operate on file lists
(like zip listings) can use the same glob format.
Test: m checkbuild
Change-Id: Ic4b90139c381c57551836590da3ea54826b0227a
PreSingletons use the same interface as Singletons, but run after
parsing all the blueprint files but before running any mutators
or GenerateBuildActions. They can be used to perform global setup,
including generating rules, that may be referenced by later
mutator or generate passes.
Test: m checkbuild
Change-Id: I4b93425a724e739f5b8843262efb8804b3bf3531
Support int64 number instead of int to be more fixed to bit size so
that the underlying arch won't affect overflow cases. Besides,
refection: func (v Value) Int() int64 always cast to int64 no matter the
input is int, int16, int32. Currently we always treat "-" as negative
sign to bind to next value, and "+" as plus operator to add operands
together.
So we allow:
a = 5 + -4 + 5 or a = -4 + 5
But we don't allow:
a = +5 + 4 + -4 since we don't treat "+" as a positive sign, otherwise,
a = 5 + +5 would exist which looks pretty weird. In the future, we may
want fully support number calculator logic eg, "+"/"-" can be
positive/negative sign or operator, and "(" and ")" will be considered
to group expressions with a higher precedence.
int & uint properties within struct keeps unchanged, which is only
allowed when tagged with 'blueprint:mutated'. We only allow *int64
property instead of int64 property within struct since it does't make
sense to do prepending or appending to int64.
Change-Id: I565e046dbd268af3538aee148cd7300037e56523
Easier to debug than "Failed to compile: main: exit status 2"
Bug: 68770962
Test: sed -i 's/build.FindSources/files := build.FindSources/' build/soong/cmd/soong_ui/main.go \
&& m -j nothing
Change-Id: If78a4fa1c3999e7c658dce072c05d7d3e23b8683
because there some symlinks named Android.bp that point to
files named Android.bp that contain <subdir> entries that
are supposed to be interpreted relative to the original
symlink. It's more convenient to just skip following subdirs.
Bug: 64363847
Test: make -j
Change-Id: Ib15f1d1c7d511191fd841b1a29ceed559dd6cdbb
When a mutator calls CreateModule, set the blueprints file and line
number to the values of the module that the mutator was visiting.
Change-Id: I4526f14a744be944e42582bc46f11a9a7b502f03
An ill-fated experiment with using a format that was closer to
Bazel left Blueprint preferring the original style, but documenting
and using the new style. Update the documentation and run bpfmt -w.
Test: builds
Change-Id: I3fb70c8fa50c332da01cf5912b179c60d1638814
This is partially in hopes of making it generally easier to use, and
partially in hopes of specifically making it less tempting to do
bpfmt Android.bp > Android.bp
which actually would just erase the contents of Android.bp
Test: bpfmt Android.bp 2>&1 | grep usage && echo ok
Bug: 67326589
Change-Id: I41c23aca6214f27dbdf55e5931f9392c318e82ed
To prevent against multiple instances attempting to rebuild the same
executable, add a file lock to Build().
The trace file may not be consistent in this case, but everything that
reads it should be able to handle a corrupted trace file.
Test: `while true; do <microfactory-enabled executable>; done` in
parallel, and modify the code to microfactory (echo "//"
>>microfactory.go)
Change-Id: I30cb22bb9c790c57c507354127d4a5f82526a489