Merge changes I982fcb8d,I17f24fe1,If5740476

am: 4326e7375c

Change-Id: I3fe0f2b113c59bc7222b90e14062fd7d2cf63400
This commit is contained in:
Paul Duffin
2019-12-19 14:31:08 -08:00
committed by android-build-merger
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("sh_binary", android.ShBinaryFactory)
ctx.RegisterModuleType("filegroup", android.FileGroupFactory) ctx.RegisterModuleType("filegroup", android.FileGroupFactory)
java.RegisterJavaBuildComponents(ctx) java.RegisterJavaBuildComponents(ctx)
ctx.RegisterModuleType("java_system_modules", java.SystemModulesFactory) java.RegisterSystemModulesBuildComponents(ctx)
java.RegisterAppBuildComponents(ctx) java.RegisterAppBuildComponents(ctx)
ctx.PreArchMutators(android.RegisterDefaultsPreArchMutators) ctx.PreArchMutators(android.RegisterDefaultsPreArchMutators)

View File

@@ -27,19 +27,8 @@ import (
) )
func init() { func init() {
android.RegisterModuleType("doc_defaults", DocDefaultsFactory) RegisterDocsBuildComponents(android.InitRegistrationContext)
android.RegisterModuleType("stubs_defaults", StubsDefaultsFactory) RegisterStubsBuildComponents(android.InitRegistrationContext)
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)
// Register sdk member type. // Register sdk member type.
android.RegisterSdkMemberType(&droidStubsSdkMemberType{ 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 ( var (
srcsLibTag = dependencyTag{name: "sources from javalib"} 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 { if t, ok := m.(*ExportedDroiddocDir); ok {
cmd.FlagWithArg("-templatedir ", t.dir.String()).Implicits(t.deps) cmd.FlagWithArg("-templatedir ", t.dir.String()).Implicits(t.deps)
} else { } 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() { func init() {
android.RegisterModuleType("java_genrule", genRuleFactory) RegisterGenRuleBuildComponents(android.InitRegistrationContext)
android.RegisterModuleType("java_genrule_host", genRuleFactoryHost) }
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. // java_genrule is a genrule that can depend on other java_* objects.

View File

@@ -66,17 +66,14 @@ func testContext() *android.TestContext {
RegisterJavaBuildComponents(ctx) RegisterJavaBuildComponents(ctx)
RegisterAppBuildComponents(ctx) RegisterAppBuildComponents(ctx)
RegisterAARBuildComponents(ctx) RegisterAARBuildComponents(ctx)
ctx.RegisterModuleType("java_system_modules", SystemModulesFactory) RegisterGenRuleBuildComponents(ctx)
ctx.RegisterModuleType("java_genrule", genRuleFactory) RegisterSystemModulesBuildComponents(ctx)
ctx.RegisterModuleType("java_plugin", PluginFactory) ctx.RegisterModuleType("java_plugin", PluginFactory)
ctx.RegisterModuleType("filegroup", android.FileGroupFactory) ctx.RegisterModuleType("filegroup", android.FileGroupFactory)
ctx.RegisterModuleType("genrule", genrule.GenRuleFactory) ctx.RegisterModuleType("genrule", genrule.GenRuleFactory)
ctx.RegisterModuleType("droiddoc", DroiddocFactory) RegisterDocsBuildComponents(ctx)
ctx.RegisterModuleType("droiddoc_host", DroiddocHostFactory) RegisterStubsBuildComponents(ctx)
ctx.RegisterModuleType("droiddoc_template", ExportedDroiddocDirFactory) RegisterSdkLibraryBuildComponents(ctx)
ctx.RegisterModuleType("prebuilt_stubs_sources", PrebuiltStubsSourcesFactory)
ctx.RegisterModuleType("java_sdk_library", SdkLibraryFactory)
ctx.RegisterModuleType("java_sdk_library_import", sdkLibraryImportFactory)
ctx.RegisterModuleType("prebuilt_apis", PrebuiltApisFactory) ctx.RegisterModuleType("prebuilt_apis", PrebuiltApisFactory)
ctx.PreArchMutators(android.RegisterPrebuiltsPreArchMutators) ctx.PreArchMutators(android.RegisterPrebuiltsPreArchMutators)
ctx.PreArchMutators(android.RegisterPrebuiltsPostDepsMutators) ctx.PreArchMutators(android.RegisterPrebuiltsPostDepsMutators)
@@ -875,7 +872,7 @@ func TestSharding(t *testing.T) {
func TestDroiddoc(t *testing.T) { func TestDroiddoc(t *testing.T) {
ctx, _ := testJava(t, ` ctx, _ := testJava(t, `
droiddoc_template { droiddoc_exported_dir {
name: "droiddoc-templates-sdk", name: "droiddoc-templates-sdk",
path: ".", path: ".",
} }
@@ -1021,7 +1018,7 @@ func TestJavaLibrary(t *testing.T) {
func TestJavaSdkLibrary(t *testing.T) { func TestJavaSdkLibrary(t *testing.T) {
ctx, _ := testJava(t, ` ctx, _ := testJava(t, `
droiddoc_template { droiddoc_exported_dir {
name: "droiddoc-templates-sdk", name: "droiddoc-templates-sdk",
path: ".", path: ".",
} }

View File

@@ -68,8 +68,7 @@ var (
// 2) HTML generation // 2) HTML generation
func init() { func init() {
android.RegisterModuleType("java_sdk_library", SdkLibraryFactory) RegisterSdkLibraryBuildComponents(android.InitRegistrationContext)
android.RegisterModuleType("java_sdk_library_import", sdkLibraryImportFactory)
android.RegisterMakeVarsProvider(pctx, func(ctx android.MakeVarsContext) { android.RegisterMakeVarsProvider(pctx, func(ctx android.MakeVarsContext) {
javaSdkLibraries := javaSdkLibraries(ctx.Config()) 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 { type sdkLibraryProperties struct {
// List of Java libraries that will be in the classpath when building stubs // List of Java libraries that will be in the classpath when building stubs
Stub_only_libs []string `android:"arch_variant"` 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. // system modules in a runtime image using the jmod and jlink tools.
func init() { func init() {
android.RegisterModuleType("java_system_modules", SystemModulesFactory) RegisterSystemModulesBuildComponents(android.InitRegistrationContext)
pctx.SourcePathVariable("moduleInfoJavaPath", "build/soong/scripts/jars-to-module-info-java.sh") pctx.SourcePathVariable("moduleInfoJavaPath", "build/soong/scripts/jars-to-module-info-java.sh")
} }
func RegisterSystemModulesBuildComponents(ctx android.RegistrationContext) {
ctx.RegisterModuleType("java_system_modules", SystemModulesFactory)
}
var ( var (
jarsTosystemModules = pctx.AndroidStaticRule("jarsTosystemModules", blueprint.RuleParams{ jarsTosystemModules = pctx.AndroidStaticRule("jarsTosystemModules", blueprint.RuleParams{
Command: `rm -rf ${outDir} ${workDir} && mkdir -p ${workDir}/jmod && ` + 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 // from java package
java.RegisterJavaBuildComponents(ctx) java.RegisterJavaBuildComponents(ctx)
java.RegisterAppBuildComponents(ctx) java.RegisterAppBuildComponents(ctx)
ctx.RegisterModuleType("droidstubs", java.DroidstubsFactory) java.RegisterStubsBuildComponents(ctx)
ctx.RegisterModuleType("prebuilt_stubs_sources", java.PrebuiltStubsSourcesFactory)
// from cc package // from cc package
ctx.RegisterModuleType("cc_library", cc.LibraryFactory) ctx.RegisterModuleType("cc_library", cc.LibraryFactory)

View File

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