aboutsummaryrefslogtreecommitdiff
path: root/android/olm-sdk/build.gradle
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2020-11-05 01:45:06 +0100
committerdec05eba <dec05eba@protonmail.com>2020-11-05 01:45:06 +0100
commit2a8202e74846d191a321cca1202175af9db6107d (patch)
treea6f455caf07da1186851f343a237a4c4e4484f46 /android/olm-sdk/build.gradle
parent8efa0ec17d8c262f9c3fd7603e8074f74a053708 (diff)
Convert to sibs projectHEADmaster
Diffstat (limited to 'android/olm-sdk/build.gradle')
-rw-r--r--android/olm-sdk/build.gradle125
1 files changed, 0 insertions, 125 deletions
diff --git a/android/olm-sdk/build.gradle b/android/olm-sdk/build.gradle
deleted file mode 100644
index 81faf5a..0000000
--- a/android/olm-sdk/build.gradle
+++ /dev/null
@@ -1,125 +0,0 @@
-import org.apache.tools.ant.taskdefs.condition.Os
-
-apply plugin: 'com.android.library'
-
-android {
- compileSdkVersion 28
-
- defaultConfig {
- minSdkVersion 11
- targetSdkVersion 28
- versionCode 321
- versionName "3.2.1"
- version "3.2.1"
- testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
- }
- buildTypes {
- debug {
- resValue "string", "git_olm_revision", "\"${gitRevision()}\""
- resValue "string", "git_olm_revision_unix_date", "\"${gitRevisionUnixDate()}\""
- resValue "string", "git_olm_revision_date", "\"${gitRevisionDate()}\""
- }
-
- release {
- resValue "string", "git_olm_revision", "\"${gitRevision()}\""
- resValue "string", "git_olm_revision_unix_date", "\"${gitRevisionUnixDate()}\""
- resValue "string", "git_olm_revision_date", "\"${gitRevisionDate()}\""
-
- minifyEnabled false
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- }
- }
- sourceSets.main {
- jniLibs.srcDir 'src/main/libs'
- jni.srcDirs = []
- }
-
- task buildJavaDoc(type: Javadoc) {
- source = android.sourceSets.main.java.srcDirs
- classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
- destinationDir = file("./doc/")
- options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PRIVATE
- failOnError false
- }
-
- task ndkBuildNativeRelease(type: Exec, description: 'NDK building..') {
- println 'ndkBuildNativeRelease starts..'
- workingDir file('src/main')
- 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') {
- workingDir file('src/main')
- commandLine getNdkBuildCmd(), 'clean'
- }
-
- 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
- }
- compileTask.dependsOn buildJavaDoc
- }
-
- clean.dependsOn cleanNative
-
-
- libraryVariants.all { variant ->
- variant.outputs.each { output ->
- def outputFile = output.outputFileName
- if (outputFile != null && outputFile.endsWith('.aar')) {
- output.outputFileName = outputFile.replace(".aar", "-${version}.aar")
- }
- }
- }
-}
-
-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
-}
-
-def gitRevision() {
- def cmd = "git rev-parse --short HEAD"
- return cmd.execute().text.trim()
-}
-
-def gitRevisionUnixDate() {
- def cmd = "git show -s --format=%ct HEAD^{commit}"
- return cmd.execute().text.trim()
-}
-
-def gitRevisionDate() {
- def cmd = "git show -s --format=%ci HEAD^{commit}"
- return cmd.execute().text.trim()
-}
-
-dependencies {
- testImplementation 'junit:junit:4.12'
- androidTestImplementation 'junit:junit:4.12'
- androidTestImplementation 'com.android.support:support-annotations:28.0.0'
- androidTestImplementation 'com.android.support.test:runner:1.0.2'
- androidTestImplementation 'com.android.support.test:rules:1.0.2'
-}