| author | Da Risk <da_risk@geekorum.com> |
| Thu, 22 Aug 2019 15:02:31 -0700 | |
| changeset 397 | 3881abcdd84c |
| parent 395 | 6e4ada4aab97 |
| child 401 | d3adda7021b1 |
| 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 |
|
|
19
5dcfa95ec99b
buildscript: expose dualTestImplementation method
Da Risk <da_risk@geekorum.com>
parents:
16
diff
changeset
|
23 |
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
|
24 |
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
|
25 |
import com.geekorum.build.enforcedDaggerPlatform |
| 0 | 26 |
import com.geekorum.build.getChangeSet |
27 |
||
28 |
plugins {
|
|
29 |
id("com.android.application")
|
|
30 |
id("com.google.android.gms.oss-licenses-plugin")
|
|
31 |
kotlin("android")
|
|
32 |
kotlin("kapt")
|
|
33 |
id("com.geekorum.build.android-tests")
|
|
34 |
id("com.geekorum.build.android-signing")
|
|
35 |
id("com.geekorum.build.android-genymotion")
|
|
|
231
f06b921ca359
build: make assembleRelease build universal apks
Da Risk <da_risk@geekorum.com>
parents:
229
diff
changeset
|
36 |
id("com.geekorum.build.android-release-universal-apk")
|
| 0 | 37 |
id("com.geekorum.build.source-license-checker")
|
38 |
id("com.geekorum.build.play-store-publish")
|
|
39 |
} |
|
40 |
||
41 |
android {
|
|
42 |
val compileSdkVersion: String by rootProject.extra |
|
43 |
setCompileSdkVersion(compileSdkVersion) |
|
44 |
defaultConfig {
|
|
45 |
applicationId = "com.geekorum.ttrss" |
|
46 |
minSdkVersion(24) |
|
|
352
09c2e952560a
app: target sdk 29 (android Q)
Da Risk <da_risk@geekorum.com>
parents:
328
diff
changeset
|
47 |
targetSdkVersion(29) |
| 1 | 48 |
val major = 1 |
| 355 | 49 |
val minor = 4 |
50 |
val patch = 0 |
|
| 0 | 51 |
versionCode = computeChangesetVersionCode(major, minor, patch) |
52 |
versionName = "$major.$minor.$patch" |
|
53 |
buildConfigField("String", "REPOSITORY_CHANGESET", "\"${getChangeSet()}\"")
|
|
54 |
||
55 |
javaCompileOptions {
|
|
56 |
annotationProcessorOptions {
|
|
57 |
arguments = mapOf( |
|
58 |
"room.schemaLocation" to "$projectDir/schemas") |
|
59 |
} |
|
60 |
} |
|
61 |
sourceSets {
|
|
|
40
c5ae393af55c
Update gradle version to 5.1-milestone-1
Da Risk <da_risk@geekorum.com>
parents:
34
diff
changeset
|
62 |
named("androidTest") {
|
|
c5ae393af55c
Update gradle version to 5.1-milestone-1
Da Risk <da_risk@geekorum.com>
parents:
34
diff
changeset
|
63 |
assets.srcDir(files("$projectDir/schemas"))
|
|
c5ae393af55c
Update gradle version to 5.1-milestone-1
Da Risk <da_risk@geekorum.com>
parents:
34
diff
changeset
|
64 |
} |
| 0 | 65 |
} |
66 |
} |
|
67 |
||
68 |
||
69 |
lintOptions {
|
|
70 |
isAbortOnError = false |
|
71 |
isCheckReleaseBuilds = false |
|
72 |
disable("MissingTranslation")
|
|
73 |
} |
|
74 |
||
75 |
buildTypes {
|
|
|
117
009e90d32ea3
build: prevent fabric to regenerate resource id on debug build
Da Risk <da_risk@geekorum.com>
parents:
113
diff
changeset
|
76 |
named("release") {
|
| 0 | 77 |
postprocessing {
|
78 |
isRemoveUnusedCode = true |
|
|
178
d5a489985531
Add a manage_feeds on demand feature module
Da Risk <da_risk@geekorum.com>
parents:
165
diff
changeset
|
79 |
// isRemoveUnusedResources = true |
| 0 | 80 |
isObfuscate = false |
81 |
isOptimizeCode = true |
|
82 |
proguardFile("proguard-rules.pro")
|
|
83 |
} |
|
84 |
} |
|
|
117
009e90d32ea3
build: prevent fabric to regenerate resource id on debug build
Da Risk <da_risk@geekorum.com>
parents:
113
diff
changeset
|
85 |
named("debug") {
|
|
009e90d32ea3
build: prevent fabric to regenerate resource id on debug build
Da Risk <da_risk@geekorum.com>
parents:
113
diff
changeset
|
86 |
// 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
|
87 |
// 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
|
88 |
(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
|
89 |
} |
| 0 | 90 |
} |
91 |
||
92 |
dataBinding {
|
|
93 |
isEnabled = true |
|
94 |
} |
|
95 |
||
96 |
flavorDimensions("distribution")
|
|
97 |
productFlavors {
|
|
98 |
register("free") {
|
|
99 |
dimension = "distribution" |
|
100 |
applicationIdSuffix = ".free" |
|
101 |
} |
|
102 |
||
| 397 | 103 |
register("google") {
|
| 0 | 104 |
dimension = "distribution" |
105 |
versionNameSuffix = "-google" |
|
106 |
} |
|
107 |
} |
|
|
178
d5a489985531
Add a manage_feeds on demand feature module
Da Risk <da_risk@geekorum.com>
parents:
165
diff
changeset
|
108 |
|
|
d5a489985531
Add a manage_feeds on demand feature module
Da Risk <da_risk@geekorum.com>
parents:
165
diff
changeset
|
109 |
dynamicFeatures = mutableSetOf(":manage_feeds")
|
| 0 | 110 |
} |
111 |
||
112 |
||
113 |
dependencies {
|
|
114 |
||
| 227 | 115 |
implementation("androidx.core:core-ktx:1.0.2")
|
|
378
b78e40e2bc30
Update androidx fragment and activity
Da Risk <da_risk@geekorum.com>
parents:
364
diff
changeset
|
116 |
implementation("androidx.fragment:fragment-ktx:1.2.0-alpha02")
|
|
b78e40e2bc30
Update androidx fragment and activity
Da Risk <da_risk@geekorum.com>
parents:
364
diff
changeset
|
117 |
implementation("androidx.activity:activity-ktx:1.1.0-alpha02")
|
|
16
9e36c283bc9b
Migrate ArticlesDatabaseMigrationTest from java to kotlin
Da Risk <da_risk@geekorum.com>
parents:
15
diff
changeset
|
118 |
|
| 0 | 119 |
// androidx ui |
|
264
0a559926d7a8
Update a few androidx dependencies
Da Risk <da_risk@geekorum.com>
parents:
256
diff
changeset
|
120 |
implementation("androidx.drawerlayout:drawerlayout:1.1.0-alpha02")
|
| 0 | 121 |
implementation("androidx.constraintlayout:constraintlayout:1.1.3")
|
122 |
implementation("androidx.recyclerview:recyclerview:1.0.0")
|
|
123 |
implementation("androidx.coordinatorlayout:coordinatorlayout:1.0.0")
|
|
124 |
implementation("androidx.preference:preference-ktx:1.0.0")
|
|
125 |
||
126 |
// androidx others |
|
127 |
implementation("androidx.browser:browser:1.0.0")
|
|
128 |
||
| 113 | 129 |
implementation("com.jakewharton.retrofit:retrofit2-kotlinx-serialization-converter:0.4.0")
|
| 0 | 130 |
|
|
312
acd822d279e3
app: use Webapi and remove network/impl based api
Da Risk <da_risk@geekorum.com>
parents:
307
diff
changeset
|
131 |
// internal libraries |
|
40
c5ae393af55c
Update gradle version to 5.1-milestone-1
Da Risk <da_risk@geekorum.com>
parents:
34
diff
changeset
|
132 |
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
|
133 |
val geekdroidExt = GEEKDROID_PROJECT_DIR?.let { "" } ?: "aar"
|
| 0 | 134 |
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
|
135 |
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
|
136 |
add("googleImplementation", it)
|
|
84a27546e309
google variant: log to crashlytics
Da Risk <da_risk@geekorum.com>
parents:
6
diff
changeset
|
137 |
} |
|
307
f1b40d8534be
extract htmlparsers into a new library module
Da Risk <da_risk@geekorum.com>
parents:
298
diff
changeset
|
138 |
implementation(project(":htmlparsers"))
|
|
312
acd822d279e3
app: use Webapi and remove network/impl based api
Da Risk <da_risk@geekorum.com>
parents:
307
diff
changeset
|
139 |
implementation(project(":webapi"))
|
| 0 | 140 |
|
|
360
b512a1eacde1
update to material-1.1.0-alpha08
Da Risk <da_risk@geekorum.com>
parents:
359
diff
changeset
|
141 |
implementation("com.google.android.material:material:1.1.0-alpha08")
|
| 0 | 142 |
implementation("com.jakewharton.retrofit:retrofit2-kotlin-coroutines-adapter:0.9.2")
|
| 227 | 143 |
implementation("com.squareup.okhttp3:logging-interceptor:3.12.0")
|
144 |
testImplementation("com.squareup.okhttp3:mockwebserver:3.12.0")
|
|
| 0 | 145 |
implementation("com.squareup.picasso:picasso:2.5.2")
|
|
298
6add67edaa54
Update firebase dependencies
Da Risk <da_risk@geekorum.com>
parents:
296
diff
changeset
|
146 |
implementation("com.google.android.gms:play-services-oss-licenses:17.0.0")
|
| 0 | 147 |
|
148 |
implementation("org.jsoup:jsoup:1.10.2")
|
|
149 |
||
|
40
c5ae393af55c
Update gradle version to 5.1-milestone-1
Da Risk <da_risk@geekorum.com>
parents:
34
diff
changeset
|
150 |
val lifecycleVersion: String by rootProject.extra |
| 0 | 151 |
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
|
152 |
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
|
153 |
implementation("androidx.lifecycle:lifecycle-livedata-ktx:$lifecycleVersion")
|
|
25
49716defe54b
Conver ArticleListActivity to kotlin
Da Risk <da_risk@geekorum.com>
parents:
19
diff
changeset
|
154 |
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
|
155 |
implementation("androidx.lifecycle:lifecycle-runtime-ktx:$lifecycleVersion")
|
| 0 | 156 |
kapt("androidx.lifecycle:lifecycle-compiler:$lifecycleVersion")
|
|
127
cb769869d515
Update some androidx alpha libraries
Da Risk <da_risk@geekorum.com>
parents:
122
diff
changeset
|
157 |
dualTestImplementation("androidx.arch.core:core-testing:2.0.1")
|
| 0 | 158 |
|
159 |
// dagger |
|
|
101
247d5b1c0324
build: use dependencies version alignment and filter content of google()
Da Risk <da_risk@geekorum.com>
parents:
96
diff
changeset
|
160 |
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
|
161 |
implementation(enforcedDaggerPlatform(daggerVersion)) |
|
247d5b1c0324
build: use dependencies version alignment and filter content of google()
Da Risk <da_risk@geekorum.com>
parents:
96
diff
changeset
|
162 |
kapt(enforcedDaggerPlatform(daggerVersion)) |
| 0 | 163 |
implementation("com.google.dagger:dagger:$daggerVersion")
|
164 |
implementation("com.google.dagger:dagger-android:$daggerVersion")
|
|
165 |
implementation("com.google.dagger:dagger-android-support:$daggerVersion")
|
|
166 |
kapt("com.google.dagger:dagger-compiler:$daggerVersion")
|
|
167 |
kapt("com.google.dagger:dagger-android-processor:$daggerVersion")
|
|
168 |
kaptTest("com.google.dagger:dagger-compiler:$daggerVersion")
|
|
169 |
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
|
170 |
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
|
171 |
kapt("com.squareup.inject:assisted-inject-processor-dagger2:0.4.0")
|
| 0 | 172 |
|
| 296 | 173 |
val roomVersion = "2.1.0" |
| 0 | 174 |
kapt("androidx.room:room-compiler:$roomVersion")
|
175 |
androidTestImplementation("androidx.room:room-testing:$roomVersion")
|
|
176 |
||
|
392
a7b184922839
Update to androidx.work-2.2.0
Da Risk <da_risk@geekorum.com>
parents:
378
diff
changeset
|
177 |
val workVersion = "2.2.0" |
|
256
64383b6d394c
PurgeArticlesWorker: add tests
Da Risk <da_risk@geekorum.com>
parents:
251
diff
changeset
|
178 |
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
|
179 |
|
| 397 | 180 |
implementation(enforcedPlatform(kotlin("bom")))
|
|
52
e5c5c909ba21
Kotlin: update to 1.3.20 and coroutines 1.1.0
Da Risk <da_risk@geekorum.com>
parents:
51
diff
changeset
|
181 |
implementation(kotlin("stdlib-jdk8"))
|
|
14
84a27546e309
google variant: log to crashlytics
Da Risk <da_risk@geekorum.com>
parents:
6
diff
changeset
|
182 |
|
|
101
247d5b1c0324
build: use dependencies version alignment and filter content of google()
Da Risk <da_risk@geekorum.com>
parents:
96
diff
changeset
|
183 |
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
|
184 |
implementation(enforcedCoroutinesPlatform(coroutinesVersion)) |
|
247d5b1c0324
build: use dependencies version alignment and filter content of google()
Da Risk <da_risk@geekorum.com>
parents:
96
diff
changeset
|
185 |
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
|
186 |
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
|
187 |
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
|
188 |
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:$coroutinesVersion")
|
| 0 | 189 |
|
|
298
6add67edaa54
Update firebase dependencies
Da Risk <da_risk@geekorum.com>
parents:
296
diff
changeset
|
190 |
implementation(enforcedPlatform("com.google.firebase:firebase-bom:20.1.0"))
|
|
6add67edaa54
Update firebase dependencies
Da Risk <da_risk@geekorum.com>
parents:
296
diff
changeset
|
191 |
add("googleImplementation", "com.crashlytics.sdk.android:crashlytics")
|
| 0 | 192 |
// ensure that the free flavor don't get any firebase dependencies |
193 |
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
|
194 |
|
|
1cb6953be2f1
Implementation of PlayStoreModuleManager to try the api
Da Risk <da_risk@geekorum.com>
parents:
181
diff
changeset
|
195 |
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
|
196 |
|
|
264
0a559926d7a8
Update a few androidx dependencies
Da Risk <da_risk@geekorum.com>
parents:
256
diff
changeset
|
197 |
// api dependencies for features modules |
|
352
09c2e952560a
app: target sdk 29 (android Q)
Da Risk <da_risk@geekorum.com>
parents:
328
diff
changeset
|
198 |
api("androidx.appcompat:appcompat:1.1.0-rc01")
|
|
264
0a559926d7a8
Update a few androidx dependencies
Da Risk <da_risk@geekorum.com>
parents:
256
diff
changeset
|
199 |
api("androidx.work:work-runtime-ktx:$workVersion")
|
|
0a559926d7a8
Update a few androidx dependencies
Da Risk <da_risk@geekorum.com>
parents:
256
diff
changeset
|
200 |
api("androidx.room:room-runtime:$roomVersion")
|
|
0a559926d7a8
Update a few androidx dependencies
Da Risk <da_risk@geekorum.com>
parents:
256
diff
changeset
|
201 |
api("androidx.room:room-ktx:$roomVersion")
|
|
0a559926d7a8
Update a few androidx dependencies
Da Risk <da_risk@geekorum.com>
parents:
256
diff
changeset
|
202 |
api("androidx.paging:paging-runtime:2.1.0")
|
|
0a559926d7a8
Update a few androidx dependencies
Da Risk <da_risk@geekorum.com>
parents:
256
diff
changeset
|
203 |
api("com.squareup.retrofit2:retrofit:2.5.0")
|
|
0a559926d7a8
Update a few androidx dependencies
Da Risk <da_risk@geekorum.com>
parents:
256
diff
changeset
|
204 |
api("com.squareup.okhttp3:okhttp:3.12.0")
|
|
0a559926d7a8
Update a few androidx dependencies
Da Risk <da_risk@geekorum.com>
parents:
256
diff
changeset
|
205 |
api("com.jakewharton.timber:timber:4.7.1")
|
|
0a559926d7a8
Update a few androidx dependencies
Da Risk <da_risk@geekorum.com>
parents:
256
diff
changeset
|
206 |
|
|
328
164b6365e14f
tests: add fragment-testing dependency
Da Risk <da_risk@geekorum.com>
parents:
321
diff
changeset
|
207 |
// fragment testing declare some activities and resources that needs to be in the apk |
|
164b6365e14f
tests: add fragment-testing dependency
Da Risk <da_risk@geekorum.com>
parents:
321
diff
changeset
|
208 |
// we don't use it. here but it is used in feature modules |
|
164b6365e14f
tests: add fragment-testing dependency
Da Risk <da_risk@geekorum.com>
parents:
321
diff
changeset
|
209 |
debugImplementation("androidx.fragment:fragment-testing:1.2.0-alpha01")
|
|
164b6365e14f
tests: add fragment-testing dependency
Da Risk <da_risk@geekorum.com>
parents:
321
diff
changeset
|
210 |
|
| 395 | 211 |
debugImplementation("com.squareup.leakcanary:leakcanary-android:2.0-beta-2")
|
| 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 |
} |