Commit 277dee99 authored by Geoffrey Métais's avatar Geoffrey Métais

Refactor gradle native build

- Release buildType doesn't build jni anymore
- Debug variant for x86
parent 09b17c00
apply plugin: 'com.android.library'
task buildDebug(type:Exec) {
task buildDebugARM(type:Exec) {
/*
Properties set for Android Studio own shell.
when you run gradlew from cli, OS shell env variables will be used
......@@ -16,17 +17,17 @@ task buildDebug(type:Exec) {
}
workingDir '..'
commandLine './compile-libvlc.sh'
args('-a', "armeabi-v7a")
}
task buildRelease(type:Exec) {
task buildDebugx86(type:Exec) {
if (System.getenv('ANDROID_SDK') == null || System.getenv('ANDROID_NDK') == null) {
environment 'ANDROID_NDK', ndk
environment 'ANDROID_SDK', sdk
}
workingDir '..'
commandLine './compile-libvlc.sh'
args('--release')
args('-a', "x86")
}
android {
......@@ -50,14 +51,6 @@ android {
defaultConfig {
minSdkVersion 7
targetSdkVersion 21
tasks.whenTaskAdded { task ->
if (task.name == 'bundleDebug') {
task.dependsOn buildDebug
} else if (task.name == 'bundleRelease') {
task.dependsOn buildRelease
}
}
}
buildTypes {
......
......@@ -13,6 +13,16 @@ android {
applicationId "org.videolan.vlc"
minSdkVersion 7
targetSdkVersion 21
//Set the build ABI according to build types
tasks.whenTaskAdded { task ->
if (task.name.startsWith('assemble')) {
if (task.name.endsWith('Debug'))
task.dependsOn(":libvlc:buildDebugARM")
else if (task.name.endsWith('Debugx86'))
task.dependsOn(":libvlc:buildDebugx86")
}
}
}
signingConfigs {
......@@ -39,9 +49,7 @@ android {
shrinkResources true
proguardFile 'proguard.cfg'
}
debug {
debuggable true
}
debugx86.initWith(debug)
}
productFlavors {
vanilla {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment