[Android] Fix the gradle build system to allow for building from terminal. It will now copy the library files correctly and sign the resulting apk.

This commit is contained in:
Ryan Houdek 2013-12-24 15:28:24 -06:00
parent a87e0e7489
commit 2ed24d5311

View File

@ -10,12 +10,24 @@ apply plugin: 'android'
dependencies { dependencies {
compile fileTree(dir: 'libs', include: '*.jar') compile fileTree(dir: 'libs', include: '*.jar')
compile fileTree(dir: "$buildDir/native-libs", include: 'native-libs.jar')
} }
android { android {
compileSdkVersion 18 compileSdkVersion 19
buildToolsVersion "18.0.1" buildToolsVersion "19.0.1"
task nativeLibsToJar(type: Zip, description: 'create a jar archive of the native libs') {
destinationDir file("$buildDir/native-libs")
baseName 'native-libs'
extension 'jar'
from fileTree(dir: 'libs', include: '**/*.so')
into 'lib/'
}
tasks.withType(Compile) {
compileTask -> compileTask.dependsOn(nativeLibsToJar)
}
sourceSets { sourceSets {
main { main {
manifest.srcFile 'AndroidManifest.xml' manifest.srcFile 'AndroidManifest.xml'
@ -39,4 +51,17 @@ android {
debug.setRoot('build-types/debug') debug.setRoot('build-types/debug')
release.setRoot('build-types/release') release.setRoot('build-types/release')
} }
signingConfigs {
release {
storeFile file(System.getenv("KEYSTORE"))
storePassword System.getenv("KEYSTORE_PASSWORD")
keyAlias System.getenv("KEY_ALIAS")
keyPassword System.getenv("KEY_PASSWORD")
}
}
buildTypes {
release {
signingConfig signingConfigs.release
}
}
} }