Merge changes I982fcb8d,I17f24fe1,If5740476 am: 4326e7375c am: 22cf68dcd1 am: d8b3bb0425

Change-Id: Iae44eab1a6a654117f221b04dce62d9edd5659dd
This commit is contained in:
Automerger Merge Worker 2019-12-19 23:34:51 +00:00
commit d3bc7e35ab
8 changed files with 50 additions and 33 deletions

View file

@ -305,7 +305,7 @@ func testApexContext(t *testing.T, bp string, handlers ...testCustomizer) (*andr
ctx.RegisterModuleType("sh_binary", android.ShBinaryFactory)
ctx.RegisterModuleType("filegroup", android.FileGroupFactory)
java.RegisterJavaBuildComponents(ctx)
ctx.RegisterModuleType("java_system_modules", java.SystemModulesFactory)
java.RegisterSystemModulesBuildComponents(ctx)
java.RegisterAppBuildComponents(ctx)
ctx.PreArchMutators(android.RegisterDefaultsPreArchMutators)

View file

@ -27,19 +27,8 @@ import (
)
func init() {
android.RegisterModuleType("doc_defaults", DocDefaultsFactory)
android.RegisterModuleType("stubs_defaults", StubsDefaultsFactory)
android.RegisterModuleType("droiddoc", DroiddocFactory)
android.RegisterModuleType("droiddoc_host", DroiddocHostFactory)
android.RegisterModuleType("droiddoc_exported_dir", ExportedDroiddocDirFactory)
android.RegisterModuleType("javadoc", JavadocFactory)
android.RegisterModuleType("javadoc_host", JavadocHostFactory)
android.RegisterModuleType("droidstubs", DroidstubsFactory)
android.RegisterModuleType("droidstubs_host", DroidstubsHostFactory)
android.RegisterModuleType("prebuilt_stubs_sources", PrebuiltStubsSourcesFactory)
RegisterDocsBuildComponents(android.InitRegistrationContext)
RegisterStubsBuildComponents(android.InitRegistrationContext)
// Register sdk member type.
android.RegisterSdkMemberType(&droidStubsSdkMemberType{
@ -49,6 +38,25 @@ func init() {
})
}
func RegisterDocsBuildComponents(ctx android.RegistrationContext) {
ctx.RegisterModuleType("doc_defaults", DocDefaultsFactory)
ctx.RegisterModuleType("droiddoc", DroiddocFactory)
ctx.RegisterModuleType("droiddoc_host", DroiddocHostFactory)
ctx.RegisterModuleType("droiddoc_exported_dir", ExportedDroiddocDirFactory)
ctx.RegisterModuleType("javadoc", JavadocFactory)
ctx.RegisterModuleType("javadoc_host", JavadocHostFactory)
}
func RegisterStubsBuildComponents(ctx android.RegistrationContext) {
ctx.RegisterModuleType("stubs_defaults", StubsDefaultsFactory)
ctx.RegisterModuleType("droidstubs", DroidstubsFactory)
ctx.RegisterModuleType("droidstubs_host", DroidstubsHostFactory)
ctx.RegisterModuleType("prebuilt_stubs_sources", PrebuiltStubsSourcesFactory)
}
var (
srcsLibTag = dependencyTag{name: "sources from javalib"}
)
@ -782,7 +790,7 @@ func (d *Droiddoc) doclavaDocsFlags(ctx android.ModuleContext, cmd *android.Rule
if t, ok := m.(*ExportedDroiddocDir); ok {
cmd.FlagWithArg("-templatedir ", t.dir.String()).Implicits(t.deps)
} else {
ctx.PropertyErrorf("custom_template", "module %q is not a droiddoc_template", ctx.OtherModuleName(m))
ctx.PropertyErrorf("custom_template", "module %q is not a droiddoc_exported_dir", ctx.OtherModuleName(m))
}
})

View file

@ -20,8 +20,12 @@ import (
)
func init() {
android.RegisterModuleType("java_genrule", genRuleFactory)
android.RegisterModuleType("java_genrule_host", genRuleFactoryHost)
RegisterGenRuleBuildComponents(android.InitRegistrationContext)
}
func RegisterGenRuleBuildComponents(ctx android.RegistrationContext) {
ctx.RegisterModuleType("java_genrule", genRuleFactory)
ctx.RegisterModuleType("java_genrule_host", genRuleFactoryHost)
}
// java_genrule is a genrule that can depend on other java_* objects.

View file

@ -66,17 +66,14 @@ func testContext() *android.TestContext {
RegisterJavaBuildComponents(ctx)
RegisterAppBuildComponents(ctx)
RegisterAARBuildComponents(ctx)
ctx.RegisterModuleType("java_system_modules", SystemModulesFactory)
ctx.RegisterModuleType("java_genrule", genRuleFactory)
RegisterGenRuleBuildComponents(ctx)
RegisterSystemModulesBuildComponents(ctx)
ctx.RegisterModuleType("java_plugin", PluginFactory)
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)
RegisterDocsBuildComponents(ctx)
RegisterStubsBuildComponents(ctx)
RegisterSdkLibraryBuildComponents(ctx)
ctx.RegisterModuleType("prebuilt_apis", PrebuiltApisFactory)
ctx.PreArchMutators(android.RegisterPrebuiltsPreArchMutators)
ctx.PreArchMutators(android.RegisterPrebuiltsPostDepsMutators)
@ -875,7 +872,7 @@ func TestSharding(t *testing.T) {
func TestDroiddoc(t *testing.T) {
ctx, _ := testJava(t, `
droiddoc_template {
droiddoc_exported_dir {
name: "droiddoc-templates-sdk",
path: ".",
}
@ -1021,7 +1018,7 @@ func TestJavaLibrary(t *testing.T) {
func TestJavaSdkLibrary(t *testing.T) {
ctx, _ := testJava(t, `
droiddoc_template {
droiddoc_exported_dir {
name: "droiddoc-templates-sdk",
path: ".",
}

View file

@ -68,8 +68,7 @@ var (
// 2) HTML generation
func init() {
android.RegisterModuleType("java_sdk_library", SdkLibraryFactory)
android.RegisterModuleType("java_sdk_library_import", sdkLibraryImportFactory)
RegisterSdkLibraryBuildComponents(android.InitRegistrationContext)
android.RegisterMakeVarsProvider(pctx, func(ctx android.MakeVarsContext) {
javaSdkLibraries := javaSdkLibraries(ctx.Config())
@ -78,6 +77,11 @@ func init() {
})
}
func RegisterSdkLibraryBuildComponents(ctx android.RegistrationContext) {
ctx.RegisterModuleType("java_sdk_library", SdkLibraryFactory)
ctx.RegisterModuleType("java_sdk_library_import", sdkLibraryImportFactory)
}
type sdkLibraryProperties struct {
// List of Java libraries that will be in the classpath when building stubs
Stub_only_libs []string `android:"arch_variant"`

View file

@ -28,11 +28,15 @@ import (
// system modules in a runtime image using the jmod and jlink tools.
func init() {
android.RegisterModuleType("java_system_modules", SystemModulesFactory)
RegisterSystemModulesBuildComponents(android.InitRegistrationContext)
pctx.SourcePathVariable("moduleInfoJavaPath", "build/soong/scripts/jars-to-module-info-java.sh")
}
func RegisterSystemModulesBuildComponents(ctx android.RegistrationContext) {
ctx.RegisterModuleType("java_system_modules", SystemModulesFactory)
}
var (
jarsTosystemModules = pctx.AndroidStaticRule("jarsTosystemModules", blueprint.RuleParams{
Command: `rm -rf ${outDir} ${workDir} && mkdir -p ${workDir}/jmod && ` +

View file

@ -80,8 +80,7 @@ func testSdkContext(bp string, fs map[string][]byte) (*android.TestContext, andr
// from java package
java.RegisterJavaBuildComponents(ctx)
java.RegisterAppBuildComponents(ctx)
ctx.RegisterModuleType("droidstubs", java.DroidstubsFactory)
ctx.RegisterModuleType("prebuilt_stubs_sources", java.PrebuiltStubsSourcesFactory)
java.RegisterStubsBuildComponents(ctx)
// from cc package
ctx.RegisterModuleType("cc_library", cc.LibraryFactory)

View file

@ -58,7 +58,8 @@ func testContext(config android.Config) *android.TestContext {
ctx := android.NewTestArchContext()
java.RegisterJavaBuildComponents(ctx)
java.RegisterAppBuildComponents(ctx)
ctx.RegisterModuleType("java_system_modules", java.SystemModulesFactory)
java.RegisterSystemModulesBuildComponents(ctx)
ctx.PreArchMutators(android.RegisterPrebuiltsPreArchMutators)
ctx.PreArchMutators(android.RegisterPrebuiltsPostDepsMutators)
ctx.PreArchMutators(android.RegisterDefaultsPreArchMutators)