Return-Path: X-Original-To: apmail-cordova-dev-archive@www.apache.org Delivered-To: apmail-cordova-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 83DEE11D94 for ; Fri, 22 Aug 2014 17:28:55 +0000 (UTC) Received: (qmail 42601 invoked by uid 500); 22 Aug 2014 17:28:55 -0000 Delivered-To: apmail-cordova-dev-archive@cordova.apache.org Received: (qmail 42577 invoked by uid 500); 22 Aug 2014 17:28:55 -0000 Mailing-List: contact dev-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cordova.apache.org Delivered-To: mailing list dev@cordova.apache.org Received: (qmail 42565 invoked by uid 500); 22 Aug 2014 17:28:54 -0000 Delivered-To: apmail-incubator-callback-dev@incubator.apache.org Received: (qmail 42562 invoked by uid 99); 22 Aug 2014 17:28:54 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 22 Aug 2014 17:28:54 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 75EC59C852B; Fri, 22 Aug 2014 17:28:54 +0000 (UTC) From: jengee To: callback-dev@incubator.apache.org Reply-To: callback-dev@incubator.apache.org References: In-Reply-To: Subject: [GitHub] cordova-mobile-spec pull request: CB-7350 Make createmobilespec fr... Content-Type: text/plain Message-Id: <20140822172854.75EC59C852B@tyr.zones.apache.org> Date: Fri, 22 Aug 2014 17:28:54 +0000 (UTC) Github user jengee commented on a diff in the pull request: https://github.com/apache/cordova-mobile-spec/pull/103#discussion_r16609983 --- Diff: createmobilespec/createmobilespec.js --- @@ -210,122 +267,153 @@ if (argv.plugman) { shelljs.cp("-f", path.join(mobile_spec_git_dir, 'config.xml'), path.join(projectDirName, 'config.xml')); // Config.json file ---> linked to local libraries - shelljs.pushd(cli_project_dir); + pushd(cli_project_dir); var localPlatforms = { - "amazon-fireos" : top_dir + "cordova-amazon-fireos" , - "android" : top_dir + "cordova-android" , - "ios" : top_dir + "cordova-ios" , - "blackberry10" : top_dir + "cordova-blackberry" , - "wp8" : top_dir + "cordova-wp8" + path.sep + "wp8", - "windows8" : top_dir + "cordova-windows", - "windows" : path.join(top_dir, "cordova-windows", "windows") + "amazon-fireos" : [top_dir, "cordova-amazon-fireos"], + "android" : [top_dir, "cordova-android"], + "ios" : [top_dir, "cordova-ios"], + "blackberry10" : [top_dir, "cordova-blackberry"], + "wp8" : [top_dir, "cordova-wp8", "wp8"], + "windows8" : [top_dir, "cordova-windows"], + "windows" : [top_dir, "cordova-windows", "windows"] }; // Executing platform Add console.log("Adding platforms..."); - platforms.forEach(function (platform) { + [].concat(platforms).forEach(function (platform) { console.log("Adding Platform: " + platform); - var platformArg = argv.global ? platform : localPlatforms[platform]; + var platformArg; + if (argv.global) { + platformArg = platform; + } else { + platformArg = path.join.apply(null, localPlatforms[platform]); + if (!fs.existsSync(platformArg)) { + couldNotFind(localPlatforms[platform][1], platform); + platforms = platforms.filter(function (p) { return p != platform; }); + return; + } + } console.log("platformArg: " + cli + " " + platformArg); shelljs.exec(cli + ' platform add "' + platformArg + '" --verbose'); }); - shelljs.popd(); + popd(); } ////////////////////// install plugins for each platform - -if (argv.plugman) { - console.log("Adding plugins using plugman..."); - platforms.forEach(function (platform) { - var projName = getProjName(platform), - nodeCommand = /^win/.test(process.platform) ? process.argv[0] +" " : ""; - shelljs.pushd(projName); - // plugin path must be relative and not absolute (sigh) - shelljs.exec(nodeCommand + path.join(top_dir, "cordova-plugman", "main.js") + - " install --platform " + platform + - " --project . --plugin " + path.join("..", "cordova-mobile-spec", "dependencies-plugin") + - " --searchpath " + top_dir); - shelljs.popd(); - }); -} else { - // don't use local git repos for plugins when using --global - var searchpath = argv.global ? "" : " --searchpath " + top_dir; - shelljs.pushd(cli_project_dir); - console.log("Adding plugins using CLI..."); - console.log("Searchpath:", searchpath); - shelljs.exec(cli + " plugin add " + path.join(mobile_spec_git_dir, "dependencies-plugin") + - searchpath); - shelljs.popd(); -} +function installPlugins() { + if (argv.plugman) { + console.log("Adding plugins using plugman..."); + if (!fs.existsSync(path.join(top_dir, "cordova-plugman"))) { + couldNotFind('plugman'); + console.log(" ln -s cordova-lib/cordova-lib cordova-plugman/node_modules"); + return; --- End diff -- this needs some `..`'s --- 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 infrastructure@apache.org or file a JIRA ticket with INFRA. ---