|
1 |
| -apply plugin: 'com.android.library' |
2 |
| - |
3 | 1 | def safeExtGet(prop, fallback) {
|
4 |
| - rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback |
| 2 | + rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback |
5 | 3 | }
|
6 | 4 |
|
7 |
| -android { |
8 |
| - compileSdkVersion safeExtGet('compileSdkVersion', 28) |
9 |
| - buildToolsVersion safeExtGet('buildToolsVersion', '28.0.3') |
| 5 | +buildscript { |
| 6 | + repositories { |
| 7 | + google() |
| 8 | + jcenter() |
| 9 | + } |
| 10 | + // The Android Gradle plugin is only required when opening the android folder stand-alone. |
| 11 | + // This avoids unnecessary downloads and potential conflicts when the library is included as a |
| 12 | + // module dependency in an application project. |
| 13 | + if (project == rootProject) { |
| 14 | + dependencies { |
| 15 | + classpath 'com.android.tools.build:gradle:3.5.0' |
| 16 | + } |
| 17 | + } |
| 18 | +} |
10 | 19 |
|
11 |
| - defaultConfig { |
12 |
| - minSdkVersion safeExtGet('minSdkVersion', 16) |
13 |
| - targetSdkVersion safeExtGet('targetSdkVersion', 28) |
14 |
| - } |
| 20 | +apply plugin: 'com.android.library' |
| 21 | + |
| 22 | +android { |
| 23 | + compileSdkVersion safeExtGet('compileSdkVersion', 28) |
| 24 | + defaultConfig { |
| 25 | + minSdkVersion safeExtGet('minSdkVersion', 16) |
| 26 | + targetSdkVersion safeExtGet('targetSdkVersion', 28) |
| 27 | + } |
| 28 | + lintOptions { |
| 29 | + abortOnError false |
| 30 | + } |
| 31 | +} |
15 | 32 |
|
16 |
| - lintOptions { |
17 |
| - abortOnError false |
18 |
| - } |
| 33 | +repositories { |
| 34 | + mavenLocal() |
| 35 | + maven { |
| 36 | + // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm |
| 37 | + url "$rootDir/../node_modules/react-native/android" |
| 38 | + } |
| 39 | + maven { |
| 40 | + // Android JSC is installed from npm |
| 41 | + url "$rootDir/../node_modules/jsc-android/dist" |
| 42 | + } |
| 43 | + google() |
| 44 | + jcenter() |
19 | 45 | }
|
20 | 46 |
|
21 | 47 | dependencies {
|
22 |
| - implementation 'com.facebook.react:react-native:+' |
| 48 | + //noinspection GradleDynamicVersion |
| 49 | + implementation 'com.facebook.react:react-native:+' // From node_modules |
23 | 50 | }
|
0 commit comments