Skip to content

Commit

Permalink
feat: adding dynamic SDK versions according to root project
Browse files Browse the repository at this point in the history
  • Loading branch information
sayurimizuguchi committed Apr 24, 2021
1 parent f5a8b9d commit 3582982
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,17 @@ def getExtOrIntegerDefault(name) {
return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties['FeedbackReporter_' + name]).toInteger()
}

// Simple helper that allows the root project to override versions declared by this library
def safeExtGet(prop, fallback) {
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
}

android {
compileSdkVersion getExtOrIntegerDefault('compileSdkVersion')
buildToolsVersion getExtOrDefault('buildToolsVersion')
compileSdkVersion safeExtGet("compileSdkVersion", 29)

defaultConfig {
minSdkVersion 16
targetSdkVersion getExtOrIntegerDefault('targetSdkVersion')
minSdkVersion safeExtGet("minSdkVersion", 17)
targetSdkVersion safeExtGet("targetSdkVersion", 29)
versionCode 1
versionName "1.0"

Expand Down

0 comments on commit 3582982

Please sign in to comment.