OsmAnd/OsmAnd-telegram/build.gradle

158 lines
3.6 KiB
Groovy

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
android {
compileSdkVersion 28
buildToolsVersion "27.0.3"
sourceSets {
main {
manifest.srcFile "AndroidManifest.xml"
jni.srcDirs = []
jniLibs.srcDirs = ["libs"]
aidl.srcDirs = ["src"]
java.srcDirs = ["src"]
resources.srcDirs = ["src"]
res.srcDirs = ["res"]
assets.srcDirs = ["assets"]
}
}
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
}
flavorDimensions "abi"
productFlavors {
x86 {
dimension "abi"
ndk {
abiFilter "x86"
}
}
armv7 {
dimension "abi"
ndk {
abiFilter "armeabi-v7a"
}
}
arm64 {
dimension "abi"
ndk {
abiFilter "arm64-v8a"
}
}
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
applicationIdSuffix ".debug"
}
release {
signingConfig signingConfigs.publishing
}
}
lintOptions {
// use this line to check all rules except those listed
disable 'InvalidPackage'
disable 'MissingTranslation'
}
packagingOptions {
exclude 'META-INF/proguard/androidx-annotations.pro'
}
}
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/org/drinkless/td"
}
task downloadPrebuiltTelegram {
dependsOn downloadTdLibzip, copyNativeLibs, copyJavaSources
}
task collectFonts(type: Copy) {
from "../../resources/fonts"
from "../../resources/fonts-telegram"
into "assets/fonts"
include "*.ttf"
}
task collectExternalResources {
dependsOn collectFonts
}
afterEvaluate {
android.applicationVariants.all { variant ->
variant.javaCompiler.dependsOn(downloadPrebuiltTelegram, collectExternalResources)
variant.preBuild.dependsOn(downloadPrebuiltTelegram)
}
}
dependencies {
implementation project(path: ':OsmAnd-java', configuration: 'android')
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation project(":osmand-api")
implementation( "org.jetbrains.kotlin:kotlin-stdlib:1.2.71") {
exclude group: 'org.jetbrains', module: 'annotations'
}
implementation 'com.android.support:appcompat-v7:28.0.0-rc01'
implementation 'com.android.support:design:28.0.0-rc01'
implementation 'com.android.support:customtabs:28.0.0-rc01'
implementation 'com.android.support:support-annotations:28.0.0-rc01'
implementation 'commons-logging:commons-logging-api:1.1'
implementation 'com.android.support:recyclerview-v7:28.0.0-rc01'
implementation 'com.vividsolutions:jts-core:1.14.0'
implementation("com.github.HITGIF:TextFieldBoxes:1.4.4") {
exclude group: 'com.android.support'
}
implementation 'org.jetbrains:annotations-java5:15.0'
implementation 'androidx.annotation:annotation:1.1.0'
}