mirror of
https://github.com/zoriya/react-native-background-downloader.git
synced 2026-05-31 17:23:13 +00:00
android: better check for useAndroidX
This commit is contained in:
+10
-8
@@ -1,19 +1,21 @@
|
||||
apply plugin: 'com.android.library'
|
||||
|
||||
def useAndroidX = (project.hasProperty('android.useAndroidX')) ? project.property('android.useAndroidX') : false
|
||||
|
||||
def safeExtGet(prop, fallback) {
|
||||
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdkVersion safeExtGet("compileSdkVersion", 33)
|
||||
compileSdkVersion safeExtGet('compileSdkVersion', 33)
|
||||
|
||||
defaultConfig {
|
||||
minSdkVersion safeExtGet('minSdkVersion', 21)
|
||||
targetSdkVersion safeExtGet('targetSdkVersion', 33)
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
versionName '1.0'
|
||||
ndk {
|
||||
abiFilters "armeabi-v7a", "x86"
|
||||
abiFilters 'armeabi-v7a', 'x86'
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -21,11 +23,11 @@ android {
|
||||
dependencies {
|
||||
//noinspection GradleDynamicVersion
|
||||
implementation 'com.facebook.react:react-native:+'
|
||||
if (project.properties['android.useAndroidX'] == 'true') {
|
||||
api "com.github.tonyofrancis.Fetch:xfetch2:3.1.6"
|
||||
implementation "com.github.tonyofrancis.Fetch:xfetch2okhttp:3.1.6"
|
||||
if (useAndroidX) {
|
||||
api 'com.github.tonyofrancis.Fetch:xfetch2:3.1.6'
|
||||
implementation 'com.github.tonyofrancis.Fetch:xfetch2okhttp:3.1.6'
|
||||
} else {
|
||||
api "com.tonyodev.fetch2:fetch2:3.0.12"
|
||||
implementation "com.tonyodev.fetch2okhttp:fetch2okhttp:3.0.12"
|
||||
api 'com.tonyodev.fetch2:fetch2:3.0.12'
|
||||
implementation 'com.tonyodev.fetch2okhttp:fetch2okhttp:3.0.12'
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user