116 lines
2.8 KiB
Groovy
116 lines
2.8 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.telegramtest"
|
|
minSdkVersion 15
|
|
targetSdkVersion 27
|
|
versionCode 1
|
|
versionName "1.0"
|
|
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"
|
|
}
|
|
}
|
|
|
|
buildTypes {
|
|
debug {
|
|
signingConfig android.signingConfigs.debug
|
|
}
|
|
nativeDebug {
|
|
signingConfig android.signingConfigs.debug
|
|
}
|
|
release {
|
|
signingConfig android.signingConfigs.debug
|
|
}
|
|
}
|
|
|
|
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'
|
|
}
|