commit | 80117687294aaebcdc1df11a456cd1655e58ab8d | [log] [tgz] |
---|---|---|
author | Colin Cross <ccross@android.com> | Fri Oct 30 15:53:55 2015 -0700 |
committer | Colin Cross <ccross@android.com> | Mon Nov 02 13:59:12 2015 -0800 |
tree | 31c3add8cd2d3de933a36e8e2b41e70e6a7b9d72 | |
parent | ecca05efb23c43093afeb97a922cdfdb7c6248f6 [diff] |
Add property support for pointers to bools and strings The only append semantics for bool that result in a no-op when the zero value is appended is to OR the two values together, but that is rarely the desired semantics. Add support for *bool and *string as property types, where appending a nil pointer is a no-op. For *bool, appending a non-nil pointer replaces the destination with the value. For *string, appending a non-nil pointer appends the value. This also provides a more reliable replacement for ModuleContext.ContainsProperty, as the build logic can tell that the property was set, even if it was set by a mutator and not by the blueprints file, by testing against nil. []string already provides these semantics for lists. Setting a *bool or *string property from a blueprints file is the same syntax as setting a bool or a string property.
Blueprint is a meta-build system that reads in Blueprints files that describe modules that need to be built, and produces a Ninja manifest describing the commands that need to be run and their dependencies. Where most build systems use built-in rules or a domain-specific language to describe the logic for converting module descriptions to build rules, Blueprint delegates this to per-project build logic written in Go. For large, heterogenous projects this allows the inherent complexity of the build logic to be maintained in a high-level language, while still allowing simple changes to individual modules by modifying easy to understand Blueprints files.