OsmAnd/OsmAnd-telegram/build.gradle
Victor Shcherb 4cf87a6b09 Fix error
2018-06-05 23:12:24 +02:00

132 lines
3.4 KiB
Groovy

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
android {
compileSdkVersion 27
sourceSets.main {
jniLibs.srcDir 'libs'
jni.srcDirs = [] //disable automatic ndk-build call
}
defaultConfig {
applicationId "net.osmand.telegram"
minSdkVersion 15
targetSdkVersion 27
versionCode 1
versionCode System.getenv("APK_NUMBER_VERSION") ? System.getenv("APK_NUMBER_VERSION").toInteger() : versionCode
versionName "1.0"
versionName System.getenv("APK_VERSION")? System.getenv("APK_VERSION").toString(): versionName
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
flavorDimensions "abi"
productFlavors {
x86 {
dimension "abi"
ndk {
abiFilter "x86"
}
}
mips {
dimension "abi"
ndk {
abiFilter "mips"
}
}
armv7 {
dimension "abi"
ndk {
abiFilter "armeabi-v7a"
}
}
armv5 {
dimension "abi"
ndk {
abiFilter "armeabi"
}
}
fat {
dimension "abi"
}
}
signingConfigs {
development {
storeFile file("../keystores/debug.keystore")
storePassword "android"
keyAlias "androiddebugkey"
keyPassword "android"
}
publishing {
storeFile file("/var/lib/jenkins/osmand_key")
storePassword System.getenv("OSMAND_APK_PASSWORD")
keyAlias "osmand"
keyPassword System.getenv("OSMAND_APK_PASSWORD")
}
}
buildTypes {
debug {
signingConfig signingConfigs.development
}
release {
signingConfig signingConfigs.publishing
}
}
lintOptions {
// use this line to check all rules except those listed
disable 'InvalidPackage'
}
}
task downloadTdLibzip {
doLast {
ant.get(src: 'https://core.telegram.org/tdlib/tdlib.zip', dest: 'tdlib.zip', skipexisting: 'true')
ant.unzip(src: 'tdlib.zip', dest: 'tdlib/')
}
}
task copyNativeLibs(type: Copy) {
dependsOn downloadTdLibzip
from "tdlib/libtd/src/main/libs"
into "libs"
}
task copyJavaSources(type: Copy) {
dependsOn downloadTdLibzip
from "tdlib/libtd/src/main/java/org/drinkless/td"
into "src/main/java/org/drinkless/td"
}
task downloadPrebuiltTelegram {
dependsOn downloadTdLibzip, copyNativeLibs, copyJavaSources
}
afterEvaluate {
android.applicationVariants.all { variant ->
variant.javaCompiler.dependsOn(downloadPrebuiltTelegram)
variant.preBuild.dependsOn(downloadPrebuiltTelegram)
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
implementation 'com.android.support:support-annotations:27.1.1'
implementation 'commons-logging:commons-logging-api:1.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}