You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by br...@apache.org on 2018/11/28 14:10:21 UTC
[cordova-mobile-spec] branch master updated: Remove testing of
third-party plugins (#179)
This is an automated email from the ASF dual-hosted git repository.
brodybits pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cordova-mobile-spec.git
The following commit(s) were added to refs/heads/master by this push:
new 8cb69d2 Remove testing of third-party plugins (#179)
8cb69d2 is described below
commit 8cb69d2e9b1c093e3ac7d0a7dc37777a9f84705b
Author: Chris Brody <ch...@gmail.com>
AuthorDate: Wed Nov 28 09:10:15 2018 -0500
Remove testing of third-party plugins (#179)
resolves #171
---
cordova-plugin-thirdparty-tests/plugin.xml | 29 ---
.../thirdparty.tests.js | 267 ---------------------
createmobilespec/createmobilespec.js | 68 ------
3 files changed, 364 deletions(-)
diff --git a/cordova-plugin-thirdparty-tests/plugin.xml b/cordova-plugin-thirdparty-tests/plugin.xml
deleted file mode 100644
index b09e8e4..0000000
--- a/cordova-plugin-thirdparty-tests/plugin.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
--->
-
-<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
- id="org.apache.cordova.mobilespec.thirdpartytests"
- version="1.0.0">
- <name>Tests for popular third-party plugins</name>
- <license>Apache 2.0</license>
-
- <js-module src="thirdparty.tests.js" name="thirdparty.tests">
- </js-module>
-</plugin>
diff --git a/cordova-plugin-thirdparty-tests/thirdparty.tests.js b/cordova-plugin-thirdparty-tests/thirdparty.tests.js
deleted file mode 100644
index d3a95f7..0000000
--- a/cordova-plugin-thirdparty-tests/thirdparty.tests.js
+++ /dev/null
@@ -1,267 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-exports.defineManualTests = function (contentEl, createActionButton) {
- var html = '<h1>Tests for third-party plugins</h1>\n';
- var pluginInfos = [];
- if (/android/.exec(cordova.platformId)) {
- pluginInfos.push({ id: 'org.devgeeks.privacyscreen', remarks: ['Use the task switcher and make sure app screenshot disappears']});
- }
- function logSuccess(msg) {
- console.log('Success. result=' + msg);
- }
- function logFailure(msg) {
- console.warn('Failed. result=' + msg);
- }
- createActionButton('AppVersion', function() {
- cordova.getAppVersion(logSuccess);
- });
- // https://github.com/Telerik-Verified-Plugins/NFC
- createActionButton('Share via NFC', function() {
- var records = [
- ndef.textRecord("Hi there at " + new Date()),
- ndef.uriRecord("http://plugins.telerik.com/plugin/nfc"),
- ndef.mimeMediaRecord("text/blah", nfc.stringToBytes("Blah!"))
- ];
- nfc.share(records, logSuccess, logFailure);
- });
- // https://github.com/Telerik-Verified-Plugins/Keyboard
- createActionButton('Show Keyboard', function() {
- cordova.plugins.Keyboard.show();
- });
- window.addEventListener('native.keyboardshow', function (e) {
- console.log('Keyboard opened, height is ' + e.keyboardHeight + 'px');
- });
- window.addEventListener('native.keyboardhide', function (e) {
- console.log('Keyboard closed');
- });
- // https://github.com/Telerik-Verified-Plugins/Keychain
- if (/ios/.exec(cordova.platformId)) {
- // prepare some variables
- var servicename = 'SomeServiceName';
- var key = 'SomeKey';
- var value = 'SomeValue';
- var kc = new Keychain();
- // store your password in the Keychain
- createActionButton('Write keychain value', function() {
- kc.setForKey(logSuccess, logFailure, key, servicename, value + '-' + +new Date());
- });
- createActionButton('Read keychain value', function() {
- kc.getForKey(logSuccess, logFailure, key, servicename);
- });
- }
- // https://github.com/Telerik-Verified-Plugins/BarcodeScanner
- createActionButton('Scan Barcode', function() {
- cordova.plugins.barcodeScanner.scan(
- function (result) {
- console.log('We got a barcode\n' +
- 'Result: ' + result.text + '\n' +
- 'Format: ' + result.format + '\n' +
- 'Cancelled: ' + result.cancelled);
- }, logFailure, {
- 'preferFrontCamera' : false,
- 'showFlipCameraButton' : true
- });
- });
- // https://github.com/Telerik-Verified-Plugins/Toast
- createActionButton('Show Toast', function() {
- window.plugins.toast.show('Hello there!', 'long', 'center', logSuccess, logFailure);
- });
- // https://github.com/Telerik-Verified-Plugins/NativePageTransitions
- createActionButton('Flip', function() {
- window.plugins.nativepagetransitions.flip({}, logSuccess, logFailure);
- setTimeout(function() {
- console.log('This log should appear only after animation.');
- }, 10);
- });
- // https://github.com/Telerik-Verified-Plugins/EmailComposer
- createActionButton('Email Compose', function() {
- window.plugin.email.isServiceAvailable(function(result) {
- console.log('Service available: ' + result);
- if (result) {
- window.plugin.email.open({
- to: ['person1@domain.com'],
- subject: 'EmailComposer plugin test',
- body: '<h2>Hello!</h2>This is <strong>HTML</strong> email.',
- isHtml: true
- }, logSuccess);
- }
- });
- });
- // https://github.com/Telerik-Verified-Plugins/Calendar
- if (/ios|android/.exec(cordova.platformId)) {
- createActionButton('Open Calendar', function() {
- var d = new Date(new Date().getTime() + 3*24*60*60*1000);
- window.plugins.calendar.openCalendar(d, logSuccess, logFailure);
- });
- createActionButton('Create event', function() {
- window.plugins.calendar.createEventInteractively('Test Event', 'my house', 'description, yeah', +new Date, +new Date, logSuccess, logFailure);
- });
- }
- // https://github.com/Telerik-Verified-Plugins/SocialSharing
- createActionButton('Social Share a URL', function() {
- window.plugins.socialsharing.share('Some message to share', 'The Subject', 'https://cordova.apache.org/', logSuccess, logFailure);
- });
- // https://github.com/brodysoft/Cordova-SQLitePlugin
- createActionButton('SQLLitePlugin - test', function() {
- var db = window.sqlitePlugin.openDatabase({name: "my.db"});
- db.transaction(function(tx) {
- tx.executeSql('DROP TABLE IF EXISTS test_table');
- tx.executeSql('CREATE TABLE IF NOT EXISTS test_table (id integer primary key, data text, data_num integer)');
-
- // demonstrate PRAGMA:
- db.executeSql("pragma table_info (test_table);", [], function(res) {
- console.log("PRAGMA res: " + JSON.stringify(res));
- });
- }, logFailure);
- });
- // https://github.com/Telerik-Verified-Plugins/Flashlight
- createActionButton('Flashlight (3 seconds)', function() {
- window.plugins.flashlight.available(function(isAvailable) {
- console.log('isAvailable=' + isAvailable);
- if (isAvailable) {
- window.plugins.flashlight.switchOn(logSuccess, logFailure);
- setTimeout(function() {
- window.plugins.flashlight.switchOff(logSuccess, logFailure);
- }, 3000);
- }
- });
- });
- // https://github.com/Wizcorp/phonegap-facebook-plugin
- createActionButton('Facebook plugin', function() {
- facebookConnectPlugin.login(['public_profile'], function (userData) {
- console.log('UserInfo: ' + JSON.stringify(userData));
- }, logFailure);
- });
- // https://github.com/yoik/cordova-yoik-screenorientation
- createActionButton('lock to landscape', function() {
- screen.lockOrientation('landscape');
- console.log('Orientation is ' + screen.orientation);
- });
- createActionButton('unlock orientation', function() {
- screen.unlockOrientation();
- console.log('Orientation is ' + screen.orientation);
- });
- // https://github.com/cranberrygame/com.cranberrygame.phonegap.plugin.ad.admob.overlay
- function initAds(then) {
- var adUnit = 'ca-app-pub-4355727382565272/8389156346';
- var adUnitFullScreen = 'ca-app-pub-4355727382565272/9307486345';
- if (!window.isAdSetup) {
- window.admob.setUp(adUnit, adUnitFullScreen, /* overlap */ false, /* isTest */ true);
- window.admob.onFullScreenAdLoaded = function() {
- console.log('onFullScreenAdLoaded');
- };
- window.admob.onFullScreenAdShown = function() {
- console.log('onFullScreenAdShown');
- };
- window.admob.onFullScreenAdClosed = function() {
- console.log('onFullScreenAdClosed');
- };
- window.isAdSetup = true;
- setTimeout(then, 100);
- } else {
- then()
- };
- }
- createActionButton('Show banner ad', function() {
- initAds(function() {
- window.admob.showBannerAd('bottom-center', 'SMART_BANNER');
- });
- });
- createActionButton('Hide banner ad', function() {
- window.admob.hideBannerAd();
- });
- createActionButton('Show fullscreen ad', function() {
- initAds(function() {
- window.admob.showFullScreenAd();
- });
- });
- // https://github.com/katzer/cordova-plugin-local-notifications/
- createActionButton('Show local notification', function() {
- if (window.plugin.notification.local.registerPermission) {
- window.plugin.notification.local.registerPermission(go);
- } else {
- go(true);
- }
- function go(granted) {
- console.log('Permission has been granted: ' + granted);
- if (granted) {
- window.plugin.notification.local.ontrigger = function (id, state, json) {
- console.log('notification ' + id + ' triggered.');
- };
- window.plugin.notification.local.onclick = function (id, state, json) {
- console.log('notification ' + id + ' clicked.');
- };
- window.plugin.notification.local.oncancel = function (id, state, json) {
- console.log('notification ' + id + ' canceled.');
- };
- window.plugin.notification.local.add({ message: 'Great app!', led: 'A0FF05' });
- }
- }
- });
-
- var mapInit;
- function getMap() {
- if (!mapInit) {
- mapInit = plugin.google.maps.Map.getMap();
- mapInit.on(plugin.google.maps.event.MAP_READY, function() {
- console.log('Map is ready.');
- });
- mapInit.on(plugin.google.maps.event.MAP_CLICK, function(latLng) {
- console.log('Map was clicked at position: ' + latLng.toUrlValue());
- });
- mapInit.setBackgroundColor('red');
- }
- return mapInit;
- }
- // https://github.com/wf9a5m75/phonegap-googlemaps-plugin
- var mapDiv;
- createActionButton('Show Map', function() {
- var map = getMap();
- if (!mapDiv) {
- mapDiv = contentEl.ownerDocument.createElement('div');
- mapDiv.style.cssText = 'width:400px;height:300px;border:2px solid black';
- contentEl.appendChild(mapDiv);
- map.setDiv(mapDiv);
- } else {
- map.refreshLayout();
- }
- });
- var mapDebuggable = false;
- createActionButton('toggle Map Debuggable', function() {
- var map = getMap();
- mapDebuggable = !mapDebuggable;
- map.setDebuggable(mapDebuggable);
- });
- createActionButton('Show Map Fullscreen', function() {
- var map = getMap();
- map.showDialog();
- });
-
- for (var i = 0; i < pluginInfos.length; ++i) {
- var pluginInfo = pluginInfos[i];
- html += pluginInfo.id;
- if (pluginInfo.remarks) {
- html += '<ul><li>' + pluginInfo.remarks.join('</li><li>') + '</ul>';
- }
- }
- contentEl.innerHTML = html;
-};
diff --git a/createmobilespec/createmobilespec.js b/createmobilespec/createmobilespec.js
index f479c80..856c120 100755
--- a/createmobilespec/createmobilespec.js
+++ b/createmobilespec/createmobilespec.js
@@ -139,58 +139,10 @@ var top_dir = process.cwd() + path.sep,
.boolean("linkplugins").describe("linkplugins", "Use the --link flag when running `cordova plugin add`.\n")
.boolean("linkplatforms").describe("linkplatforms", "Use the --link flag when running `cordova platform add`.\n")
.boolean("link").describe("link", "Alias for --linkplugins --linkplatforms.\n")
- .boolean("telerikplugins").describe("telerikplugins", "Adds a bunch of known-to-be-popular plugins from Telerik-Verified-Plugins.\n")
- .boolean("cprplugins").describe("cprplugins", "Adds a bunch of known-to-be-popular plugins from Cordova Plugin Regsitry.\n")
- .boolean("plugregplugins").describe("cprplugins", "Adds a bunch of known-to-be-popular plugins from PlugReg (that are not on the CPR).\n")
- .boolean("thirdpartyplugins").describe("thirdpartyplugins", "Alias for --telerikplugins --cprplugins --plugregplugins.\n")
.string("webview").describe("webview", "Use --webview=crosswalk to install the crosswalk plugin")
.alias("h", "help")
.argv;
-// List generated based on download counts on registry.
-var CORDOVA_REGISTRY_PLUGINS = [
- 'com.ionic.keyboard',
- 'com.google.playservices',
- 'de.appplant.cordova.plugin.local-notification',
- 'com.phonegap.plugins.barcodescanner',
- 'com.cranberrygame.phonegap.plugin.ad.admob',
- // 'com.google.cordova.admob', // these two conflict. Use the most popular one.
- // 'com.google.admob',
- // Currently need an git version of this to fix a bug in published version.
- // It's a dep of plugin.google.maps
- 'https://github.com/wf9a5m75/phonegap-http-request.git',
- 'plugin.google.maps',
- 'com.rjfun.cordova.extension',
- 'net.yoik.cordova.plugins.screenorientation',
- 'de.appplant.cordova.plugin.email-composer',
- 'com.msopentech.azure-mobile-services',
- // 'com.phonegap.plugins.pushplugin', // This one bundles play services, causing duplicate symbols
- 'com.phonegap.plugins.facebookconnect',
- 'com.danielcwilson.plugins.googleanalytics'
-];
-// Commented out plugins are popular, but duplicate those in CPR.
-var TELERIK_VERIFIED_PLUGINS = [
- 'https://github.com/Telerik-Verified-Plugins/Flashlight',
- 'https://github.com/Telerik-Verified-Plugins/SocialSharing',
- 'https://github.com/Telerik-Verified-Plugins/ActionSheet',
- 'https://github.com/Telerik-Verified-Plugins/Calendar',
- // 'https://github.com/Telerik-Verified-Plugins/EmailComposer',
- 'https://github.com/Telerik-Verified-Plugins/NativePageTransitions',
- 'https://github.com/Telerik-Verified-Plugins/Toast',
- // 'https://github.com/Telerik-Verified-Plugins/BarcodeScanner',
- 'https://github.com/Telerik-Verified-Plugins/Keychain',
- // 'https://github.com/Telerik-Verified-Plugins/Keyboard',
- 'https://github.com/Telerik-Verified-Plugins/NFC',
- 'https://github.com/Telerik-Verified-Plugins/AppVersion',
- 'https://github.com/Telerik-Verified-Plugins/PrivacyScreen'
-];
-
-var PLUGREG_PLUGINS = [
- 'https://github.com/brodysoft/Cordova-SQLitePlugin.git',
- // 'https://github.com/wildabeast/BarcodeScanner.git',
- // 'https://github.com/phonegap-build/PushPlugin.git',
-];
-
var DEFAULT_PLUGINS = [
'cordova-plugin-battery-status',
'cordova-plugin-compat',
@@ -596,26 +548,6 @@ function installPlugins() {
pluginAdd(p, sp, allPluginFlags);
});
- if (argv.thirdpartyplugins || argv.cprplugins) {
- var mapVars = ' --variable API_KEY_FOR_ANDROID="AIzaSyBICVSs9JqT7WdASuN5HSe7w-pCE0n_X88" --variable API_KEY_FOR_IOS="AIzaSyAikyYG24YYFvq5Vy41P5kppsfO2GgF9jM"';
- var fbVars = ' --variable APP_ID=value --variable APP_NAME=value';
- pluginAdd(CORDOVA_REGISTRY_PLUGINS.join(' '), searchPath, mapVars + fbVars + variableFlag);
- // Delete duplicate <uses-permission> due to maxSdk (CB-8401)
- if (argv.android) {
- shelljs.sed('-i', /{[^{]*(maxSdk|WRITE_EXTERNAL_STORAGE).*?(maxSdk|WRITE_EXTERNAL_STORAGE)[^}]*},/, '', path.join('plugins', 'android.json'));
- shelljs.sed('-i', /<.*(maxSdk|WRITE_EXTERNAL_STORAGE).*(maxSdk|WRITE_EXTERNAL_STORAGE).*>/, '', path.join('platforms', 'android', 'AndroidManifest.xml'));
- }
- }
- if (argv.thirdpartyplugins || argv.telerikplugins) {
- pluginAdd(TELERIK_VERIFIED_PLUGINS.join(' '), searchPath, variableFlag);
- }
- if (argv.thirdpartyplugins || argv.plugregplugins) {
- pluginAdd(PLUGREG_PLUGINS.join(' '), searchPath, variableFlag);
- }
- if (argv.thirdpartyplugins) {
- pluginAdd('org.apache.cordova.mobilespec.thirdpartytests', mobile_spec_git_dir, allPluginFlags);
- }
-
// Install new-style test plugins
console.log("Adding plugin tests using CLI...");
var pluginTestPaths = [];
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org