From e66c72739296a08aa94509cdf0b6d5996179d1d1 Mon Sep 17 00:00:00 2001 From: Nan Zhang Date: Tue, 6 Mar 2018 12:59:27 -0800 Subject: [PATCH] droiddoc supports no_framework_libs. follow: https://android-review.googlesource.com/c/platform/build/+/618046 Don't build agianst framwork libs when "no_framwork_libs" set to true. Test: m -j Bug: b/70351683 Change-Id: If6d37fac20c2b401aa30c31c14f1463300623a0e --- java/droiddoc.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/java/droiddoc.go b/java/droiddoc.go index 9d6f58ee1..f60463b09 100644 --- a/java/droiddoc.go +++ b/java/droiddoc.go @@ -73,6 +73,10 @@ type JavadocProperties struct { // list of of java libraries that will be in the classpath. Libs []string `android:"arch_variant"` + // don't build against the framework libraries (legacy-test, core-junit, + // ext, and framework for device targets) + No_framework_libs *bool + // If set to false, don't allow this module(-docs.zip) to be exported. Defaults to true. Installable *bool `android:"arch_variant"` @@ -183,7 +187,9 @@ func (j *Javadoc) addDeps(ctx android.BottomUpMutatorContext) { sdkDep := decodeSdkDep(ctx, String(j.properties.Sdk_version)) if sdkDep.useDefaultLibs { ctx.AddDependency(ctx.Module(), bootClasspathTag, config.DefaultBootclasspathLibraries...) - ctx.AddDependency(ctx.Module(), libTag, []string{"ext", "framework"}...) + if Bool(j.properties.No_framework_libs) { + ctx.AddDependency(ctx.Module(), libTag, []string{"ext", "framework"}...) + } } else if sdkDep.useModule { ctx.AddDependency(ctx.Module(), bootClasspathTag, sdkDep.module) }