1
+ def safeExtGet (prop , fallback ) {
2
+ rootProject. ext. has(prop) ? rootProject. ext. get(prop) : fallback
3
+ }
1
4
2
5
buildscript {
3
- repositories {
4
- google()
5
- jcenter()
6
- }
7
-
8
- dependencies {
9
- classpath ' com.android.tools.build:gradle:3.4.1'
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
+ dependencies {
15
+ classpath ' com.android.tools.build:gradle:3.4.1'
16
+ }
10
17
}
11
18
}
12
19
13
- def getExtOrDefault (name ) {
14
- return rootProject. ext. has(name) ? rootProject. ext. get(name) : project. properties[' RNAsyncStorage_' + name]
15
- }
16
-
17
- def getExtOrIntegerDefault (name ) {
18
- return rootProject. ext. has(name) ? rootProject. ext. get(name) : (project. properties[' RNAsyncStorage_' + name]). toInteger()
19
- }
20
-
21
20
// AsyncStorage has default size of 6MB.
22
21
// This is a sane limit to protect the user from the app storing too much data in the database.
23
22
// This also protects the database from filling up the disk cache and becoming malformed.
@@ -37,22 +36,30 @@ def useDedicatedExecutor = rootProject.hasProperty('AsyncStorage_dedicatedExecut
37
36
apply plugin : ' com.android.library'
38
37
39
38
android {
40
- compileSdkVersion getExtOrIntegerDefault(' compileSdkVersion' )
41
- buildToolsVersion getExtOrDefault(' buildToolsVersion' )
42
-
39
+ compileSdkVersion safeExtGet(' compileSdkVersion' , 28 )
40
+ buildToolsVersion safeExtGet(' buildToolsVersion' , ' 28.0.3' )
43
41
defaultConfig {
44
- minSdkVersion getExtOrIntegerDefault(' minSdkVersion' )
45
- targetSdkVersion getExtOrIntegerDefault(' targetSdkVersion' )
46
-
42
+ minSdkVersion safeExtGet(' minSdkVersion' , 19 )
43
+ targetSdkVersion safeExtGet(' targetSdkVersion' , 28 )
47
44
buildConfigField " Long" , " AsyncStorage_db_size" , " ${ dbSizeInMB} L"
48
45
buildConfigField(" boolean" , " AsyncStorage_useDedicatedExecutor" , " ${ useDedicatedExecutor} " )
49
46
}
47
+ lintOptions {
48
+ abortOnError false
49
+ }
50
50
}
51
51
52
52
repositories {
53
- mavenCentral()
53
+ mavenLocal()
54
+ maven {
55
+ // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
56
+ url " $rootDir /../node_modules/react-native/android"
57
+ }
58
+ google()
59
+ jcenter()
54
60
}
55
61
56
62
dependencies {
57
- implementation ' com.facebook.react:react-native:+'
63
+ // noinspection GradleDynamicVersion
64
+ implementation ' com.facebook.react:react-native:+' // From node_modules
58
65
}
0 commit comments