platform_build_blueprint/Blueprints
Colin Cross 127d2eae8b 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
2016-11-03 13:54:03 -07:00

161 lines
3.5 KiB
Text

bootstrap_go_package(
name = "blueprint",
deps = [
"blueprint-parser",
"blueprint-pathtools",
"blueprint-proptools",
],
pkgPath = "github.com/google/blueprint",
srcs = [
"context.go",
"fs.go",
"glob.go",
"live_tracker.go",
"mangle.go",
"module_ctx.go",
"ninja_defs.go",
"ninja_strings.go",
"ninja_writer.go",
"package_ctx.go",
"scope.go",
"singleton_ctx.go",
"unpack.go",
],
testSrcs = [
"context_test.go",
"ninja_strings_test.go",
"ninja_writer_test.go",
"splice_modules_test.go",
"unpack_test.go",
"visit_test.go",
],
)
bootstrap_go_package(
name = "blueprint-parser",
pkgPath = "github.com/google/blueprint/parser",
srcs = [
"parser/ast.go",
"parser/modify.go",
"parser/parser.go",
"parser/printer.go",
"parser/sort.go",
],
testSrcs = [
"parser/parser_test.go",
"parser/printer_test.go",
],
)
bootstrap_go_package(
name = "blueprint-deptools",
pkgPath = "github.com/google/blueprint/deptools",
srcs = ["deptools/depfile.go"],
)
bootstrap_go_package(
name = "blueprint-pathtools",
pkgPath = "github.com/google/blueprint/pathtools",
deps = [
"blueprint-deptools",
],
srcs = [
"pathtools/lists.go",
"pathtools/glob.go",
],
testSrcs = [
"pathtools/glob_test.go",
],
)
bootstrap_go_package(
name = "blueprint-proptools",
pkgPath = "github.com/google/blueprint/proptools",
srcs = [
"proptools/clone.go",
"proptools/escape.go",
"proptools/extend.go",
"proptools/proptools.go",
"proptools/typeequal.go",
],
testSrcs = [
"proptools/clone_test.go",
"proptools/escape_test.go",
"proptools/extend_test.go",
"proptools/typeequal_test.go",
],
)
bootstrap_go_package(
name = "blueprint-bootstrap",
deps = [
"blueprint",
"blueprint-deptools",
"blueprint-pathtools",
"blueprint-bootstrap-bpdoc",
],
pkgPath = "github.com/google/blueprint/bootstrap",
srcs = [
"bootstrap/bootstrap.go",
"bootstrap/cleanup.go",
"bootstrap/command.go",
"bootstrap/config.go",
"bootstrap/doc.go",
"bootstrap/glob.go",
"bootstrap/writedocs.go",
],
)
bootstrap_go_package(
name = "blueprint-bootstrap-bpdoc",
deps = [
"blueprint",
"blueprint-proptools",
],
pkgPath = "github.com/google/blueprint/bootstrap/bpdoc",
srcs = [
"bootstrap/bpdoc/bpdoc.go",
],
)
bootstrap_core_go_binary(
name = "minibp",
deps = [
"blueprint",
"blueprint-bootstrap",
],
srcs = ["bootstrap/minibp/main.go"],
)
bootstrap_core_go_binary(
name = "bpglob",
deps = ["blueprint-pathtools"],
srcs = ["bootstrap/bpglob/bpglob.go"],
)
blueprint_go_binary(
name = "bpfmt",
deps = ["blueprint-parser"],
srcs = ["bpfmt/bpfmt.go"],
)
blueprint_go_binary(
name = "bpmodify",
deps = ["blueprint-parser"],
srcs = ["bpmodify/bpmodify.go"],
)
bootstrap_core_go_binary(
name = "gotestmain",
srcs = ["gotestmain/gotestmain.go"],
)
bootstrap_core_go_binary(
name = "gotestrunner",
srcs = ["gotestrunner/gotestrunner.go"],
)
bootstrap_go_binary{
name = "loadplugins",
srcs = ["loadplugins/loadplugins.go"],
}