| author | Da Risk <da_risk@geekorum.com> |
| Mon, 24 Jun 2019 18:05:13 -0700 | |
| changeset 298 | 6add67edaa54 |
| parent 296 | 6ffc3ae7784c |
| child 307 | f1b40d8534be |
| permissions | -rw-r--r-- |
| 181 | 1 |
/* |
| 0 | 2 |
* Geekttrss is a RSS feed reader application on the Android Platform. |
3 |
* |
|
| 181 | 4 |
* Copyright (C) 2017-2019 by Frederic-Charles Barthelery. |
| 0 | 5 |
* |
6 |
* This file is part of Geekttrss. |
|
7 |
* |
|
8 |
* Geekttrss is free software: you can redistribute it and/or modify |
|
9 |
* it under the terms of the GNU General Public License as published by |
|
10 |
* the Free Software Foundation, either version 3 of the License, or |
|
11 |
* (at your option) any later version. |
|
12 |
* |
|
13 |
* Geekttrss is distributed in the hope that it will be useful, |
|
14 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
15 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
16 |
* GNU General Public License for more details. |
|
17 |
* |
|
18 |
* You should have received a copy of the GNU General Public License |
|
19 |
* along with Geekttrss. If not, see <http://www.gnu.org/licenses/>. |
|
20 |
*/ |
|
21 |
||
22 |
import com.geekorum.build.computeChangesetVersionCode |
|
|
101
247d5b1c0324
build: use dependencies version alignment and filter content of google()
Da Risk <da_risk@geekorum.com>
parents:
96
diff
changeset
|
23 |
import com.geekorum.build.configureJavaVersion |
|
19
5dcfa95ec99b
buildscript: expose dualTestImplementation method
Da Risk <da_risk@geekorum.com>
parents:
16
diff
changeset
|
24 |
import com.geekorum.build.dualTestImplementation |
|
101
247d5b1c0324
build: use dependencies version alignment and filter content of google()
Da Risk <da_risk@geekorum.com>
parents:
96
diff
changeset
|
25 |
import com.geekorum.build.enforcedCoroutinesPlatform |
|
247d5b1c0324
build: use dependencies version alignment and filter content of google()
Da Risk <da_risk@geekorum.com>
parents:
96
diff
changeset
|
26 |
import com.geekorum.build.enforcedDaggerPlatform |
| 0 | 27 |
import com.geekorum.build.getChangeSet |
28 |
import org.gradle.kotlin.dsl.extra |
|
29 |
import org.gradle.kotlin.dsl.kotlin |
|
30 |
||
31 |
plugins {
|
|
32 |
id("com.android.application")
|
|
33 |
id("com.google.android.gms.oss-licenses-plugin")
|
|
34 |
kotlin("android")
|
|
35 |
kotlin("kapt")
|
|
36 |
id("kotlinx-serialization")
|
|
37 |
id("com.geekorum.build.android-tests")
|
|
38 |
id("com.geekorum.build.android-signing")
|
|
39 |
id("com.geekorum.build.android-genymotion")
|
|
|
231
f06b921ca359
build: make assembleRelease build universal apks
Da Risk <da_risk@geekorum.com>
parents:
229
diff
changeset
|
40 |
id("com.geekorum.build.android-release-universal-apk")
|
| 0 | 41 |
id("com.geekorum.build.source-license-checker")
|
42 |
id("com.geekorum.build.play-store-publish")
|
|
43 |
} |
|
44 |
||
45 |
android {
|
|
46 |
val compileSdkVersion: String by rootProject.extra |
|
47 |
setCompileSdkVersion(compileSdkVersion) |
|
48 |
defaultConfig {
|
|
49 |
applicationId = "com.geekorum.ttrss" |
|
50 |
minSdkVersion(24) |
|
51 |
targetSdkVersion(28) |
|
| 1 | 52 |
val major = 1 |
| 159 | 53 |
val minor = 3 |
| 229 | 54 |
val patch = 1 |
| 0 | 55 |
versionCode = computeChangesetVersionCode(major, minor, patch) |
56 |
versionName = "$major.$minor.$patch" |
|
57 |
buildConfigField("String", "REPOSITORY_CHANGESET", "\"${getChangeSet()}\"")
|
|
58 |
||
59 |
javaCompileOptions {
|
|
60 |
annotationProcessorOptions {
|
|
61 |
arguments = mapOf( |
|
62 |
"room.schemaLocation" to "$projectDir/schemas") |
|
63 |
} |
|
64 |
} |
|
65 |
sourceSets {
|
|
|
40
c5ae393af55c
Update gradle version to 5.1-milestone-1
Da Risk <da_risk@geekorum.com>
parents:
34
diff
changeset
|
66 |
named("androidTest") {
|
|
c5ae393af55c
Update gradle version to 5.1-milestone-1
Da Risk <da_risk@geekorum.com>
parents:
34
diff
changeset
|
67 |
assets.srcDir(files("$projectDir/schemas"))
|
|
c5ae393af55c
Update gradle version to 5.1-milestone-1
Da Risk <da_risk@geekorum.com>
parents:
34
diff
changeset
|
68 |
} |
| 0 | 69 |
} |
70 |
} |
|
71 |
||
72 |
||
73 |
lintOptions {
|
|
74 |
isAbortOnError = false |
|
75 |
isCheckReleaseBuilds = false |
|
76 |
disable("MissingTranslation")
|
|
77 |
} |
|
78 |
||
79 |
buildTypes {
|
|
|
117
009e90d32ea3
build: prevent fabric to regenerate resource id on debug build
Da Risk <da_risk@geekorum.com>
parents:
113
diff
changeset
|
80 |
named("release") {
|
| 0 | 81 |
postprocessing {
|
82 |
isRemoveUnusedCode = true |
|
|
178
d5a489985531
Add a manage_feeds on demand feature module
Da Risk <da_risk@geekorum.com>
parents:
165
diff
changeset
|
83 |
// isRemoveUnusedResources = true |
| 0 | 84 |
isObfuscate = false |
85 |
isOptimizeCode = true |
|
86 |
proguardFile("proguard-rules.pro")
|
|
87 |
} |
|
88 |
} |
|
|
117
009e90d32ea3
build: prevent fabric to regenerate resource id on debug build
Da Risk <da_risk@geekorum.com>
parents:
113
diff
changeset
|
89 |
named("debug") {
|
|
009e90d32ea3
build: prevent fabric to regenerate resource id on debug build
Da Risk <da_risk@geekorum.com>
parents:
113
diff
changeset
|
90 |
// prevent fabric for generating build id which hurts gradle task caching |
|
009e90d32ea3
build: prevent fabric to regenerate resource id on debug build
Da Risk <da_risk@geekorum.com>
parents:
113
diff
changeset
|
91 |
// see https://docs.fabric.io/android/crashlytics/build-tools.html#optimize-builds-when-you-re-not-proguarding-or-using-beta-by-crashlytics |
|
009e90d32ea3
build: prevent fabric to regenerate resource id on debug build
Da Risk <da_risk@geekorum.com>
parents:
113
diff
changeset
|
92 |
(this as ExtensionAware).extra["alwaysUpdateBuildId"] = false |
|
009e90d32ea3
build: prevent fabric to regenerate resource id on debug build
Da Risk <da_risk@geekorum.com>
parents:
113
diff
changeset
|
93 |
} |
| 0 | 94 |
} |
95 |
||
96 |
dataBinding {
|
|
97 |
isEnabled = true |
|
98 |
} |
|
99 |
||
|
101
247d5b1c0324
build: use dependencies version alignment and filter content of google()
Da Risk <da_risk@geekorum.com>
parents:
96
diff
changeset
|
100 |
configureJavaVersion() |
| 0 | 101 |
|
102 |
flavorDimensions("distribution")
|
|
103 |
productFlavors {
|
|
104 |
register("free") {
|
|
105 |
dimension = "distribution" |
|
106 |
applicationIdSuffix = ".free" |
|
107 |
} |
|
108 |
||
109 |
register("google"){
|
|
110 |
dimension = "distribution" |
|
111 |
versionNameSuffix = "-google" |
|
112 |
} |
|
113 |
} |
|
|
178
d5a489985531
Add a manage_feeds on demand feature module
Da Risk <da_risk@geekorum.com>
parents:
165
diff
changeset
|
114 |
|
|
d5a489985531
Add a manage_feeds on demand feature module
Da Risk <da_risk@geekorum.com>
parents:
165
diff
changeset
|
115 |
dynamicFeatures = mutableSetOf(":manage_feeds")
|
| 0 | 116 |
} |
117 |
||
118 |
||
119 |
dependencies {
|
|
120 |
||
| 227 | 121 |
implementation("androidx.core:core-ktx:1.0.2")
|
|
264
0a559926d7a8
Update a few androidx dependencies
Da Risk <da_risk@geekorum.com>
parents:
256
diff
changeset
|
122 |
implementation("androidx.fragment:fragment-ktx:1.1.0-beta01")
|
|
0a559926d7a8
Update a few androidx dependencies
Da Risk <da_risk@geekorum.com>
parents:
256
diff
changeset
|
123 |
implementation("androidx.activity:activity-ktx:1.0.0-beta01")
|
|
16
9e36c283bc9b
Migrate ArticlesDatabaseMigrationTest from java to kotlin
Da Risk <da_risk@geekorum.com>
parents:
15
diff
changeset
|
124 |
|
| 0 | 125 |
// androidx ui |
|
264
0a559926d7a8
Update a few androidx dependencies
Da Risk <da_risk@geekorum.com>
parents:
256
diff
changeset
|
126 |
implementation("androidx.drawerlayout:drawerlayout:1.1.0-alpha02")
|
| 0 | 127 |
implementation("androidx.constraintlayout:constraintlayout:1.1.3")
|
128 |
implementation("androidx.recyclerview:recyclerview:1.0.0")
|
|
129 |
implementation("androidx.coordinatorlayout:coordinatorlayout:1.0.0")
|
|
130 |
implementation("androidx.preference:preference-ktx:1.0.0")
|
|
131 |
||
132 |
// androidx others |
|
133 |
implementation("androidx.browser:browser:1.0.0")
|
|
134 |
||
| 113 | 135 |
implementation("org.jetbrains.kotlinx:kotlinx-serialization-runtime:0.11.0")
|
136 |
implementation("com.jakewharton.retrofit:retrofit2-kotlinx-serialization-converter:0.4.0")
|
|
| 0 | 137 |
|
|
40
c5ae393af55c
Update gradle version to 5.1-milestone-1
Da Risk <da_risk@geekorum.com>
parents:
34
diff
changeset
|
138 |
val GEEKDROID_PROJECT_DIR: String? by project |
|
c5ae393af55c
Update gradle version to 5.1-milestone-1
Da Risk <da_risk@geekorum.com>
parents:
34
diff
changeset
|
139 |
val geekdroidExt = GEEKDROID_PROJECT_DIR?.let { "" } ?: "aar"
|
| 0 | 140 |
implementation(group = "com.geekorum", name = "geekdroid", version = "0.0.1", ext = geekdroidExt) |
|
14
84a27546e309
google variant: log to crashlytics
Da Risk <da_risk@geekorum.com>
parents:
6
diff
changeset
|
141 |
create(group = "com.geekorum", name = "geekdroid-firebase", version = "0.0.1", ext = geekdroidExt).also {
|
|
84a27546e309
google variant: log to crashlytics
Da Risk <da_risk@geekorum.com>
parents:
6
diff
changeset
|
142 |
add("googleImplementation", it)
|
|
84a27546e309
google variant: log to crashlytics
Da Risk <da_risk@geekorum.com>
parents:
6
diff
changeset
|
143 |
} |
| 0 | 144 |
|
| 227 | 145 |
implementation("com.google.android.material:material:1.1.0-alpha07")
|
| 0 | 146 |
implementation("com.jakewharton.retrofit:retrofit2-kotlin-coroutines-adapter:0.9.2")
|
| 227 | 147 |
implementation("com.squareup.okhttp3:logging-interceptor:3.12.0")
|
148 |
testImplementation("com.squareup.okhttp3:mockwebserver:3.12.0")
|
|
| 0 | 149 |
implementation("com.squareup.picasso:picasso:2.5.2")
|
|
298
6add67edaa54
Update firebase dependencies
Da Risk <da_risk@geekorum.com>
parents:
296
diff
changeset
|
150 |
implementation("com.google.android.gms:play-services-oss-licenses:17.0.0")
|
| 0 | 151 |
|
152 |
implementation("org.jsoup:jsoup:1.10.2")
|
|
153 |
||
|
40
c5ae393af55c
Update gradle version to 5.1-milestone-1
Da Risk <da_risk@geekorum.com>
parents:
34
diff
changeset
|
154 |
val lifecycleVersion: String by rootProject.extra |
| 0 | 155 |
implementation("androidx.lifecycle:lifecycle-extensions:$lifecycleVersion")
|
|
50
a4bb7d5230d8
Update to androidx lifecyle-2.1.0-alpha01 and cleanup
Da Risk <da_risk@geekorum.com>
parents:
46
diff
changeset
|
156 |
implementation("androidx.lifecycle:lifecycle-livedata-core-ktx:$lifecycleVersion")
|
|
a4bb7d5230d8
Update to androidx lifecyle-2.1.0-alpha01 and cleanup
Da Risk <da_risk@geekorum.com>
parents:
46
diff
changeset
|
157 |
implementation("androidx.lifecycle:lifecycle-livedata-ktx:$lifecycleVersion")
|
|
25
49716defe54b
Conver ArticleListActivity to kotlin
Da Risk <da_risk@geekorum.com>
parents:
19
diff
changeset
|
158 |
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycleVersion")
|
|
165
43285f832226
ArticleDetailFragment: use lifecyclescope to launch automark as read coroutine
Da Risk <da_risk@geekorum.com>
parents:
162
diff
changeset
|
159 |
implementation("androidx.lifecycle:lifecycle-runtime-ktx:$lifecycleVersion")
|
| 0 | 160 |
kapt("androidx.lifecycle:lifecycle-compiler:$lifecycleVersion")
|
|
127
cb769869d515
Update some androidx alpha libraries
Da Risk <da_risk@geekorum.com>
parents:
122
diff
changeset
|
161 |
dualTestImplementation("androidx.arch.core:core-testing:2.0.1")
|
| 0 | 162 |
|
163 |
// dagger |
|
|
101
247d5b1c0324
build: use dependencies version alignment and filter content of google()
Da Risk <da_risk@geekorum.com>
parents:
96
diff
changeset
|
164 |
val daggerVersion: String by rootProject.extra |
|
247d5b1c0324
build: use dependencies version alignment and filter content of google()
Da Risk <da_risk@geekorum.com>
parents:
96
diff
changeset
|
165 |
implementation(enforcedDaggerPlatform(daggerVersion)) |
|
247d5b1c0324
build: use dependencies version alignment and filter content of google()
Da Risk <da_risk@geekorum.com>
parents:
96
diff
changeset
|
166 |
kapt(enforcedDaggerPlatform(daggerVersion)) |
| 0 | 167 |
implementation("com.google.dagger:dagger:$daggerVersion")
|
168 |
implementation("com.google.dagger:dagger-android:$daggerVersion")
|
|
169 |
implementation("com.google.dagger:dagger-android-support:$daggerVersion")
|
|
170 |
kapt("com.google.dagger:dagger-compiler:$daggerVersion")
|
|
171 |
kapt("com.google.dagger:dagger-android-processor:$daggerVersion")
|
|
172 |
kaptTest("com.google.dagger:dagger-compiler:$daggerVersion")
|
|
173 |
kaptTest("com.google.dagger:dagger-android-processor:$daggerVersion")
|
|
|
122
c598826a4795
Update geekdroid and coroutines version
Da Risk <da_risk@geekorum.com>
parents:
117
diff
changeset
|
174 |
implementation("com.squareup.inject:assisted-inject-annotations-dagger2:0.4.0")
|
|
c598826a4795
Update geekdroid and coroutines version
Da Risk <da_risk@geekorum.com>
parents:
117
diff
changeset
|
175 |
kapt("com.squareup.inject:assisted-inject-processor-dagger2:0.4.0")
|
| 0 | 176 |
|
| 296 | 177 |
val roomVersion = "2.1.0" |
| 0 | 178 |
kapt("androidx.room:room-compiler:$roomVersion")
|
179 |
androidTestImplementation("androidx.room:room-testing:$roomVersion")
|
|
180 |
||
|
295
97e057f151c1
Tests: update to work-testing-2.1.0-beta02
Da Risk <da_risk@geekorum.com>
parents:
264
diff
changeset
|
181 |
val workVersion = "2.1.0-beta02" |
|
256
64383b6d394c
PurgeArticlesWorker: add tests
Da Risk <da_risk@geekorum.com>
parents:
251
diff
changeset
|
182 |
androidTestImplementation("androidx.work:work-testing:$workVersion")
|
|
251
ac20fbd55433
AddFeed: use WorkerManager instead of the custom JobIntentService
Da Risk <da_risk@geekorum.com>
parents:
239
diff
changeset
|
183 |
|
|
40
c5ae393af55c
Update gradle version to 5.1-milestone-1
Da Risk <da_risk@geekorum.com>
parents:
34
diff
changeset
|
184 |
val kotlinVersion: String by rootProject.extra |
|
52
e5c5c909ba21
Kotlin: update to 1.3.20 and coroutines 1.1.0
Da Risk <da_risk@geekorum.com>
parents:
51
diff
changeset
|
185 |
implementation(enforcedPlatform(kotlin("bom", kotlinVersion)))
|
|
e5c5c909ba21
Kotlin: update to 1.3.20 and coroutines 1.1.0
Da Risk <da_risk@geekorum.com>
parents:
51
diff
changeset
|
186 |
implementation(kotlin("stdlib-jdk8"))
|
|
14
84a27546e309
google variant: log to crashlytics
Da Risk <da_risk@geekorum.com>
parents:
6
diff
changeset
|
187 |
|
|
101
247d5b1c0324
build: use dependencies version alignment and filter content of google()
Da Risk <da_risk@geekorum.com>
parents:
96
diff
changeset
|
188 |
val coroutinesVersion: String by rootProject.extra |
|
247d5b1c0324
build: use dependencies version alignment and filter content of google()
Da Risk <da_risk@geekorum.com>
parents:
96
diff
changeset
|
189 |
implementation(enforcedCoroutinesPlatform(coroutinesVersion)) |
|
247d5b1c0324
build: use dependencies version alignment and filter content of google()
Da Risk <da_risk@geekorum.com>
parents:
96
diff
changeset
|
190 |
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion")
|
|
247d5b1c0324
build: use dependencies version alignment and filter content of google()
Da Risk <da_risk@geekorum.com>
parents:
96
diff
changeset
|
191 |
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutinesVersion")
|
|
247d5b1c0324
build: use dependencies version alignment and filter content of google()
Da Risk <da_risk@geekorum.com>
parents:
96
diff
changeset
|
192 |
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-jdk8:$coroutinesVersion")
|
|
152
2f7d02bbfb5e
LoginViewModel: fix test broken by launching a coroutines
Da Risk <da_risk@geekorum.com>
parents:
151
diff
changeset
|
193 |
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:$coroutinesVersion")
|
| 0 | 194 |
|
|
298
6add67edaa54
Update firebase dependencies
Da Risk <da_risk@geekorum.com>
parents:
296
diff
changeset
|
195 |
implementation(enforcedPlatform("com.google.firebase:firebase-bom:20.1.0"))
|
|
6add67edaa54
Update firebase dependencies
Da Risk <da_risk@geekorum.com>
parents:
296
diff
changeset
|
196 |
add("googleImplementation", "com.crashlytics.sdk.android:crashlytics")
|
| 0 | 197 |
// ensure that the free flavor don't get any firebase dependencies |
198 |
configurations["freeImplementation"].exclude(group = "com.google.firebase") |
|
|
185
1cb6953be2f1
Implementation of PlayStoreModuleManager to try the api
Da Risk <da_risk@geekorum.com>
parents:
181
diff
changeset
|
199 |
|
|
1cb6953be2f1
Implementation of PlayStoreModuleManager to try the api
Da Risk <da_risk@geekorum.com>
parents:
181
diff
changeset
|
200 |
add("googleImplementation", "com.google.android.play:core:1.5.0")
|
|
1cb6953be2f1
Implementation of PlayStoreModuleManager to try the api
Da Risk <da_risk@geekorum.com>
parents:
181
diff
changeset
|
201 |
|
|
264
0a559926d7a8
Update a few androidx dependencies
Da Risk <da_risk@geekorum.com>
parents:
256
diff
changeset
|
202 |
// api dependencies for features modules |
|
0a559926d7a8
Update a few androidx dependencies
Da Risk <da_risk@geekorum.com>
parents:
256
diff
changeset
|
203 |
api("androidx.appcompat:appcompat:1.1.0-beta01")
|
|
0a559926d7a8
Update a few androidx dependencies
Da Risk <da_risk@geekorum.com>
parents:
256
diff
changeset
|
204 |
api("androidx.work:work-runtime-ktx:$workVersion")
|
|
0a559926d7a8
Update a few androidx dependencies
Da Risk <da_risk@geekorum.com>
parents:
256
diff
changeset
|
205 |
api("androidx.room:room-runtime:$roomVersion")
|
|
0a559926d7a8
Update a few androidx dependencies
Da Risk <da_risk@geekorum.com>
parents:
256
diff
changeset
|
206 |
api("androidx.room:room-ktx:$roomVersion")
|
|
0a559926d7a8
Update a few androidx dependencies
Da Risk <da_risk@geekorum.com>
parents:
256
diff
changeset
|
207 |
api("androidx.paging:paging-runtime:2.1.0")
|
|
0a559926d7a8
Update a few androidx dependencies
Da Risk <da_risk@geekorum.com>
parents:
256
diff
changeset
|
208 |
api("com.squareup.retrofit2:retrofit:2.5.0")
|
|
0a559926d7a8
Update a few androidx dependencies
Da Risk <da_risk@geekorum.com>
parents:
256
diff
changeset
|
209 |
api("com.squareup.okhttp3:okhttp:3.12.0")
|
|
0a559926d7a8
Update a few androidx dependencies
Da Risk <da_risk@geekorum.com>
parents:
256
diff
changeset
|
210 |
api("com.jakewharton.timber:timber:4.7.1")
|
|
0a559926d7a8
Update a few androidx dependencies
Da Risk <da_risk@geekorum.com>
parents:
256
diff
changeset
|
211 |
|
| 0 | 212 |
} |
213 |
||
214 |
apply {
|
|
215 |
val playServicesActivated = file("google-services.json").exists()
|
|
216 |
if (playServicesActivated) {
|
|
217 |
// needs to be applied after configuration |
|
218 |
plugin("com.google.gms.google-services")
|
|
219 |
plugin("io.fabric")
|
|
220 |
} |
|
221 |
} |