Merge "Collect paths to transitive SDK Java library dependencies." am: 9ce2221791 am: 9b67bbd11c

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1402668

Change-Id: Ib15bc0cb3fd0d53506eb36f895f04dfc8665df24
This commit is contained in:
Ulyana Trafimovich
2020-08-20 11:11:01 +00:00
committed by Automerger Merge Worker
9 changed files with 117 additions and 55 deletions

View File

@@ -852,22 +852,20 @@ func (e *EmbeddableSdkLibraryComponent) initSdkLibraryComponent(moduleBase *andr
}
// to satisfy SdkLibraryComponentDependency
func (e *EmbeddableSdkLibraryComponent) OptionalImplicitSdkLibrary() []string {
if e.sdkLibraryComponentProperties.SdkLibraryToImplicitlyTrack != nil {
return []string{*e.sdkLibraryComponentProperties.SdkLibraryToImplicitlyTrack}
}
return nil
func (e *EmbeddableSdkLibraryComponent) OptionalImplicitSdkLibrary() *string {
return e.sdkLibraryComponentProperties.SdkLibraryToImplicitlyTrack
}
// Implemented by modules that are (or possibly could be) a component of a java_sdk_library
// (including the java_sdk_library) itself.
type SdkLibraryComponentDependency interface {
UsesLibraryDependency
// The optional name of the sdk library that should be implicitly added to the
// AndroidManifest of an app that contains code which references the sdk library.
//
// Returns an array containing 0 or 1 items rather than a *string to make it easier
// to append this to the list of exported sdk libraries.
OptionalImplicitSdkLibrary() []string
// Returns the name of the optional implicit SDK library or nil, if there isn't one.
OptionalImplicitSdkLibrary() *string
}
// Make sure that all the module types that are components of java_sdk_library/_import
@@ -881,6 +879,7 @@ var _ SdkLibraryComponentDependency = (*SdkLibraryImport)(nil)
// Provides access to sdk_version related header and implentation jars.
type SdkLibraryDependency interface {
SdkLibraryComponentDependency
UsesLibraryDependency
// Get the header jars appropriate for the supplied sdk_version.
//
@@ -1982,7 +1981,7 @@ func (module *SdkLibraryImport) SdkImplementationJars(ctx android.BaseModuleCont
return module.sdkJars(ctx, sdkVersion, false)
}
// to satisfy apex.javaDependency interface
// to satisfy SdkLibraryDependency interface
func (module *SdkLibraryImport) DexJarBuildPath() android.Path {
if module.implLibraryModule == nil {
return nil
@@ -1991,6 +1990,15 @@ func (module *SdkLibraryImport) DexJarBuildPath() android.Path {
}
}
// to satisfy SdkLibraryDependency interface
func (module *SdkLibraryImport) DexJarInstallPath() android.Path {
if module.implLibraryModule == nil {
return nil
} else {
return module.implLibraryModule.DexJarInstallPath()
}
}
// to satisfy apex.javaDependency interface
func (module *SdkLibraryImport) JacocoReportClassesFile() android.Path {
if module.implLibraryModule == nil {