Skip to content

Commit

Permalink
fix: get rootProject values for build.gradle
Browse files Browse the repository at this point in the history
  • Loading branch information
alarm109 committed Oct 27, 2022
1 parent 789bd21 commit 83506d9
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
buildscript {
ext {
compileSdkVersion = 30
kotlinVersion = "1.7.10"
minSdkVersion = 21
targetSdkVersion = 30
}
def kotlin_version = rootProject.ext.has('kotlinVersion') ? rootProject.ext.get('kotlinVersion') : "1.7.20"

repositories {
google()
Expand All @@ -13,23 +8,23 @@ buildscript {

dependencies {
classpath "com.android.tools.build:gradle:4.2.2"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}

apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'

def getExt(name) {
return rootProject.ext.get(name)
def getExtOrDefault(name, defaultValue) {
return rootProject.ext.has(name) ? rootProject.ext.get(name) : defaultValue
}

android {
compileSdkVersion getExt('compileSdkVersion')
compileSdkVersion getExtOrDefault('compileSdkVersion', 31)

defaultConfig {
minSdkVersion getExt('minSdkVersion')
targetSdkVersion getExt('targetSdkVersion')
minSdkVersion getExtOrDefault('minSdkVersion', 21)
targetSdkVersion getExtOrDefault('targetSdkVersion', 31)
}

lintOptions {
Expand Down

0 comments on commit 83506d9

Please sign in to comment.