diff options
author | Sundong Ahn <sundongahn@google.com> | 2018-07-13 16:16:44 +0900 |
---|---|---|
committer | Sundong Ahn <sundongahn@google.com> | 2018-07-17 23:52:49 +0000 |
commit | 241cd3747c797b1e908cfb37826b4e9731f4bd4c (patch) | |
tree | 504a3f58577c105f4d17ef5847536564a9b4a8dc | |
parent | 0a4cfbc21af0b085fe8f201b26bf032160add358 (diff) | |
download | android_build_soong-241cd3747c797b1e908cfb37826b4e9731f4bd4c.tar.gz android_build_soong-241cd3747c797b1e908cfb37826b4e9731f4bd4c.tar.bz2 android_build_soong-241cd3747c797b1e908cfb37826b4e9731f4bd4c.zip |
Change classpath for droiddoc
When the module type is SdkLibraryDependency, the classpath has been
gotten from headerJar
Becuase droiddoc uses src files when it builds, we should change to use
ImplementationJars instead of headerJar.
Bug: 77577799
Test: make -j
Change-Id: I1a072be69d7edff5636ea80af700be7796c3b0fc
-rw-r--r-- | java/droiddoc.go | 2 | ||||
-rw-r--r-- | java/java.go | 1 | ||||
-rw-r--r-- | java/sdk_library.go | 21 |
3 files changed, 23 insertions, 1 deletions
diff --git a/java/droiddoc.go b/java/droiddoc.go index 9ec2be81..53c75b5c 100644 --- a/java/droiddoc.go +++ b/java/droiddoc.go @@ -485,7 +485,7 @@ func (j *Javadoc) collectDeps(ctx android.ModuleContext) deps { } else if sdkVersion == "" { linkType = javaPlatform } - deps.classpath = append(deps.classpath, dep.HeaderJars(linkType)...) + deps.classpath = append(deps.classpath, dep.ImplementationJars(linkType)...) case android.SourceFileProducer: checkProducesJars(ctx, dep) deps.classpath = append(deps.classpath, dep.Srcs()...) diff --git a/java/java.go b/java/java.go index 06d35644..99af2f5a 100644 --- a/java/java.go +++ b/java/java.go @@ -313,6 +313,7 @@ type Dependency interface { type SdkLibraryDependency interface { HeaderJars(linkType linkType) android.Paths + ImplementationJars(linkType linkType) android.Paths } type SrcDependency interface { diff --git a/java/sdk_library.go b/java/sdk_library.go index e65af65f..3bac8f6f 100644 --- a/java/sdk_library.go +++ b/java/sdk_library.go @@ -129,6 +129,11 @@ type sdkLibrary struct { systemApiStubsPath android.Paths testApiStubsPath android.Paths implLibPath android.Paths + + publicApiStubsImplPath android.Paths + systemApiStubsImplPath android.Paths + testApiStubsImplPath android.Paths + implLibImplPath android.Paths } func (module *sdkLibrary) DepsMutator(ctx android.BottomUpMutatorContext) { @@ -151,12 +156,16 @@ func (module *sdkLibrary) GenerateAndroidBuildActions(ctx android.ModuleContext) switch tag { case publicApiStubsTag: module.publicApiStubsPath = lib.HeaderJars() + module.publicApiStubsImplPath = lib.ImplementationJars() case systemApiStubsTag: module.systemApiStubsPath = lib.HeaderJars() + module.systemApiStubsImplPath = lib.ImplementationJars() case testApiStubsTag: module.testApiStubsPath = lib.HeaderJars() + module.testApiStubsImplPath = lib.ImplementationJars() case implLibTag: module.implLibPath = lib.HeaderJars() + module.implLibImplPath = lib.ImplementationJars() default: 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 { return config.Once("javaSdkLibraries", func() interface{} { return &[]string{} |