diff options
author | Colin Cross <ccross@android.com> | 2020-05-06 17:51:39 -0700 |
---|---|---|
committer | Colin Cross <ccross@android.com> | 2020-05-06 17:56:46 -0700 |
commit | 76583a443e55556de98f094d4f95cdb6a40e6297 (patch) | |
tree | 3a58b3b6629c93cc2cbd16e351a79d0c42c2e36e /java/app.go | |
parent | 388d39ba9a13db914a26d70a92e6074216842b43 (diff) | |
download | build_soong-76583a443e55556de98f094d4f95cdb6a40e6297.tar.gz build_soong-76583a443e55556de98f094d4f95cdb6a40e6297.tar.bz2 build_soong-76583a443e55556de98f094d4f95cdb6a40e6297.zip |
Add jni_uses_sdk_apis
NetworkStackTests is using platform APIs for its Java code, but needs
to use portable JNI libraries. Add a jni_uses_sdk_apis so that it
can select the SDK variants of JNI libraries even though it doesn't
set sdk_version.
Bug: 154665579
Test: atest NetworkStackTests
Change-Id: I841fb761ec1c1ab8596aac44e01eb7eb91428006
Diffstat (limited to 'java/app.go')
-rwxr-xr-x | java/app.go | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/java/app.go b/java/app.go index 0c94e236..c068c464 100755 --- a/java/app.go +++ b/java/app.go @@ -80,10 +80,14 @@ type appProperties struct { // list of native libraries that will be provided in or alongside the resulting jar Jni_libs []string `android:"arch_variant"` - // if true, allow JNI libraries that link against platform APIs even if this module sets + // if true, use JNI libraries that link against platform APIs even if this module sets // sdk_version. Jni_uses_platform_apis *bool + // if true, use JNI libraries that link against SDK APIs even if this module does not set + // sdk_version. + Jni_uses_sdk_apis *bool + // STL library to use for JNI libraries. Stl *string `android:"arch_variant"` @@ -234,7 +238,8 @@ func (a *AndroidApp) DepsMutator(ctx android.BottomUpMutatorContext) { // If the app builds against an Android SDK use the SDK variant of JNI dependencies // unless jni_uses_platform_apis is set. if a.sdkVersion().specified() && a.sdkVersion().kind != sdkCorePlatform && - !Bool(a.appProperties.Jni_uses_platform_apis) { + !Bool(a.appProperties.Jni_uses_platform_apis) || + Bool(a.appProperties.Jni_uses_sdk_apis) { variation = append(variation, blueprint.Variation{Mutator: "sdk", Variation: "sdk"}) } ctx.AddFarVariationDependencies(variation, tag, a.appProperties.Jni_libs...) |