Commit graph

10 commits

Author SHA1 Message Date
Colin Cross
1b457a5e10 Add VariableFuncContext argument to VariableFuncs
Add a VariableFuncContext argument to VariableFuncs that implements
GlobWithDeps.  This will allow Soong to use optimized glob dependencies
in VariableFuncs.

Bug: 257079828
Test: no dependencies on directories in build.ninja.d
Change-Id: Iee5fc9c9ae3087662a5d1a3d7323a87462299205
2022-11-04 18:21:31 +00:00
Colin Cross
9ece72b055 Add Validations support to Blueprint
The Android fork of Ninja supports "validations", a node that is
added to the top level of the build graph whenever another node
is in the build graph.  Add support in Blueprint to specify them
on build statements and write them to the ninja.

Test: ninja_writer_test.go
Change-Id: I87cd1281dbd2ed113cc26a265c50d20c65118c91
2020-07-09 14:28:20 -07:00
Colin Cross
2ce594e446 Make ninjaString an interface
There are 8935901 *ninjaString objects generated in an AOSP
aosp_blueline-userdebug build, and 7865180 of those are a literal
string with no ninja variables.
Each of those *ninjaString objects takes a minimum of 48 bytes for
2 slices, plus 8 bytes for the pointer to the ninjaString.  For
the literal string case, one of those slices has a single element,
(costing another 16 bytes for the backing array), and the other
slice is empty, for a total of 72 bytes.

Replace *ninjaString with a ninjaString interface.  This increases
the size of the reference from 8 bytes to 16 bytes, but using
a type alias of a string for the literal string implementation uses
only 16 bytes, saving 40 bytes per literal string or 314 MB.

Test: ninja_strings_test
Change-Id: Ic5fe16ed1f2a244fe6a8ccdf762919634d825cbe
2020-01-29 16:23:40 -08:00
Colin Cross
47113641cd Allow rules to specify order-only dependencies
Commands that contain tools that don't affect the build results
may want an order-only dependency on the tool.  Allow rules
to specify order-only dependencies the same way they specify
implicit dependencies.

Test: builds
Change-Id: I3e0f886ae047b0fadf7a5c0dfeb9827d2c5c411d
2017-10-17 13:50:49 -07:00
Colin Cross
7aa318f83d Allow BuildParams to override ninja description
Allow the ninja description variable to be set on build statements
as well as rules.

Change-Id: I6abb2a8ec83a0c662348cc957fa1a307e6c9c6bb
2017-05-09 10:02:54 -07:00
Dan Willemsen
fce63d3c8f Add common implicit deps to Rules
For implicit dependencies that will be common to all users of a Rule,
add a new field 'CommandDeps' to the RuleParam. This is a list of
strings to be prepended to the implicit dependencies in each BuildParam.

This lets us have the dependencies declared next to where they are used,
instead of duplicated in areas that may be far apart.

I looked at passing this information down to ninja too, but it only
saves us a few percent of ninja file, and requires a modification to the
ninja file format.

Change-Id: Ifd910dee1506d4e32a76ed06206f853c4caec622
2015-11-17 17:08:05 -08:00
Ken Oslund
4b9a0514cd Adding a builtinPool type
This implements the Pool interface. An instance of a builtinPool
is created for the Console pool.

Change-Id: I03334c25495dc573aef2c0e62415352a0b10d6fd
2015-04-16 13:10:19 -04:00
Colin Cross
ab6d790165 Move build actions into modules
Move actionDefs from moduleGroup to moduleInfo.  This will result
in multiple build.ninja headers for a single Blueprint file module
if it has multiple variants, each one specifying the variant
used to generate the following rules.

Change-Id: I414cd4d3266da8c2e92118b295569627ddf48cdd
2015-03-12 17:36:57 -07:00
Colin Cross
8e0c51192a Add license headers and LICENSE file
Change-Id: I6f7c7374093c0745ee4aa677480376a06648b358
2015-01-23 14:23:27 -08:00
Colin Cross
3e8e74f276 Move blueprint/* up a directory
Make integrating with go tools easier by putting the blueprint package
files in the top level directory of the git project instead of in a
subdirectory called blueprint.

Change-Id: I35c144c5fe7ddf34e478d0c47c50b2f6c92c2a03
2015-01-23 14:23:27 -08:00
Renamed from blueprint/live_tracker.go (Browse further)