diff options
Diffstat (limited to 'java/app.go')
-rw-r--r-- | java/app.go | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/java/app.go b/java/app.go index 96594df3..ab623e24 100644 --- a/java/app.go +++ b/java/app.go @@ -74,6 +74,11 @@ type appProperties struct { // Store dex files uncompressed in the APK and set the android:useEmbeddedDex="true" manifest attribute so that // they are used from inside the APK at runtime. Use_embedded_dex *bool + + // Forces native libraries to always be packaged into the APK, + // Use_embedded_native_libs still selects whether they are stored uncompressed and aligned or compressed. + // True for android_test* modules. + AlwaysPackageNativeLibs bool `blueprint:"mutated"` } // android_app properties that can be overridden by override_android_app @@ -285,7 +290,8 @@ func (a *AndroidApp) dexBuildActions(ctx android.ModuleContext) android.Path { func (a *AndroidApp) jniBuildActions(jniLibs []jniLib, ctx android.ModuleContext) android.WritablePath { var jniJarFile android.WritablePath if len(jniLibs) > 0 { - embedJni := ctx.Config().UnbundledBuild() || Bool(a.appProperties.Use_embedded_native_libs) + embedJni := ctx.Config().UnbundledBuild() || Bool(a.appProperties.Use_embedded_native_libs) || + a.appProperties.AlwaysPackageNativeLibs if embedJni { jniJarFile = android.PathForModuleOut(ctx, "jnilibs.zip") TransformJniLibsToJar(ctx, jniJarFile, jniLibs, a.shouldUncompressJNI(ctx)) @@ -507,6 +513,7 @@ func AndroidTestFactory() android.Module { module.Module.properties.Instrument = true module.Module.properties.Installable = proptools.BoolPtr(true) module.appProperties.Use_embedded_native_libs = proptools.BoolPtr(true) + module.appProperties.AlwaysPackageNativeLibs = true module.Module.dexpreopter.isTest = true module.AddProperties( @@ -547,6 +554,7 @@ func AndroidTestHelperAppFactory() android.Module { module.Module.properties.Installable = proptools.BoolPtr(true) module.appProperties.Use_embedded_native_libs = proptools.BoolPtr(true) + module.appProperties.AlwaysPackageNativeLibs = true module.Module.dexpreopter.isTest = true module.AddProperties( |