Skip to content

Commit bc91e66

Browse files
authored
Merge pull request #23 from jrschifa/master
setName definition
2 parents b7ed5ca + 4ce653b commit bc91e66

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

android/build.gradle

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
apply plugin: 'com.android.library'
22

3-
def DEFAULT_COMPILE_SDK_VERSION = 23
4-
def DEFAULT_BUILD_TOOLS_VERSION = "23.0.1"
5-
def DEFAULT_TARGET_SDK_VERSION = 23
3+
def safeExtGet(prop, fallback) {
4+
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
5+
}
66

77
android {
8-
compileSdkVersion project.hasProperty('compileSdkVersion') ? project.compileSdkVersion : DEFAULT_COMPILE_SDK_VERSION
9-
buildToolsVersion project.hasProperty('buildToolsVersion') ? project.buildToolsVersion : DEFAULT_BUILD_TOOLS_VERSION
10-
8+
compileSdkVersion safeExtGet('compileSdkVersion', 23)
9+
buildToolsVersion safeExtGet('buildToolsVersion', '23.0.1')
1110

1211
defaultConfig {
13-
minSdkVersion 16
14-
targetSdkVersion project.hasProperty('targetSdkVersion') ? project.targetSdkVersion : DEFAULT_TARGET_SDK_VERSION
12+
minSdkVersion safeExtGet('minSdkVersion', 16)
13+
targetSdkVersion safeExtGet('targetSdkVersion', 23)
14+
1515
versionCode 1
1616
versionName "1.0"
1717
ndk {
@@ -21,7 +21,7 @@ android {
2121
}
2222

2323
dependencies {
24-
compile fileTree(include: ['*.jar'], dir: 'libs')
25-
compile "com.android.support:appcompat-v7:23.0.1"
26-
compile "com.facebook.react:react-native:+"
24+
implementation fileTree(include: ['*.jar'], dir: 'libs')
25+
implementation "com.android.support:appcompat-v7:${safeExtGet('supportLibVersion', '23.0.1')}"
26+
implementation "com.facebook.react:react-native:${safeExtGet('reactNativeVersion', '+')}"
2727
}

index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ type GetItemCallback = (value: string | null) => void;
22
type GetMultipleItemsCallback = (values: string[] | null) => void;
33

44
declare module "react-native-shared-preferences" {
5+
const setName: (name: string) => void;
56
const setItem: (key: string , value: string) => void;
67
const getItem: (key: string, callback: GetItemCallback) => void;
78
const getMultipleItems: (keys: string[] , calback: GetMultipleItemsCallback) => void;

0 commit comments

Comments
 (0)