Import globbing from Soong

Add globbing with dependency checking to blueprint.  Calling
ModuleContext.GlobWithDeps or SingletonContext.GlobWithDeps will return
a list of files that match the globs, while also adding efficient
dependencies to rerun the primary builder if a file that matches the
glob is added or removed.

Also use the globbing support for optional_subdirs=, subdirs= and build=
lines in blueprints files.  The globbing slightly changes the behavior
of subname= lines, it no longer falls back to looking for a file called
"Blueprints".  Blueprint files that need to include a subdirectory with
a different name can use build= instead of subdir= to directly include
them.  The Blueprints file is updated to reset subname="Blueprints" in
case we want to include subdirectories inside blueprint and the primary
builder has changed the subname.

Also adds a new test directory that contains a simple primary builder
tree to test regeneration for globbing, and runs the tests in travis.

Change-Id: I83ce525fd11e11579cc58ba5308d01ca8eea7bc6
18 files changed
tree: 64137bae7834b5439dd499ea76c29d6fbefc77ce
  1. bootstrap/
  2. bpfmt/
  3. bpmodify/
  4. deptools/
  5. gotestmain/
  6. gotestrunner/
  7. loadplugins/
  8. parser/
  9. pathtools/
  10. proptools/
  11. tests/
  12. .gitignore
  13. .travis.fix-fork.sh
  14. .travis.gofmt.sh
  15. .travis.install-ninja.sh
  16. .travis.yml
  17. blueprint.bash
  18. Blueprints
  19. bootstrap.bash
  20. build.ninja.in
  21. context.go
  22. context_test.go
  23. CONTRIBUTING.md
  24. doc.go
  25. fs.go
  26. glob.go
  27. LICENSE
  28. live_tracker.go
  29. mangle.go
  30. module_ctx.go
  31. ninja_defs.go
  32. ninja_strings.go
  33. ninja_strings_test.go
  34. ninja_writer.go
  35. ninja_writer_test.go
  36. package_ctx.go
  37. README.md
  38. scope.go
  39. singleton_ctx.go
  40. splice_modules_test.go
  41. unpack.go
  42. unpack_test.go
  43. visit_test.go
README.md

Blueprint Build System

Build Status

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.