progress-bar-android
progress-bar-android copied to clipboard
Take compileSdkVersion from root project
Description
When using this lib and building for android, another version of Android SDK is also installed due to the hardcoded values in build.gradle#L15.
What is the current behavior?
Under CI I get the following:
Checking the license for package Android SDK Platform 28 in /android/sdk/licenses
License for package Android SDK Platform 28 accepted.
Preparing "Install Android SDK Platform 28 (revision: 6)".
"Install Android SDK Platform 28 (revision: 6)" ready.
Installing Android SDK Platform 28 in /android/sdk/platforms/android-28
"Install Android SDK Platform 28 (revision: 6)" complete.
"Install Android SDK Platform 28 (revision: 6)" finished.
even though I'm using android SDK 30.0.3 and that version is present in the docker container that the job is run in.
What is the expected behavior?
The lib doesn't force the install of another SDK version.
What have you tried?
I tried applying the safeExtGet approach that many libs use via patch-package and it solved my problems.
What it boils down to:
def safeExtGet(prop, fallback) {
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
}
android {
compileSdkVersion safeExtGet("compileSdkVersion", 28)
defaultConfig {
minSdkVersion 16
targetSdkVersion safeExtGet("targetSdkVersion", 28)
// ...
}
}
This way the outside config takes precedence, but the old value is still kept as a fallback.
Version info
@react-native-community/progress-bar-android: 1.0.3 (although 1.0.4 has the same problem) react-native: 0.65.1