1- apply plugin : ' com.android.application'
2-
3- if (System . getenv(' IS_GOOGLE_BUILD' )) {
4- apply plugin : ' com.google.gms.google-services'
5- apply plugin : ' com.google.firebase.crashlytics'
6- apply plugin : ' com.google.firebase.firebase-perf'
1+ plugins {
2+ id ' com.android.application'
3+ id(' kotlin-android' )
74}
85
9- apply plugin : ' kotlin-android'
10- apply plugin : ' kotlin-kapt'
11-
126android {
137 namespace ' dev.lucasnlm.antimine'
148
159 defaultConfig {
1610 // versionCode and versionName must be hardcoded to support F-droid
17- versionCode 1705001
18- versionName ' 17.5.0 '
11+ versionCode 1705011
12+ versionName ' 17.5.1 '
1913 minSdk 21
2014 targetSdk 34
2115 compileSdk 34
@@ -56,8 +50,8 @@ android {
5650 }
5751
5852 compileOptions {
59- targetCompatibility JavaVersion . VERSION_17
60- sourceCompatibility JavaVersion . VERSION_17
53+ targetCompatibility = JavaVersion . VERSION_17
54+ sourceCompatibility = JavaVersion . VERSION_17
6155 }
6256
6357 kotlinOptions {
@@ -77,13 +71,21 @@ android {
7771 dimension ' version'
7872 applicationId ' dev.lucasnlm.antimine'
7973 versionNameSuffix ' S'
74+
75+ apply plugin : ' com.google.gms.google-services'
76+ apply plugin : ' com.google.firebase.crashlytics'
77+ apply plugin : ' com.google.firebase.firebase-perf'
8078 }
8179
8280 googleInstant {
8381 versionCode 160
8482 dimension ' version'
8583 applicationId ' dev.lucasnlm.antimine'
8684 versionNameSuffix ' I'
85+
86+ apply plugin : ' com.google.gms.google-services'
87+ apply plugin : ' com.google.firebase.crashlytics'
88+ apply plugin : ' com.google.firebase.firebase-perf'
8789 }
8890
8991 foss {
@@ -95,10 +97,6 @@ android {
9597 }
9698}
9799
98- kapt {
99- correctErrorTypes true
100- }
101-
102100dependencies {
103101 // Dependencies must be hardcoded to support F-droid
104102
@@ -129,7 +127,7 @@ dependencies {
129127 implementation ' androidx.preference:preference-ktx:1.2.1'
130128 implementation ' androidx.recyclerview:recyclerview:1.3.1'
131129 implementation ' androidx.multidex:multidex:2.0.1'
132- implementation ' androidx.activity:activity-ktx:1.7.2 '
130+ implementation ' androidx.activity:activity-ktx:1.8.0 '
133131 implementation ' androidx.fragment:fragment-ktx:1.6.1'
134132
135133 // Lifecycle
@@ -142,7 +140,7 @@ dependencies {
142140 implementation ' androidx.constraintlayout:constraintlayout:2.1.4'
143141
144142 // Google
145- implementation ' com.google.android.material:material:1.9 .0'
143+ implementation ' com.google.android.material:material:1.10 .0'
146144
147145 // Koin
148146 implementation ' io.insert-koin:koin-android:3.1.2'
@@ -188,3 +186,17 @@ tasks.withType(Test).configureEach {
188186 println " Executing test ${ desc.name} [${ desc.className} ] with result: ${ result.resultType} "
189187 }
190188}
189+
190+ // The following code disables Google Services when building for F-Droid
191+ if (System . getenv(' IS_GOOGLE_BUILD' ) == null ) {
192+ android. applicationVariants. configureEach { variant ->
193+ if (variant. flavorName == ' foss' ) {
194+ project. tasks. names. findAll { it. contains(" Google" ) }
195+ .forEach { taskName ->
196+ project. tasks. named(taskName). configure {
197+ enabled = false
198+ }
199+ }
200+ }
201+ }
202+ }
0 commit comments