summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--android/paths.go3
-rw-r--r--bp2build/build_conversion_test.go15
2 files changed, 18 insertions, 0 deletions
diff --git a/android/paths.go b/android/paths.go
index c3fa61a09..4495ad3de 100644
--- a/android/paths.go
+++ b/android/paths.go
@@ -395,6 +395,9 @@ func BazelLabelForModuleSrcExcludes(ctx BazelConversionPathContext, paths, exclu
// `android:"path"` so that dependencies on other modules will have already been handled by the
// path_properties mutator.
func expandSrcsForBazel(ctx BazelConversionPathContext, paths, expandedExcludes []string) bazel.LabelList {
+ if paths == nil {
+ return bazel.LabelList{}
+ }
labels := bazel.LabelList{
Includes: []bazel.Label{},
}
diff --git a/bp2build/build_conversion_test.go b/bp2build/build_conversion_test.go
index 27212d135..422422b1f 100644
--- a/bp2build/build_conversion_test.go
+++ b/bp2build/build_conversion_test.go
@@ -469,6 +469,21 @@ genrule {
dir string
}{
{
+ description: "filegroup with does not specify srcs",
+ moduleTypeUnderTest: "filegroup",
+ moduleTypeUnderTestFactory: android.FileGroupFactory,
+ moduleTypeUnderTestBp2BuildMutator: android.FilegroupBp2Build,
+ bp: `filegroup {
+ name: "fg_foo",
+ bazel_module: { bp2build_available: true },
+}`,
+ expectedBazelTargets: []string{
+ `filegroup(
+ name = "fg_foo",
+)`,
+ },
+ },
+ {
description: "filegroup with no srcs",
moduleTypeUnderTest: "filegroup",
moduleTypeUnderTestFactory: android.FileGroupFactory,