Handle excludes_{shared,static}_libs
Bug: 188497994 Test: bp2build.sh Change-Id: I4a5ea40cbd804e8542fe33143e4926abc0c6164f
This commit is contained in:
@@ -100,6 +100,22 @@ func BazelLabelForModuleDeps(ctx BazelConversionPathContext, modules []string) b
|
||||
return labels
|
||||
}
|
||||
|
||||
// BazelLabelForModuleDeps expects two lists: modules (containing modules to include in the list),
|
||||
// and excludes (modules to exclude from the list). Both of these should contain references to other
|
||||
// modules, ("<module>" or ":<module>"). It returns a Bazel-compatible label list which corresponds
|
||||
// to dependencies on the module within the given ctx, and the excluded dependencies.
|
||||
func BazelLabelForModuleDepsExcludes(ctx BazelConversionPathContext, modules, excludes []string) bazel.LabelList {
|
||||
moduleLabels := BazelLabelForModuleDeps(ctx, RemoveListFromList(modules, excludes))
|
||||
if len(excludes) == 0 {
|
||||
return moduleLabels
|
||||
}
|
||||
excludeLabels := BazelLabelForModuleDeps(ctx, excludes)
|
||||
return bazel.LabelList{
|
||||
Includes: moduleLabels.Includes,
|
||||
Excludes: excludeLabels.Includes,
|
||||
}
|
||||
}
|
||||
|
||||
func BazelLabelForModuleSrcSingle(ctx BazelConversionPathContext, path string) bazel.Label {
|
||||
return BazelLabelForModuleSrcExcludes(ctx, []string{path}, []string(nil)).Includes[0]
|
||||
}
|
||||
|
Reference in New Issue
Block a user