Merge "Change classpath for droiddoc"

This commit is contained in:
Treehugger Robot
2018-07-18 09:06:08 +00:00
committed by Gerrit Code Review
3 changed files with 23 additions and 1 deletions

View File

@@ -485,7 +485,7 @@ func (j *Javadoc) collectDeps(ctx android.ModuleContext) deps {
} else if sdkVersion == "" { } else if sdkVersion == "" {
linkType = javaPlatform linkType = javaPlatform
} }
deps.classpath = append(deps.classpath, dep.HeaderJars(linkType)...) deps.classpath = append(deps.classpath, dep.ImplementationJars(linkType)...)
case android.SourceFileProducer: case android.SourceFileProducer:
checkProducesJars(ctx, dep) checkProducesJars(ctx, dep)
deps.classpath = append(deps.classpath, dep.Srcs()...) deps.classpath = append(deps.classpath, dep.Srcs()...)

View File

@@ -313,6 +313,7 @@ type Dependency interface {
type SdkLibraryDependency interface { type SdkLibraryDependency interface {
HeaderJars(linkType linkType) android.Paths HeaderJars(linkType linkType) android.Paths
ImplementationJars(linkType linkType) android.Paths
} }
type SrcDependency interface { type SrcDependency interface {

View File

@@ -129,6 +129,11 @@ type sdkLibrary struct {
systemApiStubsPath android.Paths systemApiStubsPath android.Paths
testApiStubsPath android.Paths testApiStubsPath android.Paths
implLibPath android.Paths implLibPath android.Paths
publicApiStubsImplPath android.Paths
systemApiStubsImplPath android.Paths
testApiStubsImplPath android.Paths
implLibImplPath android.Paths
} }
func (module *sdkLibrary) DepsMutator(ctx android.BottomUpMutatorContext) { func (module *sdkLibrary) DepsMutator(ctx android.BottomUpMutatorContext) {
@@ -151,12 +156,16 @@ func (module *sdkLibrary) GenerateAndroidBuildActions(ctx android.ModuleContext)
switch tag { switch tag {
case publicApiStubsTag: case publicApiStubsTag:
module.publicApiStubsPath = lib.HeaderJars() module.publicApiStubsPath = lib.HeaderJars()
module.publicApiStubsImplPath = lib.ImplementationJars()
case systemApiStubsTag: case systemApiStubsTag:
module.systemApiStubsPath = lib.HeaderJars() module.systemApiStubsPath = lib.HeaderJars()
module.systemApiStubsImplPath = lib.ImplementationJars()
case testApiStubsTag: case testApiStubsTag:
module.testApiStubsPath = lib.HeaderJars() module.testApiStubsPath = lib.HeaderJars()
module.testApiStubsImplPath = lib.ImplementationJars()
case implLibTag: case implLibTag:
module.implLibPath = lib.HeaderJars() module.implLibPath = lib.HeaderJars()
module.implLibImplPath = lib.ImplementationJars()
default: default:
ctx.ModuleErrorf("depends on module %q of unknown tag %q", otherName, tag) ctx.ModuleErrorf("depends on module %q of unknown tag %q", otherName, tag)
} }
@@ -557,6 +566,18 @@ func (module *sdkLibrary) HeaderJars(linkType linkType) android.Paths {
} }
} }
// to satisfy SdkLibraryDependency interface
func (module *sdkLibrary) ImplementationJars(linkType linkType) android.Paths {
// This module is just a wrapper for the stubs.
if linkType == javaSystem {
return module.systemApiStubsImplPath
} else if linkType == javaPlatform {
return module.implLibImplPath
} else {
return module.publicApiStubsImplPath
}
}
func javaSdkLibraries(config android.Config) *[]string { func javaSdkLibraries(config android.Config) *[]string {
return config.Once("javaSdkLibraries", func() interface{} { return config.Once("javaSdkLibraries", func() interface{} {
return &[]string{} return &[]string{}