|
@@ -26,13 +26,18 @@ import (
|
|
|
)
|
|
|
|
|
|
func init() {
|
|
|
- RegisterModuleType("filegroup", FileGroupFactory)
|
|
|
+ RegisterFilegroupBuildComponents(InitRegistrationContext)
|
|
|
}
|
|
|
|
|
|
var PrepareForTestWithFilegroup = FixtureRegisterWithContext(func(ctx RegistrationContext) {
|
|
|
- ctx.RegisterModuleType("filegroup", FileGroupFactory)
|
|
|
+ RegisterFilegroupBuildComponents(ctx)
|
|
|
})
|
|
|
|
|
|
+func RegisterFilegroupBuildComponents(ctx RegistrationContext) {
|
|
|
+ ctx.RegisterModuleType("filegroup", FileGroupFactory)
|
|
|
+ ctx.RegisterModuleType("filegroup_defaults", FileGroupDefaultsFactory)
|
|
|
+}
|
|
|
+
|
|
|
var convertedProtoLibrarySuffix = "_bp2build_converted"
|
|
|
|
|
|
// IsFilegroup checks that a module is a filegroup type
|
|
@@ -178,6 +183,7 @@ type fileGroupProperties struct {
|
|
|
type fileGroup struct {
|
|
|
ModuleBase
|
|
|
BazelModuleBase
|
|
|
+ DefaultableModuleBase
|
|
|
FileGroupAsLibrary
|
|
|
properties fileGroupProperties
|
|
|
srcs Paths
|
|
@@ -195,6 +201,7 @@ func FileGroupFactory() Module {
|
|
|
module.AddProperties(&module.properties)
|
|
|
InitAndroidModule(module)
|
|
|
InitBazelModule(module)
|
|
|
+ InitDefaultableModule(module)
|
|
|
return module
|
|
|
}
|
|
|
|
|
@@ -326,3 +333,17 @@ func ToFileGroupAsLibrary(ctx BazelConversionPathContext, name string) (FileGrou
|
|
|
}
|
|
|
return nil, false
|
|
|
}
|
|
|
+
|
|
|
+// Defaults
|
|
|
+type FileGroupDefaults struct {
|
|
|
+ ModuleBase
|
|
|
+ DefaultsModuleBase
|
|
|
+}
|
|
|
+
|
|
|
+func FileGroupDefaultsFactory() Module {
|
|
|
+ module := &FileGroupDefaults{}
|
|
|
+ module.AddProperties(&fileGroupProperties{})
|
|
|
+ InitDefaultsModule(module)
|
|
|
+
|
|
|
+ return module
|
|
|
+}
|