platform_build_blueprint/Android.bp

235 lines
5.8 KiB
Text
Raw Normal View History

package {
default_applicable_licenses: ["build_blueprint_license"],
}
// Added automatically by a large-scale-change that took the approach of
// 'apply every license found to every target'. While this makes sure we respect
// every license restriction, it may not be entirely correct.
//
// e.g. GPL in an MIT project might only apply to the contrib/ directory.
//
// Please consider splitting the single license below into multiple licenses,
// taking care not to lose any license_kind information, and overriding the
// default license using the 'licenses: [...]' property on targets as needed.
//
// For unused files, consider creating a 'fileGroup' with "//visibility:private"
// to attach the license to, and including a comment whether the files may be
// used in the current project.
// See: http://go/android-license-faq
license {
name: "build_blueprint_license",
visibility: [":__subpackages__"],
license_kinds: [
"SPDX-license-identifier-Apache-2.0",
"SPDX-license-identifier-BSD",
],
license_text: [
"LICENSE",
],
}
bootstrap_go_package {
name: "blueprint",
deps: [
"blueprint-metrics",
"blueprint-parser",
"blueprint-pathtools",
"blueprint-proptools",
],
pkgPath: "github.com/google/blueprint",
srcs: [
"context.go",
"glob.go",
"live_tracker.go",
"mangle.go",
"module_ctx.go",
"name_interface.go",
"ninja_defs.go",
"ninja_strings.go",
"ninja_writer.go",
"package_ctx.go",
"provider.go",
"scope.go",
"singleton_ctx.go",
],
testSrcs: [
"context_test.go",
"glob_test.go",
"module_ctx_test.go",
"ninja_strings_test.go",
"ninja_writer_test.go",
"provider_test.go",
"splice_modules_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/modify_test.go",
"parser/parser_test.go",
"parser/printer_test.go",
"parser/sort_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/fs.go",
"pathtools/glob.go",
],
testSrcs: [
"pathtools/fs_test.go",
"pathtools/glob_test.go",
"pathtools/lists_test.go",
],
}
bootstrap_go_package {
name: "blueprint-proptools",
pkgPath: "github.com/google/blueprint/proptools",
deps: [
"blueprint-parser",
],
srcs: [
"proptools/clone.go",
"proptools/escape.go",
"proptools/extend.go",
"proptools/filter.go",
"proptools/proptools.go",
"proptools/tag.go",
"proptools/typeequal.go",
"proptools/unpack.go",
],
testSrcs: [
"proptools/clone_test.go",
"proptools/escape_test.go",
"proptools/extend_test.go",
"proptools/filter_test.go",
"proptools/tag_test.go",
"proptools/typeequal_test.go",
"proptools/unpack_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/command.go",
"bootstrap/config.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/bpdoc/properties.go",
"bootstrap/bpdoc/reader.go",
],
testSrcs: [
"bootstrap/bpdoc/bpdoc_test.go",
"bootstrap/bpdoc/properties_test.go",
"bootstrap/bpdoc/reader_test.go",
],
}
blueprint_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",
"blueprint-proptools",
],
srcs: ["bpmodify/bpmodify.go"],
testSrcs: ["bpmodify/bpmodify_test.go"],
}
blueprint_go_binary {
name: "gotestmain",
srcs: ["gotestmain/gotestmain.go"],
}
Enhance bootstrap stage selection This simplifies the bootstrap process while making it more flexible by moving the stage selection into a go binary(choosestage). It will now be possible to have more than two build stages. Now each stage has a ninja template(main.ninja.in) and a timestamp file(main.ninja.in.timestamp). The timestamp file may be updated by any build stage that wishes to regenerate the ninja template. If the choosestage binaries sees that the timestamp is newer than the template, it will choose the prior stage. The main stage no longer writes to the source tree to update the build.ninja.in file. This was a problem for read-only source trees. Instead, the choosestage binary first checks to see if that file is newer than the last bootstrap.ninja.in, copies it in place, and starts the boostrap stage. The bootstrap stage regenerates it's own ninja template, but that required a loop through the main stage to actually run it. The choosestage binary now detects if the template has changed for the current stage, and will restart the stage. One change is that if dependencies do get messed up, instead of silently failing, there's a higher chance that the bootstrap step will just continue looping, doing nothing. This can happen if the main stage has a dependency that triggers the bootstrap stage, but the bootstrap stage doesn't see anything required to rebuild the main ninja file. A side effect of this requirement is that changes to test code will now rebuild the main ninja file. Change-Id: I9965cfba79dc0dbbd3af05f5944f7653054455a2
2015-07-23 02:05:59 +02:00
// gotestmain tests can't be on the gotestmain module because it is an implicit dependency of tests.
// Put the tests in their own package and make it a dependency of minibp to make sure they run.
bootstrap_go_package {
name: "gotestmain-tests",
pkgPath: "github.com/google/blueprint/gotestmain",
srcs: [
"gotestmain/dummy.go",
],
testSrcs: [
"gotestmain/testmain_test.go",
],
}
blueprint_go_binary {
name: "gotestrunner",
srcs: ["gotestrunner/gotestrunner.go"],
}
blueprint_go_binary {
name: "loadplugins",
srcs: ["loadplugins/loadplugins.go"],
}
blueprint_go_binary {
name: "microfactory",
deps: ["blueprint-microfactory"],
srcs: ["microfactory/main/main.go"],
}
bootstrap_go_package {
name: "blueprint-microfactory",
pkgPath: "github.com/google/blueprint/microfactory",
srcs: ["microfactory/microfactory.go"],
testSrcs: ["microfactory/microfactory_test.go"],
}