From 84dfc3d33138470a9fbf624eaeda977b9f48e571 Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Wed, 25 Sep 2019 11:33:01 -0700 Subject: Make CreateModule take an android.ModuleFactory Reduce the boilerplate required to call CreateModule by taking an android.ModuleFactory instead of a blueprint.ModuleFactory. Test: m checkbuild Change-Id: I1259d2dd3f7893b5319c333bc180727ac40f9e91 --- java/sdk_library.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'java/sdk_library.go') diff --git a/java/sdk_library.go b/java/sdk_library.go index 30fd1c4e2..cc7256b1b 100644 --- a/java/sdk_library.go +++ b/java/sdk_library.go @@ -422,7 +422,7 @@ func (module *SdkLibrary) createStubsLibrary(mctx android.LoadHookContext, apiSc props.Product_specific = proptools.BoolPtr(true) } - mctx.CreateModule(android.ModuleFactoryAdaptor(LibraryFactory), &props) + mctx.CreateModule(LibraryFactory, &props) } // Creates a droiddoc module that creates stubs source files from the given full source @@ -522,7 +522,7 @@ func (module *SdkLibrary) createDocs(mctx android.LoadHookContext, apiScope apiS module.latestRemovedApiFilegroupName(apiScope)) props.Check_api.Ignore_missing_latest_api = proptools.BoolPtr(true) - mctx.CreateModule(android.ModuleFactoryAdaptor(DroidstubsFactory), &props) + mctx.CreateModule(DroidstubsFactory, &props) } // Creates the xml file that publicizes the runtime library @@ -560,7 +560,7 @@ func (module *SdkLibrary) createXmlFile(mctx android.LoadHookContext) { genruleProps.Name = proptools.StringPtr(module.xmlFileName() + "-gen") genruleProps.Cmd = proptools.StringPtr("echo '" + xmlContent + "' > $(out)") genruleProps.Out = []string{module.xmlFileName()} - mctx.CreateModule(android.ModuleFactoryAdaptor(genrule.GenRuleFactory), &genruleProps) + mctx.CreateModule(genrule.GenRuleFactory, &genruleProps) // creates a prebuilt_etc module to actually place the xml file under // /etc/permissions @@ -582,7 +582,7 @@ func (module *SdkLibrary) createXmlFile(mctx android.LoadHookContext) { } else if module.ProductSpecific() { etcProps.Product_specific = proptools.BoolPtr(true) } - mctx.CreateModule(android.ModuleFactoryAdaptor(android.PrebuiltEtcFactory), &etcProps) + mctx.CreateModule(android.PrebuiltEtcFactory, &etcProps) } func (module *SdkLibrary) PrebuiltJars(ctx android.BaseModuleContext, sdkVersion string) android.Paths { @@ -815,7 +815,7 @@ func (module *sdkLibraryImport) createInternalModules(mctx android.LoadHookConte props.Product_specific = proptools.BoolPtr(true) } - mctx.CreateModule(android.ModuleFactoryAdaptor(ImportFactory), &props, &module.properties) + mctx.CreateModule(ImportFactory, &props, &module.properties) javaSdkLibraries := javaSdkLibraries(mctx.Config()) javaSdkLibrariesLock.Lock() -- cgit v1.2.3-59-g8ed1b