Make java_sdk_library implement Dependency

dexpreopting boot jars is going to need to visit both java_library
and java_sdk_library modules.  Since java_sdk_library is already
a java_library module, move the SdkLibraryDependency methods out
of the way so that it will implement Dependency.  Also requries
re-ording some of the type switches to check for the more-specific
SdkLibraryDependency first.

Test: TestJavaSdkLibrary
Change-Id: I155c9ffaf31689dd150a4d99e07e432ff770b4a7
This commit is contained in:
Colin Cross
2019-02-11 14:03:51 -08:00
parent c7e40aa578
commit 897d2ed92f
3 changed files with 18 additions and 15 deletions

View File

@@ -630,10 +630,10 @@ func (j *Javadoc) collectDeps(ctx android.ModuleContext) deps {
}
case libTag:
switch dep := module.(type) {
case SdkLibraryDependency:
deps.classpath = append(deps.classpath, dep.SdkImplementationJars(ctx, j.sdkVersion())...)
case Dependency:
deps.classpath = append(deps.classpath, dep.HeaderJars()...)
case SdkLibraryDependency:
deps.classpath = append(deps.classpath, dep.ImplementationJars(ctx, j.sdkVersion())...)
case android.SourceFileProducer:
checkProducesJars(ctx, dep)
deps.classpath = append(deps.classpath, dep.Srcs()...)