Skip to content

Commit 373fbd8

Browse files
committed
Fix gradle setup
1 parent 6cc9755 commit 373fbd8

File tree

4 files changed

+3313
-126
lines changed

4 files changed

+3313
-126
lines changed

.editorconfig

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@ root = true
22

33
[*]
44
charset = utf-8
5-
end_of_line = lf
65
indent_size = 2
76
indent_style = space
87
insert_final_newline = true
98
trim_trailing_whitespace = true
109

10+
[*.gradle]
11+
indent_size = 4
12+
1113
[*.md]
1214
trim_trailing_whitespace = false

android/build.gradle

Lines changed: 43 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,51 @@
1-
apply plugin: 'com.android.library'
2-
31
def safeExtGet(prop, fallback) {
4-
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
2+
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
3+
}
4+
5+
buildscript {
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.5.0'
16+
}
17+
}
518
}
619

20+
apply plugin: 'com.android.library'
21+
722
android {
8-
compileSdkVersion safeExtGet('compileSdkVersion', 28)
9-
buildToolsVersion safeExtGet('buildToolsVersion', '28.0.3')
10-
defaultConfig {
11-
minSdkVersion safeExtGet('minSdkVersion', 16)
12-
targetSdkVersion safeExtGet('targetSdkVersion', 28)
13-
}
14-
lintOptions {
15-
abortOnError false
16-
}
23+
compileSdkVersion safeExtGet('compileSdkVersion', 28)
24+
buildToolsVersion safeExtGet('buildToolsVersion', '28.0.3')
25+
defaultConfig {
26+
minSdkVersion safeExtGet('minSdkVersion', 16)
27+
targetSdkVersion safeExtGet('targetSdkVersion', 28)
28+
}
29+
lintOptions {
30+
abortOnError false
31+
}
32+
}
33+
34+
repositories {
35+
mavenLocal()
36+
maven {
37+
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
38+
url "$rootDir/../node_modules/react-native/android"
39+
}
40+
maven {
41+
// Android JSC is installed from npm
42+
url "$rootDir/../node_modules/jsc-android/dist"
43+
}
44+
google()
45+
jcenter()
1746
}
1847

1948
dependencies {
20-
// noinspection GradleDynamicVersion
21-
api 'com.facebook.react:react-native:+'
49+
//noinspection GradleDynamicVersion
50+
implementation 'com.facebook.react:react-native:+' // From node_modules
2251
}

package.json

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -64,17 +64,20 @@
6464
"react-native": ">=0.60.0"
6565
},
6666
"devDependencies": {
67+
"@babel/core": "7.6.0",
6768
"@react-native-community/bob": "0.7.0",
6869
"@react-native-community/eslint-config": "0.0.5",
69-
"@types/react-native": "0.60.7",
70-
"@typescript-eslint/eslint-plugin": "2.0.0",
71-
"@typescript-eslint/parser": "2.0.0",
72-
"eslint": "6.2.1",
73-
"eslint-config-prettier": "6.1.0",
74-
"eslint-plugin-prettier": "3.1.0",
75-
"husky": "3.0.4",
76-
"lint-staged": "9.2.3",
70+
"@types/react-native": "0.60.15",
71+
"@typescript-eslint/eslint-plugin": "2.3.0",
72+
"@typescript-eslint/parser": "2.3.0",
73+
"eslint": "6.4.0",
74+
"eslint-config-prettier": "6.3.0",
75+
"eslint-plugin-prettier": "3.1.1",
76+
"husky": "3.0.5",
77+
"lint-staged": "9.2.5",
7778
"prettier": "1.18.2",
78-
"typescript": "3.5.3"
79+
"react": "16.8.6",
80+
"react-native": "0.60.5",
81+
"typescript": "3.6.3"
7982
}
8083
}

0 commit comments

Comments
 (0)