aboutsummaryrefslogtreecommitdiff
path: root/java/android/OlmLibSdk/olm-sdk/build.gradle
diff options
context:
space:
mode:
Diffstat (limited to 'java/android/OlmLibSdk/olm-sdk/build.gradle')
-rw-r--r--java/android/OlmLibSdk/olm-sdk/build.gradle24
1 files changed, 21 insertions, 3 deletions
diff --git a/java/android/OlmLibSdk/olm-sdk/build.gradle b/java/android/OlmLibSdk/olm-sdk/build.gradle
index 96eaaf7..2f92151 100644
--- a/java/android/OlmLibSdk/olm-sdk/build.gradle
+++ b/java/android/OlmLibSdk/olm-sdk/build.gradle
@@ -24,9 +24,16 @@ android {
jni.srcDirs = []
}
- task ndkBuildNative(type: Exec, description: 'NDK building..') {
+ task ndkBuildNativeRelease(type: Exec, description: 'NDK building..') {
+ println 'ndkBuildNativeRelease starts..'
workingDir file('src/main')
- commandLine getNdkBuildCmd() //, '-B', 'NDK_DEBUG=1'
+ commandLine getNdkBuildCmd(), 'NDK_DEBUG=0'
+ }
+
+ task ndkBuildNativeDebug(type: Exec, description: 'NDK building..') {
+ println 'ndkBuildNativeDebug starts..'
+ workingDir file('src/main')
+ commandLine getNdkBuildCmd(), 'NDK_DEBUG=1'
}
task cleanNative(type: Exec, description: 'Clean NDK build') {
@@ -34,10 +41,21 @@ android {
commandLine getNdkBuildCmd(), 'clean'
}
- tasks.withType(JavaCompile) {
+ /*tasks.withType(JavaCompile) {
compileTask -> compileTask.dependsOn ndkBuildNative
+ }*/
+
+ tasks.withType(JavaCompile) {
+ compileTask -> if (compileTask.name.startsWith('compileDebugJava')) {
+ println 'test compile: Debug'
+ compileTask.dependsOn ndkBuildNativeDebug
+ } else if (compileTask.name.startsWith('compileReleaseJava')) {
+ println 'test compile: Release'
+ compileTask.dependsOn ndkBuildNativeRelease
+ }
}
+
clean.dependsOn cleanNative
}