just build check
MODIFY
.travis.yml
.travis.yml
-sudo: required
-
-services:
- - couchdb
+sudo: false
env:
global:
- - ANDROID_API=24
- - ANDROID_BUILD_TOOLS=28.0.3
- - NODE_VERSION=7.0.0
+ - NODE_VERSION="9.11.2"
+ - ANDROID_API="28"
+ - ANDROID_BUILD_TOOLS="28.0.3"
+
+notifications:
+ email: false
before_cache:
# Do not cache a few Gradle files/directories (see https://docs.travis-ci.com/user/languages/java/#Caching)
@@ -16,9 +16,6 @@ before_cache:
cache:
directories:
- # Android SDK
- - $HOME/android-sdk-dl
- - $HOME/android-sdk
# Gradle dependencies
- $HOME/.gradle/caches/
@@ -33,14 +30,33 @@ cache:
matrix:
include:
- os: linux
- env: CORDOVA_PLATFORM="browser"
+ env: CORDOVA_VERSION="8.0.0" CORDOVA_PLATFORM="browser"
language: node_js
- - env: CORDOVA_PLATFORM="android" ANDROID_HOME=${HOME}/android-sdk ORG_GRADLE_PROJECT_cdvMinSdkVersion=24 ORG_GRADLE_PROJECT_cdvCompileSdkVersion=24 ORG_GRADLE_PROJECT_cdvBuildToolsVersion=${ANDROID_BUILD_TOOLS}
+ node_js: '${NODE_VERSION}'
+
+ - env: CORDOVA_VERSION="8.0.0" CORDOVA_PLATFORM="android"
os: linux
+ node_js: '${NODE_VERSION}'
language: android
jdk: oraclejdk8
+ android:
+ components:
+ - tools
+ - android-${ANDROID_API}
+ - platform-tools
+ # The BuildTools version used by your project
+ - build-tools-${ANDROID_BUILD_TOOLS}
+ # The SDK version used to compile your project
+ - android-${ANDROID_API}
+ # Additional components
+ - extra-android-m2repository
+ - extra-google-m2repository
+ - sys-img-armeabi-v7a-android-${ANDROID_API}
+ licenses:
+ - ".+"
install:
+
- exist=$(which nvm); if [[ -z "${exist}" ]]; then
rm -rf ~/.nvm > /dev/null;
git clone https://github.com/creationix/nvm.git ~/.nvm > /dev/null;
@@ -49,81 +65,18 @@ install:
fi
- exist=$(nvm list | grep ${NODE_VERSION}); if [[ -z "${exist}" ]]; then
nvm install ${NODE_VERSION} > /dev/null;
- nvm alias default ${NODE_VERSION} > /dev/null;
- nvm use default > /dev/null;
- fi
- - exist=$(nvm list | grep 'v0.10.48'); if [[ ! -z "${exist}" ]]; then
- nvm uninstall v0.10.48 > /dev/null;
fi
+ - nvm use ${NODE_VERSION} > /dev/null;
- node --version
- - exist=$(which cordova); if [[ -z "${exist}" ]]; then npm -g install cordova > /dev/null; fi
+ - exist=$(which cordova); if [[ -z "${exist}" ]]; then;
+ npm -g cordova@${CORDOVA_VERSION} > /dev/null;
+ fi
- cordova --version
- exist=$(which cordova-paramedic); if [[ -z "${exist}" ]]; then
- git clone https://github.com/apache/cordova-paramedic /tmp/paramedic;
- pushd /tmp/paramedic;
- npm i > /dev/null;
- popd;
- fi
- - if [[ "${CORDOVA_PLATFORM}" == "android" ]]; then
- if test ! -e $HOME/android-sdk-dl/sdk-tools.zip ; then curl https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip > $HOME/android-sdk-dl/sdk-tools.zip; fi;
- unzip -qq -n $HOME/android-sdk-dl/sdk-tools.zip -d ${ANDROID_HOME};
- fi
- - if [[ ! -e "${HOME}/.android/repositories.cfg" ]]; then
- touch ${HOME}/.android/repositories.cfg > /dev/null;
- fi
- - if [[ ! -e "${HOME}/.android/avd" ]]; then
- mkdir -p ${HOME}/.android/avd/ > /dev/null;
- fi
- - if [[ "${CORDOVA_PLATFORM}" == "android" ]]; then
- echo "y" | ${ANDROID_HOME}/tools/bin/sdkmanager 'tools' > /dev/null;
- fi
- - if [[ "${CORDOVA_PLATFORM}" == "android" ]]; then
- echo "y" | ${ANDROID_HOME}/tools/bin/sdkmanager 'platform-tools' > /dev/null;
- fi
- - if [[ "${CORDOVA_PLATFORM}" == "android" ]]; then
- echo "y" | ${ANDROID_HOME}/tools/bin/sdkmanager "build-tools;${ANDROID_BUILD_TOOLS}" > /dev/null;
- fi
- - if [[ "${CORDOVA_PLATFORM}" == "android" ]]; then
- echo "y" | android update sdk -a --no-ui --filter android-${ANDROID_API};
- fi
- - if [[ "${CORDOVA_PLATFORM}" == "android" ]]; then
- echo "y" | android update sdk -a --no-ui --filter sys-img-armeabi-v7a-android-${ANDROID_API};
+ npm -g install https://github.com/apache/cordova-paramedic;
fi
- - if [[ "${CORDOVA_PLATFORM}" == "android" ]]; then
- echo "y" | ${ANDROID_HOME}/tools/bin/sdkmanager 'extras;google;m2repository' > /dev/null;
- fi
- - npm i > /dev/null
-
-before_script:
- - if [[ "${CORDOVA_PLATFORM}" == "android" ]]; then
- android list targets;
- fi
- - if [[ "${CORDOVA_PLATFORM}" == "android" ]]; then
- echo no | android create avd --force -n test -t android-${ANDROID_API} --abi armeabi-v7a;
- fi
- - if [[ "${CORDOVA_PLATFORM}" == "android" ]]; then
- emulator -avd test -no-window &
- fi
- - if [[ "${CORDOVA_PLATFORM}" == "android" ]]; then
- android-wait-for-emulator;
- fi
- - if [[ "${CORDOVA_PLATFORM}" == "android" ]]; then
- adb shell input keyevent 82;
- fi
- - if [[ "${CORDOVA_PLATFORM}" == "android" ]]; then
- adb wait-for-device get-serialno;
- fi
-
+ - npm install
script:
- - npm run test
-
-
- - if [[ "${CORDOVA_PLATFORM}" == "android" ]]; then
- while [ $? -ne 0 ]; do
- sleep 1 && curl -v http://localhost:5984;
- done
- fi
- - if [[ "${CORDOVA_PLATFORM}" == "android" ]]; then
- node /tmp/paramedic/main.js --cleanUpAfterRun --platform android --plugin '. --variable API_KEY_FOR_ANDROID=test' -;
- fi
+ - npm test
+ - cordova-paramedic --cleanUpAfterRun --verbose --platform ${CORDOVA_PLATFORM} --justBuild --plugin '. --variable API_KEY_FOR_ANDROID=test --variable API_KEY_FOR_IOS=test'

