From ab2b77ae7d4baa84e04d28e1b824e748e3557508 Mon Sep 17 00:00:00 2001 From: Jule Marcoueille Date: Wed, 24 Oct 2018 12:52:54 +0200 Subject: [PATCH 1/6] Fix plugin.xml for clean cordova plugin remove. (fix #898) --- plugin.xml | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/plugin.xml b/plugin.xml index b236828ed..bf2136e93 100644 --- a/plugin.xml +++ b/plugin.xml @@ -1,7 +1,7 @@ + xmlns="http://apache.org/cordova/ns/plugins/1.0" + xmlns:android="http://schemas.android.com/apk/res/android"> Google Firebase Plugin MIT @@ -17,16 +17,16 @@ xmlns:android="http://schemas.android.com/apk/res/android"> - + - - - + + + @@ -44,15 +44,16 @@ xmlns:android="http://schemas.android.com/apk/res/android"> - + + + - @@ -76,7 +77,7 @@ xmlns:android="http://schemas.android.com/apk/res/android"> - development + development production From 5b2df6eb7915cc5dd9a44aba6a40fd3bc9f5617a Mon Sep 17 00:00:00 2001 From: Jule Marcoueille Date: Wed, 24 Oct 2018 13:01:19 +0200 Subject: [PATCH 2/6] Remove unused empty ` build-extras.gradle`. --- src/android/build-extras.gradle | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100755 src/android/build-extras.gradle diff --git a/src/android/build-extras.gradle b/src/android/build-extras.gradle deleted file mode 100755 index e69de29bb..000000000 From b4c0cdf307c774bb127f4ff06893adb01cb6bbe5 Mon Sep 17 00:00:00 2001 From: Jule Marcoueille Date: Wed, 24 Oct 2018 13:43:47 +0200 Subject: [PATCH 3/6] Move google-services.json to test folder since it is only for test purpose and edit test script in order to copy it. --- {src/android => test}/google-services.json | 0 test/platform-add.sh | 1 + 2 files changed, 1 insertion(+) rename {src/android => test}/google-services.json (100%) diff --git a/src/android/google-services.json b/test/google-services.json similarity index 100% rename from src/android/google-services.json rename to test/google-services.json diff --git a/test/platform-add.sh b/test/platform-add.sh index 1eadf054b..a5cc532f6 100644 --- a/test/platform-add.sh +++ b/test/platform-add.sh @@ -11,6 +11,7 @@ rm -rf $FOLDER npm install "cordova@$CORDOVA_VERSION" --no-save ./node_modules/.bin/cordova create $FOLDER com.github.cordova_plugin_firebase HelloWorld +cp ./test/google-services.json $FOLDER cd $FOLDER From d78a0450248a1657f020d3990bd19b92a9782152 Mon Sep 17 00:00:00 2001 From: Jule Marcoueille Date: Wed, 24 Oct 2018 14:12:59 +0200 Subject: [PATCH 4/6] Upgrade CORDOVA_PLATFORM_VERSION to 7.1.1 in order to fix tests. --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 44e115c44..55b04a3db 100644 --- a/.travis.yml +++ b/.travis.yml @@ -49,7 +49,7 @@ matrix: - android-sdk-preview-license-.+ - android-sdk-license-.+ - google-gdk-license-.+ - env: CORDOVA_VERSION="7.1.0" CORDOVA_PLATFORM="android" CORDOVA_PLATFORM_VERSION="7.1.0" + env: CORDOVA_VERSION="7.1.0" CORDOVA_PLATFORM="android" CORDOVA_PLATFORM_VERSION="7.1.1" - os: linux sudo: false @@ -72,7 +72,7 @@ matrix: - android-sdk-preview-license-.+ - android-sdk-license-.+ - google-gdk-license-.+ - env: CORDOVA_VERSION="8.0.0" CORDOVA_PLATFORM="android" CORDOVA_PLATFORM_VERSION="7.1.0" + env: CORDOVA_VERSION="8.0.0" CORDOVA_PLATFORM="android" CORDOVA_PLATFORM_VERSION="7.1.1" - os: osx language: objective-c From 589852704646fd4e1c3864914d6dc1d022df3409 Mon Sep 17 00:00:00 2001 From: Jule Marcoueille Date: Wed, 24 Oct 2018 15:02:48 +0200 Subject: [PATCH 5/6] Install cordova to global in order to not mess up with npm local env. --- test/platform-add.sh | 6 +++--- test/platform-build.sh | 2 +- test/plugin-add.sh | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/test/platform-add.sh b/test/platform-add.sh index a5cc532f6..7eb045462 100644 --- a/test/platform-add.sh +++ b/test/platform-add.sh @@ -9,10 +9,10 @@ PLATFORM_VERSION=$3 FOLDER=".build-$PLATFORM" rm -rf $FOLDER -npm install "cordova@$CORDOVA_VERSION" --no-save -./node_modules/.bin/cordova create $FOLDER com.github.cordova_plugin_firebase HelloWorld +npm install -g "cordova@$CORDOVA_VERSION" +cordova create $FOLDER com.github.cordova_plugin_firebase HelloWorld cp ./test/google-services.json $FOLDER cd $FOLDER -../node_modules/.bin/cordova platform add "$PLATFORM@$PLATFORM_VERSION" +cordova platform add "$PLATFORM@$PLATFORM_VERSION" diff --git a/test/platform-build.sh b/test/platform-build.sh index ec336b2be..97be2521b 100644 --- a/test/platform-build.sh +++ b/test/platform-build.sh @@ -9,4 +9,4 @@ PLATFORM_VERSION=$3 FOLDER=".build-$PLATFORM" cd $FOLDER -../node_modules/.bin/cordova build $PLATFORM +cordova build $PLATFORM diff --git a/test/plugin-add.sh b/test/plugin-add.sh index 9681d8b92..947c2303d 100644 --- a/test/plugin-add.sh +++ b/test/plugin-add.sh @@ -19,9 +19,9 @@ else fi if [[ "$PLUGIN" == "cordova-android-play-services-gradle-release" ]]; then - ../node_modules/.bin/cordova plugin add $PLUGIN --variable PLAY_SERVICES_VERSION=+ $FETCH_COMMAND --save + cordova plugin add $PLUGIN --variable PLAY_SERVICES_VERSION=+ $FETCH_COMMAND --save elif [[ "$PLUGIN" == "cordova-android-firebase-gradle-release" ]]; then - ../node_modules/.bin/cordova plugin add $PLUGIN --variable FIREBASE_VERSION=+ $FETCH_COMMAND --save + cordova plugin add $PLUGIN --variable FIREBASE_VERSION=+ $FETCH_COMMAND --save else - ../node_modules/.bin/cordova plugin add $PLUGIN $FETCH_COMMAND + cordova plugin add $PLUGIN $FETCH_COMMAND fi From 71c98aa9793ea28314fa2e95490561fa400b3a61 Mon Sep 17 00:00:00 2001 From: Jule Marcoueille Date: Wed, 24 Oct 2018 19:23:06 +0200 Subject: [PATCH 6/6] Be patch tolerent for test environments. --- .travis.yml | 4 ++-- package.json | 18 +++++++++--------- test/plugin-add.sh | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.travis.yml b/.travis.yml index 55b04a3db..399d737bf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -104,5 +104,5 @@ before_install: - if [[ "$CORDOVA_PLATFORM" == "android" ]]; then yes | sdkmanager "build-tools;26.0.0" "platforms;android-26" ; fi script: -- bash ./test/test-default.sh $CORDOVA_VERSION $CORDOVA_PLATFORM $CORDOVA_PLATFORM_VERSION -- if [[ "$CORDOVA_PLATFORM" == "android" ]]; then bash ./test/test-with-3-plugins.sh $CORDOVA_VERSION $CORDOVA_PLATFORM $CORDOVA_PLATFORM_VERSION cordova-plugin-request-location-accuracy cordova-android-play-services-gradle-release cordova-android-firebase-gradle-release; fi +- bash ./test/test-default.sh ~$CORDOVA_VERSION $CORDOVA_PLATFORM ~$CORDOVA_PLATFORM_VERSION +- if [[ "$CORDOVA_PLATFORM" == "android" ]]; then bash ./test/test-with-3-plugins.sh ~$CORDOVA_VERSION $CORDOVA_PLATFORM ~$CORDOVA_PLATFORM_VERSION cordova-plugin-request-location-accuracy cordova-android-play-services-gradle-release cordova-android-firebase-gradle-release; fi diff --git a/package.json b/package.json index 5ade7135f..70ef4ae72 100644 --- a/package.json +++ b/package.json @@ -35,15 +35,15 @@ "test:android": "npm run test:cordova@6.5.0:android@6.4.0 && npm run test:cordova@7.1.0:android@7.1.0 && npm run test:cordova@8.0.0:android@7.1.0", "test:browser": "npm run test:cordova@6.5.0:browser@5.0.3 && npm run test:cordova@7.1.0:browser@5.0.3 && npm run test:cordova@8.0.0:browser@5.0.3", "test:ios": "npm run test:cordova@6.5.0:ios@4.5.4 && npm run test:cordova@7.1.0:ios@4.5.4 && npm run test:cordova@8.0.0:ios@4.5.4", - "test:cordova@6.5.0:ios@4.5.4": "bash ./test/test-default.sh 6.5.0 ios 4.5.4", - "test:cordova@7.1.0:ios@4.5.4": "bash ./test/test-default.sh 7.1.0 ios 4.5.4", - "test:cordova@8.0.0:ios@4.5.4": "bash ./test/test-default.sh 8.0.0 ios 4.5.4", - "test:cordova@6.5.0:android@6.4.0": "bash ./test/test-default.sh 6.5.0 android 6.4.0 && bash ./test/test-with-3-plugins.sh 6.5.0 android 6.4.0 cordova-plugin-request-location-accuracy cordova-android-play-services-gradle-release cordova-android-firebase-gradle-release", - "test:cordova@7.1.0:android@7.1.0": "bash ./test/test-default.sh 7.1.0 android 7.1.0 && bash ./test/test-with-3-plugins.sh 7.1.0 android 7.1.0 cordova-plugin-request-location-accuracy cordova-android-play-services-gradle-release cordova-android-firebase-gradle-release", - "test:cordova@8.0.0:android@7.1.0": "bash ./test/test-default.sh 8.0.0 android 7.1.0 && bash ./test/test-with-3-plugins.sh 8.0.0 android 7.1.0 cordova-plugin-request-location-accuracy cordova-android-play-services-gradle-release cordova-android-firebase-gradle-release", - "test:cordova@6.5.0:browser@5.0.3": "bash ./test/test-default.sh 6.5.0 browser 5.0.3", - "test:cordova@7.1.0:browser@5.0.3": "bash ./test/test-default.sh 7.1.0 browser 5.0.3", - "test:cordova@8.0.0:browser@5.0.3": "bash ./test/test-default.sh 8.0.0 browser 5.0.3" + "test:cordova@6.5.0:ios@4.5.4": "bash ./test/test-default.sh ~6.5.0 ios ~4.5.4", + "test:cordova@7.1.0:ios@4.5.4": "bash ./test/test-default.sh ~7.1.0 ios ~4.5.4", + "test:cordova@8.0.0:ios@4.5.4": "bash ./test/test-default.sh ~8.0.0 ios ~4.5.4", + "test:cordova@6.5.0:android@6.4.0": "bash ./test/test-default.sh ~6.5.0 android ~6.4.0 && bash ./test/test-with-3-plugins.sh ~6.5.0 android ~6.4.0 cordova-plugin-request-location-accuracy cordova-android-play-services-gradle-release cordova-android-firebase-gradle-release", + "test:cordova@7.1.0:android@7.1.0": "bash ./test/test-default.sh ~7.1.0 android ~7.1.0 && bash ./test/test-with-3-plugins.sh ~7.1.0 android ~7.1.0 cordova-plugin-request-location-accuracy cordova-android-play-services-gradle-release cordova-android-firebase-gradle-release", + "test:cordova@8.0.0:android@7.1.0": "bash ./test/test-default.sh ~8.0.0 android ~7.1.0 && bash ./test/test-with-3-plugins.sh ~8.0.0 android ~7.1.0 cordova-plugin-request-location-accuracy cordova-android-play-services-gradle-release cordova-android-firebase-gradle-release", + "test:cordova@6.5.0:browser@5.0.3": "bash ./test/test-default.sh ~6.5.0 browser ~5.0.3", + "test:cordova@7.1.0:browser@5.0.3": "bash ./test/test-default.sh ~7.1.0 browser ~5.0.3", + "test:cordova@8.0.0:browser@5.0.3": "bash ./test/test-default.sh ~8.0.0 browser ~5.0.3" }, "dependencies": {} } diff --git a/test/plugin-add.sh b/test/plugin-add.sh index 947c2303d..ca0451235 100644 --- a/test/plugin-add.sh +++ b/test/plugin-add.sh @@ -10,7 +10,7 @@ PLUGIN=$4 FOLDER=".build-$PLATFORM" cd $FOLDER -CORDOVA_MAJOR_VERSION=$(echo $CORDOVA_VERSION | cut -c 1-1) +CORDOVA_MAJOR_VERSION=`echo "$CORDOVA_VERSION" | sed -E "s/\~?\^?([[:digit:]]).*/\1/"` if [[ "$CORDOVA_MAJOR_VERSION" == "6" ]]; then FETCH_COMMAND="--fetch"