OsmAnd/OsmAnd-telegram/build.gradle
2021-01-16 22:02:46 +03:00

157 lines
3.5 KiB
Groovy

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
android {
compileSdkVersion 29
buildToolsVersion "29.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 29
multiDexEnabled true
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 'org.jetbrains.kotlin:kotlin-stdlib:1.3.11'
implementation 'androidx.multidex:multidex:2.0.1'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'com.google.android.material:material:1.1.0'
implementation 'androidx.browser:browser:1.0.0'
implementation 'androidx.annotation:annotation:1.1.0'
implementation 'commons-logging:commons-logging-api:1.1'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'com.vividsolutions:jts-core:1.14.0'
implementation("com.github.HITGIF:TextFieldBoxes:1.4.5") {
exclude group: 'com.android.support'
}
implementation 'com.google.android.gms:play-services-location:17.1.0'
}