File tree Expand file tree Collapse file tree 1 file changed +18
-15
lines changed Expand file tree Collapse file tree 1 file changed +18
-15
lines changed Original file line number Diff line number Diff line change @@ -2,29 +2,32 @@ apply plugin: 'com.android.library'
22
33description = ' react-native-biometrics'
44
5- def DEFAULT_COMPILE_SDK_VERSION = 29
6- def DEFAULT_BUILD_TOOLS_VERSION = " 29.0.2"
7- def DEFAULT_MIN_SDK_VERSION = 16
8- def DEFAULT_TARGET_SDK_VERSION = 29
9-
105buildscript {
11- repositories {
12- google()
13- jcenter()
6+ // The Android Gradle plugin is only required when opening the android folder stand-alone.
7+ // This avoids unnecessary downloads and potential conflicts when the library is included as a
8+ // module dependency in an application project.
9+ if (project == rootProject) {
10+ repositories {
11+ google()
12+ jcenter()
13+ }
14+
15+ dependencies {
16+ classpath(" com.android.tools.build:gradle:3.6.2" )
17+ }
1418 }
19+ }
1520
16- dependencies {
17- classpath ' com.android.tools.build:gradle:3.4.2'
18- }
21+ def safeExtGet (prop , fallback ) {
22+ rootProject. ext. has(prop) ? rootProject. ext. get(prop) : fallback
1923}
2024
2125android {
22- compileSdkVersion rootProject. hasProperty(' compileSdkVersion' ) ? rootProject. compileSdkVersion : DEFAULT_COMPILE_SDK_VERSION
23- buildToolsVersion rootProject. hasProperty(' buildToolsVersion' ) ? rootProject. buildToolsVersion : DEFAULT_BUILD_TOOLS_VERSION
26+ compileSdkVersion safeExtGet(' compileSdkVersion' , 29 )
2427
2528 defaultConfig {
26- minSdkVersion rootProject . hasProperty (' minSdkVersion' ) ? rootProject . minSdkVersion : DEFAULT_MIN_SDK_VERSION
27- targetSdkVersion rootProject . hasProperty (' targetSdkVersion' ) ? rootProject . targetSdkVersion : DEFAULT_TARGET_SDK_VERSION
29+ minSdkVersion safeExtGet (' minSdkVersion' , 16 )
30+ targetSdkVersion safeExtGet (' targetSdkVersion' , 29 )
2831 }
2932 lintOptions {
3033 abortOnError false
You can’t perform that action at this time.
0 commit comments