Skip to content

Commit

Permalink
fix: get Gradle version dynamically
Browse files Browse the repository at this point in the history
  • Loading branch information
szymonrybczak committed Dec 30, 2024
1 parent 0fb4dd5 commit 5c4d219
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
buildscript {
// Buildscript is evaluated before everything else so we can't use getExtOrDefault
def kotlin_version = rootProject.ext.has("kotlinVersion") ? rootProject.ext.get("kotlinVersion") : project.properties["<%- project.name -%>_kotlinVersion"]
ext.getExtOrDefault = {name ->
return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties['<%- project.name -%>_' + name]
}

repositories {
google()
mavenCentral()
}

dependencies {
classpath "com.android.tools.build:gradle:8.10.2"
classpath "com.android.tools.build:gradle:${getExtOrDefault('gradleVersion')}"
// noinspection DifferentKotlinGradleVersion
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${getExtOrDefault('kotlinVersion')}"
}
}

Expand Down

0 comments on commit 5c4d219

Please sign in to comment.