Skip to content

Commit

Permalink
Fix build.gradle setup
Browse files Browse the repository at this point in the history
  • Loading branch information
friederbluemle committed Sep 18, 2019
1 parent 1e66d6f commit ac3dbd5
Show file tree
Hide file tree
Showing 4 changed files with 4,222 additions and 49 deletions.
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 {
repositories {
google()
jcenter()
}
// 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) {
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
}
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

0 comments on commit ac3dbd5

Please sign in to comment.