1 | buildscript {
|
2 |
|
3 |
|
4 |
|
5 | if (project == rootProject) {
|
6 | repositories {
|
7 | google()
|
8 | jcenter()
|
9 | }
|
10 |
|
11 | dependencies {
|
12 | classpath("com.android.tools.build:gradle:3.6.3")
|
13 | }
|
14 | }
|
15 | }
|
16 |
|
17 | def getExtOrInitialValue(name, initialValue) {
|
18 | return rootProject.ext.has(name) ? rootProject.ext.get(name) : initialValue
|
19 | }
|
20 |
|
21 | def getExtOrDefault(name) {
|
22 | return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties['ReactNativeNetInfo_' + name]
|
23 | }
|
24 |
|
25 | def getExtOrIntegerDefault(name) {
|
26 | return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties['ReactNativeNetInfo_' + name]).toInteger()
|
27 | }
|
28 |
|
29 | apply plugin: 'com.android.library'
|
30 |
|
31 | android {
|
32 | compileSdkVersion getExtOrIntegerDefault('compileSdkVersion')
|
33 |
|
34 | defaultConfig {
|
35 | minSdkVersion getExtOrIntegerDefault('minSdkVersion')
|
36 | targetSdkVersion getExtOrIntegerDefault('targetSdkVersion')
|
37 | }
|
38 | lintOptions{
|
39 | abortOnError false
|
40 | }
|
41 | }
|
42 |
|
43 | repositories {
|
44 | maven {
|
45 |
|
46 | url "$rootDir/../node_modules/react-native/android"
|
47 | }
|
48 | google()
|
49 | jcenter()
|
50 | mavenCentral()
|
51 | }
|
52 |
|
53 | dependencies {
|
54 |
|
55 | implementation 'com.facebook.react:react-native:+'
|
56 |
|
57 | def supportLibVersion = getExtOrInitialValue('supportLibVersion', getExtOrInitialValue('supportVersion', null))
|
58 | def androidXVersion = getExtOrInitialValue('androidXVersion', null)
|
59 | def androidXCore = getExtOrInitialValue('androidXCore', null)
|
60 | if (supportLibVersion && androidXVersion == null && androidXCore == null) {
|
61 | implementation "com.android.support:appcompat-v7:$supportLibVersion"
|
62 | } else {
|
63 | def defaultAndroidXVersion = "1.3.2"
|
64 | if (androidXCore == null) {
|
65 | androidXCore = androidXVersion == null ? defaultAndroidXVersion : androidXVersion
|
66 | }
|
67 | implementation "androidx.core:core:$androidXCore"
|
68 | }
|
69 | }
|