Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build.gradle setup #69

Merged
merged 2 commits into from
Sep 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,8 @@ indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[*.gradle]
indent_size = 4

[*.md]
trim_trailing_whitespace = false
56 changes: 42 additions & 14 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,23 +1,51 @@
apply plugin: 'com.android.library'

def safeExtGet(prop, fallback) {
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
}

android {
compileSdkVersion safeExtGet('compileSdkVersion', 28)
buildToolsVersion safeExtGet('buildToolsVersion', '28.0.3')
buildscript {
// The Android Gradle plugin is only required when opening the android folder stand-alone.
// This avoids unnecessary downloads and potential conflicts when the library is included as a
// module dependency in an application project.
if (project == rootProject) {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'
}
}
}

defaultConfig {
minSdkVersion safeExtGet('minSdkVersion', 16)
targetSdkVersion safeExtGet('targetSdkVersion', 28)
}
apply plugin: 'com.android.library'

android {
compileSdkVersion safeExtGet('compileSdkVersion', 28)
buildToolsVersion safeExtGet('buildToolsVersion', '28.0.3')
defaultConfig {
minSdkVersion safeExtGet('minSdkVersion', 16)
targetSdkVersion safeExtGet('targetSdkVersion', 28)
}
lintOptions {
abortOnError false
}
}

lintOptions {
abortOnError false
}
repositories {
mavenLocal()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
maven {
// Android JSC is installed from npm
url "$rootDir/../node_modules/jsc-android/dist"
}
google()
jcenter()
}

dependencies {
implementation 'com.facebook.react:react-native:+'
//noinspection GradleDynamicVersion
implementation 'com.facebook.react:react-native:+' // From node_modules
}
4 changes: 2 additions & 2 deletions example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ PODS:
- React-Core (= 0.60.5)
- RNFS (2.14.1):
- React
- RNLocalize (1.1.4):
- RNLocalize (1.2.0):
- React
- yoga (0.60.5.React)

Expand Down Expand Up @@ -185,7 +185,7 @@ SPEC CHECKSUMS:
React-RCTVibration: 2105b2e0e2b66a6408fc69a46c8a7fb5b2fdade0
React-RCTWebSocket: cd932a16b7214898b6b7f788c8bddb3637246ac4
RNFS: a8fbe7060fa49157d819466404794ad9c58e58cf
RNLocalize: c58cfab79eacc1d01b3b2dcd6c598781fb49097f
RNLocalize: 18737f1e6c0762579c8c5730c8f7eca881e2d205
yoga: 312528f5bbbba37b4dcea5ef00e8b4033fdd9411

PODFILE CHECKSUM: b45381785e7eb336fbe1aedab20368d196e6210c
Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,12 @@
"react-native": ">=0.56.0"
},
"devDependencies": {
"@babel/core": "^7.6.0",
"flow-bin": "0.98.0",
"husky": "3.0.5",
"lint-staged": "9.2.5",
"prettier": "1.18.2"
"prettier": "1.18.2",
"react": "16.8.6",
"react-native": "0.60.5"
}
}
Loading