aboutsummaryrefslogtreecommitdiff
path: root/java/android/OlmLibSdk/olm-sdk/build.gradle
diff options
context:
space:
mode:
authorpedroGitt <pedro.contreiras@amdocs.com>2016-10-05 18:25:09 +0200
committerpedroGitt <pedro.contreiras@amdocs.com>2016-10-05 18:25:09 +0200
commit5573d3ab23de21b93b1ecc50d4fce96b02a42886 (patch)
tree96cab6aeb25b6ed60ea1ab27757e29c00b013b79 /java/android/OlmLibSdk/olm-sdk/build.gradle
parent3136826e02ee379858ff5a1c3aa9140f0136e813 (diff)
First commit adding Olm Lib for Android
- Add Android Studio project
Diffstat (limited to 'java/android/OlmLibSdk/olm-sdk/build.gradle')
-rw-r--r--java/android/OlmLibSdk/olm-sdk/build.gradle72
1 files changed, 72 insertions, 0 deletions
diff --git a/java/android/OlmLibSdk/olm-sdk/build.gradle b/java/android/OlmLibSdk/olm-sdk/build.gradle
new file mode 100644
index 0000000..96eaaf7
--- /dev/null
+++ b/java/android/OlmLibSdk/olm-sdk/build.gradle
@@ -0,0 +1,72 @@
+import org.apache.tools.ant.taskdefs.condition.Os
+
+apply plugin: 'com.android.library'
+
+android {
+ compileSdkVersion 21
+ buildToolsVersion '21.1.2'
+
+ defaultConfig {
+ minSdkVersion 11
+ targetSdkVersion 21
+ versionCode 1
+ versionName "1.0"
+ testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
+ }
+ buildTypes {
+ release {
+ minifyEnabled false
+ proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
+ }
+ }
+ sourceSets.main {
+ jniLibs.srcDir 'src/main/libs'
+ jni.srcDirs = []
+ }
+
+ task ndkBuildNative(type: Exec, description: 'NDK building..') {
+ workingDir file('src/main')
+ commandLine getNdkBuildCmd() //, '-B', 'NDK_DEBUG=1'
+ }
+
+ task cleanNative(type: Exec, description: 'Clean NDK build') {
+ workingDir file('src/main')
+ commandLine getNdkBuildCmd(), 'clean'
+ }
+
+ tasks.withType(JavaCompile) {
+ compileTask -> compileTask.dependsOn ndkBuildNative
+ }
+
+ clean.dependsOn cleanNative
+
+}
+
+def getNdkFolder() {
+ Properties properties = new Properties()
+ properties.load(project.rootProject.file('local.properties').newDataInputStream())
+ def ndkFolder = properties.getProperty('ndk.dir', null)
+ if (ndkFolder == null)
+ throw new GradleException("NDK location missing. Define it with ndk.dir in the local.properties file")
+
+ return ndkFolder
+}
+
+def getNdkBuildCmd() {
+ def ndkBuildCmd = getNdkFolder() + "/ndk-build"
+ if (Os.isFamily(Os.FAMILY_WINDOWS))
+ ndkBuildCmd += ".cmd"
+
+ return ndkBuildCmd
+}
+
+dependencies {
+ compile fileTree(include: ['*.jar'], dir: 'libs')
+ compile 'com.android.support:appcompat-v7:21.+'
+
+ testCompile 'junit:junit:4.12'
+ androidTestCompile 'junit:junit:4.12'
+ androidTestCompile 'com.android.support:support-annotations:21.0.0'
+ androidTestCompile 'com.android.support.test:runner:0.5'
+ androidTestCompile 'com.android.support.test:rules:0.5'
+}