2019-10-22 20:19:05 +02:00
|
|
|
import org.jetbrains.kotlin.konan.properties.hasProperty
|
2019-10-21 23:26:06 +02:00
|
|
|
import java.io.FileInputStream
|
|
|
|
import java.util.*
|
|
|
|
|
|
|
|
plugins {
|
|
|
|
id("com.android.application")
|
|
|
|
id("kotlin-android")
|
|
|
|
id("kotlin-android-extensions")
|
|
|
|
|
|
|
|
id("org.jlleitschuh.gradle.ktlint") version "8.1.0"
|
|
|
|
id("com.gladed.androidgitversion") version "0.4.10"
|
|
|
|
id("com.github.triplet.play") version "2.4.2"
|
|
|
|
}
|
|
|
|
|
|
|
|
val props = Properties().apply {
|
2020-06-25 22:29:33 +02:00
|
|
|
try {
|
|
|
|
load(FileInputStream(rootProject.file("local.properties")))
|
|
|
|
} catch (e: Exception) {
|
|
|
|
}
|
2019-10-21 23:26:06 +02:00
|
|
|
}
|
|
|
|
|
2019-11-06 09:01:17 +01:00
|
|
|
androidGitVersion {
|
2019-11-06 09:05:40 +01:00
|
|
|
codeFormat = "MNNNPPP"
|
2019-11-06 09:01:17 +01:00
|
|
|
format = "%tag%%-count%%-commit%%-branch%"
|
|
|
|
}
|
|
|
|
|
2019-10-21 23:26:06 +02:00
|
|
|
android {
|
|
|
|
compileOptions {
|
|
|
|
sourceCompatibility = JavaVersion.VERSION_1_8
|
|
|
|
targetCompatibility = JavaVersion.VERSION_1_8
|
|
|
|
}
|
|
|
|
|
|
|
|
kotlinOptions {
|
2020-06-25 22:29:33 +02:00
|
|
|
jvmTarget = JavaVersion.VERSION_1_8.toString()
|
2019-10-21 23:26:06 +02:00
|
|
|
}
|
|
|
|
|
2020-05-30 16:00:24 +02:00
|
|
|
buildToolsVersion = "29.0.3"
|
2019-10-21 23:26:06 +02:00
|
|
|
compileSdkVersion(29)
|
|
|
|
|
|
|
|
defaultConfig {
|
|
|
|
applicationId = "com.github.apognu.otter"
|
|
|
|
|
|
|
|
minSdkVersion(23)
|
|
|
|
targetSdkVersion(29)
|
|
|
|
|
2020-06-11 11:09:57 +02:00
|
|
|
ndkVersion = "21.3.6528147"
|
2020-05-30 21:44:41 +02:00
|
|
|
|
2019-10-21 23:26:06 +02:00
|
|
|
versionCode = androidGitVersion.code()
|
|
|
|
versionName = androidGitVersion.name()
|
|
|
|
}
|
|
|
|
|
|
|
|
signingConfigs {
|
|
|
|
create("release") {
|
2019-10-22 20:19:05 +02:00
|
|
|
if (props.hasProperty("signing.store")) {
|
2019-10-21 23:26:06 +02:00
|
|
|
storeFile = file(props.getProperty("signing.store"))
|
|
|
|
storePassword = props.getProperty("signing.store_passphrase")
|
|
|
|
keyAlias = props.getProperty("signing.alias").toString()
|
|
|
|
keyPassword = props.getProperty("signing.key_passphrase")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
buildTypes {
|
2020-05-29 01:10:12 +02:00
|
|
|
getByName("debug") {
|
|
|
|
isDebuggable = true
|
2020-06-25 22:29:33 +02:00
|
|
|
|
|
|
|
resValue("string", "debug.hostname", props.getProperty("debug.hostname", ""))
|
|
|
|
resValue("string", "debug.username", props.getProperty("debug.username", ""))
|
|
|
|
resValue("string", "debug.password", props.getProperty("debug.password", ""))
|
2020-05-29 01:10:12 +02:00
|
|
|
}
|
|
|
|
|
2019-10-21 23:26:06 +02:00
|
|
|
getByName("release") {
|
2019-11-06 01:08:30 +01:00
|
|
|
if (props.hasProperty("signing.store")) {
|
|
|
|
signingConfig = signingConfigs.getByName("release")
|
|
|
|
}
|
2019-10-21 23:26:06 +02:00
|
|
|
|
2020-07-07 21:04:24 +02:00
|
|
|
resValue("string", "debug.hostname", "")
|
|
|
|
resValue("string", "debug.username", "")
|
|
|
|
resValue("string", "debug.password", "")
|
|
|
|
|
2020-06-25 22:29:33 +02:00
|
|
|
isMinifyEnabled = true
|
|
|
|
isShrinkResources = true
|
2019-10-21 23:26:06 +02:00
|
|
|
|
2020-06-25 22:29:33 +02:00
|
|
|
proguardFiles(
|
|
|
|
getDefaultProguardFile("proguard-android-optimize.txt"),
|
|
|
|
"proguard-rules.pro"
|
|
|
|
)
|
2019-10-21 23:26:06 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ktlint {
|
|
|
|
debug.set(false)
|
|
|
|
verbose.set(false)
|
|
|
|
}
|
|
|
|
|
|
|
|
play {
|
2019-10-22 20:19:05 +02:00
|
|
|
isEnabled = props.hasProperty("play.credentials")
|
2019-10-21 23:26:06 +02:00
|
|
|
|
|
|
|
if (isEnabled) {
|
|
|
|
serviceAccountCredentials = file(props.getProperty("play.credentials"))
|
|
|
|
defaultToAppBundles = true
|
|
|
|
track = "beta"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
2020-06-13 22:24:35 +02:00
|
|
|
implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar", "*.aar"))))
|
2019-10-21 23:26:06 +02:00
|
|
|
|
2020-06-25 22:29:33 +02:00
|
|
|
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.72")
|
|
|
|
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.7")
|
|
|
|
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.7")
|
2019-10-21 23:26:06 +02:00
|
|
|
|
|
|
|
implementation("androidx.appcompat:appcompat:1.1.0")
|
2020-06-20 22:10:13 +02:00
|
|
|
implementation("androidx.core:core-ktx:1.5.0-alpha01")
|
2020-06-25 01:26:15 +02:00
|
|
|
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.3.0-alpha05")
|
2020-05-29 01:10:12 +02:00
|
|
|
implementation("androidx.coordinatorlayout:coordinatorlayout:1.1.0")
|
|
|
|
implementation("androidx.preference:preference:1.1.1")
|
|
|
|
implementation("androidx.recyclerview:recyclerview:1.1.0")
|
2020-06-25 22:29:33 +02:00
|
|
|
implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.1.0")
|
2020-06-13 22:24:35 +02:00
|
|
|
implementation("com.google.android.material:material:1.3.0-alpha01")
|
2019-10-21 23:26:06 +02:00
|
|
|
implementation("com.android.support.constraint:constraint-layout:1.1.3")
|
|
|
|
|
2020-06-13 22:24:35 +02:00
|
|
|
implementation("com.google.android.exoplayer:exoplayer-core:2.11.5")
|
2020-06-14 14:59:50 +02:00
|
|
|
implementation("com.google.android.exoplayer:exoplayer-ui:2.11.5")
|
2020-06-13 22:24:35 +02:00
|
|
|
implementation("com.google.android.exoplayer:extension-mediasession:2.11.5")
|
|
|
|
|
2019-10-21 23:26:06 +02:00
|
|
|
implementation("com.aliassadi:power-preference-lib:1.4.1")
|
|
|
|
implementation("com.github.kittinunf.fuel:fuel:2.1.0")
|
|
|
|
implementation("com.github.kittinunf.fuel:fuel-coroutines:2.1.0")
|
|
|
|
implementation("com.github.kittinunf.fuel:fuel-android:2.1.0")
|
|
|
|
implementation("com.github.kittinunf.fuel:fuel-gson:2.1.0")
|
|
|
|
implementation("com.google.code.gson:gson:2.8.5")
|
|
|
|
implementation("com.squareup.picasso:picasso:2.71828")
|
|
|
|
implementation("jp.wasabeef:picasso-transformations:2.2.1")
|
|
|
|
}
|