From ede27a2cdf34b23e2c60bd4aded42f1fb214348b Mon Sep 17 00:00:00 2001 From: JoshLi <542938192@qq.com> Date: Thu, 29 Nov 2018 16:19:32 +0800 Subject: [PATCH 1/5] Update DOC --- README.md | 8 ++++---- README_en.md | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index fb06a787..4ba83440 100644 --- a/README.md +++ b/README.md @@ -81,10 +81,10 @@ android { } ... dependencies { - compile fileTree(dir: "libs", include: ["*.jar"]) -    compile project(':jpush-react-native') // 添加 jpush 依赖 -    compile project(':jcore-react-native') // 添加 jcore 依赖 -    compile "com.facebook.react:react-native:+" // From node_modules + implementation fileTree(dir: "libs", include: ["*.jar"]) +   implementation project(':jpush-react-native') // 添加 jpush 依赖 +   implementation project(':jcore-react-native') // 添加 jcore 依赖 +   implementation "com.facebook.react:react-native:+" // From node_modules } ``` diff --git a/README_en.md b/README_en.md index c169ce2f..32a5465a 100644 --- a/README_en.md +++ b/README_en.md @@ -74,10 +74,10 @@ android { } ... dependencies { - compile fileTree(dir: "libs", include: ["*.jar"]) -    compile project(':jpush-react-native') // add jpush dependency -    compile project(':jcore-react-native') // add jcore dependency -    compile "com.facebook.react:react-native:+" // From node_modules + implementation fileTree(dir: "libs", include: ["*.jar"]) +   implementation project(':jpush-react-native') // add jpush dependency +   implementation project(':jcore-react-native') // add jcore dependency +   implementation "com.facebook.react:react-native:+" // From node_modules } ``` From 2ad06d100327a6f796aaede8c3fcd23c466376ab Mon Sep 17 00:00:00 2001 From: JoshLi <542938192@qq.com> Date: Thu, 29 Nov 2018 16:20:19 +0800 Subject: [PATCH 2/5] Update for Android gradle 3.0+ --- android/build.gradle | 16 ++++++++++------ scripts/recipes.js | 4 ++-- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index 15b5a7cb..156208ac 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,12 +1,16 @@ apply plugin: 'com.android.library' +def safeExtGet(prop, fallback) { + rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback +} + android { - compileSdkVersion 27 - buildToolsVersion '26.0.2' + compileSdkVersion safeExtGet('compileSdkVersion', 27) + buildToolsVersion safeExtGet('buildToolsVersion', '26.0.2') defaultConfig { - minSdkVersion 16 - targetSdkVersion 27 + minSdkVersion safeExtGet('minSdkVersion', 16) + targetSdkVersion safeExtGet('targetSdkVersion', 27) versionCode 1 versionName "1.0" } @@ -24,6 +28,6 @@ repositories { } dependencies { - compile fileTree(include: ['*.jar'], dir: 'libs') - compile 'com.facebook.react:react-native:+' + api fileTree(include: ['*.jar'], dir: 'libs') + implementation 'com.facebook.react:react-native:+' } diff --git a/scripts/recipes.js b/scripts/recipes.js index 5b87b16f..f00c9b51 100644 --- a/scripts/recipes.js +++ b/scripts/recipes.js @@ -34,8 +34,8 @@ project(':jpush-react-native').projectDir = new File(rootProject.projectDir, '.. { pattern: 'dependencies {', patch: ` - compile project(':jcore-react-native') - compile project(':jpush-react-native')` + implementation project(':jcore-react-native') + implementation project(':jpush-react-native')` }, { pattern: `versionName .*`, From 81229f31983ca1829b9eddc94d4e27ddefc10f46 Mon Sep 17 00:00:00 2001 From: JoshLi <542938192@qq.com> Date: Thu, 29 Nov 2018 16:21:01 +0800 Subject: [PATCH 3/5] Release v2.4.0 --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 1d4452dc..e8a70619 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "jpush-react-native", - "version": "2.3.0", + "version": "2.4.0", "description": "a jpush plugin for react native application", "main": "index.js", "scripts": { @@ -24,7 +24,7 @@ }, "homepage": "https://github.com/jpush/jpush-react-native#readme", "peerDependencies": { - "jcore-react-native": ">= 1.2.11" + "jcore-react-native": ">= 1.3.0" }, "devDependencies": { "babel-eslint": "^7.2.3", From e7af0d6e1e17ed01acf9e6fa36e2ec8a11738317 Mon Sep 17 00:00:00 2001 From: JoshLi <542938192@qq.com> Date: Thu, 29 Nov 2018 16:37:22 +0800 Subject: [PATCH 4/5] Update example --- example/android/app/build.gradle | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index b15fda98..8d6e5569 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -98,16 +98,17 @@ android { buildToolsVersion "26.0.2" defaultConfig { - applicationId "com.pushdemo" + applicationId "com.test.josh" //替换包名: minSdkVersion 16 targetSdkVersion 23 versionCode 1 versionName "1.0" + ndk { abiFilters "armeabi-v7a", "x86" } manifestPlaceholders = [ - JPUSH_APPKEY: "d4ee2375846bc30fa51334f5", //在此替换你的APPKey + JPUSH_APPKEY: "7b4b94cca0d185d611e53cca", //在此替换你的APPKey APP_CHANNEL : "developer-default" //应用渠道号 ] } @@ -141,11 +142,12 @@ android { } dependencies { - compile fileTree(include: ['*.jar'], dir: 'libs') - api project(':jpush-react-native') - api project(':jcore-react-native') - compile 'com.android.support:appcompat-v7:25.3.1' - compile 'com.facebook.react:react-native:+' + + implementation fileTree(include: ['*.jar'], dir: 'libs') + implementation project(':jcore-react-native') + implementation project(':jpush-react-native') + implementation 'com.android.support:appcompat-v7:25.3.1' + implementation 'com.facebook.react:react-native:+' // From node_modules } From b6ba93a5f0a1096ea8f3677aa39330f9cfe0ff5a Mon Sep 17 00:00:00 2001 From: JoshLi <542938192@qq.com> Date: Thu, 29 Nov 2018 16:40:44 +0800 Subject: [PATCH 5/5] Update DOC --- documents/check.md | 8 ++++---- documents/check_en.md | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/documents/check.md b/documents/check.md index dfac7f90..0bb80a27 100644 --- a/documents/check.md +++ b/documents/check.md @@ -5,10 +5,10 @@ ``` ... dependencies { - compile fileTree(dir: "libs", include: ["*.jar"]) -    compile project(':jpush-react-native') // 添加 jpush 依赖 -    compile project(':jcore-react-native') // 添加 jcore 依赖 -    compile "com.facebook.react:react-native:+" // From node_modules + implementation fileTree(dir: "libs", include: ["*.jar"]) +   implementation project(':jpush-react-native') // 添加 jpush 依赖 +   implementation project(':jcore-react-native') // 添加 jcore 依赖 +   implementation "com.facebook.react:react-native:+" // From node_modules } ``` diff --git a/documents/check_en.md b/documents/check_en.md index 7113fe57..75d5fa22 100644 --- a/documents/check_en.md +++ b/documents/check_en.md @@ -7,10 +7,10 @@ ``` ... dependencies { - compile fileTree(dir: "libs", include: ["*.jar"]) -    compile project(':jpush-react-native') // add jpush dependency -    compile project(':jcore-react-native') // add jcore dependency -    compile "com.facebook.react:react-native:+" // From node_modules + implementation fileTree(dir: "libs", include: ["*.jar"]) +   implementation project(':jpush-react-native') // add jpush dependency +   implementation project(':jcore-react-native') // add jcore dependency +   implementation "com.facebook.react:react-native:+" // From node_modules } ```