From e7b2626707457fe1d6af36da3d7a1ec3863cd52f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20J=2E=20Est=C3=A9banez?= Date: Wed, 15 Jun 2016 15:21:18 +0200 Subject: Make Android build smarter (SCons + Gradle) Upgrade Gradle and Android plugin for Gradle Disable all signing and zip-aligning for the export templates Give correct names to generated APKs Put .so files built by SCons right where Gradle has to pick them according to arch & build type Downgrade NDK platform to 14 to match minSdkVersion --- platform/android/build.gradle.template | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'platform/android/build.gradle.template') diff --git a/platform/android/build.gradle.template b/platform/android/build.gradle.template index 1e1461ef29..d7bc615e37 100644 --- a/platform/android/build.gradle.template +++ b/platform/android/build.gradle.template @@ -3,7 +3,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:1.3.1' + classpath 'com.android.tools.build:gradle:2.1.0' } } @@ -40,6 +40,11 @@ android { minSdkVersion 14 targetSdkVersion 23 } + // Both signing and zip-aligning will be done at export time + buildTypes.all { buildType -> + buildType.zipAlignEnabled false + buildType.signingConfig null + } sourceSets { main { manifest.srcFile 'AndroidManifest.xml' @@ -65,8 +70,17 @@ android { $$GRADLE_JNI_DIRS$$ ] } - + debug.jniLibs.srcDirs = [ + 'libs/debug' + $$GRADLE_JNI_DIRS$$ + ] + release.jniLibs.srcDirs = [ + 'libs/release' + $$GRADLE_JNI_DIRS$$ + ] + } + applicationVariants.all { variant -> + // ApplicationVariant is undocumented, but this method is widely used; may break with another version of the Android Gradle plugin + variant.outputs.get(0).setOutputFile(new File("${projectDir}/../../../bin", "android_${variant.name}.apk")) } - - } -- cgit v1.2.3