diff options
Diffstat (limited to 'java')
-rw-r--r-- | java/dex.go | 19 | ||||
-rw-r--r-- | java/java.go | 8 |
2 files changed, 16 insertions, 11 deletions
diff --git a/java/dex.go b/java/dex.go index d88e8f86f..6c739a27f 100644 --- a/java/dex.go +++ b/java/dex.go @@ -289,15 +289,18 @@ func (d *dexer) r8Flags(ctx android.ModuleContext, dexParams *compileDexParams) // - suppress ProGuard warnings of referencing symbols unknown to the lower SDK version. // - prevent ProGuard stripping subclass in the support library that extends class added in the higher SDK version. // See b/20667396 - var proguardRaiseDeps classpath - ctx.VisitDirectDepsWithTag(proguardRaiseTag, func(m android.Module) { - if dep, ok := android.OtherModuleProvider(ctx, m, JavaInfoProvider); ok { - proguardRaiseDeps = append(proguardRaiseDeps, dep.RepackagedHeaderJars...) - } - }) + // TODO(b/360905238): Remove SdkSystemServer exception after resolving missing class references. + if !dexParams.sdkVersion.Stable() || dexParams.sdkVersion.Kind == android.SdkSystemServer { + var proguardRaiseDeps classpath + ctx.VisitDirectDepsWithTag(proguardRaiseTag, func(m android.Module) { + if dep, ok := android.OtherModuleProvider(ctx, m, JavaInfoProvider); ok { + proguardRaiseDeps = append(proguardRaiseDeps, dep.RepackagedHeaderJars...) + } + }) + r8Flags = append(r8Flags, proguardRaiseDeps.FormJavaClassPath("-libraryjars")) + r8Deps = append(r8Deps, proguardRaiseDeps...) + } - r8Flags = append(r8Flags, proguardRaiseDeps.FormJavaClassPath("-libraryjars")) - r8Deps = append(r8Deps, proguardRaiseDeps...) r8Flags = append(r8Flags, flags.bootClasspath.FormJavaClassPath("-libraryjars")) r8Deps = append(r8Deps, flags.bootClasspath...) r8Flags = append(r8Flags, flags.dexClasspath.FormJavaClassPath("-libraryjars")) diff --git a/java/java.go b/java/java.go index 258ebba0c..46344c842 100644 --- a/java/java.go +++ b/java/java.go @@ -1864,10 +1864,12 @@ func (j *Binary) DepsMutator(ctx android.BottomUpMutatorContext) { if ctx.Arch().ArchType == android.Common { j.deps(ctx) } - if ctx.Arch().ArchType != android.Common { - // These dependencies ensure the host installation rules will install the jar file and - // the jni libraries when the wrapper is installed. + // These dependencies ensure the installation rules will install the jar file when the + // wrapper is installed, and the jni libraries on host when the wrapper is installed. + if ctx.Arch().ArchType != android.Common && ctx.Os().Class == android.Host { ctx.AddVariationDependencies(nil, jniInstallTag, j.binaryProperties.Jni_libs...) + } + if ctx.Arch().ArchType != android.Common { ctx.AddVariationDependencies( []blueprint.Variation{{Mutator: "arch", Variation: android.CommonArch.String()}}, binaryInstallTag, ctx.ModuleName()) |