MODIFY
package.json
package.json
],
"scripts": {
"test": "npm run eslint",
- "eslint": "node node_modules/eslint/bin/eslint www && node node_modules/eslint/bin/eslint src"
+ "eslint": "node node_modules/eslint/bin/eslint www && node node_modules/eslint/bin/eslint src",
+ "test:android": "cordova-paramedic --cleanUpAfterRun --verbose --platform android --plugin '. --variable API_KEY_FOR_ANDROID=test' --useTunnel",
+ "test:browser": "cordova-paramedic --cleanUpAfterRun --verbose --platform browser --plugin '. --variable API_KEY_FOR_ANDROID=test' --useTunnel"
},
"author": "Masashi Katsumata, Hirbod Mirjavadi",
"license": "Apache-2.0",

MODIFY
plugin.xml
plugin.xml
<?xml version='1.0' encoding='utf-8'?>
-<plugin id="cordova-plugin-googlemaps" version="2.5.0-beta-20181017-1758" xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android">
+<plugin id="cordova-plugin-googlemaps" version="2.5.0" xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android">
<name>cordova-plugin-googlemaps</name>
<js-module name="Promise" src="www/Promise.js" />
<asset src="www/promise-7.0.4.min.js.map" target="promise-7.0.4.min.js.map" />

MODIFY
tests/plugin.xml
tests/plugin.xml
xmlns:rim="http://www.blackberry.com/ns/widgets"
xmlns:android="http://schemas.android.com/apk/res/android"
id="cordova-plugin-googlemaps-tests"
- version="2.5.0-beta-20181016-1830-dev">
+ version="4.0.2-dev">
<name>Cordova Geolocation Plugin Tests</name>
<license>Apache 2.0</license>
+
<js-module src="tests.js" name="tests">
</js-module>
</plugin>

MODIFY
tests/tests.js
tests/tests.js
exports.defineAutoTests = function () {
- describe('install check', function () {
+ describe('FirebaseCore (plugin.firebase.app)', function () {
- it('plugin.google.maps should exist', function () {
- expect(plugin.google.maps).toBeDefined();
- });
-
- // temporally fail test
- it('fail.google.maps should exist', function () {
- expect(fail.google.maps).toBeDefined();
+ it('plugin.firebase.app should exist', function () {
+ expect(plugin.firebase.app).toBeDefined();
});
});

MODIFY
www/plugin-loader-for-android_ios.js
www/plugin-loader-for-android_ios.js
@@ -6,8 +6,6 @@ if (!cordova) {
});
} else {
var common = require('./Common');
- // The pluginInit.js must execute before loading HTML is completed.
- require('./pluginInit')();
cordova.addConstructor(function () {
if (!window.Cordova) {
@@ -56,6 +54,9 @@ if (!cordova) {
wait();
})).then(function () {
+ // The pluginInit.js must execute before loading HTML is completed.
+ require('./pluginInit')();
+
common.nextTick(function () {
// If the developer needs to recalculate the DOM tree graph,
// use `cordova.fireDocumentEvent('plugin_touch')`

MODIFY
www/pluginInit.js
www/pluginInit.js
var cordova_exec = require('cordova/exec');
+var common = require('cordova-plugin-googlemaps.Common');
function pluginInit() {
//-------------------------------------------------------------
@@ -72,9 +73,7 @@ function pluginInit() {
document.body.insertAdjacentHTML('afterbegin', envTestDiv);
var testElement = document.getElementById('envTest');
- var computedStyles = window.getComputedStyle(testElement);
- var testResult = computedStyles.getPropertyValue('margin-top');
-
+ var testResult = common.getStyle(testElement, 'margin-top');
document.body.removeChild(testElement);
// if browser supports env(), returns a pixel value as string, even if 0px

just build check