Skip to content

Commit

Permalink
πŸ”§ Inserted mode to optionally build foss variant
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzovngl committed Sep 21, 2023
1 parent 434076b commit 1db2623
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ This simple app helps you avoid forgetting to consume foods that are about to ex
git clone https://github.com/lorenzovngl/FoodExpirationDates.git
```

2. Setup your Firebase project as described below **or** switch to the `foss` build variant to disable the Firebase SDK in the app.
2. Setup your Firebase project as described below **or** set `buildFoss = true` in [build.gradle.kts](https://github.com/lorenzovngl/FoodExpirationDates/blob/main/app/build.gradle.kts#L12) and switch to the `foss` build variant to disable the Firebase SDK in the app.

- Setup your Firebase project:

Expand Down
15 changes: 8 additions & 7 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ plugins {
alias(libs.plugins.com.google.devtools.ksp)
}

// Set firebaseEnabled = false for foss build
var firebaseEnabled = true
var buildFoss = false

android {
namespace = "com.lorenzovainigli.foodexpirationdates"
Expand Down Expand Up @@ -62,10 +61,12 @@ android {
create("full") {
dimension = "version"
}
create("foss"){
dimension = "version"
applicationIdSuffix = ".foss"
versionNameSuffix = "-foss"
if (buildFoss) {
create("foss") {
dimension = "version"
applicationIdSuffix = ".foss"
versionNameSuffix = "-foss"
}
}
}

Expand Down Expand Up @@ -145,7 +146,7 @@ dependencies {

}

if (firebaseEnabled){
if (!buildFoss){
apply(plugin = "com.google.gms.google-services")
apply(plugin = "com.google.firebase.crashlytics")
}
Expand Down

0 comments on commit 1db2623

Please sign in to comment.