Skip to content

Commit

Permalink
refactor: Feedback addressed
Browse files Browse the repository at this point in the history
  • Loading branch information
volodymyr-chekyrta committed Feb 21, 2024
1 parent d1f3262 commit 46a5a58
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
3 changes: 2 additions & 1 deletion app/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/build
/build
/google-services.json
6 changes: 6 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ if (firebaseEnabled) {
}

preBuild.dependsOn(generateGoogleServicesJson)
} else {
tasks.register('removeGoogleServicesJson') {
configHelper.removeGoogleServicesJson()
}

preBuild.dependsOn(removeGoogleServicesJson)
}

android {
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/org/openedx/app/AnalyticsManager.kt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class AnalyticsManager(

init {
// Initialise all the analytics libraries here
if (config.getFirebaseConfig().projectId.isNotBlank()) {
if (config.getFirebaseConfig().enabled) {
addAnalyticsTracker(FirebaseAnalytics(context = context))
}
val segmentConfig = config.getSegmentConfig()
Expand Down
8 changes: 8 additions & 0 deletions buildSrc/src/main/groovy/org/edx/builder/ConfigHelper.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -140,4 +140,12 @@ class ConfigHelper {
it.write(new JsonBuilder(configJson).toPrettyString())
}
}

def removeGoogleServicesJson() {
def googleServicesJsonPath = projectDir.path + "/app/google-services.json"
def file = new File(googleServicesJsonPath)
if (file.exists()) {
file.delete()
}
}
}

0 comments on commit 46a5a58

Please sign in to comment.