Skip to content
This repository has been archived by the owner on Jul 21, 2021. It is now read-only.

safeExtGet and ignore .git folder #13

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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 .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

.git
.idea
16 changes: 10 additions & 6 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,17 @@ buildscript {

apply plugin: 'com.android.library'

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

android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
compileSdkVersion safeExtGet('compileSdkVersion', 23)
buildToolsVersion safeExtGet('buildToolsVersion', "23.0.1")

defaultConfig {
minSdkVersion 16
targetSdkVersion 22
minSdkVersion safeExtGet('minSdkVersion', 16)
targetSdkVersion safeExtGet('targetSdkVersion', 22)
versionCode 1
versionName "1.0"
}
Expand All @@ -31,6 +35,6 @@ repositories {
}

dependencies {
compile 'com.facebook.react:react-native:+'
compile 'com.facebook.react:react-native:${safeExtGet('reactNativeVersion', '+')}'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a syntax error here resulting in a build failure:

* What went wrong:
A problem occurred evaluating project ':react-native-proximity'.
> Could not find method reactNativeVersion() for arguments [, )}] on DefaultExternalModuleDependency{group='com.facebook.react', name='react-native', version='${safeExtGet(', configuration='default'} of type org.gradle.api.internal.artifacts.dependencies.DefaultExternalModuleDependency.
Suggested change
compile 'com.facebook.react:react-native:${safeExtGet('reactNativeVersion', '+')}'
compile "com.facebook.react:react-native:${safeExtGet('reactNativeVersion', '+')}"

}