Change bp2build converter of module "package".
1) Use attribute name "default_package_metadata" instead of "default_applicable_licenses" in packages to better describe its use. 2) Add a filegroup "default_metadata_file" in packages to search for METADATA file in each package. 3) Include "default_metadata_file" in each package's "default_package_metadata" attribute. Bug: 275472038 Test: CIs Change-Id: I645c013c39e3190fd96c4a549d39a331aced16bd
This commit is contained in:
@@ -87,6 +87,8 @@ func NewSourceFinder(ctx Context, config Config) (f *finder.Finder) {
|
||||
"TEST_MAPPING",
|
||||
// Bazel top-level file to mark a directory as a Bazel workspace.
|
||||
"WORKSPACE",
|
||||
// METADATA file of packages
|
||||
"METADATA",
|
||||
},
|
||||
// Bazel Starlark configuration files and all .mk files for product/board configuration.
|
||||
IncludeSuffixes: []string{".bzl", ".mk"},
|
||||
@@ -189,6 +191,13 @@ func FindSources(ctx Context, config Config, f *finder.Finder) {
|
||||
ctx.Fatalf("Could not find OWNERS: %v", err)
|
||||
}
|
||||
|
||||
// Recursively look for all METADATA files.
|
||||
metadataFiles := f.FindNamedAt(".", "METADATA")
|
||||
err = dumpListToFile(ctx, config, metadataFiles, filepath.Join(dumpDir, "METADATA.list"))
|
||||
if err != nil {
|
||||
ctx.Fatalf("Could not find METADATA: %v", err)
|
||||
}
|
||||
|
||||
// Recursively look for all TEST_MAPPING files.
|
||||
testMappings := f.FindNamedAt(".", "TEST_MAPPING")
|
||||
err = dumpListToFile(ctx, config, testMappings, filepath.Join(dumpDir, "TEST_MAPPING.list"))
|
||||
|
Reference in New Issue
Block a user