From 05655a06fb9aa520389bc9a120913481282ada76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?erichua=28=E5=8D=8E=E6=8C=BA=29?= Date: Tue, 27 Jun 2017 22:12:47 +0800 Subject: [PATCH 1/8] update gitignore and move qq app id config to package.json --- .gitignore | 4 ++++ android/build.gradle | 8 +++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index cb672d2..61eaea6 100644 --- a/.gitignore +++ b/.gitignore @@ -19,7 +19,10 @@ out/ # Gradle files .gradle/ +gradle/ build/ +gradlew +gradlew.bat # Local configuration file (sdk path, etc) local.properties @@ -41,6 +44,7 @@ captures/ .idea/workspace.xml .idea/tasks.xml .idea/libraries +.idea/ # Keystore files *.jks diff --git a/android/build.gradle b/android/build.gradle index 6225377..8054fee 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -6,6 +6,12 @@ def computeVersionName() { def json = slurper.parse(file('../../../package.json'), "utf-8") return json.version } +def computeQQAppId() { + // dynamically retrieve version from package.json + def slurper = new JsonSlurper() + def json = slurper.parse(file('../../../package.json'), "utf-8") + return json.qq_app_id +} apply plugin: 'com.android.library' android { @@ -18,7 +24,7 @@ android { versionCode 1 versionName computeVersionName() manifestPlaceholders = [ - QQ_APP_ID: ${QQ_APP_ID}, //在此替换你的APPKey + QQ_APP_ID: computeQQAppId() ] } sourceSets.main { From 54ae3a59b37eae2403172ba38542cdedf21d2efb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?erichua=28=E5=8D=8E=E6=8C=BA=29?= Date: Tue, 27 Jun 2017 22:14:53 +0800 Subject: [PATCH 2/8] update gitignore and move qq app id config to package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 8dbd5cc..bc2dda1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-qqsdk", - "version": "0.7.9", + "version": "0.8.0", "description": "react-native wrapper for qq sdk", "main": "index.js", "scripts": { From 6e1388b51e50394d0226dc67b78c21794f43db7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?erichua=28=E5=8D=8E=E6=8C=BA=29?= Date: Tue, 27 Jun 2017 22:15:48 +0800 Subject: [PATCH 3/8] update version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index bc2dda1..e32f548 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-qqsdk", - "version": "0.8.0", + "version": "0.8.1", "description": "react-native wrapper for qq sdk", "main": "index.js", "scripts": { From a85d263446dfd86d14a51f93355cf82c33ef210b Mon Sep 17 00:00:00 2001 From: EricHua23 <723943634@qq.com> Date: Tue, 27 Jun 2017 22:20:54 +0800 Subject: [PATCH 4/8] Update README.md --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 61505c8..e4d1c85 100644 --- a/README.md +++ b/README.md @@ -129,13 +129,13 @@ npm install --save react-native-qqsdk@latest compile project(':react-native-qqsdk') } ``` -3. add App ID to `android/app/build.gradle` which locate in react-native-qqsdk node_modules folder +3. add App ID to `$RNProjectRoot/package.json` which locate in react-native-qqsdk node_modules folder - ```gradle - ... - manifestPlaceholders = [ - QQ_APP_ID: ${QQ_APP_ID}, //在此替换你的APPKey - ] + ``` json + { +      ... // other package.json config +      "qq_app_id": "YOUR_QQ_APP_ID" +   } ``` 4.Update the `MainApplication.java` file to use react-native-qqsdk via the following changes: From 8dfa2cc8faae594f889aee5760182c702d5eb490 Mon Sep 17 00:00:00 2001 From: EricHua23 <723943634@qq.com> Date: Tue, 27 Jun 2017 22:21:17 +0800 Subject: [PATCH 5/8] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e4d1c85..6bfbfbd 100644 --- a/README.md +++ b/README.md @@ -129,7 +129,7 @@ npm install --save react-native-qqsdk@latest compile project(':react-native-qqsdk') } ``` -3. add App ID to `$RNProjectRoot/package.json` which locate in react-native-qqsdk node_modules folder +3. add App ID to `$RNProjectRoot/package.json` ``` json { From 177796e24f6e0d9ba00e2a83e9a25af41e31af89 Mon Sep 17 00:00:00 2001 From: EricHua23 <723943634@qq.com> Date: Tue, 27 Jun 2017 22:22:09 +0800 Subject: [PATCH 6/8] Update README.md --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 6bfbfbd..739104d 100644 --- a/README.md +++ b/README.md @@ -131,12 +131,12 @@ npm install --save react-native-qqsdk@latest ``` 3. add App ID to `$RNProjectRoot/package.json` - ``` json - { -      ... // other package.json config -      "qq_app_id": "YOUR_QQ_APP_ID" -   } - ``` +``` json +{ + ... // other package.json config + "qq_app_id": "YOUR_QQ_APP_ID" +} +``` 4.Update the `MainApplication.java` file to use react-native-qqsdk via the following changes: From 93040bc3c9add9fe18b5c9d5f737ab927494c029 Mon Sep 17 00:00:00 2001 From: EricHua23 <723943634@qq.com> Date: Tue, 27 Jun 2017 22:22:41 +0800 Subject: [PATCH 7/8] Update README.md --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 739104d..4643e53 100644 --- a/README.md +++ b/README.md @@ -133,7 +133,6 @@ npm install --save react-native-qqsdk@latest ``` json { - ... // other package.json config "qq_app_id": "YOUR_QQ_APP_ID" } ``` From b49a53ea1136e50afc66d9311623063aa1f0d9d8 Mon Sep 17 00:00:00 2001 From: EricHua23 <723943634@qq.com> Date: Fri, 30 Jun 2017 10:32:54 +0800 Subject: [PATCH 8/8] Update build.gradle --- android/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/build.gradle b/android/build.gradle index 8054fee..5720864 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -7,7 +7,7 @@ def computeVersionName() { return json.version } def computeQQAppId() { - // dynamically retrieve version from package.json + // dynamically retrieve qq app id from package.json def slurper = new JsonSlurper() def json = slurper.parse(file('../../../package.json'), "utf-8") return json.qq_app_id