forked from apognu/otter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
144 lines (117 loc) · 4.26 KB
/
build.gradle.kts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
import org.jetbrains.kotlin.konan.properties.hasProperty
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 {
try {
load(FileInputStream(rootProject.file("local.properties")))
} catch (e: Exception) {
}
}
androidGitVersion {
codeFormat = "MNNNPPP"
format = "%tag%%-count%%-commit%%-branch%"
}
android {
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
}
buildToolsVersion = "29.0.3"
compileSdkVersion(29)
defaultConfig {
applicationId = "com.github.apognu.otter"
minSdkVersion(23)
targetSdkVersion(29)
ndkVersion = "21.3.6528147"
versionCode = androidGitVersion.code()
versionName = androidGitVersion.name()
}
signingConfigs {
create("release") {
if (props.hasProperty("signing.store")) {
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 {
getByName("debug") {
isDebuggable = true
applicationIdSuffix = ".dev"
manifestPlaceholders = mapOf(
"app_name" to "Otter (develop)"
)
resValue("string", "debug.hostname", props.getProperty("debug.hostname", ""))
resValue("string", "debug.username", props.getProperty("debug.username", ""))
resValue("string", "debug.password", props.getProperty("debug.password", ""))
}
getByName("release") {
manifestPlaceholders = mapOf(
"app_name" to "Otter"
)
if (props.hasProperty("signing.store")) {
signingConfig = signingConfigs.getByName("release")
}
resValue("string", "debug.hostname", "")
resValue("string", "debug.username", "")
resValue("string", "debug.password", "")
isMinifyEnabled = true
isShrinkResources = true
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
}
}
ktlint {
debug.set(false)
verbose.set(false)
}
play {
isEnabled = props.hasProperty("play.credentials")
if (isEnabled) {
serviceAccountCredentials = file(props.getProperty("play.credentials"))
defaultToAppBundles = true
track = "beta"
}
}
dependencies {
implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar", "*.aar"))))
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")
implementation("androidx.appcompat:appcompat:1.1.0")
implementation("androidx.core:core-ktx:1.5.0-alpha01")
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.3.0-alpha05")
implementation("androidx.coordinatorlayout:coordinatorlayout:1.1.0")
implementation("androidx.preference:preference:1.1.1")
implementation("androidx.recyclerview:recyclerview:1.1.0")
implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.1.0")
implementation("com.google.android.material:material:1.3.0-alpha01")
implementation("com.android.support.constraint:constraint-layout:1.1.3")
implementation("com.google.android.exoplayer:exoplayer-core:2.11.5")
implementation("com.google.android.exoplayer:exoplayer-ui:2.11.5")
implementation("com.google.android.exoplayer:extension-mediasession:2.11.5")
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")
}