diff options
author | Remi NGUYEN VAN <reminv@google.com> | 2020-05-25 01:55:59 +0000 |
---|---|---|
committer | Remi NGUYEN VAN <reminv@google.com> | 2020-05-25 02:05:07 +0000 |
commit | ed0314270d226d5a8769439a607f79b8c974f793 (patch) | |
tree | 74bf4590aa9c6f4f704d096b71b2f4ddfcd3d9d1 /java/java.go | |
parent | 31525dab95f46277e5acd794d64adfbb7fbc21d5 (diff) |
Revert "Improve tracking of exported sdk libraries"
Revert submission 11569833
Reason for revert: Broke presubmit: b/157231582
Reverted Changes:
Ia99def91e:Improve tracking of exported sdk libraries
If91b4d106:java_sdk_library: Do not expose stubs implementati...
Id6d76e56c:java_sdk_library: Access outputs using tags
Change-Id: I3a07d412e795df512c430e4d2ed221f4d17e904a
Diffstat (limited to 'java/java.go')
-rw-r--r-- | java/java.go | 33 |
1 files changed, 6 insertions, 27 deletions
diff --git a/java/java.go b/java/java.go index 00b11f77a..da9bd3dfe 100644 --- a/java/java.go +++ b/java/java.go @@ -355,17 +355,7 @@ func (me *CompilerDeviceProperties) EffectiveOptimizeEnabled() bool { } // Functionality common to Module and Import -// -// It is embedded in Module so its functionality can be used by methods in Module -// but it is currently only initialized by Import and Library. type embeddableInModuleAndImport struct { - - // Functionality related to this being used as a component of a java_sdk_library. - EmbeddableSdkLibraryComponent -} - -func (e *embeddableInModuleAndImport) initModuleAndImport(moduleBase *android.ModuleBase) { - e.initSdkLibraryComponent(moduleBase) } // Module/Import's DepIsInSameApex(...) delegates to this method. @@ -506,6 +496,11 @@ type Dependency interface { JacocoReportClassesFile() android.Path } +type SdkLibraryDependency interface { + SdkHeaderJars(ctx android.BaseModuleContext, sdkVersion sdkSpec) android.Paths + SdkImplementationJars(ctx android.BaseModuleContext, sdkVersion sdkSpec) android.Paths +} + type xref interface { XrefJavaFiles() android.Paths } @@ -935,12 +930,6 @@ func (j *Module) collectDeps(ctx android.ModuleContext) deps { } } - // If this is a component library (stubs, etc.) for a java_sdk_library then - // add the name of that java_sdk_library to the exported sdk libs to make sure - // that, if necessary, a <uses-library> element for that java_sdk_library is - // added to the Android manifest. - j.exportedSdkLibs = append(j.exportedSdkLibs, j.OptionalImplicitSdkLibrary()...) - ctx.VisitDirectDeps(func(module android.Module) { otherName := ctx.OtherModuleName(module) tag := ctx.OtherModuleDependencyTag(module) @@ -960,7 +949,7 @@ func (j *Module) collectDeps(ctx android.ModuleContext) deps { case libTag: deps.classpath = append(deps.classpath, dep.SdkHeaderJars(ctx, j.sdkVersion())...) // names of sdk libs that are directly depended are exported - j.exportedSdkLibs = append(j.exportedSdkLibs, dep.OptionalImplicitSdkLibrary()...) + j.exportedSdkLibs = append(j.exportedSdkLibs, otherName) case staticLibTag: ctx.ModuleErrorf("dependency on java_sdk_library %q can only be in libs", otherName) } @@ -2001,8 +1990,6 @@ func LibraryFactory() android.Module { &module.Module.protoProperties, &module.libraryProperties) - module.initModuleAndImport(&module.ModuleBase) - android.InitApexModule(module) android.InitSdkAwareModule(module) InitJavaModule(module, android.HostAndDeviceSupported) @@ -2464,12 +2451,6 @@ func (j *Import) GenerateAndroidBuildActions(ctx android.ModuleContext) { } j.combinedClasspathFile = outputFile - // If this is a component library (impl, stubs, etc.) for a java_sdk_library then - // add the name of that java_sdk_library to the exported sdk libs to make sure - // that, if necessary, a <uses-library> element for that java_sdk_library is - // added to the Android manifest. - j.exportedSdkLibs = append(j.exportedSdkLibs, j.OptionalImplicitSdkLibrary()...) - ctx.VisitDirectDeps(func(module android.Module) { otherName := ctx.OtherModuleName(module) tag := ctx.OtherModuleDependencyTag(module) @@ -2586,8 +2567,6 @@ func ImportFactory() android.Module { module.AddProperties(&module.properties) - module.initModuleAndImport(&module.ModuleBase) - android.InitPrebuiltModule(module, &module.properties.Jars) android.InitApexModule(module) android.InitSdkAwareModule(module) |