[GitHub] cordova-docs issue #729: Fixed up 'deployment' docs in README.md.
Github user dblotsky commented on the issue: https://github.com/apache/cordova-docs/pull/729 @stevesgill @audreyso @shazron please review when you have a moment. --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org
[GitHub] cordova-docs pull request #729: Fixed up 'deployment' docs in README.md.
GitHub user dblotsky opened a pull request: https://github.com/apache/cordova-docs/pull/729 Fixed up 'deployment' docs in README.md. - Restored `gulp build` command in lieu of `npm run serve` command. - Tested and fixed suggested deployment commands. - Removed redundant text. You can merge this pull request into a Git repository by running: $ git pull https://github.com/dblotsky/cordova-docs dblotsky-deploy-docs Alternatively you can review and apply these changes as the patch at: https://github.com/apache/cordova-docs/pull/729.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 #729 commit a08fe2eb086c5f1d7f224659b92975381a7159dd Author: Dmitry Blotsky <dmitry.blot...@gmail.com> Date: 2017-09-13T00:21:44Z Fixed up 'deployment' docs in README.md. Restored 'gulp build' command in lieu of 'npm run serve' command. Tested and fixed suggested deployment commands. Removed redundant text. --- - To unsubscribe, e-mail: dev-unsubscr...@cordova.apache.org For additional commands, e-mail: dev-h...@cordova.apache.org
[GitHub] cordova-docs issue #443: Update index.md
Github user dblotsky commented on the issue: https://github.com/apache/cordova-docs/pull/443 @purplecabbage that indeed was what I said in Russian. :) Thanks for cleaning up the PR. --- 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 issue #640: Make more comprehensible the french documentation
Github user dblotsky commented on the issue: https://github.com/apache/cordova-docs/pull/640 Here's the direct Crowdin link: https://crowdin.com/translate/cordova/12/en-fr. You'll need to create a Crowdin account to edit it though. --- 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 issue #640: Make more comprehensible the french documentation
Github user dblotsky commented on the issue: https://github.com/apache/cordova-docs/pull/640 The changes seem fine, but they should be made in crowdin. The changes made in this PR would get overwritten by translation builds. --- 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 #612: CB-11412 Added docs for template use and cre...
Github user dblotsky commented on a diff in the pull request: https://github.com/apache/cordova-docs/pull/612#discussion_r73905774 --- Diff: www/_data/redirects.yml --- @@ -348,6 +348,7 @@ docs-global: "guide_appdev_privacy_index.md.html": "guide/appdev/privacy/index.html" "guide_appdev_whitelist_index.md.html": "guide/appdev/whitelist/index.html" "guide_cli_index.md.html": "guide/cli/index.html" +"guide_cli_template.md.html": "guide/cli/template.html" --- End diff -- Did this link exist in the past? If not, the redirect isn't necessary. --- 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 #613: CB-11477 Add a page about nightly builds
Github user dblotsky commented on a diff in the pull request: https://github.com/apache/cordova-docs/pull/613#discussion_r73905131 --- Diff: www/contribute/index.html --- @@ -22,6 +22,7 @@ Join the Dev mailing list and send a brief introduction of yourself to it Join the discussion on http://slack.cordova.io/;>Slack Sign the http://www.apache.org/licenses/#clas;>Individual Contributor License Agreement (ICLA) and mailto:secret...@apache.org;>submit it +Try out the next version of Cordova using nightly builds --- End diff -- Maybe use an absolute link like `{{ site.baseurl }}/contribute/nightly_builds.html` here, in case this page ever moves. --- 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-11157 Fixing anchor generation
GitHub user dblotsky opened a pull request: https://github.com/apache/cordova-docs/pull/604 CB-11157 Fixing anchor generation Adding colons and semicolons to excluded characters in fragment creation. Verified with GitHub's anchor-making algorithm. You can merge this pull request into a Git repository by running: $ git pull https://github.com/MSOpenTech/cordova-docs CB-11157 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/cordova-docs/pull/604.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 #604 commit f5d9a67df0151aa3517b2eb3b1e77506688df159 Author: Dmitry Blotsky <dmitry.blot...@gmail.com> Date: 2016-05-21T22:05:34Z CB-11157 Adding colons and semicolons to excluded characters in fragment creation. Verified with GitHub's anchor-making algorithm. --- 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-11157 Fixing anchor generation
Github user dblotsky commented on the pull request: https://github.com/apache/cordova-docs/pull/604#issuecomment-220802999 @riknoll @nikhilkh please review when you have a moment! --- 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-11127 Improving internal linking
Github user dblotsky commented on a diff in the pull request: https://github.com/apache/cordova-docs/pull/584#discussion_r60784540 --- Diff: www/.htaccess --- @@ -61,14 +63,14 @@ RewriteRule ^.*docs/(\w\w(?:-\w\w)?)/latest$ {{site.baseurl}}/docs/$1/latest/ [R # # docs/*/XX/* -> docs/*/YY/* # -{% for redirect in site.data.redirects.version-renames %}RewriteRule ^.*docs/(\w\w(?:-\w\w)?)/{{redirect.old}}/(.*)$ {{site.baseurl}}/docs/$1/{{redirect.new}}/$2 [R=302,L] +{% for redirect in site.data.redirects.version-renames %}RewriteRule ^.*docs/(\w\w(?:-\w\w)?)/{{redirect[0]}}/(.*)$ {{site.baseurl}}/docs/$1/{{redirect[1]}}/$2 [R=302,L] {% endfor %} # 302 (temporary): # # docs/XX/* -> docs/YY/* # -{% for redirect in site.data.redirects.language-renames %}RewriteRule ^.*docs/{{redirect.old}}/((?:\d+\.(?:\d+\.\d+|x))|dev|latest)/(.*)$ {{site.baseurl}}/docs/{{redirect.new}}/$1/$2 [R=302,L] +{% for redirect in site.data.redirects.language-renames %}RewriteRule ^.*docs/{{redirect[0]}}/((?:\d+\.(?:\d+\.\d+|x))|dev|latest)/(.*)$ {{site.baseurl}}/docs/{{redirect[1]}}/$1/$2 [R=302,L] --- End diff -- Oh, sorry. Just saw your comment before. --- 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-11127 Improving internal linking
Github user dblotsky commented on a diff in the pull request: https://github.com/apache/cordova-docs/pull/584#discussion_r60784438 --- Diff: www/.htaccess --- @@ -61,14 +63,14 @@ RewriteRule ^.*docs/(\w\w(?:-\w\w)?)/latest$ {{site.baseurl}}/docs/$1/latest/ [R # # docs/*/XX/* -> docs/*/YY/* # -{% for redirect in site.data.redirects.version-renames %}RewriteRule ^.*docs/(\w\w(?:-\w\w)?)/{{redirect.old}}/(.*)$ {{site.baseurl}}/docs/$1/{{redirect.new}}/$2 [R=302,L] +{% for redirect in site.data.redirects.version-renames %}RewriteRule ^.*docs/(\w\w(?:-\w\w)?)/{{redirect[0]}}/(.*)$ {{site.baseurl}}/docs/$1/{{redirect[1]}}/$2 [R=302,L] --- End diff -- The resulting `.htaccess` file has too many spaces if we add an extra space like this: {% for ... %} RewriteRule ... {% endfor %} because it will render as: RewriteRule ... RewriteRule ... We can still refactor it from this: {% for ... %}RewriteRule ... {% endfor %} to this: {% for ... %} RewriteRule ... {% endfor %} Which do you think is better? --- 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-11127 Improving internal linking
Github user dblotsky commented on a diff in the pull request: https://github.com/apache/cordova-docs/pull/584#discussion_r60783856 --- Diff: tools/bin/gen_pages_dict.js --- @@ -0,0 +1,120 @@ +// 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. + +"use strict"; + +var fs = require("fs"); +var path = require("path"); +var yaml = require("js-yaml"); +var walk = require("walk"); +var glob = require("glob"); +var Q= require("q"); +var optimist = require("optimist"); + +var util = require("./util"); + +// constants +var LATEST_ALIAS_URI = "/latest/"; + +// helpers +function pathToURI(filePath, rootPath) { +return filePath +.replace(new RegExp("^" + rootPath), "") +.replace(new RegExp("\\.md$"), ".html"); +} + +function pagesFromRedirects(redirects, languages) { +var pages = {}; + +// add docs redirects +if (typeof redirects.docs !== "undefined") { +for (var redirectSource in redirects.docs) { + +// add an entry for the redirect's source, once for each language +for (var i = 0; i < languages.length; i++) { +var language = languages[i]; +var pagePath = "/docs/" + language + "/" + redirectSource; + +pages[pagePath] = true; +} +} +} + +return pages; +} + +function isInLatestDocs(uri, latestVersion) { +return uri.indexOf("/" + latestVersion + "/") !== (-1); +} + +// main +function main () { + +// get args +var argv = optimist +.usage("Usage: $0 [options]") +.demand("languages").describe("languages", "comma-separated list of docs languages") +.demand("latestVersion").describe("latestVersion", "the current latest docs version") +.demand("siteRoot").describe("siteRoot", "the source ToC for the given directory") +.string("redirectsFile").describe("redirectsFile", "file containing redirects for the website").default("redirectsFile", null) +.argv; + +var siteRootPath = argv.siteRoot; +var redirectsFilePath = argv.redirectsFile; +var latestVersion = argv.latestVersion; +var languages = argv.languages.split(","); + +// pages to return +var pages = {}; + +// add pages for redirects if a redirects file was passed +if (redirectsFilePath !== null) { + +var redirectsString = fs.readFileSync(redirectsFilePath); +var redirects = yaml.load(redirectsString); +var redirectsPages = pagesFromRedirects(redirects, languages); + +pages = redirectsPages; +} + +// add entries for all Markdown files in the site root +var allMarkdownFiles = path.join(siteRootPath, "**/*.md"); +glob(allMarkdownFiles, function (error, filePaths) { +for (var i = 0; i < filePaths.length; i++) { +var filePath = filePaths[i]; +var fileURI = pathToURI(filePath, siteRootPath); + +// add the page +pages[fileURI] = true; + +// also add /latest/ version for pages in latest docs +if (isInLatestDocs(fileURI, latestVersion)) { +var latestURI = fileURI.replace("/" + latestVersion + "/", LATEST_ALIAS_URI); --- End diff -- This replaces `/6.x/` with `/latest/`, so it accounts for the slashes. --- If your project is set up for it, you can reply to this email and
[GitHub] cordova-docs pull request: CB-11127 Improving internal linking
Github user dblotsky commented on a diff in the pull request: https://github.com/apache/cordova-docs/pull/584#discussion_r60783503 --- Diff: www/.htaccess --- @@ -61,14 +63,14 @@ RewriteRule ^.*docs/(\w\w(?:-\w\w)?)/latest$ {{site.baseurl}}/docs/$1/latest/ [R # # docs/*/XX/* -> docs/*/YY/* # -{% for redirect in site.data.redirects.version-renames %}RewriteRule ^.*docs/(\w\w(?:-\w\w)?)/{{redirect.old}}/(.*)$ {{site.baseurl}}/docs/$1/{{redirect.new}}/$2 [R=302,L] +{% for redirect in site.data.redirects.version-renames %}RewriteRule ^.*docs/(\w\w(?:-\w\w)?)/{{redirect[0]}}/(.*)$ {{site.baseurl}}/docs/$1/{{redirect[1]}}/$2 [R=302,L] {% endfor %} # 302 (temporary): # # docs/XX/* -> docs/YY/* # -{% for redirect in site.data.redirects.language-renames %}RewriteRule ^.*docs/{{redirect.old}}/((?:\d+\.(?:\d+\.\d+|x))|dev|latest)/(.*)$ {{site.baseurl}}/docs/{{redirect.new}}/$1/$2 [R=302,L] +{% for redirect in site.data.redirects.language-renames %}RewriteRule ^.*docs/{{redirect[0]}}/((?:\d+\.(?:\d+\.\d+|x))|dev|latest)/(.*)$ {{site.baseurl}}/docs/{{redirect[1]}}/$1/$2 [R=302,L] --- End diff -- Alignment with what? --- 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-11127 Improving internal linking
Github user dblotsky commented on the pull request: https://github.com/apache/cordova-docs/pull/584#issuecomment-213545334 @riknoll @rakatyal please also give this a look when you have a moment. --- 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-11127 Improving internal linking
GitHub user dblotsky opened a pull request: https://github.com/apache/cordova-docs/pull/584 CB-11127 Improving internal linking Relevant changes: - added a new data file, `all-pages.yml`, which stores a list of valid links on the site - version dropdowns and out-of-date alerts now use the new data file to only link to valid pages - redirects are now a dictionary instead of a list, which is more flexible and easier to work with Miscellaneous changes: - refactored Makefile dependencies to properly rebuild some files when necessary - refactored `docs.html` to be a bit more readable You can merge this pull request into a Git repository by running: $ git pull https://github.com/MSOpenTech/cordova-docs CB-11127 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/cordova-docs/pull/584.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 #584 commit 1184b339bc869e87919b2720c057e9b57a9022d2 Author: Dmitry Blotsky <dmitry.blot...@gmail.com> Date: 2016-04-13T02:40:03Z CB-11127 Improving internal linking --- 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-11104: Integrate Algolia Search to c...
Github user dblotsky commented on a diff in the pull request: https://github.com/apache/cordova-docs/pull/581#discussion_r60677936 --- Diff: www/static/js/algolia.js --- @@ -0,0 +1,21 @@ +--- +--- + +{% if page.version %} +{% assign version = page.version %} +{% else %} +{% assign version = site.latest_docs_version %} +{% endif %} + +{% if page.language %} +{% assign language = page.language %} +{% else %} +{% assign language = site.language %} +{% endif %} + +docsearch({ +apiKey: '{{ site.algolia_api_key }}', +indexName: 'cordova', +inputSelector: '#header-search-field', +algoliaOptions: { 'facetFilters': ["version: {{ version }}", "language: {{ language }}"] } --- End diff -- Two notes: - in the example from the Algolia folks, I think there was no space between `version:` and `{{version}}`; same for the language - the two variables need to be generated as constants on the HTML page (maybe bring back `algolia.html` include) and then used in this 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-docs pull request: CB-11126 ToC Generation Refactor
Github user dblotsky closed the pull request at: https://github.com/apache/cordova-docs/pull/583 --- 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-10996 Updating docs index page to ma...
Github user dblotsky commented on the pull request: https://github.com/apache/cordova-docs/pull/575#issuecomment-212685445 @riknoll please give this another look. It's now using the changes from [CB-11126][1]. [1]: https://issues.apache.org/jira/browse/CB-11126 --- 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: ToC Generation Refactor
Github user dblotsky commented on a diff in the pull request: https://github.com/apache/cordova-docs/pull/583#discussion_r60496008 --- Diff: tools/bin/toc.js --- @@ -17,123 +17,57 @@ "use strict"; -var fs = require("fs"); -var path = require("path"); +var fs = require("fs"); +var path = require("path"); +var childProcess = require("child_process"); + var yaml = require("js-yaml"); -var walk = require("walk"); var Q= require("q"); var argv = require("optimist").argv; -var util = require("./util"); - -function isUnderline(line) { -return /-+|=+|\*+/.test(line); -} - -function getPageTitle(filePath) { -var file = fs.readFileSync(filePath, 'utf8'); -var res = /([^<]*)<\/h1>|#\ (.*)|(.*)[\n\f\r]+(?:={3}=+|-{3}-+)/.exec(file); -if (res) { -if (res[1]) { -return res[1].trim(); -} -if (res[2]) { -return res[2].trim(); -} -if (res[3]) { -return res[3].trim(); -} -} -return null; -} - -function generateToC(sourceDir) { - -var deferred = Q.defer(); -var toc = []; - -// go through each file in sourceDir -var walker = walk.walk(sourceDir); -walker.on("file", function (dirPrefix, fileStats, next) { - -var fileName = fileStats.name; -var filePath = path.join(dirPrefix, fileName); - -// get the page path -var pagePrefix = dirPrefix.replace(sourceDir, ''); -var pagePath = path.join(pagePrefix, fileName); -var pageURI= pagePath.replace(".md", ".html").replace(/\\/g, "/"); - -// remove leading slash -if (pageURI[0] === "/") { -pageURI = pageURI.substr(1); -} - -// get heading -var heading = getPageTitle(filePath); - -// if the page has a heading, add it to the ToC -if (heading) { -toc.push({ -name: heading, -url: pageURI -}); -} - -next(); -}); - -walker.on("errors", function (root, nodeStatsArray, next) { -console.error("ERROR while processing " + root); -next(); -}); - -walker.on("end", function () { -deferred.resolve(toc); -}); - -return deferred.promise; -} +var augment = require("./augment_toc"); +var util= require("./util"); function main () { var docsRoot = argv._[0]; -var dataRoot = argv._[1]; +var tocRoot = argv._[1]; // validate args -if ((!docsRoot) || (!dataRoot)) { +if ((!docsRoot) || (!tocRoot)) { var scriptName = path.basename(process.argv[1]); -console.log("usage: " + scriptName + " docsRoot dataRoot"); +console.log("usage: " + scriptName + " docsRoot tocRoot"); console.log(scriptName + ": error: too few arguments"); return 1; } -var tocRoot = path.join(dataRoot, 'toc'); - // go through all the languages util.listdirsSync(docsRoot).forEach(function (languageName) { - var languagePath = path.join(docsRoot, languageName); // go through all the versions util.listdirsSync(languagePath).forEach(function (versionName) { - var versionPath = path.join(languagePath, versionName); -var outputName = util.generatedTocfileName(languageName, versionName); -var outputPath = path.join(tocRoot, outputName); -// generate ToC -generateToC(versionPath).then(function (toc) { +var srcTocName = util.srcTocfileName(languageName, versionName); +var destTocName = util.genTocfileName(languageName, versionName); -// sort the ToC -toc.sort(function (a, b) { -return a.name.localeCompare(b.name, languageName); -}); +var srcTocPath = path.join(tocRoot, srcTocName); +var destTocPath = path.join(tocRoot, destTocName); -// save it to a file -var tocText = yaml.dump(toc); -console.log(outputPath); -fs.writeFileSync(outputPath, tocText, 'utf8'); +
[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_r60495766 --- Diff: lib/utils/utilities.js --- @@ -0,0 +1,123 @@ +#!/usr/bin/env node + +var shelljs = require('shelljs'); +var verbose = undefined; +var fs = require('fs'); +var os = require("os"); +var util= require('util'); +var path= require("path-extra"); +var logger = require('cordova-common').CordovaLogger.get(); + +var HEADING_LINE_PATTERN = /List of devices/m; +var DEVICE_ROW_PATTERN = /(emulator|device|host)/m; + +function isWindows () { +return /^win/.test(os.platform()); +} + +function countAndroidDevices() { +var listCommand = "adb devices"; + +logger.info("running:"); +logger.info("" + listCommand); + +var numDevices = 0; +var result = shelljs.exec(listCommand, {silent: false, async: false}); +result.output.split('\n').forEach(function (line) { +if (!HEADING_LINE_PATTERN.test(line) && DEVICE_ROW_PATTERN.test(line)) { +numDevices += 1; +} +}); +return numDevices; +} + +function secToMin (seconds) { +return Math.ceil(seconds / 60); +} + +function getSimulatorsFolder() { +var simulatorsFolderPath = path.join(path.homedir(), "Library", "Developer", "CoreSimulator", "Devices"); +return simulatorsFolderPath; +} + +function getSimId() { +var findSimCommand = "cordova 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]); +} +}); + +return simId; +} + +function doesFileExist(filePath) { +var fileExists = false; +try { +stats = fs.statSync(filePath); +fileExists = true; +} catch (e) { +fileExists = false; +} +return fileExists; +} + +function getSqlite3InsertionCommand(destinationTCCFile, service, appName) { +return util.format( 'sqlite3 %s "insert into access' + + '(service, client, client_type, allowed, prompt_count, csreq) values(\'%s\', \'%s\', ' + + '0,1,1,NULL)"', destinationTCCFile, service, appName); +} + +module.exports = { +ANDROID:"android", +IOS:"ios", +WINDOWS:"windows", +PARAMEDIC_DEFAULT_APP_NAME: "io.cordova.hellocordova", + +DEFAULT_LOG_TIME: 15, +DEFAULT_LOG_TIME_ADDITIONAL: 2, + +secToMin: secToMin, +isWindows: isWindows, +countAndroidDevices: countAndroidDevices, +getSimulatorsFolder: getSimulatorsFolder, +getSimId: getSimId, +doesFileExist: doesFileExist, +getSqlite3InsertionCommand: getSqlite3InsertionCommand +}; --- End diff -- The name of this file is awkward. Consider just putting this code in `lib/utils.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 p
[GitHub] cordova-docs pull request: ToC Generation Refactor
GitHub user dblotsky opened a pull request: https://github.com/apache/cordova-docs/pull/583 ToC Generation Refactor **Note**: this PR is easier to review one commit at a time, and the commit messages roughly describe each change. Changes: - now `*-src.yml` files are mandatory for each docs version - `*-src.yml` files get turned into `*-gen.yml` files - renamed `*-manual.yml` files to the new `*-src.yml` format - ToCs now contain only entries with `uri`s (unless they have children) - pages now specify their ToC name using the `title` or `toc_title` front matter property - removed the `name` property from ToC entries, moving it to the respective page where necessary You can merge this pull request into a Git repository by running: $ git pull https://github.com/MSOpenTech/cordova-docs toc-gen-refactor Alternatively you can review and apply these changes as the patch at: https://github.com/apache/cordova-docs/pull/583.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 #583 commit 7022ab8713517e99904fbe0a33ac02aa0a637dc0 Author: Dmitry Blotsky <dmitry.blot...@gmail.com> Date: 2016-04-20T01:45:44Z Refactoring ToC generation process: source ToCs are always required, and the result ToCs are generated from them. Refactoring Makefile for better readability. commit 297128f29dabf2afc7b9c620b048d589029f02f6 Author: Dmitry Blotsky <dmitry.blot...@gmail.com> Date: 2016-04-20T01:53:43Z Renamed ToCs to match new ToC build process. commit 7b879387a81617b8a783e58398f84aefb1b9a181 Author: Dmitry Blotsky <dmitry.blot...@gmail.com> Date: 2016-04-20T02:05:57Z Moving ToC names into toc_title properties for their respective files, and also removing the 'name' property from all ToC files. --- 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: ToC Generation Refactor
Github user dblotsky commented on the pull request: https://github.com/apache/cordova-docs/pull/583#issuecomment-212213980 @riknoll @rakatyal @nikhilkh please review when you have a moment. --- 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-11104: Integrate Algolia Search to c...
Github user dblotsky commented on a diff in the pull request: https://github.com/apache/cordova-docs/pull/581#discussion_r60334146 --- Diff: www/static/css-src/main.scss --- @@ -194,6 +194,23 @@ code { color: #00; } +/* algolia search formatting */ +.algolia-docsearch-suggestion--category-header, .algolia-docsearch-suggestion { +font-family: "Raleway", Helvetica, Arial, sans-serif !important; +} + +.algolia-docsearch-suggestion--category-header { +background-color: #262626 !important; +font-size: 16px !important; +font-weight: bold !important; +line-height: 30px !important; +} + +.algolia-docsearch-suggestion { +font-size: 14px !important; +font-weight: 300!important; +} + --- End diff -- I just tried this guy in my browser, and it looks like there are just a few inconsistencies with the current styling. Old: ![desktop_old](https://cloud.githubusercontent.com/assets/405489/14659626/833ffdcc-0652-11e6-91a8-c3d3c485f58a.PNG) ![mobile_old](https://cloud.githubusercontent.com/assets/405489/14659627/8821ed64-0652-11e6-96a5-b16835f124ab.PNG) New: ![desktop_new](https://cloud.githubusercontent.com/assets/405489/14659632/8f7d2880-0652-11e6-9bfb-bcf9575666b8.PNG) ![mobile_new](https://cloud.githubusercontent.com/assets/405489/14659634/93f0b198-0652-11e6-9b8c-3a3282365672.PNG) --- 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-11104: Integrate Algolia Search to c...
Github user dblotsky commented on the pull request: https://github.com/apache/cordova-docs/pull/581#issuecomment-212179026 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_r60329456 --- Diff: lib/ParamediciOSPermissions.js --- @@ -0,0 +1,43 @@ +#!/usr/bin/env node + +/* jshint node: true */ +var path = require('path'); +var fs = require('fs'); +var shelljs = require("shelljs"); +var logger = require('./utils').logger; +var util = require('./utils').utilities; + +var TCC_FOLDER_PERMISSION = 0777; + +function ParamediciOSPermissions(appName, tccDbPath) { +this.appName = appName; +this.tccDbPath = tccDbPath; +} + +ParamediciOSPermissions.prototype.updatePermissions = function(serviceList){ +var simulatorsFolder = util.getSimulatorsFolder(); +var simId = util.getSimId(); +logger.info('Sim Id is: ' + simId); +var destinationTCCFile = path.join(simulatorsFolder, simId, '/data/Library/TCC/TCC.db'); + +if(!util.doesFileExist(destinationTCCFile)) { +// No TCC.db file exists by default. So, Copy the new TCC.db file +var destinationTCCFolder = path.join(simulatorsFolder, simId, '/data/Library/TCC'); +if(!util.doesFileExist(destinationTCCFolder)){ +fs.mkdir(destinationTCCFolder, TCC_FOLDER_PERMISSION); +} +var command = "cp " + this.tccDbPath + " " + destinationTCCFolder; +logger.info("Running Command: " + command); +shelljs.exec(command, {silent: true, async: false}); +} --- End diff -- The `ncp` module is also an option. --- 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-11104: Integrate Algolia Search to c...
Github user dblotsky commented on a diff in the pull request: https://github.com/apache/cordova-docs/pull/581#discussion_r60329201 --- Diff: www/_layouts/base.html --- @@ -3,12 +3,20 @@ --- - +{% if page.language %} +{% assign language = page.language %} +{% else %} +{% assign language = site.language %} +{% endif %} + + {% include head.html %} {{ content }} {% include analytics.html %} +https://cdn.jsdelivr.net/docsearch.js/1/docsearch.min.js"</a>;> --- End diff -- Please move the script tag into the included file, and add the `defer` property. --- 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-11104: Integrate Algolia Search to c...
Github user dblotsky commented on a diff in the pull request: https://github.com/apache/cordova-docs/pull/581#discussion_r60329126 --- Diff: www/_includes/header.html --- @@ -29,18 +29,24 @@ Get Started + + + +{% if page.version %} --- End diff -- Nitpick: please indent this block; it looks weird indented one level lower than the code below 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-docs pull request: CB-11104: Integrate Algolia Search to c...
Github user dblotsky commented on a diff in the pull request: https://github.com/apache/cordova-docs/pull/581#discussion_r60328845 --- Diff: www/_includes/algolia.html --- @@ -0,0 +1,14 @@ +{% if page.version %} +{% assign version = page.version %} +{% else %} +{% assign version = site.latest_docs_version %} +{% endif %} + +
[GitHub] cordova-docs pull request: CB-11104: Integrate Algolia Search to c...
Github user dblotsky commented on a diff in the pull request: https://github.com/apache/cordova-docs/pull/581#discussion_r60328800 --- Diff: conf/_config.yml --- @@ -81,3 +81,5 @@ kramdown: # exclude these directories from the build exclude: - static/css-src + +algolia_api_key: "0a916ab198bd93d031aa70611271e42e" --- End diff -- General comment: should this be kept in the private SVN repo? If so, should we store a dummy value here to be replaced by committers building the site? --- 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-11104: Integrate Algolia Search to c...
Github user dblotsky commented on a diff in the pull request: https://github.com/apache/cordova-docs/pull/581#discussion_r60314159 --- Diff: www/_layouts/base.html --- @@ -3,12 +3,27 @@ --- - +{% if page.language %} +{% assign language = page.language %} +{% else %} +{% assign language = site.language %} +{% endif %} + + {% include head.html %} {{ content }} {% include analytics.html %} +https://cdn.jsdelivr.net/docsearch.js/1/docsearch.min.js"</a>;> + + docsearch({ + apiKey: '0a916ab198bd93d031aa70611271e42e', + indexName: 'cordova', + inputSelector: '#header-search-field', + algoliaOptions: { 'facetFilters': [ "version:6.x","language: {{ language }}" ] } + }); + --- End diff -- Also, please place this code into an include like `analytics.html` for consistency. --- 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-11104: Integrate Algolia Search to c...
Github user dblotsky commented on a diff in the pull request: https://github.com/apache/cordova-docs/pull/581#discussion_r60313932 --- Diff: www/_layouts/base.html --- @@ -3,12 +3,27 @@ --- - +{% if page.language %} +{% assign language = page.language %} +{% else %} +{% assign language = site.language %} +{% endif %} + + {% include head.html %} {{ content }} {% include analytics.html %} +https://cdn.jsdelivr.net/docsearch.js/1/docsearch.min.js"</a>;> +
[GitHub] cordova-docs pull request: CB-11104: Integrate Algolia Search to c...
Github user dblotsky commented on a diff in the pull request: https://github.com/apache/cordova-docs/pull/581#discussion_r60313371 --- Diff: www/static/css-src/main.scss --- @@ -194,6 +194,23 @@ code { color: #00; } +/* algolia search formatting */ +.algolia-docsearch-suggestion--category-header, .algolia-docsearch-suggestion { +font-family: "Raleway", Helvetica, Arial, sans-serif; +} --- End diff -- Is the font being overridden in the Algolia CSS file? If not, the existing font rules for `body` should cover fonts for this widget. --- 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-11104: Integrate Algolia Search to c...
Github user dblotsky commented on a diff in the pull request: https://github.com/apache/cordova-docs/pull/581#discussion_r60313002 --- Diff: www/_layouts/base.html --- @@ -3,12 +3,27 @@ --- - +{% if page.language %} +{% assign language = page.language %} +{% else %} +{% assign language = site.language %} +{% endif %} + + {% include head.html %} {{ content }} {% include analytics.html %} +https://cdn.jsdelivr.net/docsearch.js/1/docsearch.min.js"</a>;> +
[GitHub] cordova-docs pull request: CB-11104: Integrate Algolia Search to c...
Github user dblotsky commented on a diff in the pull request: https://github.com/apache/cordova-docs/pull/581#discussion_r60312938 --- Diff: www/_layouts/base.html --- @@ -3,12 +3,27 @@ --- - +{% if page.language %} +{% assign language = page.language %} +{% else %} +{% assign language = site.language %} +{% endif %} + + {% include head.html %} {{ content }} {% include analytics.html %} +https://cdn.jsdelivr.net/docsearch.js/1/docsearch.min.js"</a>;> + + docsearch({ + apiKey: '0a916ab198bd93d031aa70611271e42e', + indexName: 'cordova', + inputSelector: '#header-search-field', + algoliaOptions: { 'facetFilters': [ "version:6.x","language: {{ language }}" ] } + }); + --- End diff -- Please fix the indentation for this block. It's offset by one space. --- 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-11104: Integrate Algolia Search to c...
Github user dblotsky commented on a diff in the pull request: https://github.com/apache/cordova-docs/pull/581#discussion_r60312014 --- Diff: www/_includes/head.html --- @@ -18,6 +18,9 @@ {% endif %} + +https://cdn.jsdelivr.net/docsearch.js/1/docsearch.min.css; /> + --- End diff -- Please put this with the CSS links below. --- 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_r60307151 --- Diff: lib/ParamediciOSPermissions.js --- @@ -0,0 +1,43 @@ +#!/usr/bin/env node + +/* jshint node: true */ +var path = require('path'); +var fs = require('fs'); +var shelljs = require("shelljs"); +var logger = require('./utils').logger; +var util = require('./utils').utilities; + +var TCC_FOLDER_PERMISSION = 0777; --- End diff -- Why doesn't `0644` work? If execution permissions are required on the folder, then please use `0755`. Using `0777` is a security hazard. --- 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-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-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-medic pull request: CB-10898 Kill iOS Simulator, Xcode7 st...
Github user dblotsky commented on the pull request: https://github.com/apache/cordova-medic/pull/86#issuecomment-209098826 @omefire please add both `"iOS Simulator"` and `"Simulator"` to that 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-docs pull request: CB-10996 Updating docs index page to ma...
Github user dblotsky commented on the pull request: https://github.com/apache/cordova-docs/pull/575#issuecomment-208684175 Screenshot: ![capture](https://cloud.githubusercontent.com/assets/405489/14448824/30cbb93c-0021-11e6-8153-e9da514d0532.PNG) --- 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-10996 Updating docs index page to ma...
GitHub user dblotsky opened a pull request: https://github.com/apache/cordova-docs/pull/575 CB-10996 Updating docs index page to match new content. @riknoll @nikhilkh @rakatyal @devgeeks please take a look when you have a moment. You can merge this pull request into a Git repository by running: $ git pull https://github.com/MSOpenTech/cordova-docs CB-10996 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/cordova-docs/pull/575.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 #575 commit b2d80cae2803c68cdbab4e991b64ff8d4dd05c1f Author: Dmitry Blotsky <dmitry.blot...@gmail.com> Date: 2016-04-12T02:37:05Z CB-10996 Updating docs index page to match new content. --- 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 dblotsky commented on a diff in the pull request: https://github.com/apache/cordova-plugin-camera/pull/202#discussion_r59295343 --- Diff: appium-tests/android/android.spec.js --- @@ -27,52 +28,47 @@ 'use strict'; -var wdHelper = require('../helpers/wdHelper'); +var wdHelper = global.WD_HELPER; +var screenshotHelper = global.SCREENSHOT_HELPER; var wd = wdHelper.getWD(); var cameraConstants = require('../../www/CameraConstants'); var cameraHelper = require('../helpers/cameraHelper'); -var screenshotHelper = require('../helpers/screenshotHelper'); -var STARTING_MESSAGE = 'Ready for action!'; -var RETRY_COUNT = 3; // how many times to retry taking a picture before failing var MINUTE = 60 * 1000; +var BACK_BUTTON = 4; var DEFAULT_SCREEN_WIDTH = 360; var DEFAULT_SCREEN_HEIGHT = 567; var DEFAULT_WEBVIEW_CONTEXT = 'WEBVIEW'; +var PROMISE_PREFIX = 'appium_camera_promise_'; describe('Camera tests Android.', function () { var driver; // the name of webview context, it will be changed to match needed context if there are named ones: var webviewContext = DEFAULT_WEBVIEW_CONTEXT; // this indicates that the device library has the test picture: var isTestPictureSaved = false; -// this indicates that there was a critical error and we should try to recover: -var errorFlag = false; -// this indicates that we couldn't restore Appium session and should fail fast: -var stopFlag = false; // we need to know the screen width and height to properly click on an image in the gallery: var screenWidth = DEFAULT_SCREEN_WIDTH; var screenHeight = DEFAULT_SCREEN_HEIGHT; +// promise count to use in promise ID +var promiseCount = 0; -function win() { -expect(true).toBe(true); +function getNextPromiseId() { +return PROMISE_PREFIX + promiseCount++; --- End diff -- Or even break up the update and the read into two lines, so it's easier to read. --- 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: Added Evothings Studio to Cordova Tools...
Github user dblotsky commented on the pull request: https://github.com/apache/cordova-docs/pull/410#issuecomment-208597412 @mikaelkindborg I've merged the PR! Please feel free to close it. Somehow my merging script didn't append the "this closes..." part. --- 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: Paramedic improvements
Github user dblotsky commented on a diff in the pull request: https://github.com/apache/cordova-paramedic/pull/3#discussion_r59101538 --- Diff: lib/paramedic.js --- @@ -0,0 +1,231 @@ +/** +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 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; + +// Time to wait for initial device connection. +// If device has not connected within this interval the tests are stopped. +var INITIAL_CONNECTION_TIMEOUT = 30; // 5mins + +function ParamedicRunner(config, _callback) { +this.tempFolder = null; +this.pluginsManager = null; + +this.config = config; + +exec.setVerboseLevel(config.isVerbose()); +} + +ParamedicRunner.prototype.run = function() { +var self = this; + +return Q().then(function() { +self.createTempProject(); +self.prepareProjectToRunTests(); +return Server.startServer(self.config.getPorts(), self.config.getExternalServerUrl(), self.config.getUseTunnel()); +}) +.then(function(server) { +self.server = server; + +self.injectReporters(); +self.subcribeForEvents(); + +var connectionUrl = server.getConnectionUrl(self.config.getPlatformId()); +self.writeMedicConnectionUrl(connectionUrl); + +return self.runTests(); +}) +.fin(function() { +self.cleanUpProject(); +}); +}; + +ParamedicRunner.prototype.createTempProject = function() { +this.tempFolder = tmp.dirSync(); +tmp.setGracefulCleanup(); +logger.info("cordova-paramedic: creating temp project at " + this.tempFolder.name); +exec('cordova create ' + this.tempFolder.name); +shell.pushd(this.tempFolder.name); +}; + +ParamedicRunner.prototype.prepareProjectToRunTests = function() { +this.installPlugins(); +this.setUpStartPage(); +this.installPlatform(); +this.checkPlatformRequirements(); +}; + +ParamedicRunner.prototype.installPlugins = function() { +logger.info("cordova-paramedic: installing plugins"); +this.pluginsManager = new PluginsManager(this.tempFolder.name, this.storedCWD); +this.pluginsManager.installPlugins(this.config.getPlugins()); +this.pluginsManager.installTestsForExistingPlugins(); + this.pluginsManager.installSinglePlugin('cordova-plugin-test-framework'); +this.pluginsManager.installSinglePlugin('cordova-plugin-device'); +this.pluginsManager.installSinglePlugin(path.join(__dirname, '../paramedic-plugin')); +}; + +ParamedicRunner.prototype.setUpStartPage = function() { +logger.normal("cordova-paramedic: setting app start page to test page"); +shell.sed('-i', 'src="index.html"', 'src="cdvtests/index.html"', 'config.xml'); +}; + +ParamedicRunner.prototype.installPlatform = function() { +logger.info("cordova-paramedic: adding platform : " + this.config.getPlatform()); +exec('cordova platform add ' + this.config.getPlatform()); +}; + +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) +throw new Error('Platform requirements check has failed!'); +}; + +ParamedicRunner.prototype.injectReporters = function() {
[GitHub] cordova-paramedic pull request: Paramedic improvements
Github user dblotsky commented on a diff in the pull request: https://github.com/apache/cordova-paramedic/pull/3#discussion_r59101124 --- Diff: lib/LocalServer.js --- @@ -0,0 +1,162 @@ +/** +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 Q = require('q'), +io = require('socket.io'), +logger = require('./utils').logger, +exec = require('./utils').exec, +path = require('path'), +util = require('util'), +portChecker = require('tcp-port-used'), +EventEmitter = require('events').EventEmitter, +localtunnel = require('localtunnel'); + + +// how many ms without a pong packet to consider the connection closed +var CONNECTION_HEARBEAT_PING_TIMEOUT = 6, +// how many ms before sending a new ping packet +CONNECTION_HEARBEAT_PING_INTERVAL = 25000; + +function LocalServer(port, externalServerUrl) { +this.port = port; +this.externalServerUrl = externalServerUrl; +} + +util.inherits(LocalServer, EventEmitter); + +LocalServer.startServer = function(ports, externalServerUrl, useTunnel) { +logger.normal("local-server: scanning ports from " + ports.start + " to " + ports.end); + +return LocalServer.getFirstAvailablePort(ports.start, ports.end) +.then(function(port) { +logger.normal("local-server: port " + port + " is available"); +logger.info("local-server: starting local medic server"); + +var localServer = new LocalServer(port, externalServerUrl); +localServer.createSocketListener(); + +if (useTunnel) { +return localServer.createTunnel(); +} + +return localServer; +}); +}; + +LocalServer.getFirstAvailablePort = function(startPort, endPort) { +// returns array range [startPort..endPort] +var ports = Array.apply(null, Array(endPort - startPort + 1)).map(function(element, index) { +return startPort + index; +}); + +return Q.promise(function(resolve, reject) { +ports.reduce(function(promise, port){ +return promise.then(function(isPortUsed) { +if (!isPortUsed) { +resolve(port - 1); +return false; +} else { +return portChecker.check(port); +} +}); +}, Q(true)); +}); +}; + +LocalServer.prototype.createTunnel = function() { +logger.info('cordova-paramedic: attempt to create local tunnel'); +var self = this; + +return Q.Promise(function(resolve, reject) { + +var tunnel = localtunnel(self.port, function(err, tunnel) { +if (err) { +reject('Unable to create local tunnel: ' + err); +return; +} + +self.tunneledUrl = tunnel.url; +logger.info('cordova-paramedic: using tunneled url ' + self.tunneledUrl); + +resolve(self); +}); + +// this trace is useful to debug test run timeout issue +tunnel.on('close', function() { + logger.normal('local-server: local tunnel has been closed'); +}); +}); +}; + +LocalServer.prototype.createSocketListener = function() { +var listener = io.listen(this.port, { +pingTimeout: CONNECTION_HEARBEAT_PING_TIMEOUT, +pingInterval: CONNECTION_HEARBEAT_PING_INTERVAL +}); + +var self = this; + +listener.on('connection', function(socket) { +logger.info('local-server: new socket connection'); +self.connection = socket; + +// server methods +['deviceLog', 'disconnect', 'deviceInfo', +'jasmineStarted', 'specStarted
[GitHub] cordova-paramedic pull request: Paramedic improvements
Github user dblotsky commented on a diff in the pull request: https://github.com/apache/cordova-paramedic/pull/3#discussion_r59094438 --- Diff: lib/LocalServer.js --- @@ -0,0 +1,162 @@ +/** +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 Q = require('q'), +io = require('socket.io'), +logger = require('./utils').logger, +exec = require('./utils').exec, +path = require('path'), +util = require('util'), +portChecker = require('tcp-port-used'), +EventEmitter = require('events').EventEmitter, +localtunnel = require('localtunnel'); + + +// how many ms without a pong packet to consider the connection closed +var CONNECTION_HEARBEAT_PING_TIMEOUT = 6, +// how many ms before sending a new ping packet +CONNECTION_HEARBEAT_PING_INTERVAL = 25000; + +function LocalServer(port, externalServerUrl) { +this.port = port; +this.externalServerUrl = externalServerUrl; +} + +util.inherits(LocalServer, EventEmitter); + +LocalServer.startServer = function(ports, externalServerUrl, useTunnel) { +logger.normal("local-server: scanning ports from " + ports.start + " to " + ports.end); + +return LocalServer.getFirstAvailablePort(ports.start, ports.end) +.then(function(port) { +logger.normal("local-server: port " + port + " is available"); +logger.info("local-server: starting local medic server"); + +var localServer = new LocalServer(port, externalServerUrl); +localServer.createSocketListener(); + +if (useTunnel) { +return localServer.createTunnel(); +} + +return localServer; +}); +}; + +LocalServer.getFirstAvailablePort = function(startPort, endPort) { --- End diff -- Should this and `startServer` be `prototype` functions? --- 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: Paramedic improvements
Github user dblotsky commented on a diff in the pull request: https://github.com/apache/cordova-paramedic/pull/3#discussion_r59094353 --- Diff: lib/LocalServer.js --- @@ -0,0 +1,162 @@ +/** +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 Q = require('q'), +io = require('socket.io'), +logger = require('./utils').logger, +exec = require('./utils').exec, +path = require('path'), +util = require('util'), +portChecker = require('tcp-port-used'), +EventEmitter = require('events').EventEmitter, +localtunnel = require('localtunnel'); + + +// how many ms without a pong packet to consider the connection closed +var CONNECTION_HEARBEAT_PING_TIMEOUT = 6, +// how many ms before sending a new ping packet +CONNECTION_HEARBEAT_PING_INTERVAL = 25000; + +function LocalServer(port, externalServerUrl) { +this.port = port; +this.externalServerUrl = externalServerUrl; +} + +util.inherits(LocalServer, EventEmitter); + +LocalServer.startServer = function(ports, externalServerUrl, useTunnel) { +logger.normal("local-server: scanning ports from " + ports.start + " to " + ports.end); + +return LocalServer.getFirstAvailablePort(ports.start, ports.end) +.then(function(port) { +logger.normal("local-server: port " + port + " is available"); +logger.info("local-server: starting local medic server"); + +var localServer = new LocalServer(port, externalServerUrl); +localServer.createSocketListener(); + +if (useTunnel) { +return localServer.createTunnel(); +} + +return localServer; +}); +}; + +LocalServer.getFirstAvailablePort = function(startPort, endPort) { +// returns array range [startPort..endPort] +var ports = Array.apply(null, Array(endPort - startPort + 1)).map(function(element, index) { +return startPort + index; +}); + +return Q.promise(function(resolve, reject) { +ports.reduce(function(promise, port){ +return promise.then(function(isPortUsed) { +if (!isPortUsed) { +resolve(port - 1); +return false; +} else { +return portChecker.check(port); +} +}); +}, Q(true)); +}); +}; --- End diff -- Nitpitck: the use of `reduce` here makes this code pretty hard to follow. It could be refactored to be recursive: ```javascript return portChecker.check(startPort).then(function (inUse) { if (inUse) { return getFirstAvailablePort(startPort + 1, endPort); } resolve(startPort); }); ``` --- 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: Paramedic improvements
Github user dblotsky commented on a diff in the pull request: https://github.com/apache/cordova-paramedic/pull/3#discussion_r59092104 --- Diff: paramedic-plugin/paramedic.js --- @@ -0,0 +1,93 @@ +/** +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 io = cordova.require('cordova-plugin-paramedic.socket.io'); + +var PARAMEDIC_SERVER_DEFAULT_URL = 'http://127.0.0.1:8008'; + +function Paramedic() { + +} + +Paramedic.prototype.initialize = function() { +var me = this; +var connectionUri = loadParamedicServerUrl(); +this.socket = io.connect(connectionUri); + +this.socket.on('connect', function () { +console.log("Paramedic has been susccessfully connected to server"); +if (typeof device != 'undefined') me.socket.emit('deviceInfo', device); +}); + +this.overrideConsole(); +this.injectJasmineReporter(); +}; + + +Paramedic.prototype.overrideConsole = function () { + +var origConsole = window.console; +var me = this; + +function createCustomLogger(type) { +return function () { +origConsole[type].apply(origConsole, arguments); + +me.socket.emit('deviceLog', { type: type, msg: Array.prototype.slice.apply(arguments) }); +}; +} +window.console = { +log: createCustomLogger('log'), +warn: createCustomLogger('warn'), +error: createCustomLogger('error'), +}; +console.log('Paramedic console has been installed.'); +}; + +Paramedic.prototype.injectJasmineReporter = function () { +var JasmineParamedicProxy = require('cordova-plugin-paramedic.JasmineParamedicProxy'); +var jasmineProxy = new JasmineParamedicProxy(this.socket); +var testsModule = cordova.require("cordova-plugin-test-framework.cdvtests"); +var defineAutoTestsOriginal = testsModule.defineAutoTests; + +testsModule.defineAutoTests = function () { +defineAutoTestsOriginal(); +jasmine.getEnv().addReporter(jasmineProxy); +}; +}; + +new Paramedic().initialize(); + +function loadParamedicServerUrl() { + +try { +// attempt to synchronously load medic config +var xhr = new XMLHttpRequest(); +xhr.open("GET", "../medic.json", false); --- End diff -- Alright, sounds good. I'm all for not using this file or mobilespec in the future as well. --- 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: Paramedic improvements
Github user dblotsky commented on a diff in the pull request: https://github.com/apache/cordova-paramedic/pull/3#discussion_r59091985 --- Diff: lib/paramedic.js --- @@ -0,0 +1,232 @@ +/** +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 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; + +// Time to wait for initial device connection. +// If device has not connected within this interval the tests are stopped. +var INITIAL_CONNECTION_TIMEOUT = 30; // 5mins + +function ParamedicRunner(config, _callback) { +this.tempFolder = null; +this.pluginsManager = null; + +this.config = config; + +exec.setVerboseLevel(config.isVerbose()); +} + +ParamedicRunner.prototype.run = function() { +var self = this; + +return Q().then(function() { +self.createTempProject(); +self.prepareProjectToRunTests(); +return Server.startServer(self.config.getPorts(), self.config.getExternalServerUrl(), self.config.getUseTunnel()); +}) +.then(function(server) { +self.server = server; + +self.injectReporters(); +self.subcribeForEvents(); + +var connectionUrl = server.getConnectionUrl() || + server.getStandartUrlForPlatform(self.config.getPlatformId()); +self.writeMedicConnectionUrl(connectionUrl); + +return self.runTests(); +}) +.fin(function() { +self.cleanUpProject(); +}); +}; + +ParamedicRunner.prototype.createTempProject = function() { +this.tempFolder = tmp.dirSync(); +tmp.setGracefulCleanup(); +logger.info("cordova-paramedic: creating temp project at " + this.tempFolder.name); +exec('cordova create ' + this.tempFolder.name); +shell.pushd(this.tempFolder.name); +}; + +ParamedicRunner.prototype.prepareProjectToRunTests = function() { +this.installPlugins(); +this.setUpStartPage(); +this.installPlatform(); +this.checkPlatformRequirements(); +}; + +ParamedicRunner.prototype.installPlugins = function() { +logger.info("cordova-paramedic: installing plugins"); +this.pluginsManager = new PluginsManager(this.tempFolder.name, this.storedCWD); +this.pluginsManager.installPlugins(this.config.getPlugins()); +this.pluginsManager.installTestsForExistingPlugins(); + this.pluginsManager.installSinglePlugin('cordova-plugin-test-framework'); +this.pluginsManager.installSinglePlugin('cordova-plugin-device'); +this.pluginsManager.installSinglePlugin(path.join(__dirname, '../paramedic-plugin')); +}; + +ParamedicRunner.prototype.setUpStartPage = function() { +logger.normal("cordova-paramedic: setting app start page to test page"); +shell.sed('-i', 'src="index.html"', 'src="cdvtests/index.html"', 'config.xml'); +}; + +ParamedicRunner.prototype.installPlatform = function() { +logger.info("cordova-paramedic: adding platform : " + this.config.getPlatform()); +exec('cordova platform add ' + this.config.getPlatform()); +}; + +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) +throw new Error('Platform requirements check has failed!'); +}; + +Param
[GitHub] cordova-docs pull request: CB-11021 Changing docs styling
Github user dblotsky commented on the pull request: https://github.com/apache/cordova-docs/pull/567#issuecomment-206601373 @riknoll yeah. The latest merge to the ASF Git master hasn't reflected in the GitHub master yet because it was a large commit. Sorry, the best way to see the diff for now is probably to check out the branch and do the diff locally. --- 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: Paramedic improvements
Github user dblotsky commented on a diff in the pull request: https://github.com/apache/cordova-paramedic/pull/3#discussion_r58787128 --- Diff: lib/LocalServer.js --- @@ -0,0 +1,141 @@ +/** +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 Q = require('q'), +io = require('socket.io'), +logger = require('./utils').logger, +exec = require('./utils').exec, +path = require('path'), +util = require('util'), +portChecker = require('tcp-port-used'), +EventEmitter = require('events').EventEmitter; + +function LocalServer(port, externalServerUrl) { +this.port = port; +this.externalServerUrl = externalServerUrl; +} + +util.inherits(LocalServer, EventEmitter); + +LocalServer.startServer = function(ports, externalServerUrl, useTunnel) { +logger.normal("local-server: scanning ports from " + ports.start + " to " + ports.end); + +return LocalServer.getFirstAvailablePort(ports.start, ports.end) +.then(function(port) { +logger.normal("local-server: port " + port + " is available"); +logger.info("local-server: starting local medic server"); + +var localServer = new LocalServer(port, externalServerUrl); +localServer.createSocketListener(); + +if (useTunnel) { +return Q.promise(function(resolve) { +localServer.createTunnel().then(function(){ +resolve(localServer); +}); +}); +} + +return localServer; +}); +}; + +LocalServer.getFirstAvailablePort = function(startPort, endPort) { +var ports = Array.apply(null, Array(endPort - startPort + 1)).map(function(element, index) { +return startPort + index; +}); + +return Q.promise(function(resolve, reject) { +ports.reduce(function(promise, port){ +return promise.then(function(isPortUsed) { +if (!isPortUsed) { +resolve(port - 1); +return false; +} else { +return portChecker.check(port); +} +}); +}, Q(true)); +}); +}; + +LocalServer.prototype.createTunnel = function() { +logger.info('cordova-paramedic: attempt to create local tunnel'); +var self = this; + +//TODO: use localtunnel module instead of shell +return Q.Promise(function(resolve, reject) { +exec(path.resolve(__dirname, '../node_modules/.bin/lt') + ' --port ' + self.port, null, function(output) { +var tunneledUrl = output.split(' ')[3]; +self.tunneledUrl = tunneledUrl; +logger.info('cordova-paramedic: using tunneled url ' + tunneledUrl); +resolve(); +}); +}); +}; + +LocalServer.prototype.createSocketListener = function() { +var listener = io.listen(this.port, { +pingTimeout: 6, // how many ms without a pong packet to consider the connection closed +pingInterval: 25000 // how many ms before sending a new ping packet +}); + +var self = this; + +listener.on('connection', function(socket) { +logger.info('local-server: new socket connection'); +self.connection = socket; + +// server methods +['deviceLog', 'disconnect', 'deviceInfo', +'jasmineStarted', 'specStarted', 'specDone', +'suiteStarted', 'suiteDone', 'jasmineDone'].forEach(function(route) { +socket.on(route, function(data) { +self.emit(route, data); +}); +}); +}); +}; + +LocalServer.prototype.getConnectionUrl = function() { +
[GitHub] cordova-paramedic pull request: Paramedic improvements
Github user dblotsky commented on a diff in the pull request: https://github.com/apache/cordova-paramedic/pull/3#discussion_r58786905 --- Diff: lib/LocalServer.js --- @@ -0,0 +1,141 @@ +/** +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 Q = require('q'), +io = require('socket.io'), +logger = require('./utils').logger, +exec = require('./utils').exec, +path = require('path'), +util = require('util'), +portChecker = require('tcp-port-used'), +EventEmitter = require('events').EventEmitter; + +function LocalServer(port, externalServerUrl) { +this.port = port; +this.externalServerUrl = externalServerUrl; +} + +util.inherits(LocalServer, EventEmitter); + +LocalServer.startServer = function(ports, externalServerUrl, useTunnel) { +logger.normal("local-server: scanning ports from " + ports.start + " to " + ports.end); + +return LocalServer.getFirstAvailablePort(ports.start, ports.end) +.then(function(port) { +logger.normal("local-server: port " + port + " is available"); +logger.info("local-server: starting local medic server"); + +var localServer = new LocalServer(port, externalServerUrl); +localServer.createSocketListener(); + +if (useTunnel) { +return Q.promise(function(resolve) { +localServer.createTunnel().then(function(){ +resolve(localServer); +}); +}); +} + +return localServer; +}); +}; + +LocalServer.getFirstAvailablePort = function(startPort, endPort) { +var ports = Array.apply(null, Array(endPort - startPort + 1)).map(function(element, index) { +return startPort + index; +}); --- End diff -- Nitpick: it would be more readable to define a `range` function that returns an array of numbers from `start` to `end` and to have `var ports = range(startPort, endPort + 1)`. --- 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: Paramedic improvements
Github user dblotsky commented on a diff in the pull request: https://github.com/apache/cordova-paramedic/pull/3#discussion_r58786335 --- Diff: lib/LocalServer.js --- @@ -0,0 +1,141 @@ +/** +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 Q = require('q'), +io = require('socket.io'), +logger = require('./utils').logger, +exec = require('./utils').exec, +path = require('path'), +util = require('util'), +portChecker = require('tcp-port-used'), +EventEmitter = require('events').EventEmitter; + +function LocalServer(port, externalServerUrl) { +this.port = port; +this.externalServerUrl = externalServerUrl; +} + +util.inherits(LocalServer, EventEmitter); + +LocalServer.startServer = function(ports, externalServerUrl, useTunnel) { +logger.normal("local-server: scanning ports from " + ports.start + " to " + ports.end); + +return LocalServer.getFirstAvailablePort(ports.start, ports.end) +.then(function(port) { +logger.normal("local-server: port " + port + " is available"); +logger.info("local-server: starting local medic server"); + +var localServer = new LocalServer(port, externalServerUrl); +localServer.createSocketListener(); + +if (useTunnel) { +return Q.promise(function(resolve) { +localServer.createTunnel().then(function(){ +resolve(localServer); +}); +}); --- End diff -- You can just return `localServer.createTunnel()` 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: Paramedic improvements
Github user dblotsky commented on a diff in the pull request: https://github.com/apache/cordova-paramedic/pull/3#discussion_r58785566 --- Diff: paramedic-plugin/paramedic.js --- @@ -0,0 +1,93 @@ +/** +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 io = cordova.require('cordova-plugin-paramedic.socket.io'); + +var PARAMEDIC_SERVER_DEFAULT_URL = 'http://127.0.0.1:8008'; + +function Paramedic() { + +} + +Paramedic.prototype.initialize = function() { +var me = this; +var connectionUri = loadParamedicServerUrl(); +this.socket = io.connect(connectionUri); + +this.socket.on('connect', function () { +console.log("Paramedic has been susccessfully connected to server"); +if (typeof device != 'undefined') me.socket.emit('deviceInfo', device); +}); + +this.overrideConsole(); +this.injectJasmineReporter(); +}; + + +Paramedic.prototype.overrideConsole = function () { + +var origConsole = window.console; +var me = this; + +function createCustomLogger(type) { +return function () { +origConsole[type].apply(origConsole, arguments); + +me.socket.emit('deviceLog', { type: type, msg: Array.prototype.slice.apply(arguments) }); +}; +} +window.console = { +log: createCustomLogger('log'), +warn: createCustomLogger('warn'), +error: createCustomLogger('error'), +}; +console.log('Paramedic console has been installed.'); +}; + +Paramedic.prototype.injectJasmineReporter = function () { +var JasmineParamedicProxy = require('cordova-plugin-paramedic.JasmineParamedicProxy'); +var jasmineProxy = new JasmineParamedicProxy(this.socket); +var testsModule = cordova.require("cordova-plugin-test-framework.cdvtests"); +var defineAutoTestsOriginal = testsModule.defineAutoTests; + +testsModule.defineAutoTests = function () { +defineAutoTestsOriginal(); +jasmine.getEnv().addReporter(jasmineProxy); +}; +}; + +new Paramedic().initialize(); + +function loadParamedicServerUrl() { + +try { +// attempt to synchronously load medic config +var xhr = new XMLHttpRequest(); +xhr.open("GET", "../medic.json", false); +xhr.send(null); +var cfg = JSON.parse(xhr.responseText); + +return cfg.logurl || PARAMEDIC_SERVER_DEFAULT_URL; + +} catch (ex) {} --- End diff -- Please log the 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-paramedic pull request: Paramedic improvements
Github user dblotsky commented on a diff in the pull request: https://github.com/apache/cordova-paramedic/pull/3#discussion_r58785401 --- Diff: paramedic-plugin/paramedic.js --- @@ -0,0 +1,93 @@ +/** +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 io = cordova.require('cordova-plugin-paramedic.socket.io'); + +var PARAMEDIC_SERVER_DEFAULT_URL = 'http://127.0.0.1:8008'; + +function Paramedic() { + +} + +Paramedic.prototype.initialize = function() { +var me = this; +var connectionUri = loadParamedicServerUrl(); +this.socket = io.connect(connectionUri); + +this.socket.on('connect', function () { +console.log("Paramedic has been susccessfully connected to server"); +if (typeof device != 'undefined') me.socket.emit('deviceInfo', device); +}); + +this.overrideConsole(); +this.injectJasmineReporter(); +}; + + +Paramedic.prototype.overrideConsole = function () { + +var origConsole = window.console; +var me = this; + +function createCustomLogger(type) { +return function () { +origConsole[type].apply(origConsole, arguments); + +me.socket.emit('deviceLog', { type: type, msg: Array.prototype.slice.apply(arguments) }); +}; +} +window.console = { +log: createCustomLogger('log'), +warn: createCustomLogger('warn'), +error: createCustomLogger('error'), +}; +console.log('Paramedic console has been installed.'); +}; + +Paramedic.prototype.injectJasmineReporter = function () { +var JasmineParamedicProxy = require('cordova-plugin-paramedic.JasmineParamedicProxy'); +var jasmineProxy = new JasmineParamedicProxy(this.socket); +var testsModule = cordova.require("cordova-plugin-test-framework.cdvtests"); +var defineAutoTestsOriginal = testsModule.defineAutoTests; + +testsModule.defineAutoTests = function () { +defineAutoTestsOriginal(); +jasmine.getEnv().addReporter(jasmineProxy); +}; +}; + +new Paramedic().initialize(); + +function loadParamedicServerUrl() { + +try { +// attempt to synchronously load medic config +var xhr = new XMLHttpRequest(); +xhr.open("GET", "../medic.json", false); --- End diff -- Please factor out the string into a constant. --- 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: Paramedic improvements
Github user dblotsky commented on a diff in the pull request: https://github.com/apache/cordova-paramedic/pull/3#discussion_r58785263 --- Diff: lib/utils/execWrapper.js --- @@ -0,0 +1,39 @@ +/** +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 shelljs = require('shelljs'); +var verbose; + +function exec(cmd, onFinish, onData) { +if (onFinish instanceof Function || onFinish === null) { +var result = shelljs.exec(cmd, {async: true, silent: !verbose}, onFinish); + +if (onData instanceof Function) { +result.stdout.on('data', onData); +} +} else { +return shelljs.exec(cmd, {silent: !verbose}); +} +} + +exec.setVerboseLevel = function(_verbose) { +verbose = _verbose; +}; + +module.exports = exec; --- End diff -- What purpose does the wrapper serve? --- 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: Paramedic improvements
Github user dblotsky commented on a diff in the pull request: https://github.com/apache/cordova-paramedic/pull/3#discussion_r58785033 --- Diff: lib/paramedic.js --- @@ -0,0 +1,232 @@ +/** +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 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; + +// Time to wait for initial device connection. +// If device has not connected within this interval the tests are stopped. +var INITIAL_CONNECTION_TIMEOUT = 30; // 5mins + +function ParamedicRunner(config, _callback) { +this.tempFolder = null; +this.pluginsManager = null; + +this.config = config; + +exec.setVerboseLevel(config.isVerbose()); +} + +ParamedicRunner.prototype.run = function() { +var self = this; + +return Q().then(function() { +self.createTempProject(); +self.prepareProjectToRunTests(); +return Server.startServer(self.config.getPorts(), self.config.getExternalServerUrl(), self.config.getUseTunnel()); +}) +.then(function(server) { +self.server = server; + +self.injectReporters(); +self.subcribeForEvents(); + +var connectionUrl = server.getConnectionUrl() || + server.getStandartUrlForPlatform(self.config.getPlatformId()); +self.writeMedicConnectionUrl(connectionUrl); + +return self.runTests(); +}) +.fin(function() { +self.cleanUpProject(); +}); +}; + +ParamedicRunner.prototype.createTempProject = function() { +this.tempFolder = tmp.dirSync(); +tmp.setGracefulCleanup(); +logger.info("cordova-paramedic: creating temp project at " + this.tempFolder.name); +exec('cordova create ' + this.tempFolder.name); +shell.pushd(this.tempFolder.name); +}; + +ParamedicRunner.prototype.prepareProjectToRunTests = function() { +this.installPlugins(); +this.setUpStartPage(); +this.installPlatform(); +this.checkPlatformRequirements(); +}; + +ParamedicRunner.prototype.installPlugins = function() { +logger.info("cordova-paramedic: installing plugins"); +this.pluginsManager = new PluginsManager(this.tempFolder.name, this.storedCWD); +this.pluginsManager.installPlugins(this.config.getPlugins()); +this.pluginsManager.installTestsForExistingPlugins(); + this.pluginsManager.installSinglePlugin('cordova-plugin-test-framework'); +this.pluginsManager.installSinglePlugin('cordova-plugin-device'); +this.pluginsManager.installSinglePlugin(path.join(__dirname, '../paramedic-plugin')); +}; + +ParamedicRunner.prototype.setUpStartPage = function() { +logger.normal("cordova-paramedic: setting app start page to test page"); +shell.sed('-i', 'src="index.html"', 'src="cdvtests/index.html"', 'config.xml'); +}; + +ParamedicRunner.prototype.installPlatform = function() { +logger.info("cordova-paramedic: adding platform : " + this.config.getPlatform()); +exec('cordova platform add ' + this.config.getPlatform()); +}; + +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) +throw new Error('Platform requirements check has failed!'); +}; + +Param
[GitHub] cordova-paramedic pull request: Paramedic improvements
Github user dblotsky commented on a diff in the pull request: https://github.com/apache/cordova-paramedic/pull/3#discussion_r58771737 --- Diff: lib/LocalServer.js --- @@ -0,0 +1,141 @@ +/** +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 Q = require('q'), +io = require('socket.io'), +logger = require('./utils').logger, +exec = require('./utils').exec, +path = require('path'), +util = require('util'), +portChecker = require('tcp-port-used'), +EventEmitter = require('events').EventEmitter; + +function LocalServer(port, externalServerUrl) { +this.port = port; +this.externalServerUrl = externalServerUrl; +} + +util.inherits(LocalServer, EventEmitter); + +LocalServer.startServer = function(ports, externalServerUrl, useTunnel) { +logger.normal("local-server: scanning ports from " + ports.start + " to " + ports.end); + +return LocalServer.getFirstAvailablePort(ports.start, ports.end) +.then(function(port) { +logger.normal("local-server: port " + port + " is available"); +logger.info("local-server: starting local medic server"); + +var localServer = new LocalServer(port, externalServerUrl); +localServer.createSocketListener(); + +if (useTunnel) { +return Q.promise(function(resolve) { +localServer.createTunnel().then(function(){ +resolve(localServer); +}); +}); +} + +return localServer; +}); +}; + +LocalServer.getFirstAvailablePort = function(startPort, endPort) { +var ports = Array.apply(null, Array(endPort - startPort + 1)).map(function(element, index) { +return startPort + index; +}); + +return Q.promise(function(resolve, reject) { +ports.reduce(function(promise, port){ +return promise.then(function(isPortUsed) { +if (!isPortUsed) { +resolve(port - 1); +return false; +} else { +return portChecker.check(port); +} +}); +}, Q(true)); +}); +}; + +LocalServer.prototype.createTunnel = function() { +logger.info('cordova-paramedic: attempt to create local tunnel'); +var self = this; + +//TODO: use localtunnel module instead of shell +return Q.Promise(function(resolve, reject) { +exec(path.resolve(__dirname, '../node_modules/.bin/lt') + ' --port ' + self.port, null, function(output) { +var tunneledUrl = output.split(' ')[3]; +self.tunneledUrl = tunneledUrl; +logger.info('cordova-paramedic: using tunneled url ' + tunneledUrl); +resolve(); +}); +}); +}; + +LocalServer.prototype.createSocketListener = function() { +var listener = io.listen(this.port, { +pingTimeout: 6, // how many ms without a pong packet to consider the connection closed +pingInterval: 25000 // how many ms before sending a new ping packet +}); + +var self = this; + +listener.on('connection', function(socket) { +logger.info('local-server: new socket connection'); +self.connection = socket; + +// server methods +['deviceLog', 'disconnect', 'deviceInfo', +'jasmineStarted', 'specStarted', 'specDone', +'suiteStarted', 'suiteDone', 'jasmineDone'].forEach(function(route) { +socket.on(route, function(data) { +self.emit(route, data); +}); +}); +}); +}; + +LocalServer.prototype.getConnectionUrl = function() { +
[GitHub] cordova-paramedic pull request: Paramedic improvements
Github user dblotsky commented on a diff in the pull request: https://github.com/apache/cordova-paramedic/pull/3#discussion_r58771547 --- Diff: lib/LocalServer.js --- @@ -0,0 +1,141 @@ +/** +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 Q = require('q'), +io = require('socket.io'), +logger = require('./utils').logger, +exec = require('./utils').exec, +path = require('path'), +util = require('util'), +portChecker = require('tcp-port-used'), +EventEmitter = require('events').EventEmitter; + +function LocalServer(port, externalServerUrl) { +this.port = port; +this.externalServerUrl = externalServerUrl; +} + +util.inherits(LocalServer, EventEmitter); + +LocalServer.startServer = function(ports, externalServerUrl, useTunnel) { +logger.normal("local-server: scanning ports from " + ports.start + " to " + ports.end); + +return LocalServer.getFirstAvailablePort(ports.start, ports.end) +.then(function(port) { +logger.normal("local-server: port " + port + " is available"); +logger.info("local-server: starting local medic server"); + +var localServer = new LocalServer(port, externalServerUrl); +localServer.createSocketListener(); + +if (useTunnel) { +return Q.promise(function(resolve) { +localServer.createTunnel().then(function(){ +resolve(localServer); +}); +}); +} + +return localServer; +}); +}; + +LocalServer.getFirstAvailablePort = function(startPort, endPort) { +var ports = Array.apply(null, Array(endPort - startPort + 1)).map(function(element, index) { +return startPort + index; +}); + +return Q.promise(function(resolve, reject) { +ports.reduce(function(promise, port){ +return promise.then(function(isPortUsed) { +if (!isPortUsed) { +resolve(port - 1); +return false; +} else { +return portChecker.check(port); +} +}); +}, Q(true)); +}); +}; + +LocalServer.prototype.createTunnel = function() { +logger.info('cordova-paramedic: attempt to create local tunnel'); +var self = this; + +//TODO: use localtunnel module instead of shell +return Q.Promise(function(resolve, reject) { +exec(path.resolve(__dirname, '../node_modules/.bin/lt') + ' --port ' + self.port, null, function(output) { +var tunneledUrl = output.split(' ')[3]; +self.tunneledUrl = tunneledUrl; +logger.info('cordova-paramedic: using tunneled url ' + tunneledUrl); +resolve(); +}); +}); +}; + +LocalServer.prototype.createSocketListener = function() { +var listener = io.listen(this.port, { +pingTimeout: 6, // how many ms without a pong packet to consider the connection closed +pingInterval: 25000 // how many ms before sending a new ping packet --- End diff -- Please factor these values out into comments. --- 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: Paramedic improvements
Github user dblotsky commented on a diff in the pull request: https://github.com/apache/cordova-paramedic/pull/3#discussion_r58771505 --- Diff: lib/LocalServer.js --- @@ -0,0 +1,141 @@ +/** +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 Q = require('q'), +io = require('socket.io'), +logger = require('./utils').logger, +exec = require('./utils').exec, +path = require('path'), +util = require('util'), +portChecker = require('tcp-port-used'), +EventEmitter = require('events').EventEmitter; + +function LocalServer(port, externalServerUrl) { +this.port = port; +this.externalServerUrl = externalServerUrl; +} + +util.inherits(LocalServer, EventEmitter); + +LocalServer.startServer = function(ports, externalServerUrl, useTunnel) { +logger.normal("local-server: scanning ports from " + ports.start + " to " + ports.end); + +return LocalServer.getFirstAvailablePort(ports.start, ports.end) +.then(function(port) { +logger.normal("local-server: port " + port + " is available"); +logger.info("local-server: starting local medic server"); + +var localServer = new LocalServer(port, externalServerUrl); +localServer.createSocketListener(); + +if (useTunnel) { +return Q.promise(function(resolve) { +localServer.createTunnel().then(function(){ +resolve(localServer); +}); +}); +} + +return localServer; +}); +}; + +LocalServer.getFirstAvailablePort = function(startPort, endPort) { +var ports = Array.apply(null, Array(endPort - startPort + 1)).map(function(element, index) { +return startPort + index; +}); + +return Q.promise(function(resolve, reject) { +ports.reduce(function(promise, port){ +return promise.then(function(isPortUsed) { +if (!isPortUsed) { +resolve(port - 1); +return false; +} else { +return portChecker.check(port); +} +}); +}, Q(true)); +}); +}; + +LocalServer.prototype.createTunnel = function() { +logger.info('cordova-paramedic: attempt to create local tunnel'); +var self = this; + +//TODO: use localtunnel module instead of shell --- End diff -- Is this a big change? Would it be feasible to resolve it in this PR? --- 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: Adding both Chinese versions.
Github user dblotsky closed the pull request at: https://github.com/apache/cordova-docs/pull/569 --- 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-11021 Changing docs styling
Github user dblotsky commented on the pull request: https://github.com/apache/cordova-docs/pull/567#issuecomment-206091474 @riknoll Please give this another look. I added an attributions page. @rakatyal I fixed the footer to be slightly different for the docs and for the rest of the site. --- 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: Paramedic improvements
Github user dblotsky commented on a diff in the pull request: https://github.com/apache/cordova-paramedic/pull/3#discussion_r58642061 --- Diff: paramedic-plugin/paramedic.js --- @@ -0,0 +1,74 @@ +var io = cordova.require('cordova-plugin-paramedic.socket.io'); --- End diff -- Do we need a special copy of socket.io? Can we just use `require('socket.io')`? --- 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: Changing docs styling.
Github user dblotsky commented on a diff in the pull request: https://github.com/apache/cordova-docs/pull/567#discussion_r58628814 --- Diff: www/_includes/footer.html --- @@ -1,6 +1,6 @@ - --- End diff -- Great catch! It makes the footer look a bit strange on other pages. I'll come up with a fix. --- 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: Changing docs styling.
Github user dblotsky commented on the pull request: https://github.com/apache/cordova-docs/pull/567#issuecomment-206025768 @riknoll thanks for pointing that out! I've created a JIRA: https://issues.apache.org/jira/browse/CB-11021. I'll also add the font attribution to the footer and the README. The ToC logic has slightly changed. The following cases used to be possible, and I removed them: - setting the `url` property on entries that had the `children` property - skipping entries that had an empty `url` property Now all entries are printed and I just commented out the ones that don't have URIs, and the entries with children can no longer be links. --- 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: Adding both Chinese versions.
Github user dblotsky commented on a diff in the pull request: https://github.com/apache/cordova-docs/pull/569#discussion_r58451039 --- Diff: www/.htaccess --- @@ -18,29 +18,31 @@ RewriteEngine on # pages to new pages. # 302 (temp): -# docs -> docs/en/latest/ -# docs/-> docs/en/latest/ -# docs/XX -> docs/XX/latest/ -# docs/XX/ -> docs/XX/latest/ +# docs/ -> docs/[default language]/ +# docs/XX-> docs/XX/ +# docs/XX/ -> docs/XX/latest +# docs/XX/latest -> docs/XX/latest/ # # NOTE: -# these can both apply, turning "/docs" into "/docs/en/latest/" -RewriteRule ^.*docs/$ {{site.baseurl}}/docs/en/ -RewriteRule ^.*docs/(\w\w)/$ {{site.baseurl}}/docs/$1/latest/ [R=302,L] - -# 302 (temp): -# docs/XX/latest -> docs/XX/latest/ -RewriteRule ^.*docs/(\w\w)/latest$ {{site.baseurl}}/docs/$1/latest/ [R=302,L] +# these can all apply, turning "/docs" into "/docs/[default language]/latest/" +RewriteRule ^.*docs/$ {{site.baseurl}}/docs/{{site.language}}/ +RewriteRule ^.*docs/(\w\w(?:-\w\w)?)$ {{site.baseurl}}/docs/$1/ --- End diff -- @riknoll I've made the change. How does it look now? --- 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: Changing docs styling.
Github user dblotsky commented on the pull request: https://github.com/apache/cordova-docs/pull/567#issuecomment-205501906 @nikhilkh @sarangan12 @riknoll @rakatyal: whenever any of you have any time, please give this a look. --- 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: Adding both Chinese versions.
Github user dblotsky commented on a diff in the pull request: https://github.com/apache/cordova-docs/pull/569#discussion_r58139811 --- Diff: www/.htaccess --- @@ -18,29 +18,31 @@ RewriteEngine on # pages to new pages. # 302 (temp): -# docs -> docs/en/latest/ -# docs/-> docs/en/latest/ -# docs/XX -> docs/XX/latest/ -# docs/XX/ -> docs/XX/latest/ +# docs/ -> docs/[default language]/ +# docs/XX-> docs/XX/ +# docs/XX/ -> docs/XX/latest +# docs/XX/latest -> docs/XX/latest/ # # NOTE: -# these can both apply, turning "/docs" into "/docs/en/latest/" -RewriteRule ^.*docs/$ {{site.baseurl}}/docs/en/ -RewriteRule ^.*docs/(\w\w)/$ {{site.baseurl}}/docs/$1/latest/ [R=302,L] - -# 302 (temp): -# docs/XX/latest -> docs/XX/latest/ -RewriteRule ^.*docs/(\w\w)/latest$ {{site.baseurl}}/docs/$1/latest/ [R=302,L] +# these can all apply, turning "/docs" into "/docs/[default language]/latest/" +RewriteRule ^.*docs/$ {{site.baseurl}}/docs/{{site.language}}/ +RewriteRule ^.*docs/(\w\w(?:-\w\w)?)$ {{site.baseurl}}/docs/$1/ --- End diff -- Oh, you're right! That doesn't exist. I said `/docs/en/` but I was thinking about `/docs/en/latest/`. The reason there is a chain is that any intermediary URI will "fall through" to `/docs/en/latest/`. So all of `/docs/en`, `/docs/en/`, `/docs/en/latest` will become `/docs/en/latest/`. --- 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: Appium runner improvements
Github user dblotsky commented on a diff in the pull request: https://github.com/apache/cordova-medic/pull/85#discussion_r57990944 --- Diff: buildbot-conf/cordova-config.json.sample --- @@ -12,8 +12,8 @@ "appium": { "androidDeviceName": "Galaxy_Nexus", "androidPlatformVersion": "19", -"iosDeviceName": "iPhone 5", -"iosPlatformVersion": "8.4", +"iosDeviceName": "iPhone 6s", +"iosPlatformVersion": "9.1", "timeout":2400, --- End diff -- Just a friendly reminder to make this change in the actual file on the Buildbot server; this file is just a sample. --- 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: Adding both Chinese versions.
Github user dblotsky commented on a diff in the pull request: https://github.com/apache/cordova-docs/pull/569#discussion_r57813112 --- Diff: www/.htaccess --- @@ -18,29 +18,31 @@ RewriteEngine on # pages to new pages. # 302 (temp): -# docs -> docs/en/latest/ -# docs/-> docs/en/latest/ -# docs/XX -> docs/XX/latest/ -# docs/XX/ -> docs/XX/latest/ +# docs/ -> docs/[default language]/ +# docs/XX-> docs/XX/ +# docs/XX/ -> docs/XX/latest +# docs/XX/latest -> docs/XX/latest/ # # NOTE: -# these can both apply, turning "/docs" into "/docs/en/latest/" -RewriteRule ^.*docs/$ {{site.baseurl}}/docs/en/ -RewriteRule ^.*docs/(\w\w)/$ {{site.baseurl}}/docs/$1/latest/ [R=302,L] - -# 302 (temp): -# docs/XX/latest -> docs/XX/latest/ -RewriteRule ^.*docs/(\w\w)/latest$ {{site.baseurl}}/docs/$1/latest/ [R=302,L] +# these can all apply, turning "/docs" into "/docs/[default language]/latest/" +RewriteRule ^.*docs/$ {{site.baseurl}}/docs/{{site.language}}/ +RewriteRule ^.*docs/(\w\w(?:-\w\w)?)$ {{site.baseurl}}/docs/$1/ --- End diff -- Yep, that's exactly what it's doing. This way `/docs/en` and `/docs/zh-tw` become `/docs/en/` and `/docs/zh-tw/` respectively. This is because `/docs/en` resolves to `/docs/en` (which doesn't exist), and `/docs/en/` resolves to `/docs/en/index.html`, which exists. --- 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: Adding both Chinese versions.
Github user dblotsky commented on the pull request: https://github.com/apache/cordova-docs/pull/569#issuecomment-203118863 @rakatyal @riknoll ping. --- 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-media pull request: CB-10783: Media Plugin - Modify...
Github user dblotsky commented on the pull request: https://github.com/apache/cordova-plugin-media/pull/89#issuecomment-202714763 How often does the test pass now? --- 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: Improving inline quotes styling
Github user dblotsky commented on the pull request: https://github.com/apache/cordova-docs/pull/568#issuecomment-201588433 Cool. LGTM then. --- 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: Adding both Chinese versions.
Github user dblotsky commented on the pull request: https://github.com/apache/cordova-docs/pull/569#issuecomment-201587290 @riknoll @rakatyal please review when you get a chance. --- 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: Adding both Chinese versions.
GitHub user dblotsky opened a pull request: https://github.com/apache/cordova-docs/pull/569 Adding both Chinese versions. - Copied `zh` into `zh-tw` and added `zh-cn` - Added redirect for `/zh/` to `/zh-tw/` - Fixed the language name in `gen_versions.js` - Fixed regexes to accept language codes of the form `XX` and `XX-YY` You can merge this pull request into a Git repository by running: $ git pull https://github.com/MSOpenTech/cordova-docs zh-docs Alternatively you can review and apply these changes as the patch at: https://github.com/apache/cordova-docs/pull/569.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 #569 commit 75873ec1f852b67891c740683df3198ca40f1e01 Author: Dmitry Blotsky <dmitry.blot...@gmail.com> Date: 2016-03-25T20:35:00Z Adding both Chinese versions. --- 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: Improving inline quotes styling
Github user dblotsky commented on the pull request: https://github.com/apache/cordova-docs/pull/568#issuecomment-201585917 Should this be global, or within `_docs.scss`? --- 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: Real time logging and other improv...
Github user dblotsky commented on a diff in the pull request: https://github.com/apache/cordova-paramedic/pull/1#discussion_r57437633 --- Diff: sample-config/.paramedic.config.js --- @@ -0,0 +1,33 @@ +module.exports = { +//"externalServerUrl": "http://10.0.8.254;, +"useTunnel": true, +"plugins": [ +"https://github.com/apache/cordova-plugin-inappbrowser; +], +"targets": [ +{ +"platform": "ios@https://github.com/apache/cordova-ios.git;, +"action": "run", + "args": "--device" +}, +{ +"platform": "android@https://github.com/apache/cordova-android.git;, +"action": "run", + "args": "--device" +}, +{// Windows 8.1 Desktop(anycpu) +"platform": "windows", +"action": "run" +}, +{ // Windows 10 Desktop(x64) +"platform": "windows@https://github.com/apache/cordova-windows.git;, +"action": "run", +"args": "--archs=x64 -- --appx=uap" +}, +// {// WP 8.1 Device(arm) +// "platform": "windows@https://github.com/apache/cordova-windows.git;, +// "action": "run", +// "args": "--archs=arm --device -- --phone" +// } +] +}; --- End diff -- Would these files be better as 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: Real time logging and other improv...
Github user dblotsky commented on a diff in the pull request: https://github.com/apache/cordova-paramedic/pull/1#discussion_r57437554 --- Diff: lib/utils.js --- @@ -0,0 +1,22 @@ +var shelljs = require('shelljs'); +var verbose = undefined; --- End diff -- Please set this to `null` or `false` 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-paramedic pull request: Real time logging and other improv...
Github user dblotsky commented on a diff in the pull request: https://github.com/apache/cordova-paramedic/pull/1#discussion_r57437413 --- Diff: lib/specReporters.js --- @@ -0,0 +1,68 @@ + +// not currently used +// var ConsoleReporter = require('./reporters/ConsoleReporter'); + +var ParamedicReporter = require('./reporters/ParamedicReporter'); +var JasmineSpecReporter = require('jasmine-spec-reporter'); +var jasmineReporters= require('jasmine-reporters'); + +// default reporter which is used to determine whether tests pass or not +var paramedicReporter = null; + +// all reporters including additional reporters to trace results to console, etc +var reporters = []; + +// specifies path to save Junit results file +var reportSavePath = null; --- End diff -- Please make these variables local instead of global. --- 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: Real time logging and other improv...
Github user dblotsky commented on a diff in the pull request: https://github.com/apache/cordova-paramedic/pull/1#discussion_r57437363 --- Diff: lib/reporters/ConsoleReporter.js --- @@ -0,0 +1,153 @@ +var noopTimer = { +start: function(){}, +elapsed: function(){ return 0; } + }; + + function ConsoleReporter(options) { +var print = options.print, + showColors = options.showColors || false, + onComplete = options.onComplete || function() {}, + timer = options.timer || noopTimer, + specCount, + failureCount, + failedSpecs = [], + pendingCount, + ansi = { +green: '\x1B[32m', +red: '\x1B[31m', +yellow: '\x1B[33m', +none: '\x1B[0m' + }, + failedSuites = []; + +this.jasmineStarted = function() { + specCount = 0; + failureCount = 0; + pendingCount = 0; + print('Started'); + printNewline(); + timer.start(); +}; + +this.jasmineDone = function() { + printNewline(); + for (var i = 0; i < failedSpecs.length; i++) { +specFailureDetails(failedSpecs[i]); + } + + if(specCount > 0) { +printNewline(); + +var specCounts = specCount + ' ' + plural('spec', specCount) + ', ' + + failureCount + ' ' + plural('failure', failureCount); + +if (pendingCount) { + specCounts += ', ' + pendingCount + ' pending ' + plural('spec', pendingCount); +} + +print(specCounts); + } else { +print('No specs found'); + } + + printNewline(); + var seconds = timer.elapsed() / 1000; + print('Finished in ' + seconds + ' ' + plural('second', seconds)); + printNewline(); + + for(i = 0; i < failedSuites.length; i++) { +suiteFailureDetails(failedSuites[i]); + } + + onComplete(failureCount === 0); +}; + +this.specStarted = function(){}; +this.suiteStarted = function(){}; + +this.specDone = function(result) { + specCount++; + + if (result.status == 'pending') { +pendingCount++; +print(colored('yellow', '*')); +return; + } + + if (result.status == 'passed') { +print(colored('green', '.')); +return; + } + + if (result.status == 'failed') { +failureCount++; +failedSpecs.push(result); +print(colored('red', 'F')); + } +}; + +this.suiteDone = function(result) { + if (result.failedExpectations && result.failedExpectations.length > 0) { +failureCount++; +failedSuites.push(result); + } +}; + +return this; + +function printNewline() { + print('\n'); +} + +function colored(color, str) { + return showColors ? (ansi[color] + str + ansi.none) : str; +} + +function plural(str, count) { + return count == 1 ? str : str + 's'; +} + +function repeat(thing, times) { + var arr = []; + for (var i = 0; i < times; i++) { +arr.push(thing); + } + return arr; +} + +function indent(str, spaces) { + var lines = (str || '').split('\n'); + var newArr = []; + for (var i = 0; i < lines.length; i++) { +newArr.push(repeat(' ', spaces).join('') + lines[i]); + } + return newArr.join('\n'); +} + +function specFailureDetails(result) { + printNewline(); + print(result.fullName); + + for (var i = 0; i < result.failedExpectations.length; i++) { +var failedExpectation = result.failedExpectations[i]; +printNewline(); +print(indent(failedExpectation.message, 2)); +print(indent(failedExpectation.stack, 2)); + } + + printNewline(); +} + +function suiteFailureDetails(result) { + for (var i = 0; i < result.failedExpectations.length; i++) { +printNewline(); +print(colored('red', 'An error was thrown in an afterAll')); +printNewline(); +print(colored('red', 'AfterAll ' + result.failedExpectations[i].message)); + + } + printNewline(); +} + } --- End diff -- Please fix the indentation in this 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 fe
[GitHub] cordova-paramedic pull request: Real time logging and other improv...
Github user dblotsky commented on a diff in the pull request: https://github.com/apache/cordova-paramedic/pull/1#discussion_r57437252 --- Diff: lib/ParamedicConfig.js --- @@ -0,0 +1,83 @@ +var Target = require('./Target'); + +var DEFAULT_START_PORT = 8008; +var DEFAULT_END_PORT = 8018; +var DEFAULT_TIMEOUT = 10 * 60 * 1000; // 10 minutes in msec - this will become a param + +function ParamedicConfig(json) { +this._config = json; +} + +ParamedicConfig.parseFromArguments = function (argv) { +return new ParamedicConfig({ +"targets": [{ +platform: argv.platform, +action: !!argv.justbuild ? 'build' : 'run', +args: (!!argv.browserify ? '--browserify ' : '') + (!!argv.device ? '--device' : '') +}], +"plugins": Array.isArray(argv.plugin) ? argv.plugin : [argv.plugin], +"useTunnel": !!argv.useTunnel, +"verbose": !!argv.verbose, +"startPort": argv.startport || argv.port, +"endPort": argv.endport || argv.port, +"externalServerUrl": argv.externalServerUrl, +"reportSavePath": !!argv.reportSavePath? argv.reportSavePath: undefined, +"cleanUpAfterRun": !!argv.cleanUpAfterRun? true: false +}); +}; + +ParamedicConfig.parseFromFile = function (paramedicConfigPath) { +return new ParamedicConfig(require(paramedicConfigPath)); +}; + +ParamedicConfig.prototype.useTunnel = function () { +return this._config.useTunnel; + --- End diff -- Extra newline. --- 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: Real time logging and other improv...
Github user dblotsky commented on a diff in the pull request: https://github.com/apache/cordova-paramedic/pull/1#discussion_r57432822 --- Diff: main.js --- @@ -1,43 +1,51 @@ #!/usr/bin/env node var parseArgs = require('minimist'), -paramedic = require('./paramedic'); - -var plugins, -platformId; +path = require('path'), +paramedic = require('./lib/paramedic'), +ParamedicConfig = require('./lib/ParamedicConfig'); var USAGE = "Error missing args. \n" + - "cordova-paramedic --platform PLATFORM --plugin PATH [--justbuild --timeout MSECS --port PORTNUM --browserify]\n" + - "`PLATFORM` : the platform id, currently only supports 'ios'\n" + - "`PATH` : the relative or absolute path to a plugin folder\n" + - "\texpected to have a 'tests' folder.\n" + - "\tYou may specify multiple --plugin flags and they will all\n" + - "\tbe installed and tested together.\n" + - "`MSECS` : (optional) time in millisecs to wait for tests to pass|fail \n" + - "\t(defaults to 10 minutes) \n" + - "`PORTNUM` : (optional) port to use for posting results from emulator back to paramedic server\n" + - "--justbuild : (optional) just builds the project, without running the tests \n" + +"cordova-paramedic --platform PLATFORM --plugin PATH [--justbuild --timeout MSECS --startport PORTNUM --endport PORTNUM --browserify]\n" + +"`PLATFORM` : the platform id. Currently supports 'ios', 'browser', 'windows', 'android', 'wp8'.\n" + +"\tPath to platform can be specified as link to git repo like:\n" + + "\twindows@https://github.com/apache/cordova-windows.git\n; + +"\tor path to local copied git repo like:\n" + +"\twindows@../cordova-windows/\n" + +"`PATH` : the relative or absolute path to a plugin folder\n" + +"\texpected to have a 'tests' folder.\n" + +"\tYou may specify multiple --plugin flags and they will all\n" + +"\tbe installed and tested together.\n" + +"`MSECS` : (optional) time in millisecs to wait for tests to pass|fail \n" + + "\t(defaults to 10 minutes) \n" + +"`PORTNUM` : (optional) ports to find available and use for posting results from emulator back to paramedic server(default is from 8008 to 8009)\n" + +"--justbuild : (optional) just builds the project, without running the tests \n" + "--browserify : (optional) plugins are browserified into cordova.js \n" + "--verbose : (optional) verbose mode. Display more information output\n" + -"--platformPath : (optional) path to install platform from, git or local file uri"; +"--useTunnel : use tunneling instead of local address. default is false\n" + +"--reportSavePath: (optional) path to save Junit results file\n" + +"--cleanUpAfterRun: (optional) cleans up the application after the run." --- End diff -- Please add the docs for the `--config` flag. --- 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: Changing docs styling.
GitHub user dblotsky opened a pull request: https://github.com/apache/cordova-docs/pull/567 Changing docs styling. - Styling ToC - Changing color scheme for headings - Changing the font Result: ![capture](https://cloud.githubusercontent.com/assets/405489/14032929/639bc052-f1d3-11e5-85d5-f6c52a587bc2.PNG) You can merge this pull request into a Git repository by running: $ git pull https://github.com/MSOpenTech/cordova-docs toc-styling Alternatively you can review and apply these changes as the patch at: https://github.com/apache/cordova-docs/pull/567.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 #567 commit f109dc0c6ac10db961e345cdfb4917f146840960 Author: Dmitry Blotsky <dmitry.blot...@gmail.com> Date: 2016-03-23T01:35:41Z Changing docs styling: improving ToC, changing color scheme for headings, and changing the font. --- 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-contacts pull request: CB-10399 Added Appium tests
Github user dblotsky commented on a diff in the pull request: https://github.com/apache/cordova-plugin-contacts/pull/101#discussion_r57245776 --- Diff: appium-tests/common/common.spec.js --- @@ -0,0 +1,321 @@ +/*jshint node: true, jasmine: true, browser: true */ +/*global ContactFindOptions, ContactName*/ + +/* + * + * 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. + * +*/ + +// these tests are meant to be executed by Cordova Medic Appium runner +// you can find it here: https://github.com/apache/cordova-medic/ +// it is not necessary to do a full CI setup to run these tests, just run: +// node cordova-medic/medic/medic.js appium --platform android --plugins cordova-plugin-contacts + +'use strict'; + +var wdHelper = global.WD_HELPER; +var screenshotHelper = global.SCREENSHOT_HELPER; +var contactsHelper = require('../helpers/contactsHelper'); + +var MINUTE = 60 * 1000; +var PLATFORM = global.PLATFORM; +var UNORM = global.UNORM; + +describe('Contacts Android', function () { +var driver; +var webviewContext; +var callbackCount = 0; + +function getNextCallbackId() { +return 'appium_callback_' + callbackCount++; +} + +function saveScreenshotAndFail(error) { +fail(error); +return screenshotHelper +.saveScreenshot(driver) +.quit() +.then(function () { +return getDriver(); +}); +} + +function getDriver() { +var getWebviewContext = function () { +return driver +.contexts() +.then(function (contexts) { +var found = false; +// take the last webview context +for (var i = 0; i < contexts.length ; i++) { +if (contexts[i].indexOf('WEBVIEW') >= 0) { +webviewContext = contexts[i]; +found = true; +} +} +if (!found) { +// no webview context, the app is still loading +return driver +.sleep(1) +.then(getWebviewContext); +} +}); +}; +driver = wdHelper.getDriver(PLATFORM); +return getWebviewContext(); +} + +function addContact(firstName, lastName) { +var contactName = contactsHelper.getContactName(firstName, lastName); +return driver +.context(webviewContext) +.setAsyncScriptTimeout(MINUTE) +.executeAsync(function(contactname, callback) { +navigator.contacts +.create({ 'displayName': contactname.formatted, 'name': contactname, 'note': 'DeleteMe' }) +.save(callback, callback); +}, [contactName]) +.then(function(result) { +if (result && result.hasOwnProperty('code')) { +throw result; +} +return result; +}); +} + +function pickContact(name) { +var callbackId = getNextCallbackId(); +return driver +.context(webviewContext) +.execute(function (cbId) { +var cbEl = document.createElement('div'); +cbEl.id = cbId; +cbEl.style.display = 'none'; +navigator.contacts.pickContact(function (contact) { +cbEl.innerHTML = JSON.stringify(contact); +document.body.appendChild(cbEl); +}, function (err) { +cbEl.innerHTML = 'ERROR: ' + err; +
[GitHub] cordova-plugin-file-transfer pull request: CB-10782: Occasional fa...
Github user dblotsky commented on the pull request: https://github.com/apache/cordova-plugin-file-transfer/pull/132#issuecomment-200492702 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-file-transfer pull request: CB-10782: Occasional fa...
Github user dblotsky commented on a diff in the pull request: https://github.com/apache/cordova-plugin-file-transfer/pull/132#discussion_r57049010 --- Diff: tests/tests.js --- @@ -451,11 +451,25 @@ exports.defineAutoTests = function () { it("filetransfer.spec.9 should not leave partial file due to abort", function (done) { +jasmine.addMatchers({ +toBeAbortOrConnectionError: function() { +return { +compare: function(transferError) { +var result = {pass: transferError === FileTransferError.ABORT_ERR || transferError === FileTransferError.CONNECTION_ERR}; +if(!result.pass) { +result.message = "Expected " + transferError + " to be " + FileTransferError.ABORT_ERR + " or " + FileTransferError.CONNECTION_ERR; +} +return result; +} +} +} +}); --- End diff -- What I mean is: can't you just do this logic in the test and not have to have a matcher? --- 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-10782: Occasional fa...
Github user dblotsky commented on a diff in the pull request: https://github.com/apache/cordova-plugin-file-transfer/pull/132#discussion_r57047060 --- Diff: tests/tests.js --- @@ -1114,6 +1125,9 @@ exports.defineAutoTests = function () { }; spyOn(transfer, "onprogress").and.callThrough(); + +// NOTE: removing uploadOptions cause Android to timeout +transfer.upload(localFilePath, fileURL, unexpectedCallbacks.httpWin, uploadFail, uploadOptions); --- End diff -- Good catch! --- 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-10782: Occasional fa...
Github user dblotsky commented on a diff in the pull request: https://github.com/apache/cordova-plugin-file-transfer/pull/132#discussion_r57046468 --- Diff: tests/tests.js --- @@ -451,11 +451,25 @@ exports.defineAutoTests = function () { it("filetransfer.spec.9 should not leave partial file due to abort", function (done) { +jasmine.addMatchers({ +toBeAbortOrConnectionError: function() { +return { +compare: function(transferError) { +var result = {pass: transferError === FileTransferError.ABORT_ERR || transferError === FileTransferError.CONNECTION_ERR}; +if(!result.pass) { +result.message = "Expected " + transferError + " to be " + FileTransferError.ABORT_ERR + " or " + FileTransferError.CONNECTION_ERR; +} +return result; +} +} +} +}); --- End diff -- Why create a matcher for this case? Can't you just do `var result = ...; expect(result).toBe(true)`? --- 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 dblotsky commented on a diff in the pull request: https://github.com/apache/cordova-plugin-file/pull/170#discussion_r56579423 --- Diff: src/android/FileUtils.java --- @@ -73,8 +73,13 @@ Licensed to the Apache Software Foundation (ASF) under one * Permission callback codes */ -public static final int READ_PERM = 0; +public static final int READ_PERM_FILE = 0; public static final int WRITE_PERM = 1; +public static final int READ_PERM_DIR = 2; +public static final int WRITE_PERM_DIR = 3; +public static final int WRITE = 4; +public static final int READ = 5; +public static final int WRITE_PERM_FILE = 6; --- End diff -- The difference between the `WRITE` flag and the `WRITE_PERM`* flags are a bit confusing. Maybe rename `WRITE` to `WRITE_ACTION` and `READ` to `READ_ACTION`? --- 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: Added Evothings Studio to Cordova Tools...
Github user dblotsky commented on the pull request: https://github.com/apache/cordova-docs/pull/410#issuecomment-198858128 @mikaelkindborg thank you for submitting your app to the showcase! Sorry that it took us so long to address your PR. The Cordova developer community had a discussion that you can view [here][thread], and it was decided that the app showcase ought to be closed for submissions. Please however feel free to email dev@cordova.apache.org if you have any questions or concerns regarding this decision. [thread]: http://markmail.org/message/xww4r34spb72h7r6 --- 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