Revert "java_sdk_library: Do not expose stubs implementation jar"

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: I87e459d45ee97e284a9d966d5446305f80627175
This commit is contained in:
Remi NGUYEN VAN
2020-05-25 01:55:59 +00:00
parent ed0314270d
commit 43e1734985

View File

@@ -694,7 +694,7 @@ func (c *commonToSdkLibraryAndImport) findClosestScopePath(scope *apiScope) *sco
return nil
}
func (c *commonToSdkLibraryAndImport) selectHeaderJarsForSdkVersion(ctx android.BaseModuleContext, sdkVersion sdkSpec) android.Paths {
func (c *commonToSdkLibraryAndImport) sdkJarsCommon(ctx android.BaseModuleContext, sdkVersion sdkSpec, headerJars bool) android.Paths {
// If a specific numeric version has been requested then use prebuilt versions of the sdk.
if sdkVersion.version.isNumbered() {
@@ -725,7 +725,11 @@ func (c *commonToSdkLibraryAndImport) selectHeaderJarsForSdkVersion(ctx android.
return nil
}
return paths.stubsHeaderPath
if headerJars {
return paths.stubsHeaderPath
} else {
return paths.stubsImplPath
}
}
type SdkLibrary struct {
@@ -1196,7 +1200,7 @@ func (module *SdkLibrary) sdkJars(ctx android.BaseModuleContext, sdkVersion sdkS
return module.HeaderJars()
}
return module.selectHeaderJarsForSdkVersion(ctx, sdkVersion)
return module.sdkJarsCommon(ctx, sdkVersion, headerJars)
}
// to satisfy SdkLibraryDependency interface
@@ -1635,7 +1639,11 @@ func (module *sdkLibraryImport) GenerateAndroidBuildActions(ctx android.ModuleCo
}
func (module *sdkLibraryImport) sdkJars(ctx android.BaseModuleContext, sdkVersion sdkSpec) android.Paths {
return module.selectHeaderJarsForSdkVersion(ctx, sdkVersion)
// The java_sdk_library_import can only ever give back header jars as it does not
// have an implementation jar.
headerJars := true
return module.sdkJarsCommon(ctx, sdkVersion, headerJars)
}
// to satisfy SdkLibraryDependency interface