Loading java/aar.go +2 −2 Original line number Diff line number Diff line Loading @@ -81,7 +81,7 @@ type aapt struct { extraAaptPackagesFile android.Path mergedManifestFile android.Path isLibrary bool uncompressedJNI bool useEmbeddedNativeLibs bool useEmbeddedDex bool usesNonSdkApis bool Loading Loading @@ -201,7 +201,7 @@ func (a *aapt) buildActions(ctx android.ModuleContext, sdkContext sdkContext, ex manifestSrcPath := android.PathForModuleSrc(ctx, manifestFile) manifestPath := manifestFixer(ctx, manifestSrcPath, sdkContext, a.isLibrary, a.uncompressedJNI, a.usesNonSdkApis, a.useEmbeddedDex) a.isLibrary, a.useEmbeddedNativeLibs, a.usesNonSdkApis, a.useEmbeddedDex) a.transitiveManifestPaths = append(android.Paths{manifestPath}, transitiveStaticLibManifests...) Loading java/android_manifest.go +3 −3 Original line number Diff line number Diff line Loading @@ -43,7 +43,7 @@ var manifestMergerRule = pctx.AndroidStaticRule("manifestMerger", // Uses manifest_fixer.py to inject minSdkVersion, etc. into an AndroidManifest.xml func manifestFixer(ctx android.ModuleContext, manifest android.Path, sdkContext sdkContext, isLibrary, uncompressedJNI, usesNonSdkApis, useEmbeddedDex bool) android.Path { isLibrary, useEmbeddedNativeLibs, usesNonSdkApis, useEmbeddedDex bool) android.Path { var args []string if isLibrary { Loading @@ -54,8 +54,8 @@ func manifestFixer(ctx android.ModuleContext, manifest android.Path, sdkContext ctx.ModuleErrorf("invalid minSdkVersion: %s", err) } if minSdkVersion >= 23 { args = append(args, fmt.Sprintf("--extract-native-libs=%v", !uncompressedJNI)) } else if uncompressedJNI { args = append(args, fmt.Sprintf("--extract-native-libs=%v", !useEmbeddedNativeLibs)) } else if useEmbeddedNativeLibs { ctx.ModuleErrorf("module attempted to store uncompressed native libraries, but minSdkVersion=%d doesn't support it", minSdkVersion) } Loading java/app.go +6 −4 Original line number Diff line number Diff line Loading @@ -162,14 +162,14 @@ func (a *AndroidApp) DepsMutator(ctx android.BottomUpMutatorContext) { } func (a *AndroidApp) GenerateAndroidBuildActions(ctx android.ModuleContext) { a.aapt.uncompressedJNI = a.shouldUncompressJNI(ctx) a.aapt.useEmbeddedNativeLibs = a.useEmbeddedNativeLibs(ctx) a.aapt.useEmbeddedDex = Bool(a.appProperties.Use_embedded_dex) a.generateAndroidBuildActions(ctx) } // shouldUncompressJNI returns true if the native libraries should be stored in the APK uncompressed and the // Returns true if the native libraries should be stored in the APK uncompressed and the // extractNativeLibs application flag should be set to false in the manifest. func (a *AndroidApp) shouldUncompressJNI(ctx android.ModuleContext) bool { func (a *AndroidApp) useEmbeddedNativeLibs(ctx android.ModuleContext) bool { minSdkVersion, err := sdkVersionToNumber(ctx, a.minSdkVersion()) if err != nil { ctx.PropertyErrorf("min_sdk_version", "invalid value %q: %s", a.minSdkVersion(), err) Loading Loading @@ -295,7 +295,7 @@ func (a *AndroidApp) jniBuildActions(jniLibs []jniLib, ctx android.ModuleContext a.appProperties.AlwaysPackageNativeLibs if embedJni { jniJarFile = android.PathForModuleOut(ctx, "jnilibs.zip") TransformJniLibsToJar(ctx, jniJarFile, jniLibs, a.shouldUncompressJNI(ctx)) TransformJniLibsToJar(ctx, jniJarFile, jniLibs, a.useEmbeddedNativeLibs(ctx)) } else { a.installJniLibs = jniLibs } Loading Loading @@ -489,6 +489,8 @@ func (a *AndroidTest) GenerateAndroidBuildActions(ctx android.ModuleContext) { a.additionalAaptFlags = append(a.additionalAaptFlags, "--rename-instrumentation-target-package "+manifestPackageName) } } a.aapt.useEmbeddedNativeLibs = a.useEmbeddedNativeLibs(ctx) a.aapt.useEmbeddedDex = Bool(a.appProperties.Use_embedded_dex) a.generateAndroidBuildActions(ctx) a.testConfig = tradefed.AutoGenInstrumentationTestConfig(ctx, a.testProperties.Test_config, a.testProperties.Test_config_template, a.manifestPath, a.testProperties.Test_suites) Loading Loading
java/aar.go +2 −2 Original line number Diff line number Diff line Loading @@ -81,7 +81,7 @@ type aapt struct { extraAaptPackagesFile android.Path mergedManifestFile android.Path isLibrary bool uncompressedJNI bool useEmbeddedNativeLibs bool useEmbeddedDex bool usesNonSdkApis bool Loading Loading @@ -201,7 +201,7 @@ func (a *aapt) buildActions(ctx android.ModuleContext, sdkContext sdkContext, ex manifestSrcPath := android.PathForModuleSrc(ctx, manifestFile) manifestPath := manifestFixer(ctx, manifestSrcPath, sdkContext, a.isLibrary, a.uncompressedJNI, a.usesNonSdkApis, a.useEmbeddedDex) a.isLibrary, a.useEmbeddedNativeLibs, a.usesNonSdkApis, a.useEmbeddedDex) a.transitiveManifestPaths = append(android.Paths{manifestPath}, transitiveStaticLibManifests...) Loading
java/android_manifest.go +3 −3 Original line number Diff line number Diff line Loading @@ -43,7 +43,7 @@ var manifestMergerRule = pctx.AndroidStaticRule("manifestMerger", // Uses manifest_fixer.py to inject minSdkVersion, etc. into an AndroidManifest.xml func manifestFixer(ctx android.ModuleContext, manifest android.Path, sdkContext sdkContext, isLibrary, uncompressedJNI, usesNonSdkApis, useEmbeddedDex bool) android.Path { isLibrary, useEmbeddedNativeLibs, usesNonSdkApis, useEmbeddedDex bool) android.Path { var args []string if isLibrary { Loading @@ -54,8 +54,8 @@ func manifestFixer(ctx android.ModuleContext, manifest android.Path, sdkContext ctx.ModuleErrorf("invalid minSdkVersion: %s", err) } if minSdkVersion >= 23 { args = append(args, fmt.Sprintf("--extract-native-libs=%v", !uncompressedJNI)) } else if uncompressedJNI { args = append(args, fmt.Sprintf("--extract-native-libs=%v", !useEmbeddedNativeLibs)) } else if useEmbeddedNativeLibs { ctx.ModuleErrorf("module attempted to store uncompressed native libraries, but minSdkVersion=%d doesn't support it", minSdkVersion) } Loading
java/app.go +6 −4 Original line number Diff line number Diff line Loading @@ -162,14 +162,14 @@ func (a *AndroidApp) DepsMutator(ctx android.BottomUpMutatorContext) { } func (a *AndroidApp) GenerateAndroidBuildActions(ctx android.ModuleContext) { a.aapt.uncompressedJNI = a.shouldUncompressJNI(ctx) a.aapt.useEmbeddedNativeLibs = a.useEmbeddedNativeLibs(ctx) a.aapt.useEmbeddedDex = Bool(a.appProperties.Use_embedded_dex) a.generateAndroidBuildActions(ctx) } // shouldUncompressJNI returns true if the native libraries should be stored in the APK uncompressed and the // Returns true if the native libraries should be stored in the APK uncompressed and the // extractNativeLibs application flag should be set to false in the manifest. func (a *AndroidApp) shouldUncompressJNI(ctx android.ModuleContext) bool { func (a *AndroidApp) useEmbeddedNativeLibs(ctx android.ModuleContext) bool { minSdkVersion, err := sdkVersionToNumber(ctx, a.minSdkVersion()) if err != nil { ctx.PropertyErrorf("min_sdk_version", "invalid value %q: %s", a.minSdkVersion(), err) Loading Loading @@ -295,7 +295,7 @@ func (a *AndroidApp) jniBuildActions(jniLibs []jniLib, ctx android.ModuleContext a.appProperties.AlwaysPackageNativeLibs if embedJni { jniJarFile = android.PathForModuleOut(ctx, "jnilibs.zip") TransformJniLibsToJar(ctx, jniJarFile, jniLibs, a.shouldUncompressJNI(ctx)) TransformJniLibsToJar(ctx, jniJarFile, jniLibs, a.useEmbeddedNativeLibs(ctx)) } else { a.installJniLibs = jniLibs } Loading Loading @@ -489,6 +489,8 @@ func (a *AndroidTest) GenerateAndroidBuildActions(ctx android.ModuleContext) { a.additionalAaptFlags = append(a.additionalAaptFlags, "--rename-instrumentation-target-package "+manifestPackageName) } } a.aapt.useEmbeddedNativeLibs = a.useEmbeddedNativeLibs(ctx) a.aapt.useEmbeddedDex = Bool(a.appProperties.Use_embedded_dex) a.generateAndroidBuildActions(ctx) a.testConfig = tradefed.AutoGenInstrumentationTestConfig(ctx, a.testProperties.Test_config, a.testProperties.Test_config_template, a.manifestPath, a.testProperties.Test_suites) Loading