[jira] [Commented] (CB-5082) add BB10 support in doPlatform()
[ https://issues.apache.org/jira/browse/CB-5082?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14268725#comment-14268725 ] ASF GitHub Bot commented on CB-5082: Github user asfgit closed the pull request at: https://github.com/apache/cordova-lib/pull/7 add BB10 support in doPlatform() Key: CB-5082 URL: https://issues.apache.org/jira/browse/CB-5082 Project: Apache Cordova Issue Type: Sub-task Components: CLI Reporter: Marcel Kinard Assignee: Martin Gonzalez Priority: Minor -- This message was sent by Atlassian JIRA (v6.3.4#6332) - To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org For additional commands, e-mail: issues-h...@cordova.apache.org
[jira] [Commented] (CB-5082) add BB10 support in doPlatform()
[ https://issues.apache.org/jira/browse/CB-5082?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14103983#comment-14103983 ] ASF GitHub Bot commented on CB-5082: Github user agrieve commented on the pull request: https://github.com/apache/cordova-lib/pull/7#issuecomment-52792885 bump add BB10 support in doPlatform() Key: CB-5082 URL: https://issues.apache.org/jira/browse/CB-5082 Project: Apache Cordova Issue Type: Sub-task Components: CLI Reporter: Marcel Kinard Assignee: Martin Gonzalez Priority: Minor -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (CB-5082) add BB10 support in doPlatform()
[ https://issues.apache.org/jira/browse/CB-5082?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14103992#comment-14103992 ] ASF GitHub Bot commented on CB-5082: Github user asfgit closed the pull request at: https://github.com/apache/cordova-cli/pull/152 add BB10 support in doPlatform() Key: CB-5082 URL: https://issues.apache.org/jira/browse/CB-5082 Project: Apache Cordova Issue Type: Sub-task Components: CLI Reporter: Marcel Kinard Assignee: Martin Gonzalez Priority: Minor -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (CB-5082) add BB10 support in doPlatform()
[ https://issues.apache.org/jira/browse/CB-5082?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14016538#comment-14016538 ] ASF GitHub Bot commented on CB-5082: Github user martincgg commented on a diff in the pull request: https://github.com/apache/cordova-lib/pull/7#discussion_r13335471 --- Diff: cordova-lib/src/cordova/info.js --- @@ -31,23 +31,50 @@ var cordova_util = require('./util'), // Execute using a child_process exec, for any async command function execSpawn(command, args, resultMsg, errorMsg) { -return superspawn.spawn(command, args).then(function(result) { +return superspawn.spawn(command, args).then(function (result) { return resultMsg + result; -}, function(error) { +}, function (error) { return errorMsg + error; }); } +//Collects data from promise, and it returns a promise +function preparePromise(promise, headline) { +var output = ; +resultList = promise.state === 'fullfilled' ? promise.value : promise.reason; +if (resultList.length 0) { +resultList.map(function (result) { +output += result.name + ' ip: ' + result.ip + '\n'; +}); +return Q(headline + ':\n' + output); +} +return Q(headline + ':\n' + 'Not found'); +} + function getPlatformInfo(platform, projectRoot) { switch (platform) { case 'ios': return execSpawn('xcodebuild', ['-version'], 'iOS platform:\n\n', 'Error retrieving iOS platform information: '); case 'android': return execSpawn('android', ['list', 'target'], 'Android platform:\n\n', 'Error retrieving Android platform information: '); +case 'blackberry10': +var bbUtilsPath = path.join(projectRoot, 'platforms', platform, 'cordova'); +return Q.allSettled([ +Q.nfcall(require(path.join(bbUtilsPath, 'lib', 'target-utils')).getTargetList, 'emulator', false), +Q.nfcall(require(path.join(bbUtilsPath, 'lib', 'target-utils')).getTargetList, 'device', false) +]).spread(function (emu, dev) { +return Q.all([ +execSpawn(path.join(bbUtilsPath,'bb10-ndk-version'), '', 'Blackberry 10 Native SDK version: ', 'Error retrieving Blackberry 10 Native SDK version'), +preparePromise(emu, 'Blackberry 10 deployed emulators:'), --- End diff -- I can spell it correctly, no problem add BB10 support in doPlatform() Key: CB-5082 URL: https://issues.apache.org/jira/browse/CB-5082 Project: Apache Cordova Issue Type: Sub-task Components: CLI Reporter: Marcel Kinard Assignee: Martin Gonzalez Priority: Minor -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (CB-5082) add BB10 support in doPlatform()
[ https://issues.apache.org/jira/browse/CB-5082?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14016552#comment-14016552 ] ASF GitHub Bot commented on CB-5082: Github user kamrik commented on a diff in the pull request: https://github.com/apache/cordova-lib/pull/7#discussion_r13336691 --- Diff: cordova-lib/src/cordova/info.js --- @@ -31,23 +31,50 @@ var cordova_util = require('./util'), // Execute using a child_process exec, for any async command function execSpawn(command, args, resultMsg, errorMsg) { -return superspawn.spawn(command, args).then(function(result) { +return superspawn.spawn(command, args).then(function (result) { return resultMsg + result; -}, function(error) { +}, function (error) { return errorMsg + error; }); } +//Collects data from promise, and it returns a promise +function preparePromise(promise, headline) { +var output = ; +resultList = promise.state === 'fullfilled' ? promise.value : promise.reason; +if (resultList.length 0) { +resultList.map(function (result) { +output += result.name + ' ip: ' + result.ip + '\n'; +}); +return Q(headline + ':\n' + output); +} +return Q(headline + ':\n' + 'Not found'); +} + function getPlatformInfo(platform, projectRoot) { switch (platform) { case 'ios': return execSpawn('xcodebuild', ['-version'], 'iOS platform:\n\n', 'Error retrieving iOS platform information: '); case 'android': return execSpawn('android', ['list', 'target'], 'Android platform:\n\n', 'Error retrieving Android platform information: '); +case 'blackberry10': +var bbUtilsPath = path.join(projectRoot, 'platforms', platform, 'cordova'); +return Q.allSettled([ +Q.nfcall(require(path.join(bbUtilsPath, 'lib', 'target-utils')).getTargetList, 'emulator', false), +Q.nfcall(require(path.join(bbUtilsPath, 'lib', 'target-utils')).getTargetList, 'device', false) --- End diff -- Why do we import the same thing twice? In general this change looks extremely hacky, please add a bunch of comments to help people understand what's being done here and why is it being done in this particular way. A multi-line comment with an example of command line equivalent of the commands being spawned here could also be extremely helpful. add BB10 support in doPlatform() Key: CB-5082 URL: https://issues.apache.org/jira/browse/CB-5082 Project: Apache Cordova Issue Type: Sub-task Components: CLI Reporter: Marcel Kinard Assignee: Martin Gonzalez Priority: Minor -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (CB-5082) add BB10 support in doPlatform()
[ https://issues.apache.org/jira/browse/CB-5082?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14016559#comment-14016559 ] ASF GitHub Bot commented on CB-5082: Github user martincgg commented on a diff in the pull request: https://github.com/apache/cordova-lib/pull/7#discussion_r13337337 --- Diff: cordova-lib/src/cordova/info.js --- @@ -31,23 +31,50 @@ var cordova_util = require('./util'), // Execute using a child_process exec, for any async command function execSpawn(command, args, resultMsg, errorMsg) { -return superspawn.spawn(command, args).then(function(result) { +return superspawn.spawn(command, args).then(function (result) { return resultMsg + result; -}, function(error) { +}, function (error) { return errorMsg + error; }); } +//Collects data from promise, and it returns a promise +function preparePromise(promise, headline) { +var output = ; +resultList = promise.state === 'fullfilled' ? promise.value : promise.reason; +if (resultList.length 0) { +resultList.map(function (result) { +output += result.name + ' ip: ' + result.ip + '\n'; +}); +return Q(headline + ':\n' + output); +} +return Q(headline + ':\n' + 'Not found'); +} + function getPlatformInfo(platform, projectRoot) { switch (platform) { case 'ios': return execSpawn('xcodebuild', ['-version'], 'iOS platform:\n\n', 'Error retrieving iOS platform information: '); case 'android': return execSpawn('android', ['list', 'target'], 'Android platform:\n\n', 'Error retrieving Android platform information: '); +case 'blackberry10': +var bbUtilsPath = path.join(projectRoot, 'platforms', platform, 'cordova'); +return Q.allSettled([ +Q.nfcall(require(path.join(bbUtilsPath, 'lib', 'target-utils')).getTargetList, 'emulator', false), +Q.nfcall(require(path.join(bbUtilsPath, 'lib', 'target-utils')).getTargetList, 'device', false) --- End diff -- Ok, basically it's calling the target-utils.js file, to get the target list, one of it it's emulator and the other one it's to retrieve the list of devices. nfcall, it's because the existent blackberry code on that are callback-based, not promises, and in info.js promises are required. I can add some comment lines in there. No problem at all. add BB10 support in doPlatform() Key: CB-5082 URL: https://issues.apache.org/jira/browse/CB-5082 Project: Apache Cordova Issue Type: Sub-task Components: CLI Reporter: Marcel Kinard Assignee: Martin Gonzalez Priority: Minor -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (CB-5082) add BB10 support in doPlatform()
[ https://issues.apache.org/jira/browse/CB-5082?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14016567#comment-14016567 ] ASF GitHub Bot commented on CB-5082: Github user jsoref commented on a diff in the pull request: https://github.com/apache/cordova-lib/pull/7#discussion_r13337873 --- Diff: cordova-lib/src/cordova/info.js --- @@ -31,23 +31,50 @@ var cordova_util = require('./util'), // Execute using a child_process exec, for any async command function execSpawn(command, args, resultMsg, errorMsg) { -return superspawn.spawn(command, args).then(function(result) { +return superspawn.spawn(command, args).then(function (result) { return resultMsg + result; -}, function(error) { +}, function (error) { return errorMsg + error; }); } +//Collects data from promise, and it returns a promise +function preparePromise(promise, headline) { +var output = ; +resultList = promise.state === 'fullfilled' ? promise.value : promise.reason; +if (resultList.length 0) { +resultList.map(function (result) { +output += result.name + ' ip: ' + result.ip + '\n'; +}); +return Q(headline + ':\n' + output); +} +return Q(headline + ':\n' + 'Not found'); +} + function getPlatformInfo(platform, projectRoot) { switch (platform) { case 'ios': return execSpawn('xcodebuild', ['-version'], 'iOS platform:\n\n', 'Error retrieving iOS platform information: '); case 'android': return execSpawn('android', ['list', 'target'], 'Android platform:\n\n', 'Error retrieving Android platform information: '); +case 'blackberry10': +var bbUtilsPath = path.join(projectRoot, 'platforms', platform, 'cordova'); +return Q.allSettled([ +Q.nfcall(require(path.join(bbUtilsPath, 'lib', 'target-utils')).getTargetList, 'emulator', false), +Q.nfcall(require(path.join(bbUtilsPath, 'lib', 'target-utils')).getTargetList, 'device', false) --- End diff -- @kamrik is saying that you should cache at least: require(path.join(bbUtilsPath, 'lib', 'target-utils')) In a var somewhere. Specifically right after the var bbUtilsPath line: add BB10 support in doPlatform() Key: CB-5082 URL: https://issues.apache.org/jira/browse/CB-5082 Project: Apache Cordova Issue Type: Sub-task Components: CLI Reporter: Marcel Kinard Assignee: Martin Gonzalez Priority: Minor -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (CB-5082) add BB10 support in doPlatform()
[ https://issues.apache.org/jira/browse/CB-5082?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14016572#comment-14016572 ] ASF GitHub Bot commented on CB-5082: Github user martincgg commented on a diff in the pull request: https://github.com/apache/cordova-lib/pull/7#discussion_r13337982 --- Diff: cordova-lib/src/cordova/info.js --- @@ -31,23 +31,50 @@ var cordova_util = require('./util'), // Execute using a child_process exec, for any async command function execSpawn(command, args, resultMsg, errorMsg) { -return superspawn.spawn(command, args).then(function(result) { +return superspawn.spawn(command, args).then(function (result) { return resultMsg + result; -}, function(error) { +}, function (error) { return errorMsg + error; }); } +//Collects data from promise, and it returns a promise +function preparePromise(promise, headline) { +var output = ; +resultList = promise.state === 'fullfilled' ? promise.value : promise.reason; +if (resultList.length 0) { +resultList.map(function (result) { +output += result.name + ' ip: ' + result.ip + '\n'; +}); +return Q(headline + ':\n' + output); +} +return Q(headline + ':\n' + 'Not found'); +} + function getPlatformInfo(platform, projectRoot) { switch (platform) { case 'ios': return execSpawn('xcodebuild', ['-version'], 'iOS platform:\n\n', 'Error retrieving iOS platform information: '); case 'android': return execSpawn('android', ['list', 'target'], 'Android platform:\n\n', 'Error retrieving Android platform information: '); +case 'blackberry10': +var bbUtilsPath = path.join(projectRoot, 'platforms', platform, 'cordova'); +return Q.allSettled([ +Q.nfcall(require(path.join(bbUtilsPath, 'lib', 'target-utils')).getTargetList, 'emulator', false), +Q.nfcall(require(path.join(bbUtilsPath, 'lib', 'target-utils')).getTargetList, 'device', false) --- End diff -- Yeah, my mistake, adding to a var, no problem. add BB10 support in doPlatform() Key: CB-5082 URL: https://issues.apache.org/jira/browse/CB-5082 Project: Apache Cordova Issue Type: Sub-task Components: CLI Reporter: Marcel Kinard Assignee: Martin Gonzalez Priority: Minor -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (CB-5082) add BB10 support in doPlatform()
[ https://issues.apache.org/jira/browse/CB-5082?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14017157#comment-14017157 ] ASF GitHub Bot commented on CB-5082: Github user martincgg commented on the pull request: https://github.com/apache/cordova-lib/pull/7#issuecomment-45021216 Hi @jsoref , here is the PR: https://github.com/apache/cordova-lib/pull/7 with a single commit: https://github.com/martincgg/cordova-lib/commit/f964956b9c90db36325fb6acfe36e619463367e9. If you can merged this in, it would be great. Thanks. add BB10 support in doPlatform() Key: CB-5082 URL: https://issues.apache.org/jira/browse/CB-5082 Project: Apache Cordova Issue Type: Sub-task Components: CLI Reporter: Marcel Kinard Assignee: Martin Gonzalez Priority: Minor -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (CB-5082) add BB10 support in doPlatform()
[ https://issues.apache.org/jira/browse/CB-5082?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14017201#comment-14017201 ] ASF GitHub Bot commented on CB-5082: Github user jsoref commented on the pull request: https://github.com/apache/cordova-lib/pull/7#issuecomment-45026274 Please don't expect same day turnaround. It's trivial for me to give feedback, but I'm still trying to figure out if what you're doing makes sense. I'm on vacation tomorrow. I haven't even set up my apache account - I won't this week. Your request is behind me merging my own work. add BB10 support in doPlatform() Key: CB-5082 URL: https://issues.apache.org/jira/browse/CB-5082 Project: Apache Cordova Issue Type: Sub-task Components: CLI Reporter: Marcel Kinard Assignee: Martin Gonzalez Priority: Minor -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (CB-5082) add BB10 support in doPlatform()
[ https://issues.apache.org/jira/browse/CB-5082?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14015995#comment-14015995 ] ASF GitHub Bot commented on CB-5082: Github user jsoref commented on a diff in the pull request: https://github.com/apache/cordova-lib/pull/7#discussion_r13311217 --- Diff: cordova-lib/src/cordova/info.js --- @@ -62,15 +89,15 @@ module.exports = function info() { //Get Node version Q('Node version: ' + process.version), //Get Cordova version -Q('Cordova version: ' + package.version), -//Get project config.xml file using ano --- End diff -- This change should not be hidden in a BlackBerry request, please split it out. add BB10 support in doPlatform() Key: CB-5082 URL: https://issues.apache.org/jira/browse/CB-5082 Project: Apache Cordova Issue Type: Sub-task Components: CLI Reporter: Marcel Kinard Assignee: Martin Gonzalez Priority: Minor -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (CB-5082) add BB10 support in doPlatform()
[ https://issues.apache.org/jira/browse/CB-5082?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14015998#comment-14015998 ] ASF GitHub Bot commented on CB-5082: Github user jsoref commented on a diff in the pull request: https://github.com/apache/cordova-lib/pull/7#discussion_r13311258 --- Diff: cordova-lib/src/cordova/info.js --- @@ -84,10 +111,10 @@ module.exports = function info() { function getPlatforms(projectRoot) { var platforms = cordova_util.listPlatforms(projectRoot); if (platforms.length) { -return Q.all(platforms.map(function(p) { --- End diff -- Please don't do unrelated whitespace changes in feature work add BB10 support in doPlatform() Key: CB-5082 URL: https://issues.apache.org/jira/browse/CB-5082 Project: Apache Cordova Issue Type: Sub-task Components: CLI Reporter: Marcel Kinard Assignee: Martin Gonzalez Priority: Minor -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (CB-5082) add BB10 support in doPlatform()
[ https://issues.apache.org/jira/browse/CB-5082?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13951225#comment-13951225 ] ASF GitHub Bot commented on CB-5082: Github user agrieve commented on a diff in the pull request: https://github.com/apache/cordova-cli/pull/152#discussion_r11080370 --- Diff: src/info-utils.js --- @@ -0,0 +1,150 @@ +/** +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. +*/ +var cordova_util = require('./util'), +child_process = require('child_process'), +path = require('path'), +fs= require('fs'), +_self; + +_self = { +getNodeInfo: function( callback ){ +callback(_self.execFunc('node', '--version', function(call){callback(call);})); +}, + +getCordovaInfo: function( callback ){ +callback(_self.execFunc('cordova', '--version', function(call){callback(call);})); +}, + +getPlatformInfo: function(platform, projectRoot, callback ){ +var command=, args=; +switch( platform ){ +case ios: +_self.execFunc('xcodebuild', '-version', function(call){callback('iOS Platform:\r\r' +call);}); +break; +case android: +_self.execFunc('android', 'list target', function(call){callback('Android Platform:\r\r' +call);}); +break; +case blackberry10: +var bbUtilsPath = path.join(projectRoot, 'platforms', platform, 'cordova'), +bbBuildPath= path.join(projectRoot, 'platforms', platform, 'build'), +bbresults=, +varState; +//get CORDOVA_BBTOOLS environment variable. +_self.get_pathEnv( ['blackberry-nativepackager', 'blackberry-deploy'], function (path){ +if(path){ +//s et CORDOVA_BBTOOLS environment variable. +varState = _self.setEnv_Var('CORDOVA_BBTOOLS', path, false); +// Get BB10 SDK Version +_self.getSDKinfo(bbUtilsPath, function(result){ +if(result){bbresults+=Blackberry 10 Native SDK version: +result+\r; +// Get BB10 deployed and stored devices +_self.deployedDevices(bbUtilsPath, 'device', false, function(result){ +if(result){bbresults+=\rBlackberry 10 deployed devices:\r+result+\r; +// Get BB10 deployed and stored emulators +_self.deployedDevices(bbUtilsPath, 'emulator', false, function (result){ + if(result){bbresults+=\rBlackberry deployed emulator:\r+result+\r; + if(!varState){_self.delEnv_Var('CORDOVA_BBTOOLS');} +callback('Blackberry 10 Platform:\r\r' +bbresults); +}}); +}}); +}}); +} +else{callback(Blackberry 10 Native SDK path not found);} +}); +break; +} +}, +// Execute using a child_process exec, for any async command +execFunc: function(command, args, callback){ +child_process.exec(command + ' ' +args, +function (error, stdout, stderr) { +callback(stdout); +if (error !== null) { +callback('Error performing command: ' + error + \n +stderr); +} +}); +}, +//Uses Library to get Native SDK version +getSDKinfo: function ( utilsPath, callback) { +_self.execFunc(\ +path.join(utilsPath,'bb10-ndk-version')+\ , '' ,function(output){callback(output);}); +}, +// It explores the json file to get deployed devices
[jira] [Commented] (CB-5082) add BB10 support in doPlatform()
[ https://issues.apache.org/jira/browse/CB-5082?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13951227#comment-13951227 ] ASF GitHub Bot commented on CB-5082: Github user agrieve commented on a diff in the pull request: https://github.com/apache/cordova-cli/pull/152#discussion_r11080438 --- Diff: src/info-utils.js --- @@ -0,0 +1,150 @@ +/** +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. +*/ +var cordova_util = require('./util'), +child_process = require('child_process'), +path = require('path'), +fs= require('fs'), +_self; + +_self = { +getNodeInfo: function( callback ){ +callback(_self.execFunc('node', '--version', function(call){callback(call);})); +}, + +getCordovaInfo: function( callback ){ +callback(_self.execFunc('cordova', '--version', function(call){callback(call);})); +}, + +getPlatformInfo: function(platform, projectRoot, callback ){ +var command=, args=; +switch( platform ){ +case ios: +_self.execFunc('xcodebuild', '-version', function(call){callback('iOS Platform:\r\r' +call);}); +break; +case android: +_self.execFunc('android', 'list target', function(call){callback('Android Platform:\r\r' +call);}); +break; +case blackberry10: +var bbUtilsPath = path.join(projectRoot, 'platforms', platform, 'cordova'), +bbBuildPath= path.join(projectRoot, 'platforms', platform, 'build'), +bbresults=, +varState; +//get CORDOVA_BBTOOLS environment variable. +_self.get_pathEnv( ['blackberry-nativepackager', 'blackberry-deploy'], function (path){ +if(path){ +//s et CORDOVA_BBTOOLS environment variable. +varState = _self.setEnv_Var('CORDOVA_BBTOOLS', path, false); +// Get BB10 SDK Version +_self.getSDKinfo(bbUtilsPath, function(result){ +if(result){bbresults+=Blackberry 10 Native SDK version: +result+\r; +// Get BB10 deployed and stored devices +_self.deployedDevices(bbUtilsPath, 'device', false, function(result){ +if(result){bbresults+=\rBlackberry 10 deployed devices:\r+result+\r; +// Get BB10 deployed and stored emulators +_self.deployedDevices(bbUtilsPath, 'emulator', false, function (result){ + if(result){bbresults+=\rBlackberry deployed emulator:\r+result+\r; + if(!varState){_self.delEnv_Var('CORDOVA_BBTOOLS');} +callback('Blackberry 10 Platform:\r\r' +bbresults); +}}); +}}); +}}); +} +else{callback(Blackberry 10 Native SDK path not found);} +}); +break; +} +}, +// Execute using a child_process exec, for any async command +execFunc: function(command, args, callback){ +child_process.exec(command + ' ' +args, +function (error, stdout, stderr) { +callback(stdout); +if (error !== null) { +callback('Error performing command: ' + error + \n +stderr); +} +}); +}, +//Uses Library to get Native SDK version +getSDKinfo: function ( utilsPath, callback) { +_self.execFunc(\ +path.join(utilsPath,'bb10-ndk-version')+\ , '' ,function(output){callback(output);}); +}, +// It explores the json file to get deployed devices
[jira] [Commented] (CB-5082) add BB10 support in doPlatform()
[ https://issues.apache.org/jira/browse/CB-5082?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13951442#comment-13951442 ] ASF GitHub Bot commented on CB-5082: Github user martincgg commented on a diff in the pull request: https://github.com/apache/cordova-cli/pull/152#discussion_r11086870 --- Diff: src/info-utils.js --- @@ -0,0 +1,150 @@ +/** +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. +*/ +var cordova_util = require('./util'), +child_process = require('child_process'), +path = require('path'), +fs= require('fs'), +_self; + +_self = { +getNodeInfo: function( callback ){ +callback(_self.execFunc('node', '--version', function(call){callback(call);})); +}, + +getCordovaInfo: function( callback ){ +callback(_self.execFunc('cordova', '--version', function(call){callback(call);})); +}, + +getPlatformInfo: function(platform, projectRoot, callback ){ +var command=, args=; +switch( platform ){ +case ios: +_self.execFunc('xcodebuild', '-version', function(call){callback('iOS Platform:\r\r' +call);}); +break; +case android: +_self.execFunc('android', 'list target', function(call){callback('Android Platform:\r\r' +call);}); +break; +case blackberry10: +var bbUtilsPath = path.join(projectRoot, 'platforms', platform, 'cordova'), +bbBuildPath= path.join(projectRoot, 'platforms', platform, 'build'), +bbresults=, +varState; +//get CORDOVA_BBTOOLS environment variable. +_self.get_pathEnv( ['blackberry-nativepackager', 'blackberry-deploy'], function (path){ +if(path){ +//s et CORDOVA_BBTOOLS environment variable. +varState = _self.setEnv_Var('CORDOVA_BBTOOLS', path, false); +// Get BB10 SDK Version +_self.getSDKinfo(bbUtilsPath, function(result){ +if(result){bbresults+=Blackberry 10 Native SDK version: +result+\r; +// Get BB10 deployed and stored devices +_self.deployedDevices(bbUtilsPath, 'device', false, function(result){ +if(result){bbresults+=\rBlackberry 10 deployed devices:\r+result+\r; +// Get BB10 deployed and stored emulators +_self.deployedDevices(bbUtilsPath, 'emulator', false, function (result){ + if(result){bbresults+=\rBlackberry deployed emulator:\r+result+\r; + if(!varState){_self.delEnv_Var('CORDOVA_BBTOOLS');} +callback('Blackberry 10 Platform:\r\r' +bbresults); +}}); +}}); +}}); +} +else{callback(Blackberry 10 Native SDK path not found);} +}); +break; +} +}, +// Execute using a child_process exec, for any async command +execFunc: function(command, args, callback){ +child_process.exec(command + ' ' +args, +function (error, stdout, stderr) { +callback(stdout); +if (error !== null) { +callback('Error performing command: ' + error + \n +stderr); +} +}); +}, +//Uses Library to get Native SDK version +getSDKinfo: function ( utilsPath, callback) { +_self.execFunc(\ +path.join(utilsPath,'bb10-ndk-version')+\ , '' ,function(output){callback(output);}); +}, +// It explores the json file to get deployed devices
[jira] [Commented] (CB-5082) add BB10 support in doPlatform()
[ https://issues.apache.org/jira/browse/CB-5082?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13951445#comment-13951445 ] ASF GitHub Bot commented on CB-5082: Github user martincgg commented on a diff in the pull request: https://github.com/apache/cordova-cli/pull/152#discussion_r11086944 --- Diff: src/info-utils.js --- @@ -0,0 +1,150 @@ +/** +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. +*/ +var cordova_util = require('./util'), +child_process = require('child_process'), +path = require('path'), +fs= require('fs'), +_self; + +_self = { +getNodeInfo: function( callback ){ +callback(_self.execFunc('node', '--version', function(call){callback(call);})); +}, + +getCordovaInfo: function( callback ){ +callback(_self.execFunc('cordova', '--version', function(call){callback(call);})); +}, + +getPlatformInfo: function(platform, projectRoot, callback ){ +var command=, args=; +switch( platform ){ +case ios: +_self.execFunc('xcodebuild', '-version', function(call){callback('iOS Platform:\r\r' +call);}); +break; +case android: +_self.execFunc('android', 'list target', function(call){callback('Android Platform:\r\r' +call);}); +break; +case blackberry10: +var bbUtilsPath = path.join(projectRoot, 'platforms', platform, 'cordova'), +bbBuildPath= path.join(projectRoot, 'platforms', platform, 'build'), +bbresults=, +varState; +//get CORDOVA_BBTOOLS environment variable. +_self.get_pathEnv( ['blackberry-nativepackager', 'blackberry-deploy'], function (path){ +if(path){ +//s et CORDOVA_BBTOOLS environment variable. +varState = _self.setEnv_Var('CORDOVA_BBTOOLS', path, false); +// Get BB10 SDK Version +_self.getSDKinfo(bbUtilsPath, function(result){ +if(result){bbresults+=Blackberry 10 Native SDK version: +result+\r; +// Get BB10 deployed and stored devices +_self.deployedDevices(bbUtilsPath, 'device', false, function(result){ +if(result){bbresults+=\rBlackberry 10 deployed devices:\r+result+\r; +// Get BB10 deployed and stored emulators +_self.deployedDevices(bbUtilsPath, 'emulator', false, function (result){ + if(result){bbresults+=\rBlackberry deployed emulator:\r+result+\r; + if(!varState){_self.delEnv_Var('CORDOVA_BBTOOLS');} +callback('Blackberry 10 Platform:\r\r' +bbresults); +}}); +}}); +}}); +} +else{callback(Blackberry 10 Native SDK path not found);} +}); +break; +} +}, +// Execute using a child_process exec, for any async command +execFunc: function(command, args, callback){ +child_process.exec(command + ' ' +args, +function (error, stdout, stderr) { +callback(stdout); +if (error !== null) { +callback('Error performing command: ' + error + \n +stderr); +} +}); +}, +//Uses Library to get Native SDK version +getSDKinfo: function ( utilsPath, callback) { +_self.execFunc(\ +path.join(utilsPath,'bb10-ndk-version')+\ , '' ,function(output){callback(output);}); +}, +// It explores the json file to get deployed devices
[jira] [Commented] (CB-5082) add BB10 support in doPlatform()
[ https://issues.apache.org/jira/browse/CB-5082?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13951455#comment-13951455 ] ASF GitHub Bot commented on CB-5082: Github user martincgg commented on a diff in the pull request: https://github.com/apache/cordova-cli/pull/152#discussion_r11087137 --- Diff: src/info-utils.js --- @@ -0,0 +1,150 @@ +/** +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. +*/ +var cordova_util = require('./util'), +child_process = require('child_process'), +path = require('path'), +fs= require('fs'), +_self; + +_self = { +getNodeInfo: function( callback ){ +callback(_self.execFunc('node', '--version', function(call){callback(call);})); +}, + +getCordovaInfo: function( callback ){ +callback(_self.execFunc('cordova', '--version', function(call){callback(call);})); +}, + +getPlatformInfo: function(platform, projectRoot, callback ){ +var command=, args=; +switch( platform ){ +case ios: +_self.execFunc('xcodebuild', '-version', function(call){callback('iOS Platform:\r\r' +call);}); +break; +case android: +_self.execFunc('android', 'list target', function(call){callback('Android Platform:\r\r' +call);}); +break; +case blackberry10: +var bbUtilsPath = path.join(projectRoot, 'platforms', platform, 'cordova'), +bbBuildPath= path.join(projectRoot, 'platforms', platform, 'build'), +bbresults=, +varState; +//get CORDOVA_BBTOOLS environment variable. +_self.get_pathEnv( ['blackberry-nativepackager', 'blackberry-deploy'], function (path){ +if(path){ +//s et CORDOVA_BBTOOLS environment variable. +varState = _self.setEnv_Var('CORDOVA_BBTOOLS', path, false); +// Get BB10 SDK Version +_self.getSDKinfo(bbUtilsPath, function(result){ +if(result){bbresults+=Blackberry 10 Native SDK version: +result+\r; +// Get BB10 deployed and stored devices +_self.deployedDevices(bbUtilsPath, 'device', false, function(result){ +if(result){bbresults+=\rBlackberry 10 deployed devices:\r+result+\r; +// Get BB10 deployed and stored emulators +_self.deployedDevices(bbUtilsPath, 'emulator', false, function (result){ + if(result){bbresults+=\rBlackberry deployed emulator:\r+result+\r; + if(!varState){_self.delEnv_Var('CORDOVA_BBTOOLS');} +callback('Blackberry 10 Platform:\r\r' +bbresults); +}}); +}}); +}}); +} +else{callback(Blackberry 10 Native SDK path not found);} +}); +break; +} +}, +// Execute using a child_process exec, for any async command +execFunc: function(command, args, callback){ +child_process.exec(command + ' ' +args, +function (error, stdout, stderr) { +callback(stdout); +if (error !== null) { +callback('Error performing command: ' + error + \n +stderr); +} +}); +}, +//Uses Library to get Native SDK version +getSDKinfo: function ( utilsPath, callback) { +_self.execFunc(\ +path.join(utilsPath,'bb10-ndk-version')+\ , '' ,function(output){callback(output);}); +}, +// It explores the json file to get deployed devices
[jira] [Commented] (CB-5082) add BB10 support in doPlatform()
[ https://issues.apache.org/jira/browse/CB-5082?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13949737#comment-13949737 ] ASF GitHub Bot commented on CB-5082: Github user martincgg commented on the pull request: https://github.com/apache/cordova-cli/pull/152#issuecomment-38841084 Fixed: - No more tabs. - Brand misspelled - Included new line at the end. The cordova info command is used to get information from the dev environment, information to ask for help, or report an issue, summary of what the project contains, get information; getting relevant information about the environment, that's its only cases of use. Set a variable with 'process.env.CORDOVA_BBTOOLS' is required to provide good usage at some blackberry libraries that requires to run functions. That variable is settled and used during the js file execution, but when the control is returned to terminal, the variable is not present to be used in the terminal or by any other js file. I've made several test under Windows 7, 8 and Ubuntu, try to access to the variable with another js file, or using the terminal command (SET (Windows) or EXPORT(Linux Mac)) to list all current variables, that one it never appears in the list. Anyway, I've added logic to deal with. If the variable is present is not going to change it, not at all. If is not present is going to set the value, and then at the end of all blackberry operations it will erase it, with this in any usage case it won't affect any other process. Hi, @jsoref , What do you think about this? by the way, thanks a lot for the feedback add BB10 support in doPlatform() Key: CB-5082 URL: https://issues.apache.org/jira/browse/CB-5082 Project: Apache Cordova Issue Type: Sub-task Components: CLI Reporter: Marcel Kinard Assignee: Martin Gonzalez Priority: Minor -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (CB-5082) add BB10 support in doPlatform()
[ https://issues.apache.org/jira/browse/CB-5082?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13948324#comment-13948324 ] ASF GitHub Bot commented on CB-5082: GitHub user martincgg opened a pull request: https://github.com/apache/cordova-cli/pull/152 CB-5082 [CLI] BB10 add support in doPlatform() https://issues.apache.org/jira/browse/CB-5082 Support for blackberry10, when 'cordova info' command is used to retrieve information about the dev environment. It provides: -BB10 NDK version. -It gets information about every devices or emulator, used to deploy a cordova application using the 'cordova run/build' command. You can merge this pull request into a Git repository by running: $ git pull https://github.com/martincgg/cordova-cli CB-5082 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/cordova-cli/pull/152.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 #152 commit 501b8242c90eeeff7ad320aa90559ff4438956cb Author: Martin Gonzalez martin.c.glez.g...@gmail.com Date: 2014-03-26T19:00:09Z CB-5082 [CLI] BB10 add support in doPlatform() Support for blackberry10, when 'cordova info' command is used to retrieve information about the dev environment. It provides: -BB10 NDK version. -It gets information about every devices or emulator, used to deploy a cordova application using the 'cordova run/build' command. add BB10 support in doPlatform() Key: CB-5082 URL: https://issues.apache.org/jira/browse/CB-5082 Project: Apache Cordova Issue Type: Sub-task Components: CLI Reporter: Marcel Kinard Assignee: Martin Gonzalez Priority: Minor -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (CB-5082) add BB10 support in doPlatform()
[ https://issues.apache.org/jira/browse/CB-5082?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13948341#comment-13948341 ] ASF GitHub Bot commented on CB-5082: Github user jsoref commented on a diff in the pull request: https://github.com/apache/cordova-cli/pull/152#discussion_r10993531 --- Diff: src/info-utils.js --- @@ -0,0 +1,132 @@ +/** + 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. +*/ +var cordova_util = require('./util'), +child_process = require('child_process'), +path = require('path'), +fs= require('fs'), +_self; + +_self = { + +getNodeInfo: function( callback ){ + callback(_self.execFunc('node', '--version', function(call){callback(call);})); + }, + +getCordovaInfo: function( callback ){ + callback(_self.execFunc('cordova', '--version', function(call){callback(call);})); + }, + +getPlatformInfo: function(platform, projectRoot, callback ){ + var command=, args=; + switch( platform ){ + case ios: + _self.execFunc('xcodebuild', '-version', function(call){callback('iOS Platform:\r\r' +call);}); + break; + case android: + _self.execFunc('android', 'list target', function(call){callback('Android Platform:\r\r' +call);}); + break; + case blackberry10: + var bbUtilsPath = path.join(projectRoot, 'platforms', platform, 'cordova'), + bbBuildPath= path.join(projectRoot, 'platforms', platform, 'build'), + bbresults=; + //get CORDOVA_BBTOOLS environment variable. + _self.get_pathEnv( ['blackberry-nativepackager', 'blackberry-deploy'], function (path){ + if(path){ + //set CORDOVA_BBTOOLS environment variable. + _self.setEnv_Var('CORDOVA_BBTOOLS', path); + // Get BB10 SDK Version + _self.getSDKinfo(bbUtilsPath, function(result){ + if(result){bbresults+=Blackberry 10 NDK version: +result+\r; + // Get BB10 deployed and stored devices + _self.deployedDevices(bbUtilsPath, 'device', false, function(result){ + if(result){bbresults+=\rBlackberry 10 deployed devices:\r+result+\r; + // Get BB10 deployed and stored emulators + _self.deployedDevices(bbUtilsPath, 'emulator', false, function (result){ + if(result){bbresults+=\rBlackberry deployed emulator:\r+result+\r; + callback('Blackberry10 Platform:\r\r' +bbresults); + }}); + }}); + }}); + + } + else{callback(Blackberry 10 NDK path not found);} --- End diff -- Please don't misspell the brand. add BB10 support in doPlatform() Key: CB-5082 URL: https://issues.apache.org/jira/browse/CB-5082 Project: Apache Cordova Issue Type: Sub-task Components: CLI Reporter: Marcel Kinard Assignee: Martin Gonzalez Priority: Minor
[jira] [Commented] (CB-5082) add BB10 support in doPlatform()
[ https://issues.apache.org/jira/browse/CB-5082?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13948344#comment-13948344 ] ASF GitHub Bot commented on CB-5082: Github user jsoref commented on a diff in the pull request: https://github.com/apache/cordova-cli/pull/152#discussion_r10993657 --- Diff: src/info-utils.js --- @@ -0,0 +1,132 @@ +/** + 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. +*/ +var cordova_util = require('./util'), +child_process = require('child_process'), +path = require('path'), +fs= require('fs'), +_self; + +_self = { + +getNodeInfo: function( callback ){ + callback(_self.execFunc('node', '--version', function(call){callback(call);})); + }, + +getCordovaInfo: function( callback ){ + callback(_self.execFunc('cordova', '--version', function(call){callback(call);})); + }, + +getPlatformInfo: function(platform, projectRoot, callback ){ + var command=, args=; + switch( platform ){ + case ios: + _self.execFunc('xcodebuild', '-version', function(call){callback('iOS Platform:\r\r' +call);}); + break; + case android: + _self.execFunc('android', 'list target', function(call){callback('Android Platform:\r\r' +call);}); + break; + case blackberry10: + var bbUtilsPath = path.join(projectRoot, 'platforms', platform, 'cordova'), + bbBuildPath= path.join(projectRoot, 'platforms', platform, 'build'), + bbresults=; + //get CORDOVA_BBTOOLS environment variable. + _self.get_pathEnv( ['blackberry-nativepackager', 'blackberry-deploy'], function (path){ + if(path){ + //set CORDOVA_BBTOOLS environment variable. + _self.setEnv_Var('CORDOVA_BBTOOLS', path); + // Get BB10 SDK Version + _self.getSDKinfo(bbUtilsPath, function(result){ + if(result){bbresults+=Blackberry 10 NDK version: +result+\r; + // Get BB10 deployed and stored devices + _self.deployedDevices(bbUtilsPath, 'device', false, function(result){ + if(result){bbresults+=\rBlackberry 10 deployed devices:\r+result+\r; + // Get BB10 deployed and stored emulators + _self.deployedDevices(bbUtilsPath, 'emulator', false, function (result){ + if(result){bbresults+=\rBlackberry deployed emulator:\r+result+\r; + callback('Blackberry10 Platform:\r\r' +bbresults); + }}); + }}); + }}); + + } + else{callback(Blackberry 10 NDK path not found);} + }); + break; + } + }, + +execFunc: function(command, args, callback){ + child_process.exec(command + ' ' +args, + function (error, stdout, stderr) { + callback(stdout); + if (error !== null) { + callback('Error performing command: ' + error + \n
[jira] [Commented] (CB-5082) add BB10 support in doPlatform()
[ https://issues.apache.org/jira/browse/CB-5082?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13948343#comment-13948343 ] ASF GitHub Bot commented on CB-5082: Github user jsoref commented on a diff in the pull request: https://github.com/apache/cordova-cli/pull/152#discussion_r10993586 --- Diff: src/info-utils.js --- @@ -0,0 +1,132 @@ +/** + 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. +*/ +var cordova_util = require('./util'), +child_process = require('child_process'), +path = require('path'), +fs= require('fs'), +_self; + +_self = { + +getNodeInfo: function( callback ){ + callback(_self.execFunc('node', '--version', function(call){callback(call);})); + }, + +getCordovaInfo: function( callback ){ + callback(_self.execFunc('cordova', '--version', function(call){callback(call);})); + }, + +getPlatformInfo: function(platform, projectRoot, callback ){ + var command=, args=; + switch( platform ){ + case ios: + _self.execFunc('xcodebuild', '-version', function(call){callback('iOS Platform:\r\r' +call);}); + break; + case android: + _self.execFunc('android', 'list target', function(call){callback('Android Platform:\r\r' +call);}); + break; + case blackberry10: + var bbUtilsPath = path.join(projectRoot, 'platforms', platform, 'cordova'), + bbBuildPath= path.join(projectRoot, 'platforms', platform, 'build'), + bbresults=; + //get CORDOVA_BBTOOLS environment variable. + _self.get_pathEnv( ['blackberry-nativepackager', 'blackberry-deploy'], function (path){ + if(path){ + //set CORDOVA_BBTOOLS environment variable. + _self.setEnv_Var('CORDOVA_BBTOOLS', path); + // Get BB10 SDK Version + _self.getSDKinfo(bbUtilsPath, function(result){ + if(result){bbresults+=Blackberry 10 NDK version: +result+\r; + // Get BB10 deployed and stored devices + _self.deployedDevices(bbUtilsPath, 'device', false, function(result){ + if(result){bbresults+=\rBlackberry 10 deployed devices:\r+result+\r; + // Get BB10 deployed and stored emulators + _self.deployedDevices(bbUtilsPath, 'emulator', false, function (result){ + if(result){bbresults+=\rBlackberry deployed emulator:\r+result+\r; + callback('Blackberry10 Platform:\r\r' +bbresults); + }}); + }}); + }}); + + } + else{callback(Blackberry 10 NDK path not found);} + }); + break; + } + }, + +execFunc: function(command, args, callback){ + child_process.exec(command + ' ' +args, + function (error, stdout, stderr) { + callback(stdout); + if (error !== null) { + callback('Error performing command: ' + error + \n
[jira] [Commented] (CB-5082) add BB10 support in doPlatform()
[ https://issues.apache.org/jira/browse/CB-5082?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13948346#comment-13948346 ] ASF GitHub Bot commented on CB-5082: Github user jsoref commented on a diff in the pull request: https://github.com/apache/cordova-cli/pull/152#discussion_r10993698 --- Diff: src/info-utils.js --- @@ -0,0 +1,132 @@ +/** + 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. +*/ +var cordova_util = require('./util'), +child_process = require('child_process'), +path = require('path'), +fs= require('fs'), +_self; + +_self = { + +getNodeInfo: function( callback ){ + callback(_self.execFunc('node', '--version', function(call){callback(call);})); + }, + +getCordovaInfo: function( callback ){ + callback(_self.execFunc('cordova', '--version', function(call){callback(call);})); + }, + +getPlatformInfo: function(platform, projectRoot, callback ){ + var command=, args=; + switch( platform ){ + case ios: + _self.execFunc('xcodebuild', '-version', function(call){callback('iOS Platform:\r\r' +call);}); + break; + case android: + _self.execFunc('android', 'list target', function(call){callback('Android Platform:\r\r' +call);}); + break; + case blackberry10: + var bbUtilsPath = path.join(projectRoot, 'platforms', platform, 'cordova'), + bbBuildPath= path.join(projectRoot, 'platforms', platform, 'build'), + bbresults=; + //get CORDOVA_BBTOOLS environment variable. + _self.get_pathEnv( ['blackberry-nativepackager', 'blackberry-deploy'], function (path){ + if(path){ + //set CORDOVA_BBTOOLS environment variable. + _self.setEnv_Var('CORDOVA_BBTOOLS', path); + // Get BB10 SDK Version + _self.getSDKinfo(bbUtilsPath, function(result){ + if(result){bbresults+=Blackberry 10 NDK version: +result+\r; + // Get BB10 deployed and stored devices + _self.deployedDevices(bbUtilsPath, 'device', false, function(result){ + if(result){bbresults+=\rBlackberry 10 deployed devices:\r+result+\r; + // Get BB10 deployed and stored emulators + _self.deployedDevices(bbUtilsPath, 'emulator', false, function (result){ + if(result){bbresults+=\rBlackberry deployed emulator:\r+result+\r; + callback('Blackberry10 Platform:\r\r' +bbresults); + }}); + }}); + }}); + + } + else{callback(Blackberry 10 NDK path not found);} + }); + break; + } + }, + +execFunc: function(command, args, callback){ + child_process.exec(command + ' ' +args, + function (error, stdout, stderr) { + callback(stdout); + if (error !== null) { + callback('Error performing command: ' + error + \n
[jira] [Commented] (CB-5082) add BB10 support in doPlatform()
[ https://issues.apache.org/jira/browse/CB-5082?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13948345#comment-13948345 ] ASF GitHub Bot commented on CB-5082: Github user jsoref commented on a diff in the pull request: https://github.com/apache/cordova-cli/pull/152#discussion_r10993672 --- Diff: src/info-utils.js --- @@ -0,0 +1,132 @@ +/** --- End diff -- No one likes tabs add BB10 support in doPlatform() Key: CB-5082 URL: https://issues.apache.org/jira/browse/CB-5082 Project: Apache Cordova Issue Type: Sub-task Components: CLI Reporter: Marcel Kinard Assignee: Martin Gonzalez Priority: Minor -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (CB-5082) add BB10 support in doPlatform()
[ https://issues.apache.org/jira/browse/CB-5082?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13948356#comment-13948356 ] ASF GitHub Bot commented on CB-5082: Github user martincgg commented on the pull request: https://github.com/apache/cordova-cli/pull/152#issuecomment-38729077 Well, I'm using windows as my main development environment, sorry about the misspell, I have fixed that up. I've added the line at the end as well. The set env function it sets, if is not already set by the init command at the blackberry library, I'm setting the cordova_ BBTools var, because is used by target-utils.js, located in the blackberry library, it's the very same variable that is set in this file: https://github.com/apache/cordova-blackberry/blob/master/blackberry10/bin/init.bat#L83 add BB10 support in doPlatform() Key: CB-5082 URL: https://issues.apache.org/jira/browse/CB-5082 Project: Apache Cordova Issue Type: Sub-task Components: CLI Reporter: Marcel Kinard Assignee: Martin Gonzalez Priority: Minor -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (CB-5082) add BB10 support in doPlatform()
[ https://issues.apache.org/jira/browse/CB-5082?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13948364#comment-13948364 ] ASF GitHub Bot commented on CB-5082: Github user jsoref commented on the pull request: https://github.com/apache/cordova-cli/pull/152#issuecomment-38730048 Right, I'm not saying you shouldn't set environment variables before calling children. It's about how you call them and for whom. You shouldn't be using process.env for this purpose, see http://nodejs.org/api/child_process.html#child_process_child_process_spawn_command_args_options for how one passes special env values. add BB10 support in doPlatform() Key: CB-5082 URL: https://issues.apache.org/jira/browse/CB-5082 Project: Apache Cordova Issue Type: Sub-task Components: CLI Reporter: Marcel Kinard Assignee: Martin Gonzalez Priority: Minor -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (CB-5082) add BB10 support in doPlatform()
[ https://issues.apache.org/jira/browse/CB-5082?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13948485#comment-13948485 ] ASF GitHub Bot commented on CB-5082: Github user martincgg commented on the pull request: https://github.com/apache/cordova-cli/pull/152#issuecomment-38741745 Ok, got it, no problem. I can add logic to determine if the variable is already in place, and also something that when the function or the blackberry operations are completed, I can get ride of the value from the system, or I can make a backup of the path variable and after blackberry operation are completed, I'm going to set it back to place. Also, I'm going to check how child_process.spawn works to see if I can use it. Like I said, this process it only sets the variable for the current terminal, it won't mess with other process or it doesn't set the value in a permanently way, But I understand clearly your point. add BB10 support in doPlatform() Key: CB-5082 URL: https://issues.apache.org/jira/browse/CB-5082 Project: Apache Cordova Issue Type: Sub-task Components: CLI Reporter: Marcel Kinard Assignee: Martin Gonzalez Priority: Minor -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (CB-5082) add BB10 support in doPlatform()
[ https://issues.apache.org/jira/browse/CB-5082?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13948554#comment-13948554 ] ASF GitHub Bot commented on CB-5082: Github user jsoref commented on the pull request: https://github.com/apache/cordova-cli/pull/152#issuecomment-38747218 While cordova-cli is usually run as `bin/cordova`, it's possible to use cordova as a library, which means that your env changes last longer. add BB10 support in doPlatform() Key: CB-5082 URL: https://issues.apache.org/jira/browse/CB-5082 Project: Apache Cordova Issue Type: Sub-task Components: CLI Reporter: Marcel Kinard Assignee: Martin Gonzalez Priority: Minor -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (CB-5082) add BB10 support in doPlatform()
[ https://issues.apache.org/jira/browse/CB-5082?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13922825#comment-13922825 ] Martin Gonzalez commented on CB-5082: - Blackberry10 environment commands located under bin, do not provide any information about the NDK or well not any useful information, those command line tools, are used for other purposes. So I'd like to add that information using another sources that comes along with the blackberry ndk. add BB10 support in doPlatform() Key: CB-5082 URL: https://issues.apache.org/jira/browse/CB-5082 Project: Apache Cordova Issue Type: Sub-task Components: CLI Reporter: Marcel Kinard Assignee: Martin Gonzalez Priority: Minor -- This message was sent by Atlassian JIRA (v6.2#6252)
[jira] [Commented] (CB-5082) add BB10 support in doPlatform()
[ https://issues.apache.org/jira/browse/CB-5082?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13823971#comment-13823971 ] Josh Soref commented on CB-5082: I don't think this is what people would want... add BB10 support in doPlatform() Key: CB-5082 URL: https://issues.apache.org/jira/browse/CB-5082 Project: Apache Cordova Issue Type: Sub-task Components: CLI Reporter: Marcel Kinard Assignee: Lucas Holmquist Priority: Minor -- This message was sent by Atlassian JIRA (v6.1#6144)
[jira] [Commented] (CB-5082) add BB10 support in doPlatform()
[ https://issues.apache.org/jira/browse/CB-5082?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13796874#comment-13796874 ] Lucas Holmquist commented on CB-5082: - PR at https://github.com/apache/cordova-cli/pull/54 add BB10 support in doPlatform() Key: CB-5082 URL: https://issues.apache.org/jira/browse/CB-5082 Project: Apache Cordova Issue Type: Sub-task Components: CLI Reporter: Marcel Kinard Assignee: Lucas Holmquist Priority: Minor -- This message was sent by Atlassian JIRA (v6.1#6144)