[GitHub] cordova-paramedic pull request: Code changes for Collecting Device...
Github user nikhilkh commented on a diff in the pull request: https://github.com/apache/cordova-paramedic/pull/4#discussion_r59646081 --- Diff: lib/paramedic.js --- @@ -210,13 +234,29 @@ ParamedicRunner.prototype.waitForConnection = function() { }; ParamedicRunner.prototype.cleanUpProject = function() { -if(this.config.getShouldCleanUpAfterRun()) { +if(this.config.shouldCleanUpAfterRun()) { logger.info("cordova-paramedic: Deleting the application: " + this.tempFolder.name); shell.popd(); shell.rm('-rf', this.tempFolder.name); } }; +ParamedicRunner.prototype.killProcess = function() { +if(this.config.shouldCleanUpAfterRun()){ +logger.info("cordova-paramedic: Killing the process."); --- End diff -- emulator process? --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org
[GitHub] cordova-paramedic pull request: Code changes for Collecting Device...
Github user nikhilkh commented on a diff in the pull request: https://github.com/apache/cordova-paramedic/pull/4#discussion_r59645814 --- Diff: lib/ParamedicLog.js --- @@ -0,0 +1,154 @@ +#!/usr/bin/env node + +/* jshint node: true */ + +"use strict"; + +var shelljs = require("shelljs"); +var fs = require("fs"); +var path = require("path"); +var util = require('./utils').utilities; +var logger = require('./utils').logger; + + +function ParamedicLog(platform, appPath, logPath){ +this.platform = platform; +this.appPath = appPath; +this.logPath = logPath; +} + +ParamedicLog.prototype.logIOS = function (appPath) { +// We need to print out the system log for the simulator app. In order to figure +// out the path to that file, we need to find the ID of the simulator running +// mobilespec + +// First, figure out the simulator that ran mobilespec. "cordova run"" just chooses +// the last simulator in this list that starts with the word "iPhone" +shelljs.pushd(appPath); + +var findSimCommand = this.getLocalCLI() + " run --list --emulator | grep ^iPhone | tail -n1"; + +logger.info("running:"); +logger.info("" + findSimCommand); + +var findSimResult = shelljs.exec(findSimCommand, {silent: true, async: false}); + +if (findSimResult.code > 0) { +logger.error("Failed to find simulator we deployed to"); +return; +} + +var split = findSimResult.output.split(", "); + +// Format of the output is "iPhone-6s-Plus, 9.1" +// Extract the device name and the version number +var device = split[0].replace(/-/g, " ").trim(); +var version = split[1].trim(); + +// Next, figure out the ID of the simulator we found +var instrCommand = "instruments -s devices | grep ^iPhone"; +logger.info("running:"); +logger.info("" + instrCommand); + +var instrResult = shelljs.exec(instrCommand, {silent: true, async: false}); + +if (instrResult.code > 0) { +logger.error("Failed to get the list of simulators"); +return; +} + +// This matches () [] +var simIdRegex = /^([a-zA-Z\d ]+) \(([\d.]+)\) \[([a-zA-Z\d\-]*)\]$/; + +var simId = null; +var lines = instrResult.output.split(/\n/); +lines.forEach(function(line) { +var simIdMatch = simIdRegex.exec(line); +if (simIdMatch && simIdMatch.length === 4 && simIdMatch[1] === device && simIdMatch[2] === version) { +simId = encodeURIComponent(simIdMatch[3]); +} +}); + +if (simId) { +// Now we can print out the log file +var logPath = path.join("~", "Library", "Logs", "CoreSimulator", simId, "system.log"); +var logCommand = "cat " + logPath; +this.generateLogs(logCommand); +} else { +logger.error("Failed to find ID of mobilespec simulator"); +} +} + +ParamedicLog.prototype.logWindows = function (appPath, logMins) { +var logScriptPath = path.join(appPath, "platforms", "windows", "cordova", "log.bat"); +if (fs.existsSync(logScriptPath)) { +var mins = util.DEFAULT_LOG_TIME; +if (logMins) { +mins = logMins + util.DEFAULT_LOG_TIME_ADDITIONAL; +} +var logCommand = logScriptPath + " --dump --mins " + mins; +this.generateLogs(logCommand); +} +} + +ParamedicLog.prototype.logAndroid = function (){ +var logCommand = "adb logcat -d"; + +var numDevices = util.countAndroidDevices(); +if (numDevices != 1) { +logger.error("there must be exactly one emulator/device attached"); +return; +} +this.generateLogs(logCommand); +} + +ParamedicLog.prototype.generateLogs = function(logCommand) { +var logFile = this.getLogFileName(); +logger.info('Running Command: ' + logCommand); + +var result = shelljs.exec(logCommand, {silent: true, async: false}); +if (result.code > 0) { +logger.error("Failed to run command: " + logCommand); +return; +} + +try { +fs.writeFileSync(logFile, result.output); +} catch (ex) { +logger.error("Cannot write the log results to the file. " + ex); +} +} + +ParamedicLog.prototype.getLogFileName = function() { +return path.join(this.logPath, this.platform+"_logs.txt"); --- End diff -- spaces missing --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled
[GitHub] cordova-paramedic pull request: Code changes for Collecting Device...
Github user nikhilkh commented on a diff in the pull request: https://github.com/apache/cordova-paramedic/pull/4#discussion_r59645737 --- Diff: lib/ParamedicLog.js --- @@ -0,0 +1,154 @@ +#!/usr/bin/env node + +/* jshint node: true */ + +"use strict"; + +var shelljs = require("shelljs"); +var fs = require("fs"); +var path = require("path"); +var util = require('./utils').utilities; +var logger = require('./utils').logger; + + +function ParamedicLog(platform, appPath, logPath){ +this.platform = platform; +this.appPath = appPath; +this.logPath = logPath; +} + +ParamedicLog.prototype.logIOS = function (appPath) { +// We need to print out the system log for the simulator app. In order to figure +// out the path to that file, we need to find the ID of the simulator running +// mobilespec + +// First, figure out the simulator that ran mobilespec. "cordova run"" just chooses +// the last simulator in this list that starts with the word "iPhone" +shelljs.pushd(appPath); + +var findSimCommand = this.getLocalCLI() + " run --list --emulator | grep ^iPhone | tail -n1"; + +logger.info("running:"); +logger.info("" + findSimCommand); + +var findSimResult = shelljs.exec(findSimCommand, {silent: true, async: false}); + +if (findSimResult.code > 0) { +logger.error("Failed to find simulator we deployed to"); +return; +} + +var split = findSimResult.output.split(", "); + +// Format of the output is "iPhone-6s-Plus, 9.1" +// Extract the device name and the version number +var device = split[0].replace(/-/g, " ").trim(); +var version = split[1].trim(); + +// Next, figure out the ID of the simulator we found +var instrCommand = "instruments -s devices | grep ^iPhone"; +logger.info("running:"); +logger.info("" + instrCommand); + +var instrResult = shelljs.exec(instrCommand, {silent: true, async: false}); + +if (instrResult.code > 0) { +logger.error("Failed to get the list of simulators"); +return; +} + +// This matches () [] +var simIdRegex = /^([a-zA-Z\d ]+) \(([\d.]+)\) \[([a-zA-Z\d\-]*)\]$/; + +var simId = null; +var lines = instrResult.output.split(/\n/); +lines.forEach(function(line) { +var simIdMatch = simIdRegex.exec(line); +if (simIdMatch && simIdMatch.length === 4 && simIdMatch[1] === device && simIdMatch[2] === version) { +simId = encodeURIComponent(simIdMatch[3]); +} +}); + +if (simId) { +// Now we can print out the log file +var logPath = path.join("~", "Library", "Logs", "CoreSimulator", simId, "system.log"); +var logCommand = "cat " + logPath; +this.generateLogs(logCommand); +} else { +logger.error("Failed to find ID of mobilespec simulator"); +} +} + +ParamedicLog.prototype.logWindows = function (appPath, logMins) { +var logScriptPath = path.join(appPath, "platforms", "windows", "cordova", "log.bat"); +if (fs.existsSync(logScriptPath)) { +var mins = util.DEFAULT_LOG_TIME; +if (logMins) { +mins = logMins + util.DEFAULT_LOG_TIME_ADDITIONAL; +} +var logCommand = logScriptPath + " --dump --mins " + mins; +this.generateLogs(logCommand); +} +} + +ParamedicLog.prototype.logAndroid = function (){ +var logCommand = "adb logcat -d"; + +var numDevices = util.countAndroidDevices(); +if (numDevices != 1) { +logger.error("there must be exactly one emulator/device attached"); +return; +} +this.generateLogs(logCommand); +} + +ParamedicLog.prototype.generateLogs = function(logCommand) { +var logFile = this.getLogFileName(); +logger.info('Running Command: ' + logCommand); + +var result = shelljs.exec(logCommand, {silent: true, async: false}); +if (result.code > 0) { +logger.error("Failed to run command: " + logCommand); +return; +} + +try { +fs.writeFileSync(logFile, result.output); +} catch (ex) { +logger.error("Cannot write the log results to the file. " + ex); +} +} + +ParamedicLog.prototype.getLogFileName = function() { +return path.join(this.logPath, this.platform+"_logs.txt"); +} + +ParamedicLog.prototype.getLocalCLI = function (){ --- End diff -- Consider just using "cordova" inline instead of this method. --- If your project is set up for it, you can
[GitHub] cordova-paramedic pull request: Code changes for Collecting Device...
Github user nikhilkh commented on a diff in the pull request: https://github.com/apache/cordova-paramedic/pull/4#discussion_r59645230 --- Diff: lib/ParamedicLog.js --- @@ -0,0 +1,154 @@ +#!/usr/bin/env node + +/* jshint node: true */ + +"use strict"; + +var shelljs = require("shelljs"); +var fs = require("fs"); +var path = require("path"); +var util = require('./utils').utilities; +var logger = require('./utils').logger; + + +function ParamedicLog(platform, appPath, logPath){ +this.platform = platform; +this.appPath = appPath; +this.logPath = logPath; +} + +ParamedicLog.prototype.logIOS = function (appPath) { +// We need to print out the system log for the simulator app. In order to figure +// out the path to that file, we need to find the ID of the simulator running +// mobilespec + +// First, figure out the simulator that ran mobilespec. "cordova run"" just chooses +// the last simulator in this list that starts with the word "iPhone" +shelljs.pushd(appPath); + +var findSimCommand = this.getLocalCLI() + " run --list --emulator | grep ^iPhone | tail -n1"; + +logger.info("running:"); +logger.info("" + findSimCommand); + +var findSimResult = shelljs.exec(findSimCommand, {silent: true, async: false}); + +if (findSimResult.code > 0) { +logger.error("Failed to find simulator we deployed to"); +return; +} + +var split = findSimResult.output.split(", "); + +// Format of the output is "iPhone-6s-Plus, 9.1" +// Extract the device name and the version number +var device = split[0].replace(/-/g, " ").trim(); +var version = split[1].trim(); + +// Next, figure out the ID of the simulator we found +var instrCommand = "instruments -s devices | grep ^iPhone"; +logger.info("running:"); +logger.info("" + instrCommand); + +var instrResult = shelljs.exec(instrCommand, {silent: true, async: false}); + +if (instrResult.code > 0) { +logger.error("Failed to get the list of simulators"); +return; +} + +// This matches () [] +var simIdRegex = /^([a-zA-Z\d ]+) \(([\d.]+)\) \[([a-zA-Z\d\-]*)\]$/; + +var simId = null; +var lines = instrResult.output.split(/\n/); +lines.forEach(function(line) { +var simIdMatch = simIdRegex.exec(line); +if (simIdMatch && simIdMatch.length === 4 && simIdMatch[1] === device && simIdMatch[2] === version) { +simId = encodeURIComponent(simIdMatch[3]); +} +}); + +if (simId) { +// Now we can print out the log file +var logPath = path.join("~", "Library", "Logs", "CoreSimulator", simId, "system.log"); +var logCommand = "cat " + logPath; +this.generateLogs(logCommand); +} else { +logger.error("Failed to find ID of mobilespec simulator"); +} +} + +ParamedicLog.prototype.logWindows = function (appPath, logMins) { +var logScriptPath = path.join(appPath, "platforms", "windows", "cordova", "log.bat"); +if (fs.existsSync(logScriptPath)) { +var mins = util.DEFAULT_LOG_TIME; +if (logMins) { +mins = logMins + util.DEFAULT_LOG_TIME_ADDITIONAL; +} +var logCommand = logScriptPath + " --dump --mins " + mins; +this.generateLogs(logCommand); +} +} + +ParamedicLog.prototype.logAndroid = function (){ +var logCommand = "adb logcat -d"; + +var numDevices = util.countAndroidDevices(); +if (numDevices != 1) { +logger.error("there must be exactly one emulator/device attached"); +return; +} +this.generateLogs(logCommand); +} + +ParamedicLog.prototype.generateLogs = function(logCommand) { +var logFile = this.getLogFileName(); +logger.info('Running Command: ' + logCommand); + +var result = shelljs.exec(logCommand, {silent: true, async: false}); +if (result.code > 0) { +logger.error("Failed to run command: " + logCommand); --- End diff -- Ideally you want to log return code and stderr/stdout --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail:
[GitHub] cordova-paramedic pull request: Code changes for Collecting Device...
Github user nikhilkh commented on a diff in the pull request: https://github.com/apache/cordova-paramedic/pull/4#discussion_r59644970 --- Diff: lib/ParamedicPermissions.js --- @@ -0,0 +1,60 @@ +#!/usr/bin/env node + +/* jshint node: true */ +var path= require('path'); +var fs = require('fs'); +var shelljs = require("shelljs"); +var logger = require('./utils').logger; + +function ParamedicPermissions(appName, simulatorsFolder, dbPath) { + this.appName = appName; + this.simulatorsFolder = simulatorsFolder; + this.dbPath = dbPath; +} + +ParamedicPermissions.prototype.updatePermissions = function(serviceList){ + var self = this; + this.getDirectories(self.simulatorsFolder).forEach(function(simFolder){ + var destinationTCCFile = path.join(self.simulatorsFolder, simFolder, '/data/Library/TCC/TCC.db'); + + //Check if the simFolder has TCC.db file in it + if(self.doesFileExist(destinationTCCFile)) { + var sqlite3Command_firstPart = 'sqlite3 ' + destinationTCCFile; + var sqlite3Command_secondPart = ' "insert into access(service, client, client_type, allowed, prompt_count, csreq) values(\''; + var sqlite3Command_lastPart = '\',\'' + self.appName + '\',0,1,1,NULL)"'; + serviceList.forEach(function(service){ + var command = sqlite3Command_firstPart + sqlite3Command_secondPart + service + sqlite3Command_lastPart ; + logger.info("Running Command: " + command); + shelljs.exec(command, {silent: true, async: false}); + }); + } else { + // No TCC.db file exists by default. So, Copy the new TCC.db file + var destinationTCCFolder = path.join(self.simulatorsFolder, simFolder, '/data/Library/TCC'); + if(!self.doesFileExist(destinationTCCFolder)){ + fs.mkdir(destinationTCCFolder, 0777); + } + var command = "cp " + self.dbPath + " " + destinationTCCFolder; + logger.info("Running Command: " + command); + shelljs.exec(command, {silent: true, async: false}); --- End diff -- Consider writing a comment of why you are not handling errors here. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org
[GitHub] cordova-paramedic pull request: Code changes for Collecting Device...
Github user nikhilkh commented on a diff in the pull request: https://github.com/apache/cordova-paramedic/pull/4#discussion_r59644686 --- Diff: lib/ParamedicPermissions.js --- @@ -0,0 +1,60 @@ +#!/usr/bin/env node + +/* jshint node: true */ +var path= require('path'); +var fs = require('fs'); +var shelljs = require("shelljs"); +var logger = require('./utils').logger; + +function ParamedicPermissions(appName, simulatorsFolder, dbPath) { + this.appName = appName; + this.simulatorsFolder = simulatorsFolder; + this.dbPath = dbPath; +} + +ParamedicPermissions.prototype.updatePermissions = function(serviceList){ + var self = this; + this.getDirectories(self.simulatorsFolder).forEach(function(simFolder){ + var destinationTCCFile = path.join(self.simulatorsFolder, simFolder, '/data/Library/TCC/TCC.db'); + + //Check if the simFolder has TCC.db file in it + if(self.doesFileExist(destinationTCCFile)) { + var sqlite3Command_firstPart = 'sqlite3 ' + destinationTCCFile; + var sqlite3Command_secondPart = ' "insert into access(service, client, client_type, allowed, prompt_count, csreq) values(\''; + var sqlite3Command_lastPart = '\',\'' + self.appName + '\',0,1,1,NULL)"'; + serviceList.forEach(function(service){ + var command = sqlite3Command_firstPart + sqlite3Command_secondPart + service + sqlite3Command_lastPart ; --- End diff -- Consider using `util.format` --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org
[GitHub] cordova-paramedic pull request: Code changes for Collecting Device...
Github user nikhilkh commented on a diff in the pull request: https://github.com/apache/cordova-paramedic/pull/4#discussion_r59644267 --- Diff: lib/ParamedicPermissions.js --- @@ -0,0 +1,60 @@ +#!/usr/bin/env node + +/* jshint node: true */ +var path= require('path'); +var fs = require('fs'); +var shelljs = require("shelljs"); +var logger = require('./utils').logger; + +function ParamedicPermissions(appName, simulatorsFolder, dbPath) { + this.appName = appName; + this.simulatorsFolder = simulatorsFolder; + this.dbPath = dbPath; +} + +ParamedicPermissions.prototype.updatePermissions = function(serviceList){ + var self = this; + this.getDirectories(self.simulatorsFolder).forEach(function(simFolder){ + var destinationTCCFile = path.join(self.simulatorsFolder, simFolder, '/data/Library/TCC/TCC.db'); + + //Check if the simFolder has TCC.db file in it + if(self.doesFileExist(destinationTCCFile)) { + var sqlite3Command_firstPart = 'sqlite3 ' + destinationTCCFile; + var sqlite3Command_secondPart = ' "insert into access(service, client, client_type, allowed, prompt_count, csreq) values(\''; --- End diff -- Instead of copying a tcc db with permissions - consider copying empty and insert permissions into it - that helps in configuring permissions only in one place. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org
[GitHub] cordova-plugin-file pull request: CB-10798, CB-10384: Fixing permi...
Github user macdonst commented on the pull request: https://github.com/apache/cordova-plugin-file/pull/170#issuecomment-209689870 @silhouettes I don't think @stevengill will reply on this thread but maybe now that he's been @ messaged. I'm sure there will be a plugins release for Cordova soon but don't know of a timeline. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org
[GitHub] cordova-paramedic pull request: Code changes for Collecting Device...
Github user nikhilkh commented on a diff in the pull request: https://github.com/apache/cordova-paramedic/pull/4#discussion_r59644069 --- Diff: lib/ParamedicPermissions.js --- @@ -0,0 +1,60 @@ +#!/usr/bin/env node + +/* jshint node: true */ +var path= require('path'); +var fs = require('fs'); +var shelljs = require("shelljs"); +var logger = require('./utils').logger; + +function ParamedicPermissions(appName, simulatorsFolder, dbPath) { + this.appName = appName; + this.simulatorsFolder = simulatorsFolder; + this.dbPath = dbPath; +} + +ParamedicPermissions.prototype.updatePermissions = function(serviceList){ + var self = this; + this.getDirectories(self.simulatorsFolder).forEach(function(simFolder){ + var destinationTCCFile = path.join(self.simulatorsFolder, simFolder, '/data/Library/TCC/TCC.db'); + + //Check if the simFolder has TCC.db file in it + if(self.doesFileExist(destinationTCCFile)) { + var sqlite3Command_firstPart = 'sqlite3 ' + destinationTCCFile; + var sqlite3Command_secondPart = ' "insert into access(service, client, client_type, allowed, prompt_count, csreq) values(\''; + var sqlite3Command_lastPart = '\',\'' + self.appName + '\',0,1,1,NULL)"'; + serviceList.forEach(function(service){ + var command = sqlite3Command_firstPart + sqlite3Command_secondPart + service + sqlite3Command_lastPart ; + logger.info("Running Command: " + command); + shelljs.exec(command, {silent: true, async: false}); + }); + } else { + // No TCC.db file exists by default. So, Copy the new TCC.db file + var destinationTCCFolder = path.join(self.simulatorsFolder, simFolder, '/data/Library/TCC'); + if(!self.doesFileExist(destinationTCCFolder)){ + fs.mkdir(destinationTCCFolder, 0777); + } + var command = "cp " + self.dbPath + " " + destinationTCCFolder; + logger.info("Running Command: " + command); + shelljs.exec(command, {silent: true, async: false}); + } + }); +} + +ParamedicPermissions.prototype.getDirectories = function(srcpath) { + return fs.readdirSync(srcpath).filter(function(file) { + return fs.statSync(path.join(srcpath, file)).isDirectory(); + }); +} + +ParamedicPermissions.prototype.doesFileExist = function(filePath) { + var fileExists = false; --- End diff -- consider factoring it out into `util` module --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org
[GitHub] cordova-paramedic pull request: Code changes for Collecting Device...
Github user nikhilkh commented on a diff in the pull request: https://github.com/apache/cordova-paramedic/pull/4#discussion_r59643631 --- Diff: lib/ParamedicConfig.js --- @@ -104,4 +117,44 @@ ParamedicConfig.prototype.getTimeout = function() { return DEFAULT_TIMEOUT; }; +ParamedicConfig.prototype.getLogPath = function() { +return this._config.logPath; +}; + +ParamedicConfig.prototype.setLogPath = function(logPath) { +this._config.logPath = logPath; +}; + +ParamedicConfig.prototype.getLogMins = function() { +return this._config.logMins; +}; + +ParamedicConfig.prototype.setLogMins = function(logMins) { +this._config.logMins = logMins; +}; + +ParamedicConfig.prototype.setAppName = function(appName) { +this._config.appName = appName; +}; + +ParamedicConfig.prototype.getAppName = function() { +return this._config.appName; +}; + +ParamedicConfig.prototype.setSimulatorsFolder = function(simulatorsFolder) { +this._config.simulatorsFolder = simulatorsFolder; --- End diff -- Consider using what we do for getting simulator logs. Ideally we should have one way of doing this and not configurable externally. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org
[GitHub] cordova-medic pull request: Adding configuration files to be used ...
Github user nikhilkh commented on the pull request: https://github.com/apache/cordova-medic/pull/91#issuecomment-209688315 Also, looks like some config parameters are coming as command line values and others as config file - it's good to be consistent and have them in one place. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org
[GitHub] cordova-paramedic pull request: Code changes for Collecting Device...
Github user nikhilkh commented on a diff in the pull request: https://github.com/apache/cordova-paramedic/pull/4#discussion_r59642669 --- Diff: lib/ParamedicConfig.js --- @@ -104,4 +117,44 @@ ParamedicConfig.prototype.getTimeout = function() { return DEFAULT_TIMEOUT; }; +ParamedicConfig.prototype.getLogPath = function() { +return this._config.logPath; +}; + +ParamedicConfig.prototype.setLogPath = function(logPath) { +this._config.logPath = logPath; +}; + +ParamedicConfig.prototype.getLogMins = function() { +return this._config.logMins; +}; + +ParamedicConfig.prototype.setLogMins = function(logMins) { +this._config.logMins = logMins; +}; + +ParamedicConfig.prototype.setAppName = function(appName) { +this._config.appName = appName; --- End diff -- Either remove this config parameter & use a default value that you can assume to be true or create the app with the name specified here. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org
[GitHub] cordova-paramedic pull request: Code changes for Collecting Device...
Github user nikhilkh commented on a diff in the pull request: https://github.com/apache/cordova-paramedic/pull/4#discussion_r59641603 --- Diff: lib/ParamedicConfig.js --- @@ -104,4 +117,44 @@ ParamedicConfig.prototype.getTimeout = function() { return DEFAULT_TIMEOUT; }; +ParamedicConfig.prototype.getLogPath = function() { +return this._config.logPath; +}; + +ParamedicConfig.prototype.setLogPath = function(logPath) { +this._config.logPath = logPath; --- End diff -- Consider re-using `outputDir` --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org
[GitHub] cordova-paramedic pull request: Code changes for Collecting Device...
Github user nikhilkh commented on a diff in the pull request: https://github.com/apache/cordova-paramedic/pull/4#discussion_r59641411 --- Diff: lib/ParamedicConfig.js --- @@ -53,7 +58,11 @@ ParamedicConfig.prototype.getReportSavePath = function () { return this._config.reportSavePath; }; -ParamedicConfig.prototype.getShouldCleanUpAfterRun = function () { +ParamedicConfig.prototype.setReportSavePath = function (reportSavePath) { +this._config.reportSavePath = reportSavePath; --- End diff -- Consider renaming this to `testResultsPath` or `testResultsDir` or `outputDir` --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org
[GitHub] cordova-paramedic pull request: Code changes for Collecting Device...
Github user nikhilkh commented on a diff in the pull request: https://github.com/apache/cordova-paramedic/pull/4#discussion_r59639808 --- Diff: lib/ParamedicLog.js --- @@ -0,0 +1,154 @@ +#!/usr/bin/env node + +/* jshint node: true */ + +"use strict"; + +var shelljs = require("shelljs"); +var fs = require("fs"); +var path = require("path"); +var util = require('./utils').utilities; +var logger = require('./utils').logger; + + +function ParamedicLog(platform, appPath, logPath){ +this.platform = platform; +this.appPath = appPath; +this.logPath = logPath; +} + +ParamedicLog.prototype.logIOS = function (appPath) { +// We need to print out the system log for the simulator app. In order to figure +// out the path to that file, we need to find the ID of the simulator running +// mobilespec + +// First, figure out the simulator that ran mobilespec. "cordova run"" just chooses +// the last simulator in this list that starts with the word "iPhone" +shelljs.pushd(appPath); + +var findSimCommand = this.getLocalCLI() + " run --list --emulator | grep ^iPhone | tail -n1"; + +logger.info("running:"); +logger.info("" + findSimCommand); + +var findSimResult = shelljs.exec(findSimCommand, {silent: true, async: false}); + +if (findSimResult.code > 0) { +logger.error("Failed to find simulator we deployed to"); +return; +} + +var split = findSimResult.output.split(", "); + +// Format of the output is "iPhone-6s-Plus, 9.1" +// Extract the device name and the version number +var device = split[0].replace(/-/g, " ").trim(); +var version = split[1].trim(); + +// Next, figure out the ID of the simulator we found +var instrCommand = "instruments -s devices | grep ^iPhone"; +logger.info("running:"); +logger.info("" + instrCommand); + +var instrResult = shelljs.exec(instrCommand, {silent: true, async: false}); + +if (instrResult.code > 0) { +logger.error("Failed to get the list of simulators"); +return; +} + +// This matches () [] +var simIdRegex = /^([a-zA-Z\d ]+) \(([\d.]+)\) \[([a-zA-Z\d\-]*)\]$/; + +var simId = null; +var lines = instrResult.output.split(/\n/); +lines.forEach(function(line) { +var simIdMatch = simIdRegex.exec(line); +if (simIdMatch && simIdMatch.length === 4 && simIdMatch[1] === device && simIdMatch[2] === version) { +simId = encodeURIComponent(simIdMatch[3]); +} +}); + +if (simId) { +// Now we can print out the log file +var logPath = path.join("~", "Library", "Logs", "CoreSimulator", simId, "system.log"); +var logCommand = "cat " + logPath; +this.generateLogs(logCommand); +} else { +logger.error("Failed to find ID of mobilespec simulator"); +} +} + +ParamedicLog.prototype.logWindows = function (appPath, logMins) { +var logScriptPath = path.join(appPath, "platforms", "windows", "cordova", "log.bat"); +if (fs.existsSync(logScriptPath)) { +var mins = util.DEFAULT_LOG_TIME; +if (logMins) { +mins = logMins + util.DEFAULT_LOG_TIME_ADDITIONAL; +} +var logCommand = logScriptPath + " --dump --mins " + mins; +this.generateLogs(logCommand); +} +} + +ParamedicLog.prototype.logAndroid = function (){ +var logCommand = "adb logcat -d"; --- End diff -- Please use "adb logcat -d -v time" --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org
[GitHub] cordova-plugin-camera pull request: CB-10873 Avoid crash due to us...
Github user asfgit closed the pull request at: https://github.com/apache/cordova-plugin-camera/pull/205 --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org
[GitHub] cordova-paramedic pull request: Code changes for Collecting Device...
Github user dblotsky commented on a diff in the pull request: https://github.com/apache/cordova-paramedic/pull/4#discussion_r59638892 --- Diff: lib/paramedic.js --- @@ -105,10 +116,23 @@ ParamedicRunner.prototype.checkPlatformRequirements = function() { logger.normal("cordova-paramedic: checking requirements for platform " + this.config.getPlatformId()); var result = exec('cordova requirements ' + this.config.getPlatformId()); -if (result.code !== 0) +if (result.code !== 0) throw new Error('Platform requirements check has failed!'); }; +ParamedicRunner.prototype.setPermissions = function() { +if(this.config.getPlatformId() === 'ios'){ --- End diff -- Does this function only support iOS? --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org
[GitHub] cordova-plugin-network-information pull request: added code exampl...
GitHub user Mikejo5000 opened a pull request: https://github.com/apache/cordova-plugin-network-information/pull/40 added code examples You can merge this pull request into a Git repository by running: $ git pull https://github.com/Mikejo5000/cordova-plugin-network-information master Alternatively you can review and apply these changes as the patch at: https://github.com/apache/cordova-plugin-network-information/pull/40.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #40 commit 35e2d3ba8336f66b898ecf1e816282766de2fab2 Author: Mikejo5001Date: 2016-04-13T22:42:11Z added code examples --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org
[GitHub] cordova-android pull request: CB-8383 Handle pause event when keep...
Github user infil00p commented on the pull request: https://github.com/apache/cordova-android/pull/288#issuecomment-209673913 This does not work, since all actions on a WebView thread MUST happen on the UI thread. Also, you don't actually start the thread at all and this patch breaks the pause/resume functionality of KeepRunning entirely. Adding a thread just for the sake of adding a thread is generally a bad idea, especially when you have to pause something that runs on the UI thread. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org
[GitHub] cordova-plugin-camera pull request: CB-10873 Avoid crash due to us...
Github user jasongin commented on the pull request: https://github.com/apache/cordova-plugin-camera/pull/205#issuecomment-209669073 LGTM --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org
[GitHub] cordova-paramedic pull request: Code changes for Collecting Device...
Github user dblotsky commented on a diff in the pull request: https://github.com/apache/cordova-paramedic/pull/4#discussion_r59634307 --- Diff: lib/ParamedicPermissions.js --- @@ -0,0 +1,60 @@ +#!/usr/bin/env node + +/* jshint node: true */ +var path= require('path'); +var fs = require('fs'); +var shelljs = require("shelljs"); +var logger = require('./utils').logger; + +function ParamedicPermissions(appName, simulatorsFolder, dbPath) { + this.appName = appName; + this.simulatorsFolder = simulatorsFolder; + this.dbPath = dbPath; +} + +ParamedicPermissions.prototype.updatePermissions = function(serviceList){ + var self = this; + this.getDirectories(self.simulatorsFolder).forEach(function(simFolder){ + var destinationTCCFile = path.join(self.simulatorsFolder, simFolder, '/data/Library/TCC/TCC.db'); + + //Check if the simFolder has TCC.db file in it + if(self.doesFileExist(destinationTCCFile)) { + var sqlite3Command_firstPart = 'sqlite3 ' + destinationTCCFile; + var sqlite3Command_secondPart = ' "insert into access(service, client, client_type, allowed, prompt_count, csreq) values(\''; + var sqlite3Command_lastPart = '\',\'' + self.appName + '\',0,1,1,NULL)"'; + serviceList.forEach(function(service){ + var command = sqlite3Command_firstPart + sqlite3Command_secondPart + service + sqlite3Command_lastPart ; + logger.info("Running Command: " + command); + shelljs.exec(command, {silent: true, async: false}); + }); + } else { + // No TCC.db file exists by default. So, Copy the new TCC.db file + var destinationTCCFolder = path.join(self.simulatorsFolder, simFolder, '/data/Library/TCC'); + if(!self.doesFileExist(destinationTCCFolder)){ + fs.mkdir(destinationTCCFolder, 0777); --- End diff -- Please use 0644 instead of 0777 here. Also, please factor out the permissions setting into a variable. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org
[GitHub] cordova-paramedic pull request: Code changes for Collecting Device...
Github user dblotsky commented on a diff in the pull request: https://github.com/apache/cordova-paramedic/pull/4#discussion_r59633776 --- Diff: lib/ParamedicPermissions.js --- @@ -0,0 +1,60 @@ +#!/usr/bin/env node + +/* jshint node: true */ +var path= require('path'); +var fs = require('fs'); +var shelljs = require("shelljs"); +var logger = require('./utils').logger; + +function ParamedicPermissions(appName, simulatorsFolder, dbPath) { + this.appName = appName; + this.simulatorsFolder = simulatorsFolder; + this.dbPath = dbPath; +} + +ParamedicPermissions.prototype.updatePermissions = function(serviceList){ + var self = this; + this.getDirectories(self.simulatorsFolder).forEach(function(simFolder){ --- End diff -- If a regular for-loop is used here, the `self` pattern can be avoided. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org
[GitHub] cordova-paramedic pull request: Code changes for Collecting Device...
Github user dblotsky commented on a diff in the pull request: https://github.com/apache/cordova-paramedic/pull/4#discussion_r59633588 --- Diff: lib/ParamedicPermissions.js --- @@ -0,0 +1,60 @@ +#!/usr/bin/env node + +/* jshint node: true */ +var path= require('path'); +var fs = require('fs'); +var shelljs = require("shelljs"); +var logger = require('./utils').logger; --- End diff -- Nitpick: spacing. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org
[GitHub] cordova-paramedic pull request: Code changes for Collecting Device...
Github user dblotsky commented on a diff in the pull request: https://github.com/apache/cordova-paramedic/pull/4#discussion_r59633116 --- Diff: lib/ParamedicKill.js --- @@ -0,0 +1,95 @@ +#!/usr/bin/env node + +"use strict"; + +var shelljs = require("shelljs"); +var util= require("./utils").utilities; +var logger = require('./utils').logger; + +function ParamedicKill(platform) { +this.platform = platform; +} + +ParamedicKill.prototype.kill = function() { +// shell config +shelljs.config.fatal = false; +shelljs.config.silent = false; + +// get platform tasks +var platformTasks = this.tasksOnPlatform(this.platform); + +if (platformTasks.length < 1) { +console.warn("no known tasks to kill"); +} + +// kill them +this.killTasks(platformTasks); + +if (this.platform === util.ANDROID) { +this.killAdbServer(); +} + +} + +ParamedicKill.prototype.tasksOnPlatform = function (platformName) { +switch (platformName) { +case util.WINDOWS: +return ["WWAHost.exe", "Xde.exe"]; +case util.IOS: +return ["Simulator"]; --- End diff -- Please add `"iOS Simulator"` to this array. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org
[GitHub] cordova-paramedic pull request: Code changes for Collecting Device...
Github user dblotsky commented on a diff in the pull request: https://github.com/apache/cordova-paramedic/pull/4#discussion_r59632979 --- Diff: lib/ParamedicConfig.js --- @@ -37,7 +37,12 @@ ParamedicConfig.parseFromArguments = function (argv) { endPort: argv.endport || argv.port, externalServerUrl: argv.externalServerUrl, reportSavePath:!!argv.reportSavePath? argv.reportSavePath: undefined, -cleanUpAfterRun: !!argv.cleanUpAfterRun? true: false +cleanUpAfterRun: !!argv.cleanUpAfterRun? true: false, +logPath: !!argv.logPath? argv.logPath: undefined, +logMins: !!argv.logMins? argv.logMins: undefined, +appName: !!argv.appName? argv.appName: undefined, +simulatorsFolder: !!argv.simulatorsFolder? argv.simulatorsFolder: undefined, +tccDbPath: !!argv.tccDbPath? argv.tccDbPath: undefined --- End diff -- Please add defaults for these properties, or set them to `null` instead of `undefined`. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org
[GitHub] cordova-medic pull request: Adding configuration files to be used ...
Github user dblotsky commented on the pull request: https://github.com/apache/cordova-medic/pull/91#issuecomment-209663615 Can these files be `.json` instead of `.js`? --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org
[GitHub] cordova-paramedic pull request: Code changes for Collecting Device...
Github user riknoll commented on a diff in the pull request: https://github.com/apache/cordova-paramedic/pull/4#discussion_r59631368 --- Diff: lib/paramedic.js --- @@ -17,22 +17,30 @@ under the License. */ -var exec = require('./utils').exec, -shell = require('shelljs'), -Server = require('./LocalServer'), -Q = require('q'), -tmp = require('tmp'), -PluginsManager = require('./PluginsManager'), -path = require('path'), -Q = require('q'), -fs = require('fs'), -getReporters = require('./Reporters'), -logger = require('./utils').logger; +var exec= require('./utils').exec; +var shell = require('shelljs'); +var Server = require('./LocalServer'); +var Q = require('q'); +var tmp = require('tmp'); +var path= require('path'); +var Q = require('q'); --- End diff -- Q is being required twice --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org
[GitHub] cordova-paramedic pull request: Code changes for Collecting Device...
Github user riknoll commented on a diff in the pull request: https://github.com/apache/cordova-paramedic/pull/4#discussion_r59630497 --- Diff: lib/ParamedicPermissions.js --- @@ -0,0 +1,60 @@ +#!/usr/bin/env node + +/* jshint node: true */ +var path= require('path'); +var fs = require('fs'); +var shelljs = require("shelljs"); +var logger = require('./utils').logger; + +function ParamedicPermissions(appName, simulatorsFolder, dbPath) { + this.appName = appName; + this.simulatorsFolder = simulatorsFolder; + this.dbPath = dbPath; +} + +ParamedicPermissions.prototype.updatePermissions = function(serviceList){ + var self = this; + this.getDirectories(self.simulatorsFolder).forEach(function(simFolder){ + var destinationTCCFile = path.join(self.simulatorsFolder, simFolder, '/data/Library/TCC/TCC.db'); + + //Check if the simFolder has TCC.db file in it + if(self.doesFileExist(destinationTCCFile)) { + var sqlite3Command_firstPart = 'sqlite3 ' + destinationTCCFile; --- End diff -- Why split this variable into three parts like this? --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org
[GitHub] cordova-medic pull request: Adding configuration files to be used ...
GitHub user sarangan12 opened a pull request: https://github.com/apache/cordova-medic/pull/91 Adding configuration files to be used in Jenkins CI These are the configuration files & permissions DB file that will be used for the new CI process. @omefire @riknoll @dblotsky @nikhilkh Can you please review and merge this PR? You can merge this pull request into a Git repository by running: $ git pull https://github.com/sarangan12/cordova-medic JenkinsCI Alternatively you can review and apply these changes as the patch at: https://github.com/apache/cordova-medic/pull/91.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #91 commit eb65b1e472262daa31cdf4787b1bbbd0169f655f Author: Sarangan RajamanickamDate: 2016-02-24T21:45:00Z Adding configuration files to be used in Jenkins CI --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org
[GitHub] cordova-plugin-camera pull request: Added Sample section to the Ca...
Github user riknoll commented on a diff in the pull request: https://github.com/apache/cordova-plugin-camera/pull/203#discussion_r59614155 --- Diff: jsdoc2md/TEMPLATE.md --- @@ -203,3 +203,194 @@ Tizen only supports a `destinationType` of [web_activities]: https://hacks.mozilla.org/2013/01/introducing-web-activities/ [wp8_bug]: https://issues.apache.org/jira/browse/CB-2083 [msdn_wp8_docs]: http://msdn.microsoft.com/en-us/library/windowsphone/develop/hh394006.aspx + +## Sample: Take Pictures, Select Pictures from the Picture Library, and Get Thumbnails + +The Camera plugin allows you to do things like open the device's Camera app and take a picture, or open the file picker and select one. The code snippets in this section demonstrate different tasks including: + +* Open the Camera app and [take a Picture](#takePicture) +* Take a picture and [return thumbnails](#getThumbnails) (resized picture) +* Take a picture and [generate a FileEntry object](#convert) +* [Select a file](#selectFile) from the picture library +* Select a JPEG image and [return thumbnails](#getFileThumbnails) (resized image) +* Select an image and [generate a FileEntry object](#convert) + +## Take a Picture + +Before you can take a picture, you need to set some Camera plugin options to pass into the Camera plugin's `getPicture` function. Here is a common set of recommendations. In this example, you create the object that you will use for the Camera options, and set the `sourceType` dynamically to support both the Camera app and the file picker. + +```js +function setOptions(srcType) { +var options = { +// Some common settings are 20, 50, and 100 +quality: 50, +destinationType: Camera.DestinationType.FILE_URI, +// In this app, dynamically set the picture source, Camera or photo gallery +sourceType: srcType, +encodingType: Camera.EncodingType.JPEG, +mediaType: Camera.MediaType.PICTURE, +allowEdit: true, +correctOrientation: true //Corrects Android orientation quirks +} +return options; +} +``` + +Typically, you want to use a FILE_URI instead of a DATA_URL to avoid most memory issues. JPEG is the recommended encoding type for Android. + +You take a picture by passing in the options object to `getPicture`, which takes a CameraOptions object as the third argument. When you call `setOptions`, pass `Camera.PictureSourceType.CAMERA` as the picture source. + +```js +function openCamera(selection) { + +var srcType = Camera.PictureSourceType.CAMERA; +var options = setOptions(srcType); +var func = copyToFile; + +navigator.camera.getPicture(function cameraSuccess(imageUri) { + +displayImage(imageUri); +// You may choose to copy the picture, save it somewhere, or upload. +func(imageUri); + +}, function cameraError(error) { +console.debug("Unable to obtain picture: " + error, "app"); + +}, options); +} +``` + +Once you take the picture, you can display it or do something else. In this example, call the app's `displayImage` function from the preceding code. + +```js +function displayImage(imgUri) { + +var elem = document.getElementById('imageFile'); +elem.src = imgUri; +} +``` + +## Take a Picture and Return Thumbnails (Resize the Picture) + +To get smaller images, you can return a resized image by passing both `targetHeight` and `targetWidth` values with your CameraOptions object. In this example, you resize the returned image to fit in a 100px by 100px box (the aspect ratio is maintained, so 100px is either the height or width, whichever is greater in the source). + +```js +function openCamera(selection) { + +var srcType = Camera.PictureSourceType.CAMERA; +var options = setOptions(srcType); +var func = copyToFile; + +if (selection == "camera-thmb") { +options.targetHeight = 100; +options.targetWidth = 100; +} + +navigator.camera.getPicture(function cameraSuccess(imageUri) { + +// Do something + +}, function cameraError(error) { +console.debug("Unable to obtain picture: " + error, "app"); + +}, options); +} +``` + +## Select a File from the Picture Library + +When selecting a file using the file picker, you also need to set the CameraOptions object. In this example, set the `sourceType` to `Camera.PictureSourceType.SAVEDPHOTOALBUM`. To open the file picker, call `getPicture` just as you did in the previous example, passing in the success and error callbacks along with CameraOptions object. + +```js
[GitHub] cordova-lib pull request: CB-11022 Improve performance of `cordova...
Github user jasongin commented on the pull request: https://github.com/apache/cordova-lib/pull/423#issuecomment-209620711 Yes, LGTM --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org
[GitHub] cordova-lib pull request: CB-11022 Improve performance of `cordova...
Github user vladimir-kotikov commented on the pull request: https://github.com/apache/cordova-lib/pull/423#issuecomment-209607020 @jasongin, i've added tests to cover the new logic. Is this PR ready to go? --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org
[GitHub] cordova-medic pull request: Add medic command to download BuildBot...
Github user dblotsky commented on a diff in the pull request: https://github.com/apache/cordova-medic/pull/87#discussion_r59607181 --- Diff: medic/medic-downloadlogs.js --- @@ -0,0 +1,80 @@ +var path = require('path'), +fs = require('fs'), +https = require('https'), +optimist = require('optimist'); +q = require('Q'), +mkdirp = require('mkdirp') +util = require('util'); + +var SERVER = "https://ci.apache.org;; +var BUILDERS = ["cordova-windows-store8.1", "cordova-ios", "cordova-windows-phone8.1", "cordova-android-osx","cordova-android-win"]; +//var BUILDERS = ["cordova-windows-store8.1"]; +var STEPS = ["running-tests", "gathering-logs", "getting-test-results"]; + +function downloadLogs(outputDir) { +var counter = 0; +var builderPromises = BUILDERS.map(function(builder) { +//https://ci.apache.org/json/builders/cordova-ios/builds/_all +var buildInfoFile = path.join(outputDir, builder + ".json"); +var buildInfoUrl = util.format("%s/json/builders/%s/builds/_all", SERVER, builder); +return download(buildInfoUrl, buildInfoFile).then(function() { +var buildInfo = JSON.parse(fs.readFileSync(buildInfoFile)); +var promises = []; +for(var buildNumber in buildInfo) { +var steps = buildInfo[buildNumber].steps.filter( +function(step) { +return STEPS.indexOf(step.name) !== -1 && step.logs && step.logs.length > 0; +}); +steps.forEach(function(step) { +var filename = util.format("%s_%s_%s_stdio.log", builder, buildNumber, step.name); +if(step.logs[0].length !== 2) { +throw "Unexpected build info schema"; --- End diff -- Please throw an `Error` here. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org
[GitHub] cordova-medic pull request: Add medic command to download BuildBot...
Github user dblotsky commented on a diff in the pull request: https://github.com/apache/cordova-medic/pull/87#discussion_r59607150 --- Diff: medic/medic-downloadlogs.js --- @@ -0,0 +1,80 @@ +var path = require('path'), +fs = require('fs'), +https = require('https'), +optimist = require('optimist'); +q = require('Q'), +mkdirp = require('mkdirp') +util = require('util'); + +var SERVER = "https://ci.apache.org;; +var BUILDERS = ["cordova-windows-store8.1", "cordova-ios", "cordova-windows-phone8.1", "cordova-android-osx","cordova-android-win"]; +//var BUILDERS = ["cordova-windows-store8.1"]; +var STEPS = ["running-tests", "gathering-logs", "getting-test-results"]; + +function downloadLogs(outputDir) { +var counter = 0; +var builderPromises = BUILDERS.map(function(builder) { +//https://ci.apache.org/json/builders/cordova-ios/builds/_all +var buildInfoFile = path.join(outputDir, builder + ".json"); +var buildInfoUrl = util.format("%s/json/builders/%s/builds/_all", SERVER, builder); +return download(buildInfoUrl, buildInfoFile).then(function() { +var buildInfo = JSON.parse(fs.readFileSync(buildInfoFile)); +var promises = []; +for(var buildNumber in buildInfo) { +var steps = buildInfo[buildNumber].steps.filter( +function(step) { +return STEPS.indexOf(step.name) !== -1 && step.logs && step.logs.length > 0; +}); +steps.forEach(function(step) { --- End diff -- This anonymous function and the one above are done in different styles. Please format them to be consistent with the others in the file. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org
[GitHub] cordova-medic pull request: Add medic command to download BuildBot...
Github user dblotsky commented on a diff in the pull request: https://github.com/apache/cordova-medic/pull/87#discussion_r59606984 --- Diff: medic/medic-downloadlogs.js --- @@ -0,0 +1,80 @@ +var path = require('path'), +fs = require('fs'), +https = require('https'), +optimist = require('optimist'); +q = require('Q'), +mkdirp = require('mkdirp') +util = require('util'); + +var SERVER = "https://ci.apache.org;; +var BUILDERS = ["cordova-windows-store8.1", "cordova-ios", "cordova-windows-phone8.1", "cordova-android-osx","cordova-android-win"]; +//var BUILDERS = ["cordova-windows-store8.1"]; +var STEPS = ["running-tests", "gathering-logs", "getting-test-results"]; + +function downloadLogs(outputDir) { +var counter = 0; +var builderPromises = BUILDERS.map(function(builder) { --- End diff -- Can this be done in a `for`-loop instead of `map`? --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org
[GitHub] cordova-medic pull request: Add medic command to download BuildBot...
Github user dblotsky commented on a diff in the pull request: https://github.com/apache/cordova-medic/pull/87#discussion_r59606834 --- Diff: medic/medic-downloadlogs.js --- @@ -0,0 +1,80 @@ +var path = require('path'), +fs = require('fs'), +https = require('https'), +optimist = require('optimist'); +q = require('Q'), +mkdirp = require('mkdirp') +util = require('util'); + +var SERVER = "https://ci.apache.org;; +var BUILDERS = ["cordova-windows-store8.1", "cordova-ios", "cordova-windows-phone8.1", "cordova-android-osx","cordova-android-win"]; +//var BUILDERS = ["cordova-windows-store8.1"]; --- End diff -- If this content is unnecessary, please remove it. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org
[GitHub] cordova-medic pull request: Add medic command to download BuildBot...
Github user dblotsky commented on a diff in the pull request: https://github.com/apache/cordova-medic/pull/87#discussion_r59606560 --- Diff: medic/medic-downloadlogs.js --- @@ -0,0 +1,80 @@ +var path = require('path'), +fs = require('fs'), +https = require('https'), +optimist = require('optimist'); +q = require('Q'), +mkdirp = require('mkdirp') +util = require('util'); + +var SERVER = "https://ci.apache.org;; +var BUILDERS = ["cordova-windows-store8.1", "cordova-ios", "cordova-windows-phone8.1", "cordova-android-osx","cordova-android-win"]; +//var BUILDERS = ["cordova-windows-store8.1"]; +var STEPS = ["running-tests", "gathering-logs", "getting-test-results"]; + +function downloadLogs(outputDir) { +var counter = 0; +var builderPromises = BUILDERS.map(function(builder) { +//https://ci.apache.org/json/builders/cordova-ios/builds/_all +var buildInfoFile = path.join(outputDir, builder + ".json"); +var buildInfoUrl = util.format("%s/json/builders/%s/builds/_all", SERVER, builder); +return download(buildInfoUrl, buildInfoFile).then(function() { +var buildInfo = JSON.parse(fs.readFileSync(buildInfoFile)); +var promises = []; +for(var buildNumber in buildInfo) { +var steps = buildInfo[buildNumber].steps.filter( +function(step) { +return STEPS.indexOf(step.name) !== -1 && step.logs && step.logs.length > 0; +}); +steps.forEach(function(step) { +var filename = util.format("%s_%s_%s_stdio.log", builder, buildNumber, step.name); +if(step.logs[0].length !== 2) { +throw "Unexpected build info schema"; +} +counter++; +promises.push(download(step.logs[0][1] + "/text", path.join(outputDir, filename))); +}); +} +return q.all(promises); +}); +}); + +q.all(builderPromises).done(function() { +console.log("Downloaded " + counter + " logs to " + outputDir); +}, function(error) { +console.log("Error: " + error); +}); +} + +function download(url, filename){ +var defer = q.defer(); +https.get(url, function(res) { +res.setEncoding('utf-8'); +if (res.statusCode == 200) { +var file = fs.createWriteStream(filename); +res.pipe(file); +file.on('finish', function() { + console.log(url + " -> " + filename); + file.end(); + defer.resolve(); +}); +} else { +defer.reject(url + " Status code: " + res.statusCode); +} +}).on('error', function(error) { +defer.reject(url + " Error: " + error); +}); +return defer.promise; +} --- End diff -- Please comment and space out this code. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org
[GitHub] cordova-plugin-camera pull request: Added Sample section to the Ca...
Github user Mikejo5000 commented on a diff in the pull request: https://github.com/apache/cordova-plugin-camera/pull/203#discussion_r59604648 --- Diff: jsdoc2md/TEMPLATE.md --- @@ -203,3 +203,194 @@ Tizen only supports a `destinationType` of [web_activities]: https://hacks.mozilla.org/2013/01/introducing-web-activities/ [wp8_bug]: https://issues.apache.org/jira/browse/CB-2083 [msdn_wp8_docs]: http://msdn.microsoft.com/en-us/library/windowsphone/develop/hh394006.aspx + +## Sample: Take Pictures, Select Pictures from the Picture Library, and Get Thumbnails + +The Camera plugin allows you to do things like open the device's Camera app and take a picture, or open the file picker and select one. The code snippets in this section demonstrate different tasks including: + +* Open the Camera app and [take a Picture](#takePicture) +* Take a picture and [return thumbnails](#getThumbnails) (resized picture) +* Take a picture and [generate a FileEntry object](#convert) +* [Select a file](#selectFile) from the picture library +* Select a JPEG image and [return thumbnails](#getFileThumbnails) (resized image) +* Select an image and [generate a FileEntry object](#convert) + +## Take a Picture + +Before you can take a picture, you need to set some Camera plugin options to pass into the Camera plugin's `getPicture` function. Here is a common set of recommendations. In this example, you create the object that you will use for the Camera options, and set the `sourceType` dynamically to support both the Camera app and the file picker. + +```js +function setOptions(srcType) { +var options = { +// Some common settings are 20, 50, and 100 +quality: 50, +destinationType: Camera.DestinationType.FILE_URI, +// In this app, dynamically set the picture source, Camera or photo gallery +sourceType: srcType, +encodingType: Camera.EncodingType.JPEG, +mediaType: Camera.MediaType.PICTURE, +allowEdit: true, +correctOrientation: true //Corrects Android orientation quirks +} +return options; +} +``` + +Typically, you want to use a FILE_URI instead of a DATA_URL to avoid most memory issues. JPEG is the recommended encoding type for Android. + +You take a picture by passing in the options object to `getPicture`, which takes a CameraOptions object as the third argument. When you call `setOptions`, pass `Camera.PictureSourceType.CAMERA` as the picture source. + +```js +function openCamera(selection) { + +var srcType = Camera.PictureSourceType.CAMERA; +var options = setOptions(srcType); +var func = copyToFile; + +navigator.camera.getPicture(function cameraSuccess(imageUri) { + +displayImage(imageUri); +// You may choose to copy the picture, save it somewhere, or upload. +func(imageUri); + +}, function cameraError(error) { +console.debug("Unable to obtain picture: " + error, "app"); + +}, options); +} +``` + +Once you take the picture, you can display it or do something else. In this example, call the app's `displayImage` function from the preceding code. + +```js +function displayImage(imgUri) { + +var elem = document.getElementById('imageFile'); +elem.src = imgUri; +} +``` + +## Take a Picture and Return Thumbnails (Resize the Picture) + +To get smaller images, you can return a resized image by passing both `targetHeight` and `targetWidth` values with your CameraOptions object. In this example, you resize the returned image to fit in a 100px by 100px box (the aspect ratio is maintained, so 100px is either the height or width, whichever is greater in the source). + +```js +function openCamera(selection) { + +var srcType = Camera.PictureSourceType.CAMERA; +var options = setOptions(srcType); +var func = copyToFile; + +if (selection == "camera-thmb") { +options.targetHeight = 100; +options.targetWidth = 100; +} + +navigator.camera.getPicture(function cameraSuccess(imageUri) { + +// Do something + +}, function cameraError(error) { +console.debug("Unable to obtain picture: " + error, "app"); + +}, options); +} +``` + +## Select a File from the Picture Library + +When selecting a file using the file picker, you also need to set the CameraOptions object. In this example, set the `sourceType` to `Camera.PictureSourceType.SAVEDPHOTOALBUM`. To open the file picker, call `getPicture` just as you did in the previous example, passing in the success and error callbacks along with CameraOptions object. +
[GitHub] cordova-plugin-camera pull request: Added Sample section to the Ca...
Github user riknoll commented on a diff in the pull request: https://github.com/apache/cordova-plugin-camera/pull/203#discussion_r59602729 --- Diff: jsdoc2md/TEMPLATE.md --- @@ -203,3 +203,194 @@ Tizen only supports a `destinationType` of [web_activities]: https://hacks.mozilla.org/2013/01/introducing-web-activities/ [wp8_bug]: https://issues.apache.org/jira/browse/CB-2083 [msdn_wp8_docs]: http://msdn.microsoft.com/en-us/library/windowsphone/develop/hh394006.aspx + +## Sample: Take Pictures, Select Pictures from the Picture Library, and Get Thumbnails + +The Camera plugin allows you to do things like open the device's Camera app and take a picture, or open the file picker and select one. The code snippets in this section demonstrate different tasks including: + +* Open the Camera app and [take a Picture](#takePicture) +* Take a picture and [return thumbnails](#getThumbnails) (resized picture) +* Take a picture and [generate a FileEntry object](#convert) +* [Select a file](#selectFile) from the picture library +* Select a JPEG image and [return thumbnails](#getFileThumbnails) (resized image) +* Select an image and [generate a FileEntry object](#convert) + +## Take a Picture + +Before you can take a picture, you need to set some Camera plugin options to pass into the Camera plugin's `getPicture` function. Here is a common set of recommendations. In this example, you create the object that you will use for the Camera options, and set the `sourceType` dynamically to support both the Camera app and the file picker. + +```js +function setOptions(srcType) { +var options = { +// Some common settings are 20, 50, and 100 +quality: 50, +destinationType: Camera.DestinationType.FILE_URI, +// In this app, dynamically set the picture source, Camera or photo gallery +sourceType: srcType, +encodingType: Camera.EncodingType.JPEG, +mediaType: Camera.MediaType.PICTURE, +allowEdit: true, +correctOrientation: true //Corrects Android orientation quirks +} +return options; +} +``` + +Typically, you want to use a FILE_URI instead of a DATA_URL to avoid most memory issues. JPEG is the recommended encoding type for Android. + +You take a picture by passing in the options object to `getPicture`, which takes a CameraOptions object as the third argument. When you call `setOptions`, pass `Camera.PictureSourceType.CAMERA` as the picture source. + +```js +function openCamera(selection) { + +var srcType = Camera.PictureSourceType.CAMERA; +var options = setOptions(srcType); +var func = copyToFile; + +navigator.camera.getPicture(function cameraSuccess(imageUri) { + +displayImage(imageUri); +// You may choose to copy the picture, save it somewhere, or upload. +func(imageUri); + +}, function cameraError(error) { +console.debug("Unable to obtain picture: " + error, "app"); + +}, options); +} +``` + +Once you take the picture, you can display it or do something else. In this example, call the app's `displayImage` function from the preceding code. + +```js +function displayImage(imgUri) { + +var elem = document.getElementById('imageFile'); +elem.src = imgUri; +} +``` + +## Take a Picture and Return Thumbnails (Resize the Picture) + +To get smaller images, you can return a resized image by passing both `targetHeight` and `targetWidth` values with your CameraOptions object. In this example, you resize the returned image to fit in a 100px by 100px box (the aspect ratio is maintained, so 100px is either the height or width, whichever is greater in the source). + +```js +function openCamera(selection) { + +var srcType = Camera.PictureSourceType.CAMERA; +var options = setOptions(srcType); +var func = copyToFile; + +if (selection == "camera-thmb") { +options.targetHeight = 100; +options.targetWidth = 100; +} + +navigator.camera.getPicture(function cameraSuccess(imageUri) { + +// Do something + +}, function cameraError(error) { +console.debug("Unable to obtain picture: " + error, "app"); + +}, options); +} +``` + +## Select a File from the Picture Library + +When selecting a file using the file picker, you also need to set the CameraOptions object. In this example, set the `sourceType` to `Camera.PictureSourceType.SAVEDPHOTOALBUM`. To open the file picker, call `getPicture` just as you did in the previous example, passing in the success and error callbacks along with CameraOptions object. + +```js
[GitHub] cordova-plugin-camera pull request: Added Sample section to the Ca...
Github user riknoll commented on a diff in the pull request: https://github.com/apache/cordova-plugin-camera/pull/203#discussion_r59602299 --- Diff: jsdoc2md/TEMPLATE.md --- @@ -203,3 +203,194 @@ Tizen only supports a `destinationType` of [web_activities]: https://hacks.mozilla.org/2013/01/introducing-web-activities/ [wp8_bug]: https://issues.apache.org/jira/browse/CB-2083 [msdn_wp8_docs]: http://msdn.microsoft.com/en-us/library/windowsphone/develop/hh394006.aspx + +## Sample: Take Pictures, Select Pictures from the Picture Library, and Get Thumbnails + +The Camera plugin allows you to do things like open the device's Camera app and take a picture, or open the file picker and select one. The code snippets in this section demonstrate different tasks including: + +* Open the Camera app and [take a Picture](#takePicture) +* Take a picture and [return thumbnails](#getThumbnails) (resized picture) +* Take a picture and [generate a FileEntry object](#convert) +* [Select a file](#selectFile) from the picture library +* Select a JPEG image and [return thumbnails](#getFileThumbnails) (resized image) +* Select an image and [generate a FileEntry object](#convert) + +## Take a Picture + +Before you can take a picture, you need to set some Camera plugin options to pass into the Camera plugin's `getPicture` function. Here is a common set of recommendations. In this example, you create the object that you will use for the Camera options, and set the `sourceType` dynamically to support both the Camera app and the file picker. + +```js +function setOptions(srcType) { +var options = { +// Some common settings are 20, 50, and 100 +quality: 50, +destinationType: Camera.DestinationType.FILE_URI, +// In this app, dynamically set the picture source, Camera or photo gallery +sourceType: srcType, +encodingType: Camera.EncodingType.JPEG, +mediaType: Camera.MediaType.PICTURE, +allowEdit: true, +correctOrientation: true //Corrects Android orientation quirks +} +return options; +} +``` + +Typically, you want to use a FILE_URI instead of a DATA_URL to avoid most memory issues. JPEG is the recommended encoding type for Android. + +You take a picture by passing in the options object to `getPicture`, which takes a CameraOptions object as the third argument. When you call `setOptions`, pass `Camera.PictureSourceType.CAMERA` as the picture source. + +```js +function openCamera(selection) { + +var srcType = Camera.PictureSourceType.CAMERA; +var options = setOptions(srcType); +var func = copyToFile; + +navigator.camera.getPicture(function cameraSuccess(imageUri) { + +displayImage(imageUri); +// You may choose to copy the picture, save it somewhere, or upload. +func(imageUri); + +}, function cameraError(error) { +console.debug("Unable to obtain picture: " + error, "app"); + +}, options); +} +``` + +Once you take the picture, you can display it or do something else. In this example, call the app's `displayImage` function from the preceding code. + +```js +function displayImage(imgUri) { + +var elem = document.getElementById('imageFile'); +elem.src = imgUri; +} +``` + +## Take a Picture and Return Thumbnails (Resize the Picture) + +To get smaller images, you can return a resized image by passing both `targetHeight` and `targetWidth` values with your CameraOptions object. In this example, you resize the returned image to fit in a 100px by 100px box (the aspect ratio is maintained, so 100px is either the height or width, whichever is greater in the source). + +```js +function openCamera(selection) { + +var srcType = Camera.PictureSourceType.CAMERA; +var options = setOptions(srcType); +var func = copyToFile; + +if (selection == "camera-thmb") { +options.targetHeight = 100; +options.targetWidth = 100; +} + +navigator.camera.getPicture(function cameraSuccess(imageUri) { + +// Do something + +}, function cameraError(error) { +console.debug("Unable to obtain picture: " + error, "app"); + +}, options); +} +``` + +## Select a File from the Picture Library + +When selecting a file using the file picker, you also need to set the CameraOptions object. In this example, set the `sourceType` to `Camera.PictureSourceType.SAVEDPHOTOALBUM`. To open the file picker, call `getPicture` just as you did in the previous example, passing in the success and error callbacks along with CameraOptions object. + +```js
[GitHub] cordova-lib pull request: CB-10986: Adding support for scoped npm ...
Github user riknoll commented on the pull request: https://github.com/apache/cordova-lib/pull/425#issuecomment-209586254 No problem, and thanks for testing @dpogue! --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org
[GitHub] cordova-lib pull request: CB-10986: Adding support for scoped npm ...
Github user asfgit closed the pull request at: https://github.com/apache/cordova-lib/pull/425 --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org
[GitHub] cordova-docs pull request: CB-11070 Document SplashScreenBackgroun...
Github user nikhilkh commented on the pull request: https://github.com/apache/cordova-docs/pull/578#issuecomment-209584856 LGTM. @rakatyal, @omefire for FYI --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org
[GitHub] cordova-plugin-camera pull request: Added Sample section to the Ca...
Github user Mikejo5000 commented on a diff in the pull request: https://github.com/apache/cordova-plugin-camera/pull/203#discussion_r59600615 --- Diff: jsdoc2md/TEMPLATE.md --- @@ -203,3 +203,194 @@ Tizen only supports a `destinationType` of [web_activities]: https://hacks.mozilla.org/2013/01/introducing-web-activities/ [wp8_bug]: https://issues.apache.org/jira/browse/CB-2083 [msdn_wp8_docs]: http://msdn.microsoft.com/en-us/library/windowsphone/develop/hh394006.aspx + +## Sample: Take Pictures, Select Pictures from the Picture Library, and Get Thumbnails + +The Camera plugin allows you to do things like open the device's Camera app and take a picture, or open the file picker and select one. The code snippets in this section demonstrate different tasks including: + +* Open the Camera app and [take a Picture](#takePicture) +* Take a picture and [return thumbnails](#getThumbnails) (resized picture) +* Take a picture and [generate a FileEntry object](#convert) +* [Select a file](#selectFile) from the picture library +* Select a JPEG image and [return thumbnails](#getFileThumbnails) (resized image) +* Select an image and [generate a FileEntry object](#convert) + +## Take a Picture + +Before you can take a picture, you need to set some Camera plugin options to pass into the Camera plugin's `getPicture` function. Here is a common set of recommendations. In this example, you create the object that you will use for the Camera options, and set the `sourceType` dynamically to support both the Camera app and the file picker. + +```js +function setOptions(srcType) { +var options = { +// Some common settings are 20, 50, and 100 +quality: 50, +destinationType: Camera.DestinationType.FILE_URI, +// In this app, dynamically set the picture source, Camera or photo gallery +sourceType: srcType, +encodingType: Camera.EncodingType.JPEG, +mediaType: Camera.MediaType.PICTURE, +allowEdit: true, +correctOrientation: true //Corrects Android orientation quirks +} +return options; +} +``` + +Typically, you want to use a FILE_URI instead of a DATA_URL to avoid most memory issues. JPEG is the recommended encoding type for Android. + +You take a picture by passing in the options object to `getPicture`, which takes a CameraOptions object as the third argument. When you call `setOptions`, pass `Camera.PictureSourceType.CAMERA` as the picture source. + +```js +function openCamera(selection) { + +var srcType = Camera.PictureSourceType.CAMERA; +var options = setOptions(srcType); +var func = copyToFile; + +navigator.camera.getPicture(function cameraSuccess(imageUri) { + +displayImage(imageUri); +// You may choose to copy the picture, save it somewhere, or upload. +func(imageUri); + +}, function cameraError(error) { +console.debug("Unable to obtain picture: " + error, "app"); + +}, options); +} +``` + +Once you take the picture, you can display it or do something else. In this example, call the app's `displayImage` function from the preceding code. + +```js +function displayImage(imgUri) { + +var elem = document.getElementById('imageFile'); +elem.src = imgUri; +} +``` + +## Take a Picture and Return Thumbnails (Resize the Picture) + +To get smaller images, you can return a resized image by passing both `targetHeight` and `targetWidth` values with your CameraOptions object. In this example, you resize the returned image to fit in a 100px by 100px box (the aspect ratio is maintained, so 100px is either the height or width, whichever is greater in the source). + +```js +function openCamera(selection) { + +var srcType = Camera.PictureSourceType.CAMERA; +var options = setOptions(srcType); +var func = copyToFile; + +if (selection == "camera-thmb") { +options.targetHeight = 100; +options.targetWidth = 100; +} + +navigator.camera.getPicture(function cameraSuccess(imageUri) { + +// Do something + +}, function cameraError(error) { +console.debug("Unable to obtain picture: " + error, "app"); + +}, options); +} +``` + +## Select a File from the Picture Library + +When selecting a file using the file picker, you also need to set the CameraOptions object. In this example, set the `sourceType` to `Camera.PictureSourceType.SAVEDPHOTOALBUM`. To open the file picker, call `getPicture` just as you did in the previous example, passing in the success and error callbacks along with CameraOptions object. +
[GitHub] cordova-lib pull request: CB-10986: Adding support for scoped npm ...
Github user dpogue commented on the pull request: https://github.com/apache/cordova-lib/pull/425#issuecomment-209579652 :+1: I've tested and this seems to be working properly. Thanks @riknoll! --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org
[GitHub] cordova-cli pull request: CB-11042: Add cordova run option to skip...
Github user omefire commented on the pull request: https://github.com/apache/cordova-cli/pull/244#issuecomment-209579313 ok, now I get it. apparently, the website content will be generated from this readme.md, so we're fine. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org
[GitHub] cordova-cli pull request: CB-11042: Add cordova run option to skip...
Github user omefire commented on the pull request: https://github.com/apache/cordova-cli/pull/244#issuecomment-209579344 LGTM! --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org
[GitHub] cordova-cli pull request: CB-11042: Add cordova run option to skip...
Github user nikhilkh commented on a diff in the pull request: https://github.com/apache/cordova-cli/pull/244#discussion_r59599203 --- Diff: doc/readme.md --- @@ -464,29 +464,31 @@ cordova build [ [...]] ### Synopsis -Prepares, builds (unless `--nobuild` is specified) and deploys app on specified platform devices/emulators. If a device is connected it will be used, unless an eligible emulator is already running. +Prepares, builds, and deploys app on specified platform devices/emulators. If a device is connected it will be used, unless an eligible emulator is already running. ###Syntax ```bash cordova run [ [...]] -[--list | --nobuild ] +[--list | --debug | --release] +[--noprepare] [--nobuild] [--device|--emulator|--target=] [--buildConfig=] [--browserify] [-- ] ``` -| Option | Description -||-- +| Option | Description +|-|-- | ` [..]` | Platform name(s) to run. If not specified, all platforms are run. -|--nobuild | Skip building -|--debug | Deploy a debug build. This is the default behavior unless `--release` is specified. -|--release | Deploy a release build -|--device| Deploy to a device -|--emulator | Deploy to an emulator -|--target| Deploy to a specific target emulator/device. Use `--list` to display target options -| --list | Lists available targets. Displays both device and emulator deployment targets unless specified +| --list | Lists available targets. Displays both device and emulator deployment targets unless specified +| --debug | Deploy a debug build. This is the default behavior unless `--release` is specified. +| --release | Deploy a release build +| --noprepare | Skip preparing --- End diff -- One slight caveat - just mention something like: [Available in cordova CLI 6.2 and above] Since we have a 6.x version of the docs - new features, flags need to be versioned inline. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org
[GitHub] cordova-cli pull request: CB-11042: Add cordova run option to skip...
Github user nikhilkh commented on the pull request: https://github.com/apache/cordova-cli/pull/244#issuecomment-209578347 We update website content regularly and don't need a JIRA. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org
[GitHub] cordova-cli pull request: CB-11042: Add cordova run option to skip...
Github user omefire commented on the pull request: https://github.com/apache/cordova-cli/pull/244#issuecomment-209578035 @nikhilkh , if that's the case don't we need a JIRA to track updating the docs website ? --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org
[GitHub] cordova-cli pull request: CB-11042: Add cordova run option to skip...
Github user nikhilkh commented on the pull request: https://github.com/apache/cordova-cli/pull/244#issuecomment-209577843 LGTM --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org
[GitHub] cordova-plugin-camera pull request: CB-10873 Avoid crash due to us...
Github user omefire commented on a diff in the pull request: https://github.com/apache/cordova-plugin-camera/pull/205#discussion_r59598321 --- Diff: src/ios/CDVCamera.m --- @@ -358,6 +358,7 @@ - (NSData*)processImage:(UIImage*)image info:(NSDictionary*)info options:(CDVPic // use image unedited as requested , don't resize data = UIImageJPEGRepresentation(image, 1.0); } else { +data = UIImageJPEGRepresentation(image, [options.quality floatValue] / 100.0f); if (options.usesGeolocation) { --- End diff -- @jasongin I suspect it might not be correct behavior. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org
[GitHub] cordova-cli pull request: CB-11042: Add cordova run option to skip...
Github user nikhilkh commented on the pull request: https://github.com/apache/cordova-cli/pull/244#issuecomment-209576907 Updating docs\readme.md should be sufficient - docs website publishing should take care of updating the version in cordova-docs. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org
[GitHub] cordova-plugin-camera pull request: CB-10873 Avoid crash due to us...
Github user omefire commented on the pull request: https://github.com/apache/cordova-plugin-camera/pull/205#issuecomment-209575841 I agree on an appium test to cover this scenario, but I think it should go further than just making sure no crash happens and also validate that the EXIF header is correctly written: - https://github.com/gomfunkel/node-exif I have the feeling that code path might not be well tested/exercised. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org
[GitHub] cordova-cli pull request: CB-11042: Add cordova run option to skip...
Github user omefire commented on the pull request: https://github.com/apache/cordova-cli/pull/244#issuecomment-209572705 It's located elsewhere, in the cordova-docs repo: https://github.com/apache/cordova-docs/blob/1f35df99b7cf77aa5889c2ecb9a3c3ab71542ee6/www/docs/en/6.x/reference/cordova-cli/index.md --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org
[GitHub] cordova-cli pull request: CB-11042: Add cordova run option to skip...
Github user jasongin commented on the pull request: https://github.com/apache/cordova-cli/pull/244#issuecomment-209571650 @omefire Isn't that covered by the update to docs/readme.md in this change? Or is it duplicated somewhere else? --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org
[GitHub] cordova-plugin-test-framework pull request: Add spec started/compl...
GitHub user nikhilkh opened a pull request: https://github.com/apache/cordova-plugin-test-framework/pull/19 Add spec started/completed log This will help in debugging and provides a start/stop marker in native logs. You can merge this pull request into a Git repository by running: $ git pull https://github.com/MSOpenTech/cordova-plugin-test-framework enhanceReporter Alternatively you can review and apply these changes as the patch at: https://github.com/apache/cordova-plugin-test-framework/pull/19.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #19 commit 4918d7a8f48c7c28342c4ff5a711322f9cfafcda Author: Nikhil KhandelwalDate: 2016-04-13T18:04:41Z Add spec started/completed log --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org
[GitHub] cordova-medic pull request: Ensure Android adb logs have timestamp
Github user sarangan12 commented on the pull request: https://github.com/apache/cordova-medic/pull/90#issuecomment-209570475 LGTM --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org
[GitHub] cordova-medic pull request: Ensure Android adb logs have timestamp
Github user riknoll commented on the pull request: https://github.com/apache/cordova-medic/pull/90#issuecomment-209569528 LGTM --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org
[GitHub] cordova-cli pull request: CB-11042: Add cordova run option to skip...
Github user omefire commented on the pull request: https://github.com/apache/cordova-cli/pull/244#issuecomment-209564718 @jasongin consider also updating the docs: http://cordova.apache.org/docs/en/latest/reference/cordova-cli/index.html --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org
[GitHub] cordova-lib pull request: CB-11042: Add cordova run option to skip...
Github user omefire commented on a diff in the pull request: https://github.com/apache/cordova-lib/pull/426#discussion_r59592544 --- Diff: cordova-lib/src/cordova/run.js --- @@ -32,8 +32,10 @@ module.exports = function run(options) { var hooksRunner = new HooksRunner(projectRoot); return hooksRunner.fire('before_run', options) .then(function() { -// Run a prepare first, then shell out to run -return require('./cordova').raw.prepare(options); +if (!options.options.noprepare) { +// Run a prepare first, then shell out to run +return require('./cordova').raw.prepare(options); +} --- End diff -- Please add ```return Q();``` in the alternative code path --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org
[GitHub] cordova-medic pull request: Ensure Android adb logs have timestamp
GitHub user nikhilkh opened a pull request: https://github.com/apache/cordova-medic/pull/90 Ensure Android adb logs have timestamp This should help in debugging as it will have timestamps for native logs. @riknoll, @sarangan12 to take a look. We should do the same with paramedic if we have similar code. You can merge this pull request into a Git repository by running: $ git pull https://github.com/MSOpenTech/cordova-medic logtime Alternatively you can review and apply these changes as the patch at: https://github.com/apache/cordova-medic/pull/90.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #90 commit 3074524908aabe615280253b19ee216f0a67685b Author: Nikhil KhandelwalDate: 2016-04-13T05:45:51Z Ensure Android adb logs have timestamp --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org
[GitHub] cordova-plugin-camera pull request: CB-10873 Avoid crash due to us...
Github user nikhilkh commented on the pull request: https://github.com/apache/cordova-plugin-camera/pull/205#issuecomment-209551757 @alsorokin Is it possible for our appium test cover this scenario? Sounds like you will have to enable this preference to see this issue. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org
Re: Roadmap for next few weeks - Microsoft - April Edition
I find the Roadmap emails useful. Perhaps other teams should consider it as well. Plugin bugs are definitely a concern. Speaking for myself I have been more concerned with platform bugs, trying to get the ios platform stable. > "We would also like to work on things like Plugin compatibility when folks update their platforms, etc." I did a limited thing when doing the cordova-ios-4.x upgrade. Would be great to have an automated tool that could pull in "popular" plugins (or even all known plugins) to see if they all build. This would be useful when upgrading a major version of a platform. On Thu, Apr 7, 2016 at 12:46 PM, Parashuram Nwrote: > Hey folks, > > Last month, we sent out a list of things that the team at Microsoft was > working on, for the Apache Cordova project. You can find that list here - > http://apache.markmail.org/thread/lqvfduev3ib2ob62 > > We made a lot of progress, and I wanted to keep up the cadence, telling > people what we plan to work on. I am hoping that with this list available, > folks can tell us if there are interesting things we should look at, or > even better – join us on working on all the fun stuff. > > From last week > > Last week, most of our focus was on making documentation better. We made > some good progress on that, and now have an improved look for the > documentation. We also started adding much more detailed examples to our > plugins so that anyone getting started with plugins could simply copy the > examples and see them in action. > We worked on the splash screen and camera bugs, and have closed a large > number. Many folks told us that plugins bugs are a cause of concern, and we > would like to cause a dent in that bug debt. > > > In the near Future > === > Cordova’s power it its community and I think that we would like to > encourage more people in making Cordova better. We are looking at building > a system to run tests when someone submits a PR – a method that most open > source projects follow to easily respond to pull request. We would like to > continue fixing bugs on Camera plugins. > We would also like to switch gears a little bit an focus on the phonegap > barcode scanner plugin, and the phonegap push plugin. Typically, we are > looking to add features like background support for Windows in the push > plugin, android M support in Barcode scanner, etc. While these plugins are > not core Cordova plugins, these are super popular and people have even > asked that they be core plugins ! > We would also like to work on things like Plugin compatibility when folks > update their platforms, etc. > > > P.S: Please do let us know if these emails from us are useful and if we > should continue sending them. Would also love to hear what you fine folks > are working on, in the near future :) >
[GitHub] cordova-lib pull request: CB-10986: Adding support for scoped npm ...
Github user riknoll commented on a diff in the pull request: https://github.com/apache/cordova-lib/pull/425#discussion_r59584301 --- Diff: cordova-lib/src/cordova/plugin_spec_parser.js --- @@ -0,0 +1,61 @@ +/** +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. +*/ + +// npm packages follow the pattern of (@scope/)?package(@spec)? where scope and tag are optional +var NPM_SPEC_REGEX = /^(@[^\/]+\/)?([^@\/]+)(?:@(.+))?$/; + +module.exports.parse = parse; + +/** + * Represents a parsed specification for a plugin + * @class + * @param {String} raw The raw specification (i.e. provided by the user) + * @param {String} scopeThe scope of the package if this is an npm package + * @param {String} id The id of the package if this is an npm package + * @param {String} version The version specified for the package if this is an npm package + */ +function PluginSpec(raw, scope, id, version) { +/** @member {String|null} The npm scope of the plugin spec or null if it does not have one */ +this.scope = scope || null; + +/** @member {String|null} The id of the plugin or the raw plugin spec if it is not an npm package */ +this.id = id || raw; + +/** @member {String|null} The specified version of the plugin or null if no version was specified */ +this.version = version || null; + +/** @member {String|null} The npm package of the plugin (with scope) or null if this is not a spec for an npm package */ +this.package = (scope ? scope + id : id) || null; +} + +/** + * Tries to parse the given string as an npm-style package specification of + * the form (@scope/)?package(@version)? and return the various parts. + * + * @param {String} raw The string to be parsed + * @param {PluginSpec} The parsed plugin spec --- End diff -- Good catch! Will update --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org
[GitHub] cordova-plugin-camera pull request: CB-10873 Avoid crash due to us...
Github user jasongin commented on a diff in the pull request: https://github.com/apache/cordova-plugin-camera/pull/205#discussion_r59583794 --- Diff: src/ios/CDVCamera.m --- @@ -358,6 +358,7 @@ - (NSData*)processImage:(UIImage*)image info:(NSDictionary*)info options:(CDVPic // use image unedited as requested , don't resize data = UIImageJPEGRepresentation(image, 1.0); } else { +data = UIImageJPEGRepresentation(image, [options.quality floatValue] / 100.0f); if (options.usesGeolocation) { --- End diff -- When using the "unedited" image above, the geolocation option is ignored -- is that correct behavior? Or should the if (options.usesGeolocation) be moved to outside/after the else block? --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org
[GitHub] cordova-plugin-camera pull request: CB-11073 Appium tests stabilit...
Github user asfgit closed the pull request at: https://github.com/apache/cordova-plugin-camera/pull/206 --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org
[GitHub] cordova-plugin-camera pull request: CB-11073 Appium tests stabilit...
Github user alsorokin commented on the pull request: https://github.com/apache/cordova-plugin-camera/pull/206#issuecomment-209432618 This is a re-creation of https://github.com/apache/cordova-plugin-camera/pull/202 --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org
[GitHub] cordova-plugin-camera pull request: Appium tests stability improve...
Github user alsorokin closed the pull request at: https://github.com/apache/cordova-plugin-camera/pull/202 --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org
[GitHub] cordova-plugin-camera pull request: CB-11073 Appium tests stabilit...
GitHub user alsorokin opened a pull request: https://github.com/apache/cordova-plugin-camera/pull/206 CB-11073 Appium tests stability improvements https://issues.apache.org/jira/browse/CB-11073 You can merge this pull request into a Git repository by running: $ git pull https://github.com/MSOpenTech/cordova-plugin-camera CB-11073 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/cordova-plugin-camera/pull/206.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #206 commit 82c9f4524a4720242d7572e479c533b498be0751 Author: Alexander SorokinDate: 2016-04-13T09:42:51Z CB-11073 Appium tests stability improvements --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org
[GitHub] cordova-medic pull request: CB-11075 Appium tests: Exit gracefully...
Github user asfgit closed the pull request at: https://github.com/apache/cordova-medic/pull/89 --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org
[GitHub] cordova-medic pull request: CB-11075 Appium tests: Exit gracefully...
GitHub user alsorokin opened a pull request: https://github.com/apache/cordova-medic/pull/89 CB-11075 Appium tests: Exit gracefully on uncaught exception https://issues.apache.org/jira/browse/CB-11075 You can merge this pull request into a Git repository by running: $ git pull https://github.com/MSOpenTech/cordova-medic CB-11075 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/cordova-medic/pull/89.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #89 commit b4b2fd412b50020148a499424a3bbc2aa196cf0b Author: Alexander SorokinDate: 2016-04-13T12:59:31Z CB-11075 Appium tests: Exit gracefully on uncaught exception --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org
[GitHub] cordova-plugin-battery-status pull request: be sure to remove list...
GitHub user RRutsche opened a pull request: https://github.com/apache/cordova-plugin-battery-status/pull/34 be sure to remove listeners before executing start Hi, thanks for your plugin. Works great for us. Only issue we have that the initial values for `level` and `isPlugged` were not set after a page reload. The native part already registered the listeners and did not update the js part. regards You can merge this pull request into a Git repository by running: $ git pull https://github.com/RRutsche/cordova-plugin-battery-status master Alternatively you can review and apply these changes as the patch at: https://github.com/apache/cordova-plugin-battery-status/pull/34.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #34 commit df1cebb388d26d17adefb0aa4afb55e04f5b4448 Author: Richard RutscheDate: 2016-04-13T12:05:40Z be sure to remove listeners before executing start this fixes window reload: there was no initial value for level and isPlugged after page reload because native part already registered the listeners --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org
[GitHub] cordova-android pull request: 2.9.x
GitHub user sasoMetakocka opened a pull request: https://github.com/apache/cordova-android/pull/290 2.9.x You can merge this pull request into a Git repository by running: $ git pull https://github.com/apache/cordova-android 2.9.x Alternatively you can review and apply these changes as the patch at: https://github.com/apache/cordova-android/pull/290.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #290 commit a83bbcaf1dfc9d31ac5dabe1f932110cfdf996f4 Author: Andrew GrieveDate: 2013-06-18T17:49:25Z Set VERSION to 2.9.0rc1 commit fb4527d91b70dbff39b8eb0bd510ac7c1dff Author: Joe Bowser Date: 2013-06-18T20:24:53Z Updating Javascript commit 1f58d8ee27c9ea00c3bc7bf60eed144725c5ce43 Author: Benn Mapes Date: 2013-06-18T21:54:59Z [CB-3625] [CB-3338] updated windows cli scripts and added version option commit 2b6a6831986d3277142a571f765346472dc0ce39 Author: Joe Bowser Date: 2013-06-18T23:19:27Z CB-3902: Explicitly add market URIs to CordovaWebViewClient so this always works, not just sometimes commit e01678da93f65493fcb12060fb96b67979e7d7d7 Author: Joe Bowser Date: 2013-06-19T22:03:11Z Dealing with the retagging of cordova.js commit 24a0e8956cdc82fdfa6b5edb56320e212638cfd0 Author: Fil Maj Date: 2013-06-21T21:23:40Z Accidentally commented "build" out when running ./run --emulator. Whoops D: commit 6aff54be764867fb2c8fec51df119632b1e1d7f3 Author: Joe Bowser Date: 2013-06-25T21:11:30Z Incrementing versions and updating code commit df1536ea77e97b7d362a19582f8beddd168c5ec3 Author: Joe Bowser Date: 2013-06-25T21:12:41Z Merge branch '2.9.x' of https://git-wip-us.apache.org/repos/asf/cordova-android into 2.9.x commit c5e83b10796ec38b80cb748f925584cc7e89b3de Author: Don Coleman Date: 2013-06-25T04:29:16Z [CB-3998] video duration is an int commit 67e97a89ced3aa5dddfc823ca7873af7328d40e8 Author: Andrew Grieve Date: 2013-06-28T15:23:58Z [CB-4048] Merge branch 'master' into 2.9.x commit 7cde444ffe0085b2100a8ceedf8fa2d40369fde5 Author: Andrew Grieve Date: 2013-06-28T02:29:18Z [CB-4038] Move non-deprecated classes from the api package into the main package. (cherry picked from commit 79829f620985249876bdb7fefa572a53435da336) commit 1167da2027d794ff0e4fb06db90979b38b9dd38b Author: Max Woghiren Date: 2013-07-10T21:27:13Z [CB-4103] Made config parameters case-insensitive. For consistency with other platforms (and for readability), UpperCamelCasing is used by default in the code. commit e03bd0a40d1b8bc764d2b37f1dad39627764ee27 Author: macdonst Date: 2013-07-11T20:34:16Z CB-4155: Cordova Android - navigator.app.clearCache(); is called on (prospectively unsupported) WebViewCoreThread commit f3acf9002ea1ea9f02b2a78d3e603f014ebc52ce Author: Ian Clelland Date: 2013-07-17T18:20:50Z [CB-4140] Fix version of cordova-android to 2.9.0 commit 654d489c0119d986cdeabc882287136da4dcf58d Author: Max Woghiren Date: 2013-07-30T16:21:50Z [CB-4013] Fixed loadUrlTimeoutValue preference. commit cd4a316a9113ac23f5ec761b1eed1d867af2a45b Author: Joe Bowser Date: 2013-07-30T23:20:21Z CB-4465: Supporting 2.9.x for a period of time commit 8c4c22c72a36acb9cc8c3bbba0e324f7e00d6a35 Author: Max Woghiren Date: 2013-08-08T04:53:01Z [CB-4013] Added a missing import. commit 70f3785b47ea224fe1b72b62607c01d67d65cdb7 Author: Joe Bowser Date: 2013-08-20T23:37:41Z CB-4498: Updating 2.9.x to minimum supported commit 5550ec8f2c9d3707642d729769b9ead9e4dec1b5 Author: Joe Bowser Date: 2013-10-01T21:05:07Z CB-4633: Backporting to Android 2.9.x commit 2cf79a1adb96b85be7804d0355092c9c0d7a4bc4 Author: Joe Bowser Date: 2013-10-01T21:42:56Z Updating cordova.js to be up-to-date commit 0e9b446a81a7aaa1a5030f4cc3adc1cf87e43532 Author: Joe Bowser Date: 2013-10-01T21:45:41Z Backporting FileUtils fixes to 2.9 commit cb11486f66884fe91ed6c98567a06fff69d0eb66 Author: Joe Bowser Date: 2013-10-16T18:44:21Z Backporting CB-4521 commit cdb49eaa1fda8a9ee262035cf6d162baa4f95828 Author: Joe Bowser Date: 2013-10-16T18:58:07Z CB-4471: Mitigating Android 4.3 errors where data isn't being passed so NPE doesn't happen commit 6a57a3c452146ca042b737761cdaff971292fc01 Author: Joe Bowser Date: 2013-10-16T19:03:03Z Backporting
[GitHub] cordova-plugin-file-transfer pull request: CB-9600 FileUploadOptio...
Github user mirko77 commented on the pull request: https://github.com/apache/cordova-plugin-file-transfer/pull/121#issuecomment-209383867 @daserge fair enough, I think we will have to simplify that object. It has always been working on Android so we never faced the issue. Stringifying or serialising the data object work --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org
[GitHub] cordova-plugin-file-transfer pull request: CB-9600 FileUploadOptio...
Github user mirko77 commented on the pull request: https://github.com/apache/cordova-plugin-file-transfer/pull/121#issuecomment-209334303 I am posting to a Linux server (Ubuntu 14.10), PHP 5.6 backend , from an Ionic1.2.4 app. Here is the code, I removed the stuff not related to the bug ``` var uploader = new FileTransfer(); var options = new FileUploadOptions(); var upload_URL = $rootScope.serverUrl + PARAMETERS.API_PATH + '/upload/' + slug; var file = $rootScope.file; var file_URI; function _onSuccess(r) {} function _onError(error) {} // Set options for multipart entity file options.fileKey = 'name'; options.fileName = file.file_name; options.params = { data: { entry_uuid: "3e6450ee-eb6e-5387-0ec7-da7d13c6df30", id: "3e6450ee-eb6e-5387-0ec7-da7d13c6df30", attributes: { form: { type: "hierarchy", ref: "b8906ef28f944a26a1b7839290a5c2a6_57078c27d0238" } }, type: "file", relationships: { branch: { }, parent: { } }, file: { input_ref: "b8906ef28f944a26a1b7839290a5c2a6_57078c27d0238_57078cbf32c50", type: "photo", name: "3e6450ee-eb6e-5387-0ec7-da7d13c6df30_1460537677.jpg" } } }; if (auth) { options.headers = { Authorization: 'Bearer ' + auth; }; } file_URI = file.file_path + file.project_ref + '/' + file.file_name; //append protocol for file on ios if (window.device.platform === PARAMETERS.IOS) { file_URI = 'file://' + file_URI; options.chunkedMode = false; } uploader.upload(file_URI, upload_URL, _onSuccess, _onError, options); ``` content of the POST array of an Android request: `Array([data] => { "entry_uuid": "3e6450ee-eb6e-5387-0ec7-da7d13c6df30", "id": "3e6450ee-eb6e-5387-0ec7-da7d13c6df30", "attributes": { "form": { "type": "hierarchy", "ref": "b8906ef28f944a26a1b7839290a5c2a6_57078c27d0238" } }, "type": "file", "relationships": { "branch": {}, "parent": {} }, "file": { "input_ref": "b8906ef28f944a26a1b7839290a5c2a6_57078c27d0238_57078cbf32c50", "type": "photo", "name": "3e6450ee-eb6e-5387-0ec7-da7d13c6df30_1460537677.jpg" } })` content of the POST array of an iOS request: `Array () ` --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org
[GitHub] cordova-plugin-file-transfer pull request: CB-9600 FileUploadOptio...
Github user daserge commented on the pull request: https://github.com/apache/cordova-plugin-file-transfer/pull/121#issuecomment-209347935 `params` should be `A set of optional key/value pairs to pass in the HTTP request. (Object, key/value - DOMString)` as the documentation says - can you please try to JSON.stringify the `data` object? --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org
[GitHub] cordova-plugin-wkwebview-engine pull request: Fixes CB-11074: WKWe...
GitHub user akofman opened a pull request: https://github.com/apache/cordova-plugin-wkwebview-engine/pull/7 Fixes CB-11074: WKWebView configuration is not considered I updated the configuration before the WKWebView initialisation in order to consider it. It implies that the updateWithInfo method doesn't update it anymore. I'm not sure it is really a problem but I'd prefer @shazron to confirm. Thanks for the reviews ! You can merge this pull request into a Git repository by running: $ git pull https://github.com/akofman/cordova-plugin-wkwebview-engine master Alternatively you can review and apply these changes as the patch at: https://github.com/apache/cordova-plugin-wkwebview-engine/pull/7.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #7 commit 18219a0fe66208cc3ff1a794908510194cf86668 Author: Alexis KofmanDate: 2016-04-13T09:46:45Z Fixes CB-11074: WKWebView configuration is not considered --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org
[GitHub] cordova-ios pull request: CB-6992 Fix non-working create case, add...
Github user asfgit closed the pull request at: https://github.com/apache/cordova-ios/pull/216 --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org
[GitHub] cordova-plugin-file-transfer pull request: CB-11067 - Adds content...
GitHub user oddcb opened a pull request: https://github.com/apache/cordova-plugin-file-transfer/pull/140 CB-11067 - Adds content-length to multipart string if file length determined as also iOS plugin does ICLA signed and sent per email. https://issues.apache.org/jira/browse/CB-11067 You can merge this pull request into a Git repository by running: $ git pull https://github.com/oddcb/cordova-plugin-file-transfer CB-11067_add_file_content_length_to_multipart_if_present Alternatively you can review and apply these changes as the patch at: https://github.com/apache/cordova-plugin-file-transfer/pull/140.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #140 commit 7673590ad65a673c7578f7eead78fd4bd083f05c Author: Odd Christer BrovigDate: 2016-04-13T08:10:16Z CB-11067 - Adds content-length to multipart string if the file length is determined, as also the iOS plugin does. --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org
[GitHub] cordova-lib pull request: CB-10986: Adding support for scoped npm ...
Github user vladimir-kotikov commented on the pull request: https://github.com/apache/cordova-lib/pull/425#issuecomment-209292949 LGTM --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org
[GitHub] cordova-lib pull request: CB-10986: Adding support for scoped npm ...
Github user vladimir-kotikov commented on a diff in the pull request: https://github.com/apache/cordova-lib/pull/425#discussion_r59503554 --- Diff: cordova-lib/src/cordova/plugin_spec_parser.js --- @@ -0,0 +1,61 @@ +/** +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. +*/ + +// npm packages follow the pattern of (@scope/)?package(@spec)? where scope and tag are optional +var NPM_SPEC_REGEX = /^(@[^\/]+\/)?([^@\/]+)(?:@(.+))?$/; + +module.exports.parse = parse; + +/** + * Represents a parsed specification for a plugin + * @class + * @param {String} raw The raw specification (i.e. provided by the user) + * @param {String} scopeThe scope of the package if this is an npm package + * @param {String} id The id of the package if this is an npm package + * @param {String} version The version specified for the package if this is an npm package + */ +function PluginSpec(raw, scope, id, version) { +/** @member {String|null} The npm scope of the plugin spec or null if it does not have one */ +this.scope = scope || null; + +/** @member {String|null} The id of the plugin or the raw plugin spec if it is not an npm package */ +this.id = id || raw; + +/** @member {String|null} The specified version of the plugin or null if no version was specified */ +this.version = version || null; + +/** @member {String|null} The npm package of the plugin (with scope) or null if this is not a spec for an npm package */ +this.package = (scope ? scope + id : id) || null; +} + +/** + * Tries to parse the given string as an npm-style package specification of + * the form (@scope/)?package(@version)? and return the various parts. + * + * @param {String} raw The string to be parsed + * @param {PluginSpec} The parsed plugin spec + */ +function parse(raw) { +var split = NPM_SPEC_REGEX.exec(raw); +if (split) { +return new PluginSpec(raw, split[1], split[2], split[3]); +} else { --- End diff -- Not an issue, but `else` is not necessary here --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org
[GitHub] cordova-lib pull request: CB-10986: Adding support for scoped npm ...
Github user vladimir-kotikov commented on a diff in the pull request: https://github.com/apache/cordova-lib/pull/425#discussion_r59503458 --- Diff: cordova-lib/src/cordova/plugin_spec_parser.js --- @@ -0,0 +1,61 @@ +/** +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. +*/ + +// npm packages follow the pattern of (@scope/)?package(@spec)? where scope and tag are optional +var NPM_SPEC_REGEX = /^(@[^\/]+\/)?([^@\/]+)(?:@(.+))?$/; + +module.exports.parse = parse; + +/** + * Represents a parsed specification for a plugin + * @class + * @param {String} raw The raw specification (i.e. provided by the user) + * @param {String} scopeThe scope of the package if this is an npm package + * @param {String} id The id of the package if this is an npm package + * @param {String} version The version specified for the package if this is an npm package + */ +function PluginSpec(raw, scope, id, version) { +/** @member {String|null} The npm scope of the plugin spec or null if it does not have one */ +this.scope = scope || null; + +/** @member {String|null} The id of the plugin or the raw plugin spec if it is not an npm package */ +this.id = id || raw; + +/** @member {String|null} The specified version of the plugin or null if no version was specified */ +this.version = version || null; + +/** @member {String|null} The npm package of the plugin (with scope) or null if this is not a spec for an npm package */ +this.package = (scope ? scope + id : id) || null; +} + +/** + * Tries to parse the given string as an npm-style package specification of + * the form (@scope/)?package(@version)? and return the various parts. + * + * @param {String} raw The string to be parsed + * @param {PluginSpec} The parsed plugin spec --- End diff -- Probably a copy/paste typo: `@param` -> `@return` --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org