| author | Da Risk <da_risk@geekorum.com> |
| Mon, 20 May 2019 15:08:22 -0700 | |
| changeset 162 | f627eceb01b2 |
| parent 161 | a359009c33c3 |
| child 165 | 43285f832226 |
| permissions | -rw-r--r-- |
| 0 | 1 |
/** |
2 |
* Geekttrss is a RSS feed reader application on the Android Platform. |
|
3 |
* |
|
4 |
* Copyright (C) 2017-2018 by Frederic-Charles Barthelery. |
|
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.enforcedAndroidxLifecyclePlatform |
|
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.enforcedCoroutinesPlatform |
|
247d5b1c0324
build: use dependencies version alignment and filter content of google()
Da Risk <da_risk@geekorum.com>
parents:
96
diff
changeset
|
27 |
import com.geekorum.build.enforcedDaggerPlatform |
| 0 | 28 |
import com.geekorum.build.getChangeSet |
29 |
import org.gradle.kotlin.dsl.extra |
|
30 |
import org.gradle.kotlin.dsl.kotlin |
|
31 |
||
32 |
plugins {
|
|
33 |
id("com.android.application")
|
|
34 |
id("com.google.android.gms.oss-licenses-plugin")
|
|
35 |
kotlin("android")
|
|
36 |
kotlin("kapt")
|
|
37 |
id("kotlinx-serialization")
|
|
38 |
id("com.geekorum.build.android-tests")
|
|
39 |
id("com.geekorum.build.android-signing")
|
|
40 |
id("com.geekorum.build.android-genymotion")
|
|
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 |
| 0 | 54 |
val patch = 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 |
|
83 |
isRemoveUnusedResources = true |
|
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 |
} |
|
114 |
} |
|
115 |
||
116 |
||
117 |
dependencies {
|
|
118 |
||
|
16
9e36c283bc9b
Migrate ArticlesDatabaseMigrationTest from java to kotlin
Da Risk <da_risk@geekorum.com>
parents:
15
diff
changeset
|
119 |
implementation("androidx.core:core-ktx:1.0.1")
|
|
127
cb769869d515
Update some androidx alpha libraries
Da Risk <da_risk@geekorum.com>
parents:
122
diff
changeset
|
120 |
implementation("androidx.fragment:fragment-ktx:1.1.0-alpha07")
|
|
cb769869d515
Update some androidx alpha libraries
Da Risk <da_risk@geekorum.com>
parents:
122
diff
changeset
|
121 |
implementation("androidx.activity:activity-ktx:1.0.0-alpha07")
|
|
16
9e36c283bc9b
Migrate ArticlesDatabaseMigrationTest from java to kotlin
Da Risk <da_risk@geekorum.com>
parents:
15
diff
changeset
|
122 |
|
| 0 | 123 |
// androidx ui |
|
162
f627eceb01b2
Update appcompat and lifecycle
Da Risk <da_risk@geekorum.com>
parents:
161
diff
changeset
|
124 |
implementation("androidx.appcompat:appcompat:1.1.0-alpha05")
|
|
151
07a26cc711bd
Update material library and drawer layout to support Android Q gestures
Da Risk <da_risk@geekorum.com>
parents:
147
diff
changeset
|
125 |
implementation("androidx.drawerlayout:drawerlayout:1.1.0-alpha01")
|
| 0 | 126 |
implementation("androidx.constraintlayout:constraintlayout:1.1.3")
|
127 |
implementation("androidx.recyclerview:recyclerview:1.0.0")
|
|
128 |
implementation("androidx.coordinatorlayout:coordinatorlayout:1.0.0")
|
|
129 |
implementation("androidx.preference:preference-ktx:1.0.0")
|
|
130 |
||
131 |
// androidx others |
|
132 |
implementation("androidx.browser:browser:1.0.0")
|
|
133 |
||
| 113 | 134 |
implementation("org.jetbrains.kotlinx:kotlinx-serialization-runtime:0.11.0")
|
135 |
implementation("com.jakewharton.retrofit:retrofit2-kotlinx-serialization-converter:0.4.0")
|
|
| 0 | 136 |
|
|
40
c5ae393af55c
Update gradle version to 5.1-milestone-1
Da Risk <da_risk@geekorum.com>
parents:
34
diff
changeset
|
137 |
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
|
138 |
val geekdroidExt = GEEKDROID_PROJECT_DIR?.let { "" } ?: "aar"
|
| 0 | 139 |
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
|
140 |
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
|
141 |
add("googleImplementation", it)
|
|
84a27546e309
google variant: log to crashlytics
Da Risk <da_risk@geekorum.com>
parents:
6
diff
changeset
|
142 |
} |
| 0 | 143 |
|
|
151
07a26cc711bd
Update material library and drawer layout to support Android Q gestures
Da Risk <da_risk@geekorum.com>
parents:
147
diff
changeset
|
144 |
implementation("com.google.android.material:material:1.1.0-alpha06")
|
| 6 | 145 |
implementation("com.squareup.retrofit2:retrofit:2.5.0")
|
| 0 | 146 |
implementation("com.jakewharton.retrofit:retrofit2-kotlin-coroutines-adapter:0.9.2")
|
| 6 | 147 |
implementation("com.squareup.okhttp3:okhttp:3.12.0")
|
| 0 | 148 |
implementation("com.squareup.okhttp3:logging-interceptor:3.10.0")
|
|
105
5fbdb7b6762b
Use HTTP Basic auth if ServerInformation have the credentials
Da Risk <da_risk@geekorum.com>
parents:
103
diff
changeset
|
149 |
testImplementation("com.squareup.okhttp3:mockwebserver:3.10.0")
|
| 0 | 150 |
implementation("com.squareup.picasso:picasso:2.5.2")
|
| 88 | 151 |
implementation("com.google.android.gms:play-services-oss-licenses:16.0.2")
|
| 0 | 152 |
|
153 |
implementation("org.jsoup:jsoup:1.10.2")
|
|
154 |
||
|
40
c5ae393af55c
Update gradle version to 5.1-milestone-1
Da Risk <da_risk@geekorum.com>
parents:
34
diff
changeset
|
155 |
val lifecycleVersion: String by rootProject.extra |
|
101
247d5b1c0324
build: use dependencies version alignment and filter content of google()
Da Risk <da_risk@geekorum.com>
parents:
96
diff
changeset
|
156 |
implementation(enforcedAndroidxLifecyclePlatform(lifecycleVersion)) |
| 0 | 157 |
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
|
158 |
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
|
159 |
implementation("androidx.lifecycle:lifecycle-livedata-ktx:$lifecycleVersion")
|
|
25
49716defe54b
Conver ArticleListActivity to kotlin
Da Risk <da_risk@geekorum.com>
parents:
19
diff
changeset
|
160 |
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycleVersion")
|
| 0 | 161 |
kapt("androidx.lifecycle:lifecycle-compiler:$lifecycleVersion")
|
|
127
cb769869d515
Update some androidx alpha libraries
Da Risk <da_risk@geekorum.com>
parents:
122
diff
changeset
|
162 |
dualTestImplementation("androidx.arch.core:core-testing:2.0.1")
|
| 88 | 163 |
implementation("androidx.paging:paging-runtime:2.1.0")
|
| 0 | 164 |
|
165 |
// dagger |
|
|
101
247d5b1c0324
build: use dependencies version alignment and filter content of google()
Da Risk <da_risk@geekorum.com>
parents:
96
diff
changeset
|
166 |
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
|
167 |
implementation(enforcedDaggerPlatform(daggerVersion)) |
|
247d5b1c0324
build: use dependencies version alignment and filter content of google()
Da Risk <da_risk@geekorum.com>
parents:
96
diff
changeset
|
168 |
kapt(enforcedDaggerPlatform(daggerVersion)) |
| 0 | 169 |
implementation("com.google.dagger:dagger:$daggerVersion")
|
170 |
implementation("com.google.dagger:dagger-android:$daggerVersion")
|
|
171 |
implementation("com.google.dagger:dagger-android-support:$daggerVersion")
|
|
172 |
kapt("com.google.dagger:dagger-compiler:$daggerVersion")
|
|
173 |
kapt("com.google.dagger:dagger-android-processor:$daggerVersion")
|
|
174 |
kaptTest("com.google.dagger:dagger-compiler:$daggerVersion")
|
|
175 |
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
|
176 |
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
|
177 |
kapt("com.squareup.inject:assisted-inject-processor-dagger2:0.4.0")
|
| 0 | 178 |
|
|
40
c5ae393af55c
Update gradle version to 5.1-milestone-1
Da Risk <da_risk@geekorum.com>
parents:
34
diff
changeset
|
179 |
val roomVersion: String by rootProject.extra |
| 0 | 180 |
implementation("androidx.room:room-runtime:$roomVersion")
|
| 147 | 181 |
implementation("androidx.room:room-ktx:$roomVersion")
|
| 0 | 182 |
kapt("androidx.room:room-compiler:$roomVersion")
|
183 |
androidTestImplementation("androidx.room:room-testing:$roomVersion")
|
|
|
40
c5ae393af55c
Update gradle version to 5.1-milestone-1
Da Risk <da_risk@geekorum.com>
parents:
34
diff
changeset
|
184 |
dualTestImplementation("androidx.test.ext:truth:1.1.0")
|
| 0 | 185 |
|
|
40
c5ae393af55c
Update gradle version to 5.1-milestone-1
Da Risk <da_risk@geekorum.com>
parents:
34
diff
changeset
|
186 |
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
|
187 |
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
|
188 |
implementation(kotlin("stdlib-jdk8"))
|
|
14
84a27546e309
google variant: log to crashlytics
Da Risk <da_risk@geekorum.com>
parents:
6
diff
changeset
|
189 |
|
|
101
247d5b1c0324
build: use dependencies version alignment and filter content of google()
Da Risk <da_risk@geekorum.com>
parents:
96
diff
changeset
|
190 |
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
|
191 |
implementation(enforcedCoroutinesPlatform(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-core:$coroutinesVersion")
|
|
247d5b1c0324
build: use dependencies version alignment and filter content of google()
Da Risk <da_risk@geekorum.com>
parents:
96
diff
changeset
|
193 |
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
|
194 |
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
|
195 |
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:$coroutinesVersion")
|
| 0 | 196 |
|
197 |
implementation("com.jakewharton.timber:timber:4.7.1")
|
|
198 |
||
|
14
84a27546e309
google variant: log to crashlytics
Da Risk <da_risk@geekorum.com>
parents:
6
diff
changeset
|
199 |
add("googleImplementation", "com.crashlytics.sdk.android:crashlytics:2.9.6")
|
| 0 | 200 |
// ensure that the free flavor don't get any firebase dependencies |
201 |
configurations["freeImplementation"].exclude(group = "com.google.firebase") |
|
202 |
} |
|
203 |
||
204 |
apply {
|
|
205 |
val playServicesActivated = file("google-services.json").exists()
|
|
206 |
if (playServicesActivated) {
|
|
207 |
// needs to be applied after configuration |
|
208 |
plugin("com.google.gms.google-services")
|
|
209 |
plugin("io.fabric")
|
|
210 |
} |
|
211 |
} |