Skip to content

Commit

Permalink
refactor: Move gradle files to Kotlin DSL
Browse files Browse the repository at this point in the history
  • Loading branch information
aikrq committed Dec 12, 2024
1 parent 75d1467 commit b08007b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 4 additions & 5 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
val secrets = System.getenv("GOOGLE_SERVICES_JSON")
val analyticsEnabled = secrets != null
val gitCommitHash = "git rev-parse HEAD".execute().text.trim()

fun getCommitHash(): String =
ByteArrayOutputStream().use { stdout ->
Expand All @@ -14,11 +13,11 @@ fun getCommitHash(): String =
plugins {
id("com.android.application")
kotlin("android")
}

if (analyticsEnabled) {
id("com.google.gms.google-services")
id("com.google.firebase.crashlytics")
}
if (analyticsEnabled) {
plugins.apply("com.google.gms.google-services")
plugins.apply("com.google.firebase.crashlytics")
}

android {
Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ buildscript {
}

tasks.register<Delete>("clean") {
delete(rootProject.buildDir)
delete(rootProject.layout.buildDirectory)
}

0 comments on commit b08007b

Please sign in to comment.