Make TestContext.RegisterModuleType take an android.ModuleFactory

am: 4b49b768a2

Change-Id: Ifdfcdcc3cbf58713bc16fa3f55dd5e2afe0e5943
This commit is contained in:
Colin Cross 2019-11-25 14:22:02 -08:00 committed by android-build-merger
commit 89169a36dd
33 changed files with 204 additions and 201 deletions

View file

@ -47,8 +47,8 @@ func TestAndroidMkSingleton_PassesUpdatedAndroidMkDataToCustomCallback(t *testin
config.inMake = true // Enable androidmk Singleton
ctx := NewTestContext()
ctx.RegisterSingletonType("androidmk", SingletonFactoryAdaptor(AndroidMkSingleton))
ctx.RegisterModuleType("custom", ModuleFactoryAdaptor(customModuleFactory))
ctx.RegisterSingletonType("androidmk", AndroidMkSingleton)
ctx.RegisterModuleType("custom", customModuleFactory)
ctx.Register()
bp := `

View file

@ -338,7 +338,7 @@ func TestArchMutator(t *testing.T) {
for _, tt := range testCases {
t.Run(tt.name, func(t *testing.T) {
ctx := NewTestArchContext()
ctx.RegisterModuleType("module", ModuleFactoryAdaptor(archTestModuleFactory))
ctx.RegisterModuleType("module", archTestModuleFactory)
ctx.MockFileSystem(mockFS)
ctx.Register()
config := TestArchConfig(buildDir, nil)

View file

@ -22,7 +22,7 @@ func testCSuiteConfig(test *testing.T, bpFileContents string) *TestContext {
config := TestArchConfig(buildDir, nil)
ctx := NewTestArchContext()
ctx.RegisterModuleType("csuite_config", ModuleFactoryAdaptor(CSuiteConfigFactory))
ctx.RegisterModuleType("csuite_config", CSuiteConfigFactory)
ctx.Register()
mockFiles := map[string][]byte{
"Android.bp": []byte(bpFileContents),

View file

@ -64,8 +64,8 @@ func TestDefaultsAllowMissingDependencies(t *testing.T) {
ctx := NewTestContext()
ctx.SetAllowMissingDependencies(true)
ctx.RegisterModuleType("test", ModuleFactoryAdaptor(defaultsTestModuleFactory))
ctx.RegisterModuleType("defaults", ModuleFactoryAdaptor(defaultsTestDefaultsFactory))
ctx.RegisterModuleType("test", defaultsTestModuleFactory)
ctx.RegisterModuleType("defaults", defaultsTestDefaultsFactory)
ctx.PreArchMutators(RegisterDefaultsPreArchMutators)

View file

@ -165,7 +165,7 @@ func depsModuleFactory() Module {
func TestErrorDependsOnDisabledModule(t *testing.T) {
ctx := NewTestContext()
ctx.RegisterModuleType("deps", ModuleFactoryAdaptor(depsModuleFactory))
ctx.RegisterModuleType("deps", depsModuleFactory)
bp := `
deps {

View file

@ -62,7 +62,7 @@ func TestMutatorAddMissingDependencies(t *testing.T) {
ctx := NewTestContext()
ctx.SetAllowMissingDependencies(true)
ctx.RegisterModuleType("test", ModuleFactoryAdaptor(mutatorTestModuleFactory))
ctx.RegisterModuleType("test", mutatorTestModuleFactory)
ctx.PreDepsMutators(func(ctx RegisterMutatorsContext) {
ctx.TopDown("add_missing_dependencies", addMissingDependenciesMutator)
})
@ -131,7 +131,7 @@ func TestModuleString(t *testing.T) {
})
})
ctx.RegisterModuleType("test", ModuleFactoryAdaptor(mutatorTestModuleFactory))
ctx.RegisterModuleType("test", mutatorTestModuleFactory)
bp := `
test {

View file

@ -637,9 +637,9 @@ func setupTestFromFiles(bps map[string][]byte) (ctx *TestContext, errs []error)
ctx = NewTestContext()
ctx.MockFileSystem(bps)
ctx.RegisterModuleType("test_module", ModuleFactoryAdaptor(newTestModule))
ctx.RegisterModuleType("soong_namespace", ModuleFactoryAdaptor(NamespaceFactory))
ctx.RegisterModuleType("blueprint_test_module", newBlueprintTestModule)
ctx.RegisterModuleType("test_module", newTestModule)
ctx.RegisterModuleType("soong_namespace", NamespaceFactory)
ctx.Context.RegisterModuleType("blueprint_test_module", newBlueprintTestModule)
ctx.PreArchMutators(RegisterNamespaceMutator)
ctx.PreDepsMutators(func(ctx RegisterMutatorsContext) {
ctx.BottomUp("rename", renameMutator)

View file

@ -269,10 +269,10 @@ func TestNeverallow(t *testing.T) {
func testNeverallow(config Config, fs map[string][]byte) (*TestContext, []error) {
ctx := NewTestContext()
ctx.RegisterModuleType("cc_library", ModuleFactoryAdaptor(newMockCcLibraryModule))
ctx.RegisterModuleType("java_library", ModuleFactoryAdaptor(newMockJavaLibraryModule))
ctx.RegisterModuleType("java_library_host", ModuleFactoryAdaptor(newMockJavaLibraryModule))
ctx.RegisterModuleType("java_device_for_host", ModuleFactoryAdaptor(newMockJavaLibraryModule))
ctx.RegisterModuleType("cc_library", newMockCcLibraryModule)
ctx.RegisterModuleType("java_library", newMockJavaLibraryModule)
ctx.RegisterModuleType("java_library_host", newMockJavaLibraryModule)
ctx.RegisterModuleType("java_device_for_host", newMockJavaLibraryModule)
ctx.PostDepsMutators(registerNeverallowMutator)
ctx.Register()

View file

@ -87,7 +87,7 @@ func testPackage(fs map[string][]byte) (*TestContext, []error) {
config := TestArchConfig(buildDir, nil)
ctx := NewTestArchContext()
ctx.RegisterModuleType("package", ModuleFactoryAdaptor(PackageFactory))
ctx.RegisterModuleType("package", PackageFactory)
ctx.PreArchMutators(registerPackageRenamer)
ctx.Register()

View file

@ -100,8 +100,8 @@ func TestPathDepsMutator(t *testing.T) {
config := TestArchConfig(buildDir, nil)
ctx := NewTestArchContext()
ctx.RegisterModuleType("test", ModuleFactoryAdaptor(pathDepsMutatorTestModuleFactory))
ctx.RegisterModuleType("filegroup", ModuleFactoryAdaptor(FileGroupFactory))
ctx.RegisterModuleType("test", pathDepsMutatorTestModuleFactory)
ctx.RegisterModuleType("filegroup", FileGroupFactory)
bp := test.bp + `
filegroup {

View file

@ -865,9 +865,9 @@ func testPathForModuleSrc(t *testing.T, buildDir string, tests []pathForModuleSr
config := TestConfig(buildDir, nil)
ctx := NewTestContext()
ctx.RegisterModuleType("test", ModuleFactoryAdaptor(pathForModuleSrcTestModuleFactory))
ctx.RegisterModuleType("output_file_provider", ModuleFactoryAdaptor(pathForModuleSrcOutputFileProviderModuleFactory))
ctx.RegisterModuleType("filegroup", ModuleFactoryAdaptor(FileGroupFactory))
ctx.RegisterModuleType("test", pathForModuleSrcTestModuleFactory)
ctx.RegisterModuleType("output_file_provider", pathForModuleSrcOutputFileProviderModuleFactory)
ctx.RegisterModuleType("filegroup", FileGroupFactory)
fgBp := `
filegroup {
@ -1079,7 +1079,7 @@ func TestPathsForModuleSrc_AllowMissingDependencies(t *testing.T) {
ctx := NewTestContext()
ctx.SetAllowMissingDependencies(true)
ctx.RegisterModuleType("test", ModuleFactoryAdaptor(pathForModuleSrcTestModuleFactory))
ctx.RegisterModuleType("test", pathForModuleSrcTestModuleFactory)
bp := `
test {

View file

@ -23,12 +23,12 @@ import (
func testPrebuiltEtc(t *testing.T, bp string) (*TestContext, Config) {
config := TestArchConfig(buildDir, nil)
ctx := NewTestArchContext()
ctx.RegisterModuleType("prebuilt_etc", ModuleFactoryAdaptor(PrebuiltEtcFactory))
ctx.RegisterModuleType("prebuilt_etc_host", ModuleFactoryAdaptor(PrebuiltEtcHostFactory))
ctx.RegisterModuleType("prebuilt_usr_share", ModuleFactoryAdaptor(PrebuiltUserShareFactory))
ctx.RegisterModuleType("prebuilt_usr_share_host", ModuleFactoryAdaptor(PrebuiltUserShareHostFactory))
ctx.RegisterModuleType("prebuilt_font", ModuleFactoryAdaptor(PrebuiltFontFactory))
ctx.RegisterModuleType("prebuilt_firmware", ModuleFactoryAdaptor(PrebuiltFirmwareFactory))
ctx.RegisterModuleType("prebuilt_etc", PrebuiltEtcFactory)
ctx.RegisterModuleType("prebuilt_etc_host", PrebuiltEtcHostFactory)
ctx.RegisterModuleType("prebuilt_usr_share", PrebuiltUserShareFactory)
ctx.RegisterModuleType("prebuilt_usr_share_host", PrebuiltUserShareHostFactory)
ctx.RegisterModuleType("prebuilt_font", PrebuiltFontFactory)
ctx.RegisterModuleType("prebuilt_firmware", PrebuiltFirmwareFactory)
ctx.PreDepsMutators(func(ctx RegisterMutatorsContext) {
ctx.BottomUp("prebuilt_etc", prebuiltEtcMutator).Parallel()
})

View file

@ -132,9 +132,9 @@ func TestPrebuilts(t *testing.T) {
ctx := NewTestContext()
ctx.PreArchMutators(RegisterPrebuiltsPreArchMutators)
ctx.PostDepsMutators(RegisterPrebuiltsPostDepsMutators)
ctx.RegisterModuleType("filegroup", ModuleFactoryAdaptor(FileGroupFactory))
ctx.RegisterModuleType("prebuilt", ModuleFactoryAdaptor(newPrebuiltModule))
ctx.RegisterModuleType("source", ModuleFactoryAdaptor(newSourceModule))
ctx.RegisterModuleType("filegroup", FileGroupFactory)
ctx.RegisterModuleType("prebuilt", newPrebuiltModule)
ctx.RegisterModuleType("source", newSourceModule)
ctx.Register()
ctx.MockFileSystem(map[string][]byte{
"prebuilt_file": nil,

View file

@ -465,8 +465,8 @@ func TestRuleBuilder_Build(t *testing.T) {
"bar": nil,
"cp": nil,
})
ctx.RegisterModuleType("rule_builder_test", ModuleFactoryAdaptor(testRuleBuilderFactory))
ctx.RegisterSingletonType("rule_builder_test", SingletonFactoryAdaptor(testRuleBuilderSingletonFactory))
ctx.RegisterModuleType("rule_builder_test", testRuleBuilderFactory)
ctx.RegisterSingletonType("rule_builder_test", testRuleBuilderSingletonFactory)
ctx.Register()
_, errs := ctx.ParseFileList(".", []string{"Android.bp"})

View file

@ -9,8 +9,8 @@ func testShBinary(t *testing.T, bp string) (*TestContext, Config) {
config := TestArchConfig(buildDir, nil)
ctx := NewTestArchContext()
ctx.RegisterModuleType("sh_test", ModuleFactoryAdaptor(ShTestFactory))
ctx.RegisterModuleType("sh_test_host", ModuleFactoryAdaptor(ShTestHostFactory))
ctx.RegisterModuleType("sh_test", ShTestFactory)
ctx.RegisterModuleType("sh_test_host", ShTestHostFactory)
ctx.Register()
mockFiles := map[string][]byte{
"Android.bp": []byte(bp),

View file

@ -71,7 +71,15 @@ func (ctx *TestContext) PostDepsMutators(f RegisterMutatorFunc) {
func (ctx *TestContext) Register() {
registerMutators(ctx.Context.Context, ctx.preArch, ctx.preDeps, ctx.postDeps)
ctx.RegisterSingletonType("env", SingletonFactoryAdaptor(EnvSingleton))
ctx.RegisterSingletonType("env", EnvSingleton)
}
func (ctx *TestContext) RegisterModuleType(name string, factory ModuleFactory) {
ctx.Context.RegisterModuleType(name, ModuleFactoryAdaptor(factory))
}
func (ctx *TestContext) RegisterSingletonType(name string, factory SingletonFactory) {
ctx.Context.RegisterSingletonType(name, SingletonFactoryAdaptor(factory))
}
func (ctx *TestContext) ModuleForTests(name, variant string) TestingModule {

View file

@ -159,17 +159,17 @@ func testProductVariableModuleFactoryFactory(props interface{}) func() Module {
func TestProductVariables(t *testing.T) {
ctx := NewTestContext()
// A module type that has a srcs property but not a cflags property.
ctx.RegisterModuleType("module1", ModuleFactoryAdaptor(testProductVariableModuleFactoryFactory(struct {
ctx.RegisterModuleType("module1", testProductVariableModuleFactoryFactory(struct {
Srcs []string
}{})))
}{}))
// A module type that has a cflags property but not a srcs property.
ctx.RegisterModuleType("module2", ModuleFactoryAdaptor(testProductVariableModuleFactoryFactory(struct {
ctx.RegisterModuleType("module2", testProductVariableModuleFactoryFactory(struct {
Cflags []string
}{})))
}{}))
// A module type that does not have any properties that match product_variables.
ctx.RegisterModuleType("module3", ModuleFactoryAdaptor(testProductVariableModuleFactoryFactory(struct {
ctx.RegisterModuleType("module3", testProductVariableModuleFactoryFactory(struct {
Foo []string
}{})))
}{}))
ctx.PreDepsMutators(func(ctx RegisterMutatorsContext) {
ctx.BottomUp("variable", variableMutator).Parallel()
})

View file

@ -871,9 +871,9 @@ func testVisibility(buildDir string, fs map[string][]byte) (*TestContext, []erro
config := TestArchConfig(buildDir, nil)
ctx := NewTestArchContext()
ctx.RegisterModuleType("package", ModuleFactoryAdaptor(PackageFactory))
ctx.RegisterModuleType("mock_library", ModuleFactoryAdaptor(newMockLibraryModule))
ctx.RegisterModuleType("mock_defaults", ModuleFactoryAdaptor(defaultsFactory))
ctx.RegisterModuleType("package", PackageFactory)
ctx.RegisterModuleType("mock_library", newMockLibraryModule)
ctx.RegisterModuleType("mock_defaults", defaultsFactory)
ctx.PreArchMutators(registerPackageRenamer)
ctx.PreArchMutators(registerVisibilityRuleChecker)
ctx.PreArchMutators(RegisterDefaultsPreArchMutators)

View file

@ -22,7 +22,7 @@ func testVtsConfig(test *testing.T, bpFileContents string) *TestContext {
config := TestArchConfig(buildDir, nil)
ctx := NewTestArchContext()
ctx.RegisterModuleType("vts_config", ModuleFactoryAdaptor(VtsConfigFactory))
ctx.RegisterModuleType("vts_config", VtsConfigFactory)
ctx.Register()
mockFiles := map[string][]byte{
"Android.bp": []byte(bpFileContents),

View file

@ -101,39 +101,39 @@ func testApexContext(t *testing.T, bp string, handlers ...testCustomizer) (*andr
config.TestProductVariables.Platform_vndk_version = proptools.StringPtr("VER")
ctx := android.NewTestArchContext()
ctx.RegisterModuleType("apex", android.ModuleFactoryAdaptor(BundleFactory))
ctx.RegisterModuleType("apex_test", android.ModuleFactoryAdaptor(testApexBundleFactory))
ctx.RegisterModuleType("apex_vndk", android.ModuleFactoryAdaptor(vndkApexBundleFactory))
ctx.RegisterModuleType("apex_key", android.ModuleFactoryAdaptor(ApexKeyFactory))
ctx.RegisterModuleType("apex_defaults", android.ModuleFactoryAdaptor(defaultsFactory))
ctx.RegisterModuleType("prebuilt_apex", android.ModuleFactoryAdaptor(PrebuiltFactory))
ctx.RegisterModuleType("override_apex", android.ModuleFactoryAdaptor(overrideApexFactory))
ctx.RegisterModuleType("apex", BundleFactory)
ctx.RegisterModuleType("apex_test", testApexBundleFactory)
ctx.RegisterModuleType("apex_vndk", vndkApexBundleFactory)
ctx.RegisterModuleType("apex_key", ApexKeyFactory)
ctx.RegisterModuleType("apex_defaults", defaultsFactory)
ctx.RegisterModuleType("prebuilt_apex", PrebuiltFactory)
ctx.RegisterModuleType("override_apex", overrideApexFactory)
ctx.RegisterModuleType("cc_library", android.ModuleFactoryAdaptor(cc.LibraryFactory))
ctx.RegisterModuleType("cc_library_shared", android.ModuleFactoryAdaptor(cc.LibrarySharedFactory))
ctx.RegisterModuleType("cc_library_headers", android.ModuleFactoryAdaptor(cc.LibraryHeaderFactory))
ctx.RegisterModuleType("cc_prebuilt_library_shared", android.ModuleFactoryAdaptor(cc.PrebuiltSharedLibraryFactory))
ctx.RegisterModuleType("cc_prebuilt_library_static", android.ModuleFactoryAdaptor(cc.PrebuiltStaticLibraryFactory))
ctx.RegisterModuleType("cc_binary", android.ModuleFactoryAdaptor(cc.BinaryFactory))
ctx.RegisterModuleType("cc_object", android.ModuleFactoryAdaptor(cc.ObjectFactory))
ctx.RegisterModuleType("cc_defaults", android.ModuleFactoryAdaptor(func() android.Module {
ctx.RegisterModuleType("cc_library", cc.LibraryFactory)
ctx.RegisterModuleType("cc_library_shared", cc.LibrarySharedFactory)
ctx.RegisterModuleType("cc_library_headers", cc.LibraryHeaderFactory)
ctx.RegisterModuleType("cc_prebuilt_library_shared", cc.PrebuiltSharedLibraryFactory)
ctx.RegisterModuleType("cc_prebuilt_library_static", cc.PrebuiltStaticLibraryFactory)
ctx.RegisterModuleType("cc_binary", cc.BinaryFactory)
ctx.RegisterModuleType("cc_object", cc.ObjectFactory)
ctx.RegisterModuleType("cc_defaults", func() android.Module {
return cc.DefaultsFactory()
}))
ctx.RegisterModuleType("cc_test", android.ModuleFactoryAdaptor(cc.TestFactory))
ctx.RegisterModuleType("llndk_library", android.ModuleFactoryAdaptor(cc.LlndkLibraryFactory))
ctx.RegisterModuleType("vndk_prebuilt_shared", android.ModuleFactoryAdaptor(cc.VndkPrebuiltSharedFactory))
ctx.RegisterModuleType("vndk_libraries_txt", android.ModuleFactoryAdaptor(cc.VndkLibrariesTxtFactory))
ctx.RegisterModuleType("toolchain_library", android.ModuleFactoryAdaptor(cc.ToolchainLibraryFactory))
ctx.RegisterModuleType("prebuilt_etc", android.ModuleFactoryAdaptor(android.PrebuiltEtcFactory))
ctx.RegisterModuleType("sh_binary", android.ModuleFactoryAdaptor(android.ShBinaryFactory))
ctx.RegisterModuleType("android_app_certificate", android.ModuleFactoryAdaptor(java.AndroidAppCertificateFactory))
ctx.RegisterModuleType("filegroup", android.ModuleFactoryAdaptor(android.FileGroupFactory))
ctx.RegisterModuleType("java_library", android.ModuleFactoryAdaptor(java.LibraryFactory))
ctx.RegisterModuleType("java_import", android.ModuleFactoryAdaptor(java.ImportFactory))
ctx.RegisterModuleType("java_system_modules", android.ModuleFactoryAdaptor(java.SystemModulesFactory))
ctx.RegisterModuleType("android_app", android.ModuleFactoryAdaptor(java.AndroidAppFactory))
ctx.RegisterModuleType("android_app_import", android.ModuleFactoryAdaptor(java.AndroidAppImportFactory))
ctx.RegisterModuleType("override_android_app", android.ModuleFactoryAdaptor(java.OverrideAndroidAppModuleFactory))
})
ctx.RegisterModuleType("cc_test", cc.TestFactory)
ctx.RegisterModuleType("llndk_library", cc.LlndkLibraryFactory)
ctx.RegisterModuleType("vndk_prebuilt_shared", cc.VndkPrebuiltSharedFactory)
ctx.RegisterModuleType("vndk_libraries_txt", cc.VndkLibrariesTxtFactory)
ctx.RegisterModuleType("toolchain_library", cc.ToolchainLibraryFactory)
ctx.RegisterModuleType("prebuilt_etc", android.PrebuiltEtcFactory)
ctx.RegisterModuleType("sh_binary", android.ShBinaryFactory)
ctx.RegisterModuleType("android_app_certificate", java.AndroidAppCertificateFactory)
ctx.RegisterModuleType("filegroup", android.FileGroupFactory)
ctx.RegisterModuleType("java_library", java.LibraryFactory)
ctx.RegisterModuleType("java_import", java.ImportFactory)
ctx.RegisterModuleType("java_system_modules", java.SystemModulesFactory)
ctx.RegisterModuleType("android_app", java.AndroidAppFactory)
ctx.RegisterModuleType("android_app_import", java.AndroidAppImportFactory)
ctx.RegisterModuleType("override_android_app", java.OverrideAndroidAppModuleFactory)
ctx.PreArchMutators(android.RegisterDefaultsPreArchMutators)
ctx.PreArchMutators(func(ctx android.RegisterMutatorsContext) {

View file

@ -55,7 +55,7 @@ func testContext(bp string) *android.TestContext {
}
ctx := cc.CreateTestContext(bp, mockFS, android.Android)
ctx.RegisterModuleType("bpf", android.ModuleFactoryAdaptor(bpfFactory))
ctx.RegisterModuleType("bpf", bpfFactory)
ctx.Register()
return ctx

View file

@ -25,7 +25,7 @@ func testGenruleContext(config android.Config, bp string,
fs map[string][]byte) *android.TestContext {
ctx := android.NewTestArchContext()
ctx.RegisterModuleType("cc_genrule", android.ModuleFactoryAdaptor(genRuleFactory))
ctx.RegisterModuleType("cc_genrule", genRuleFactory)
ctx.Register()
mockFS := map[string][]byte{

View file

@ -72,9 +72,9 @@ func TestPrebuilt(t *testing.T) {
ctx := CreateTestContext(bp, fs, android.Android)
ctx.RegisterModuleType("cc_prebuilt_library_shared", android.ModuleFactoryAdaptor(PrebuiltSharedLibraryFactory))
ctx.RegisterModuleType("cc_prebuilt_library_static", android.ModuleFactoryAdaptor(PrebuiltStaticLibraryFactory))
ctx.RegisterModuleType("cc_prebuilt_binary", android.ModuleFactoryAdaptor(prebuiltBinaryFactory))
ctx.RegisterModuleType("cc_prebuilt_library_shared", PrebuiltSharedLibraryFactory)
ctx.RegisterModuleType("cc_prebuilt_library_static", PrebuiltStaticLibraryFactory)
ctx.RegisterModuleType("cc_prebuilt_binary", prebuiltBinaryFactory)
ctx.PreArchMutators(android.RegisterPrebuiltsPreArchMutators)
ctx.PostDepsMutators(android.RegisterPrebuiltsPostDepsMutators)

View file

@ -126,10 +126,8 @@ func TestDataTests(t *testing.T) {
"dir/baz": nil,
"dir/bar/baz": nil,
})
ctx.RegisterModuleType("filegroup",
android.ModuleFactoryAdaptor(android.FileGroupFactory))
ctx.RegisterModuleType("test",
android.ModuleFactoryAdaptor(newTest))
ctx.RegisterModuleType("filegroup", android.FileGroupFactory)
ctx.RegisterModuleType("test", newTest)
ctx.Register()
_, errs := ctx.ParseBlueprintsFiles("Blueprints")

View file

@ -253,23 +253,23 @@ func CreateTestContext(bp string, fs map[string][]byte,
os android.OsType) *android.TestContext {
ctx := android.NewTestArchContext()
ctx.RegisterModuleType("cc_defaults", android.ModuleFactoryAdaptor(defaultsFactory))
ctx.RegisterModuleType("cc_binary", android.ModuleFactoryAdaptor(BinaryFactory))
ctx.RegisterModuleType("cc_binary_host", android.ModuleFactoryAdaptor(binaryHostFactory))
ctx.RegisterModuleType("cc_fuzz", android.ModuleFactoryAdaptor(FuzzFactory))
ctx.RegisterModuleType("cc_library", android.ModuleFactoryAdaptor(LibraryFactory))
ctx.RegisterModuleType("cc_library_shared", android.ModuleFactoryAdaptor(LibrarySharedFactory))
ctx.RegisterModuleType("cc_library_static", android.ModuleFactoryAdaptor(LibraryStaticFactory))
ctx.RegisterModuleType("cc_library_headers", android.ModuleFactoryAdaptor(LibraryHeaderFactory))
ctx.RegisterModuleType("cc_test", android.ModuleFactoryAdaptor(TestFactory))
ctx.RegisterModuleType("toolchain_library", android.ModuleFactoryAdaptor(ToolchainLibraryFactory))
ctx.RegisterModuleType("llndk_library", android.ModuleFactoryAdaptor(LlndkLibraryFactory))
ctx.RegisterModuleType("llndk_headers", android.ModuleFactoryAdaptor(llndkHeadersFactory))
ctx.RegisterModuleType("vendor_public_library", android.ModuleFactoryAdaptor(vendorPublicLibraryFactory))
ctx.RegisterModuleType("cc_object", android.ModuleFactoryAdaptor(ObjectFactory))
ctx.RegisterModuleType("filegroup", android.ModuleFactoryAdaptor(android.FileGroupFactory))
ctx.RegisterModuleType("vndk_prebuilt_shared", android.ModuleFactoryAdaptor(VndkPrebuiltSharedFactory))
ctx.RegisterModuleType("vndk_libraries_txt", android.ModuleFactoryAdaptor(VndkLibrariesTxtFactory))
ctx.RegisterModuleType("cc_defaults", defaultsFactory)
ctx.RegisterModuleType("cc_binary", BinaryFactory)
ctx.RegisterModuleType("cc_binary_host", binaryHostFactory)
ctx.RegisterModuleType("cc_fuzz", FuzzFactory)
ctx.RegisterModuleType("cc_library", LibraryFactory)
ctx.RegisterModuleType("cc_library_shared", LibrarySharedFactory)
ctx.RegisterModuleType("cc_library_static", LibraryStaticFactory)
ctx.RegisterModuleType("cc_library_headers", LibraryHeaderFactory)
ctx.RegisterModuleType("cc_test", TestFactory)
ctx.RegisterModuleType("toolchain_library", ToolchainLibraryFactory)
ctx.RegisterModuleType("llndk_library", LlndkLibraryFactory)
ctx.RegisterModuleType("llndk_headers", llndkHeadersFactory)
ctx.RegisterModuleType("vendor_public_library", vendorPublicLibraryFactory)
ctx.RegisterModuleType("cc_object", ObjectFactory)
ctx.RegisterModuleType("filegroup", android.FileGroupFactory)
ctx.RegisterModuleType("vndk_prebuilt_shared", VndkPrebuiltSharedFactory)
ctx.RegisterModuleType("vndk_libraries_txt", VndkLibrariesTxtFactory)
ctx.PreDepsMutators(func(ctx android.RegisterMutatorsContext) {
ctx.BottomUp("image", ImageMutator).Parallel()
ctx.BottomUp("link", LinkageMutator).Parallel()
@ -281,7 +281,7 @@ func CreateTestContext(bp string, fs map[string][]byte,
ctx.TopDown("double_loadable", checkDoubleLoadableLibraries).Parallel()
})
ctx.PreArchMutators(android.RegisterDefaultsPreArchMutators)
ctx.RegisterSingletonType("vndk-snapshot", android.SingletonFactoryAdaptor(VndkSnapshotSingleton))
ctx.RegisterSingletonType("vndk-snapshot", VndkSnapshotSingleton)
// add some modules that are required by the compiler and/or linker
bp = bp + GatherRequiredDepsForTest(os)

View file

@ -55,11 +55,11 @@ func testContext(config android.Config, bp string,
fs map[string][]byte) *android.TestContext {
ctx := android.NewTestArchContext()
ctx.RegisterModuleType("filegroup", android.ModuleFactoryAdaptor(android.FileGroupFactory))
ctx.RegisterModuleType("genrule", android.ModuleFactoryAdaptor(GenRuleFactory))
ctx.RegisterModuleType("gensrcs", android.ModuleFactoryAdaptor(GenSrcsFactory))
ctx.RegisterModuleType("genrule_defaults", android.ModuleFactoryAdaptor(defaultsFactory))
ctx.RegisterModuleType("tool", android.ModuleFactoryAdaptor(toolFactory))
ctx.RegisterModuleType("filegroup", android.FileGroupFactory)
ctx.RegisterModuleType("genrule", GenRuleFactory)
ctx.RegisterModuleType("gensrcs", GenSrcsFactory)
ctx.RegisterModuleType("genrule_defaults", defaultsFactory)
ctx.RegisterModuleType("tool", toolFactory)
ctx.PreArchMutators(android.RegisterDefaultsPreArchMutators)
ctx.Register()

View file

@ -53,7 +53,7 @@ func TestDexpreoptBootJars(t *testing.T) {
ctx := testContext(bp, nil)
ctx.RegisterSingletonType("dex_bootjars", android.SingletonFactoryAdaptor(dexpreoptBootJarsFactory))
ctx.RegisterSingletonType("dex_bootjars", dexpreoptBootJarsFactory)
run(t, ctx, config)

View file

@ -63,38 +63,38 @@ func testConfig(env map[string]string) android.Config {
func testContext(bp string, fs map[string][]byte) *android.TestContext {
ctx := android.NewTestArchContext()
ctx.RegisterModuleType("android_app", android.ModuleFactoryAdaptor(AndroidAppFactory))
ctx.RegisterModuleType("android_app_certificate", android.ModuleFactoryAdaptor(AndroidAppCertificateFactory))
ctx.RegisterModuleType("android_app_import", android.ModuleFactoryAdaptor(AndroidAppImportFactory))
ctx.RegisterModuleType("android_library", android.ModuleFactoryAdaptor(AndroidLibraryFactory))
ctx.RegisterModuleType("android_test", android.ModuleFactoryAdaptor(AndroidTestFactory))
ctx.RegisterModuleType("android_test_helper_app", android.ModuleFactoryAdaptor(AndroidTestHelperAppFactory))
ctx.RegisterModuleType("android_test_import", android.ModuleFactoryAdaptor(AndroidTestImportFactory))
ctx.RegisterModuleType("java_binary", android.ModuleFactoryAdaptor(BinaryFactory))
ctx.RegisterModuleType("java_binary_host", android.ModuleFactoryAdaptor(BinaryHostFactory))
ctx.RegisterModuleType("java_device_for_host", android.ModuleFactoryAdaptor(DeviceForHostFactory))
ctx.RegisterModuleType("java_host_for_device", android.ModuleFactoryAdaptor(HostForDeviceFactory))
ctx.RegisterModuleType("java_library", android.ModuleFactoryAdaptor(LibraryFactory))
ctx.RegisterModuleType("java_library_host", android.ModuleFactoryAdaptor(LibraryHostFactory))
ctx.RegisterModuleType("java_test", android.ModuleFactoryAdaptor(TestFactory))
ctx.RegisterModuleType("java_import", android.ModuleFactoryAdaptor(ImportFactory))
ctx.RegisterModuleType("java_import_host", android.ModuleFactoryAdaptor(ImportFactoryHost))
ctx.RegisterModuleType("java_defaults", android.ModuleFactoryAdaptor(defaultsFactory))
ctx.RegisterModuleType("java_system_modules", android.ModuleFactoryAdaptor(SystemModulesFactory))
ctx.RegisterModuleType("java_genrule", android.ModuleFactoryAdaptor(genRuleFactory))
ctx.RegisterModuleType("java_plugin", android.ModuleFactoryAdaptor(PluginFactory))
ctx.RegisterModuleType("dex_import", android.ModuleFactoryAdaptor(DexImportFactory))
ctx.RegisterModuleType("filegroup", android.ModuleFactoryAdaptor(android.FileGroupFactory))
ctx.RegisterModuleType("genrule", android.ModuleFactoryAdaptor(genrule.GenRuleFactory))
ctx.RegisterModuleType("droiddoc", android.ModuleFactoryAdaptor(DroiddocFactory))
ctx.RegisterModuleType("droiddoc_host", android.ModuleFactoryAdaptor(DroiddocHostFactory))
ctx.RegisterModuleType("droiddoc_template", android.ModuleFactoryAdaptor(ExportedDroiddocDirFactory))
ctx.RegisterModuleType("prebuilt_stubs_sources", android.ModuleFactoryAdaptor(PrebuiltStubsSourcesFactory))
ctx.RegisterModuleType("java_sdk_library", android.ModuleFactoryAdaptor(SdkLibraryFactory))
ctx.RegisterModuleType("java_sdk_library_import", android.ModuleFactoryAdaptor(sdkLibraryImportFactory))
ctx.RegisterModuleType("override_android_app", android.ModuleFactoryAdaptor(OverrideAndroidAppModuleFactory))
ctx.RegisterModuleType("override_android_test", android.ModuleFactoryAdaptor(OverrideAndroidTestModuleFactory))
ctx.RegisterModuleType("prebuilt_apis", android.ModuleFactoryAdaptor(PrebuiltApisFactory))
ctx.RegisterModuleType("android_app", AndroidAppFactory)
ctx.RegisterModuleType("android_app_certificate", AndroidAppCertificateFactory)
ctx.RegisterModuleType("android_app_import", AndroidAppImportFactory)
ctx.RegisterModuleType("android_library", AndroidLibraryFactory)
ctx.RegisterModuleType("android_test", AndroidTestFactory)
ctx.RegisterModuleType("android_test_helper_app", AndroidTestHelperAppFactory)
ctx.RegisterModuleType("android_test_import", AndroidTestImportFactory)
ctx.RegisterModuleType("java_binary", BinaryFactory)
ctx.RegisterModuleType("java_binary_host", BinaryHostFactory)
ctx.RegisterModuleType("java_device_for_host", DeviceForHostFactory)
ctx.RegisterModuleType("java_host_for_device", HostForDeviceFactory)
ctx.RegisterModuleType("java_library", LibraryFactory)
ctx.RegisterModuleType("java_library_host", LibraryHostFactory)
ctx.RegisterModuleType("java_test", TestFactory)
ctx.RegisterModuleType("java_import", ImportFactory)
ctx.RegisterModuleType("java_import_host", ImportFactoryHost)
ctx.RegisterModuleType("java_defaults", defaultsFactory)
ctx.RegisterModuleType("java_system_modules", SystemModulesFactory)
ctx.RegisterModuleType("java_genrule", genRuleFactory)
ctx.RegisterModuleType("java_plugin", PluginFactory)
ctx.RegisterModuleType("dex_import", DexImportFactory)
ctx.RegisterModuleType("filegroup", android.FileGroupFactory)
ctx.RegisterModuleType("genrule", genrule.GenRuleFactory)
ctx.RegisterModuleType("droiddoc", DroiddocFactory)
ctx.RegisterModuleType("droiddoc_host", DroiddocHostFactory)
ctx.RegisterModuleType("droiddoc_template", ExportedDroiddocDirFactory)
ctx.RegisterModuleType("prebuilt_stubs_sources", PrebuiltStubsSourcesFactory)
ctx.RegisterModuleType("java_sdk_library", SdkLibraryFactory)
ctx.RegisterModuleType("java_sdk_library_import", sdkLibraryImportFactory)
ctx.RegisterModuleType("override_android_app", OverrideAndroidAppModuleFactory)
ctx.RegisterModuleType("override_android_test", OverrideAndroidTestModuleFactory)
ctx.RegisterModuleType("prebuilt_apis", PrebuiltApisFactory)
ctx.PreArchMutators(android.RegisterPrebuiltsPreArchMutators)
ctx.PreArchMutators(android.RegisterPrebuiltsPostDepsMutators)
ctx.PreArchMutators(android.RegisterDefaultsPreArchMutators)
@ -106,11 +106,11 @@ func testContext(bp string, fs map[string][]byte) *android.TestContext {
ctx.RegisterPreSingletonType("sdk_versions", android.SingletonFactoryAdaptor(sdkPreSingletonFactory))
// Register module types and mutators from cc needed for JNI testing
ctx.RegisterModuleType("cc_library", android.ModuleFactoryAdaptor(cc.LibraryFactory))
ctx.RegisterModuleType("cc_object", android.ModuleFactoryAdaptor(cc.ObjectFactory))
ctx.RegisterModuleType("toolchain_library", android.ModuleFactoryAdaptor(cc.ToolchainLibraryFactory))
ctx.RegisterModuleType("llndk_library", android.ModuleFactoryAdaptor(cc.LlndkLibraryFactory))
ctx.RegisterModuleType("ndk_prebuilt_shared_stl", android.ModuleFactoryAdaptor(cc.NdkPrebuiltSharedStlFactory))
ctx.RegisterModuleType("cc_library", cc.LibraryFactory)
ctx.RegisterModuleType("cc_object", cc.ObjectFactory)
ctx.RegisterModuleType("toolchain_library", cc.ToolchainLibraryFactory)
ctx.RegisterModuleType("llndk_library", cc.LlndkLibraryFactory)
ctx.RegisterModuleType("ndk_prebuilt_shared_stl", cc.NdkPrebuiltSharedStlFactory)
ctx.PreDepsMutators(func(ctx android.RegisterMutatorsContext) {
ctx.BottomUp("link", cc.LinkageMutator).Parallel()
ctx.BottomUp("begin", cc.BeginMutator).Parallel()

View file

@ -332,12 +332,9 @@ func TestPythonModule(t *testing.T) {
ctx.PreDepsMutators(func(ctx android.RegisterMutatorsContext) {
ctx.BottomUp("version_split", versionSplitMutator()).Parallel()
})
ctx.RegisterModuleType("python_library_host",
android.ModuleFactoryAdaptor(PythonLibraryHostFactory))
ctx.RegisterModuleType("python_binary_host",
android.ModuleFactoryAdaptor(PythonBinaryHostFactory))
ctx.RegisterModuleType("python_defaults",
android.ModuleFactoryAdaptor(defaultsFactory))
ctx.RegisterModuleType("python_library_host", PythonLibraryHostFactory)
ctx.RegisterModuleType("python_binary_host", PythonBinaryHostFactory)
ctx.RegisterModuleType("python_defaults", defaultsFactory)
ctx.PreArchMutators(android.RegisterDefaultsPreArchMutators)
ctx.Register()
ctx.MockFileSystem(d.mockFiles)

View file

@ -164,25 +164,25 @@ func GatherRequiredDepsForTest() string {
func CreateTestContext(bp string) *android.TestContext {
ctx := android.NewTestArchContext()
ctx.RegisterModuleType("cc_library", android.ModuleFactoryAdaptor(cc.LibraryFactory))
ctx.RegisterModuleType("cc_object", android.ModuleFactoryAdaptor(cc.ObjectFactory))
ctx.RegisterModuleType("rust_binary", android.ModuleFactoryAdaptor(RustBinaryFactory))
ctx.RegisterModuleType("rust_binary_host", android.ModuleFactoryAdaptor(RustBinaryHostFactory))
ctx.RegisterModuleType("rust_test", android.ModuleFactoryAdaptor(RustTestFactory))
ctx.RegisterModuleType("rust_test_host", android.ModuleFactoryAdaptor(RustTestHostFactory))
ctx.RegisterModuleType("rust_library", android.ModuleFactoryAdaptor(RustLibraryFactory))
ctx.RegisterModuleType("rust_library_host", android.ModuleFactoryAdaptor(RustLibraryHostFactory))
ctx.RegisterModuleType("rust_library_host_rlib", android.ModuleFactoryAdaptor(RustLibraryRlibHostFactory))
ctx.RegisterModuleType("rust_library_host_dylib", android.ModuleFactoryAdaptor(RustLibraryDylibHostFactory))
ctx.RegisterModuleType("rust_library_rlib", android.ModuleFactoryAdaptor(RustLibraryRlibFactory))
ctx.RegisterModuleType("rust_library_dylib", android.ModuleFactoryAdaptor(RustLibraryDylibFactory))
ctx.RegisterModuleType("rust_library_shared", android.ModuleFactoryAdaptor(RustLibrarySharedFactory))
ctx.RegisterModuleType("rust_library_static", android.ModuleFactoryAdaptor(RustLibraryStaticFactory))
ctx.RegisterModuleType("rust_library_host_shared", android.ModuleFactoryAdaptor(RustLibrarySharedHostFactory))
ctx.RegisterModuleType("rust_library_host_static", android.ModuleFactoryAdaptor(RustLibraryStaticHostFactory))
ctx.RegisterModuleType("rust_proc_macro", android.ModuleFactoryAdaptor(ProcMacroFactory))
ctx.RegisterModuleType("rust_prebuilt_dylib", android.ModuleFactoryAdaptor(PrebuiltDylibFactory))
ctx.RegisterModuleType("toolchain_library", android.ModuleFactoryAdaptor(cc.ToolchainLibraryFactory))
ctx.RegisterModuleType("cc_library", cc.LibraryFactory)
ctx.RegisterModuleType("cc_object", cc.ObjectFactory)
ctx.RegisterModuleType("rust_binary", RustBinaryFactory)
ctx.RegisterModuleType("rust_binary_host", RustBinaryHostFactory)
ctx.RegisterModuleType("rust_test", RustTestFactory)
ctx.RegisterModuleType("rust_test_host", RustTestHostFactory)
ctx.RegisterModuleType("rust_library", RustLibraryFactory)
ctx.RegisterModuleType("rust_library_host", RustLibraryHostFactory)
ctx.RegisterModuleType("rust_library_host_rlib", RustLibraryRlibHostFactory)
ctx.RegisterModuleType("rust_library_host_dylib", RustLibraryDylibHostFactory)
ctx.RegisterModuleType("rust_library_rlib", RustLibraryRlibFactory)
ctx.RegisterModuleType("rust_library_dylib", RustLibraryDylibFactory)
ctx.RegisterModuleType("rust_library_shared", RustLibrarySharedFactory)
ctx.RegisterModuleType("rust_library_static", RustLibraryStaticFactory)
ctx.RegisterModuleType("rust_library_host_shared", RustLibrarySharedHostFactory)
ctx.RegisterModuleType("rust_library_host_static", RustLibraryStaticHostFactory)
ctx.RegisterModuleType("rust_proc_macro", ProcMacroFactory)
ctx.RegisterModuleType("rust_prebuilt_dylib", PrebuiltDylibFactory)
ctx.RegisterModuleType("toolchain_library", cc.ToolchainLibraryFactory)
ctx.PreDepsMutators(func(ctx android.RegisterMutatorsContext) {
// cc mutators
ctx.BottomUp("image", cc.ImageMutator).Parallel()

View file

@ -42,20 +42,20 @@ func testSdkContext(t *testing.T, bp string) (*android.TestContext, android.Conf
})
// from java package
ctx.RegisterModuleType("android_app_certificate", android.ModuleFactoryAdaptor(java.AndroidAppCertificateFactory))
ctx.RegisterModuleType("java_library", android.ModuleFactoryAdaptor(java.LibraryFactory))
ctx.RegisterModuleType("java_import", android.ModuleFactoryAdaptor(java.ImportFactory))
ctx.RegisterModuleType("droidstubs", android.ModuleFactoryAdaptor(java.DroidstubsFactory))
ctx.RegisterModuleType("prebuilt_stubs_sources", android.ModuleFactoryAdaptor(java.PrebuiltStubsSourcesFactory))
ctx.RegisterModuleType("android_app_certificate", java.AndroidAppCertificateFactory)
ctx.RegisterModuleType("java_library", java.LibraryFactory)
ctx.RegisterModuleType("java_import", java.ImportFactory)
ctx.RegisterModuleType("droidstubs", java.DroidstubsFactory)
ctx.RegisterModuleType("prebuilt_stubs_sources", java.PrebuiltStubsSourcesFactory)
// from cc package
ctx.RegisterModuleType("cc_library", android.ModuleFactoryAdaptor(cc.LibraryFactory))
ctx.RegisterModuleType("cc_library_shared", android.ModuleFactoryAdaptor(cc.LibrarySharedFactory))
ctx.RegisterModuleType("cc_object", android.ModuleFactoryAdaptor(cc.ObjectFactory))
ctx.RegisterModuleType("cc_prebuilt_library_shared", android.ModuleFactoryAdaptor(cc.PrebuiltSharedLibraryFactory))
ctx.RegisterModuleType("cc_prebuilt_library_static", android.ModuleFactoryAdaptor(cc.PrebuiltStaticLibraryFactory))
ctx.RegisterModuleType("llndk_library", android.ModuleFactoryAdaptor(cc.LlndkLibraryFactory))
ctx.RegisterModuleType("toolchain_library", android.ModuleFactoryAdaptor(cc.ToolchainLibraryFactory))
ctx.RegisterModuleType("cc_library", cc.LibraryFactory)
ctx.RegisterModuleType("cc_library_shared", cc.LibrarySharedFactory)
ctx.RegisterModuleType("cc_object", cc.ObjectFactory)
ctx.RegisterModuleType("cc_prebuilt_library_shared", cc.PrebuiltSharedLibraryFactory)
ctx.RegisterModuleType("cc_prebuilt_library_static", cc.PrebuiltStaticLibraryFactory)
ctx.RegisterModuleType("llndk_library", cc.LlndkLibraryFactory)
ctx.RegisterModuleType("toolchain_library", cc.ToolchainLibraryFactory)
ctx.PreDepsMutators(func(ctx android.RegisterMutatorsContext) {
ctx.BottomUp("image", cc.ImageMutator).Parallel()
ctx.BottomUp("link", cc.LinkageMutator).Parallel()
@ -66,13 +66,13 @@ func testSdkContext(t *testing.T, bp string) (*android.TestContext, android.Conf
})
// from apex package
ctx.RegisterModuleType("apex", android.ModuleFactoryAdaptor(apex.BundleFactory))
ctx.RegisterModuleType("apex_key", android.ModuleFactoryAdaptor(apex.ApexKeyFactory))
ctx.RegisterModuleType("apex", apex.BundleFactory)
ctx.RegisterModuleType("apex_key", apex.ApexKeyFactory)
ctx.PostDepsMutators(apex.RegisterPostDepsMutators)
// from this package
ctx.RegisterModuleType("sdk", android.ModuleFactoryAdaptor(ModuleFactory))
ctx.RegisterModuleType("sdk_snapshot", android.ModuleFactoryAdaptor(SnapshotModuleFactory))
ctx.RegisterModuleType("sdk", ModuleFactory)
ctx.RegisterModuleType("sdk_snapshot", SnapshotModuleFactory)
ctx.PreDepsMutators(RegisterPreDepsMutators)
ctx.PostDepsMutators(RegisterPostDepsMutators)

View file

@ -56,9 +56,9 @@ func testContext(config android.Config, bp string,
fs map[string][]byte) *android.TestContext {
ctx := android.NewTestArchContext()
ctx.RegisterModuleType("android_app", android.ModuleFactoryAdaptor(java.AndroidAppFactory))
ctx.RegisterModuleType("java_library", android.ModuleFactoryAdaptor(java.LibraryFactory))
ctx.RegisterModuleType("java_system_modules", android.ModuleFactoryAdaptor(java.SystemModulesFactory))
ctx.RegisterModuleType("android_app", java.AndroidAppFactory)
ctx.RegisterModuleType("java_library", java.LibraryFactory)
ctx.RegisterModuleType("java_system_modules", java.SystemModulesFactory)
ctx.PreArchMutators(android.RegisterPrebuiltsPreArchMutators)
ctx.PreArchMutators(android.RegisterPrebuiltsPostDepsMutators)
ctx.PreArchMutators(android.RegisterDefaultsPreArchMutators)
@ -66,12 +66,12 @@ func testContext(config android.Config, bp string,
ctx.BottomUp("sysprop_deps", syspropDepsMutator).Parallel()
})
ctx.RegisterModuleType("cc_library", android.ModuleFactoryAdaptor(cc.LibraryFactory))
ctx.RegisterModuleType("cc_library_headers", android.ModuleFactoryAdaptor(cc.LibraryHeaderFactory))
ctx.RegisterModuleType("cc_library_static", android.ModuleFactoryAdaptor(cc.LibraryFactory))
ctx.RegisterModuleType("cc_object", android.ModuleFactoryAdaptor(cc.ObjectFactory))
ctx.RegisterModuleType("llndk_library", android.ModuleFactoryAdaptor(cc.LlndkLibraryFactory))
ctx.RegisterModuleType("toolchain_library", android.ModuleFactoryAdaptor(cc.ToolchainLibraryFactory))
ctx.RegisterModuleType("cc_library", cc.LibraryFactory)
ctx.RegisterModuleType("cc_library_headers", cc.LibraryHeaderFactory)
ctx.RegisterModuleType("cc_library_static", cc.LibraryFactory)
ctx.RegisterModuleType("cc_object", cc.ObjectFactory)
ctx.RegisterModuleType("llndk_library", cc.LlndkLibraryFactory)
ctx.RegisterModuleType("toolchain_library", cc.ToolchainLibraryFactory)
ctx.PreDepsMutators(func(ctx android.RegisterMutatorsContext) {
ctx.BottomUp("image", cc.ImageMutator).Parallel()
ctx.BottomUp("link", cc.LinkageMutator).Parallel()
@ -81,7 +81,7 @@ func testContext(config android.Config, bp string,
ctx.BottomUp("sysprop", cc.SyspropMutator).Parallel()
})
ctx.RegisterModuleType("sysprop_library", android.ModuleFactoryAdaptor(syspropLibraryFactory))
ctx.RegisterModuleType("sysprop_library", syspropLibraryFactory)
ctx.Register()

View file

@ -50,8 +50,8 @@ func TestMain(m *testing.M) {
func testXml(t *testing.T, bp string) *android.TestContext {
config := android.TestArchConfig(buildDir, nil)
ctx := android.NewTestArchContext()
ctx.RegisterModuleType("prebuilt_etc", android.ModuleFactoryAdaptor(android.PrebuiltEtcFactory))
ctx.RegisterModuleType("prebuilt_etc_xml", android.ModuleFactoryAdaptor(PrebuiltEtcXmlFactory))
ctx.RegisterModuleType("prebuilt_etc", android.PrebuiltEtcFactory)
ctx.RegisterModuleType("prebuilt_etc_xml", PrebuiltEtcXmlFactory)
ctx.Register()
mockFiles := map[string][]byte{
"Android.bp": []byte(bp),