You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by pu...@apache.org on 2014/08/15 21:41:30 UTC
[2/2] git commit: CB-6976 Changes switch name from '--store' to
'--win'
CB-6976 Changes switch name from '--store' to '--win'
Project: http://git-wip-us.apache.org/repos/asf/cordova-windows/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-windows/commit/735f9297
Tree: http://git-wip-us.apache.org/repos/asf/cordova-windows/tree/735f9297
Diff: http://git-wip-us.apache.org/repos/asf/cordova-windows/diff/735f9297
Branch: refs/heads/master
Commit: 735f92970431ffca015518611cd8c6b37fe09385
Parents: e022826
Author: sgrebnov <v-...@microsoft.com>
Authored: Fri Aug 15 13:27:10 2014 +0400
Committer: sgrebnov <v-...@microsoft.com>
Committed: Fri Aug 15 18:54:45 2014 +0400
----------------------------------------------------------------------
windows/template/cordova/lib/build.js | 38 ++++++++++++++++--------------
windows/template/cordova/lib/run.js | 21 ++++++++---------
2 files changed, 30 insertions(+), 29 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/735f9297/windows/template/cordova/lib/build.js
----------------------------------------------------------------------
diff --git a/windows/template/cordova/lib/build.js b/windows/template/cordova/lib/build.js
index 6dcf8f1..9a661a3 100644
--- a/windows/template/cordova/lib/build.js
+++ b/windows/template/cordova/lib/build.js
@@ -29,8 +29,8 @@ var Q = require('Q'),
var ROOT = path.join(__dirname, '..', '..');
var projFiles = {
phone: 'CordovaApp.Phone.jsproj',
- store: 'CordovaApp.Store.jsproj',
- store80: 'CordovaApp.Store80.jsproj'
+ win: 'CordovaApp.Store.jsproj',
+ win80: 'CordovaApp.Store80.jsproj'
};
// parsed nopt arguments
var args;
@@ -66,12 +66,14 @@ module.exports.run = function run (argv) {
// help/usage function
module.exports.help = function help() {
console.log("");
- console.log("Usage: build [ --debug | --release ] [--archs=\"<list of architectures...>\"]");
+ console.log("Usage: build [ --debug | --release ] [--archs=\"<list of architectures...>\"] [--phone | --win]");
console.log(" --help : Displays this dialog.");
- console.log(" --debug : builds project in debug mode. (Default)");
- console.log(" --release : builds project in release mode.");
- console.log(" -r : shortcut :: builds project in release mode.");
- console.log(" --archs : Builds project binaries for specific chip architectures. `anycpu` + `arm` + `x86` + `x64` are supported.");
+ console.log(" --debug : Builds project in debug mode. (Default)");
+ console.log(" --release : Builds project in release mode.");
+ console.log(" -r : Shortcut :: builds project in release mode.");
+ console.log(" --archs : Builds project binaries for specific chip architectures (`anycpu`, `arm`, `x86`, `x64`).");
+ console.log(" --phone, --win");
+ console.log(" : Specifies, what type of project to build");
console.log("examples:");
console.log(" build ");
console.log(" build --debug");
@@ -84,13 +86,13 @@ module.exports.help = function help() {
function parseAndValidateArgs(argv) {
// parse and validate args
args = nopt({'debug': Boolean, 'release': Boolean, 'archs': [String],
- 'phone': Boolean, 'store': Boolean}, {'-r': '--release'}, argv);
+ 'phone': Boolean, 'win': Boolean}, {'-r': '--release'}, argv);
// Validate args
if (args.debug && args.release) {
throw 'Only one of "debug"/"release" options should be specified';
}
- if (args.phone && args.store) {
- throw 'Only one of "phone"/"store" options should be specified';
+ if (args.phone && args.win) {
+ throw 'Only one of "phone"/"win" options should be specified';
}
// get build options/defaults
@@ -120,7 +122,7 @@ function buildTargets() {
build.arch = 'anycpu';
}
// msbuild 4.0 requires .sln file, we can't build jsproj
- if (msbuild.version == '4.0' && build.target == projFiles.store80) {
+ if (msbuild.version == '4.0' && build.target == projFiles.win80) {
build.target = 'CordovaApp.vs2012.sln';
}
return msbuild.buildProject(path.join(ROOT, build.target), buildType, build.arch);
@@ -138,23 +140,23 @@ function applyPlatformConfig() {
function getBuildTargets() {
var config = new ConfigParser(path.join(ROOT, 'config.xml'));
var targets = [];
- var noSwitches = !(args.phone || args.store);
-
- if (args.store || noSwitches) { // if --store or no arg
+ var noSwitches = !(args.phone || args.win);
+ // Windows
+ if (args.win || noSwitches) { // if --win or no arg
var windowsTargetVersion = config.getPreference('windows-target-version')
switch(windowsTargetVersion) {
case '8':
case '8.0':
- targets.push(projFiles.store80);
+ targets.push(projFiles.win80);
break;
case '8.1':
- targets.push(projFiles.store);
+ targets.push(projFiles.win);
break;
default:
throw new Error('Unsupported windows-target-version value: ' + windowsTargetVersion)
}
}
-
+ // Windows Phone
if (args.phone || noSwitches) { // if --phone or no arg
var windowsPhoneTargetVersion = config.getPreference('windows-phone-target-version')
switch(windowsPhoneTargetVersion) {
@@ -180,7 +182,7 @@ function filterSupportedTargets (targets) {
// MSBuild 4.0 does not support Windows 8.1 and Windows Phone 8.1
var supportedTargets = targets.filter(function(target) {
- return target != projFiles.store && target != projFiles.phone;
+ return target != projFiles.win && target != projFiles.phone;
});
// unsupported targets have been detected
http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/735f9297/windows/template/cordova/lib/run.js
----------------------------------------------------------------------
diff --git a/windows/template/cordova/lib/run.js b/windows/template/cordova/lib/run.js
index ec1552c..58389b9 100644
--- a/windows/template/cordova/lib/run.js
+++ b/windows/template/cordova/lib/run.js
@@ -35,7 +35,7 @@ module.exports.run = function (argv) {
// parse args
var args = nopt({"debug": Boolean, "release": Boolean, "nobuild": Boolean,
"device": Boolean, "emulator": Boolean, "target": String, "archs": String,
- "phone": Boolean, "store": Boolean}, {"r" : "--release"}, argv);
+ "phone": Boolean, "win": Boolean}, {"r" : "--release"}, argv);
// Validate args
if (args.debug && args.release) {
@@ -44,8 +44,8 @@ module.exports.run = function (argv) {
if ((args.device && args.emulator) || ((args.device || args.emulator) && args.target)) {
return Q.reject('Only one of "device"/"emulator"/"target" options should be specified');
}
- if (args.phone && args.store) {
- return Q.reject('Only one of "phone"/"store" options should be specified');
+ if (args.phone && args.win) {
+ return Q.reject('Only one of "phone"/"win" options should be specified');
}
// Get build/deploy options
@@ -55,7 +55,7 @@ module.exports.run = function (argv) {
deployTarget = args.target ? args.target : args.device ? "device" : "emulator";
// for store switch we should correctly handle 8.0 and 8.1 version as per configuration
- if (projectType == 'store' && getStoreTargetVersion() == '8.0') {
+ if (projectType == 'store' && getWindowsTargetVersion() == '8.0') {
projectType = 'store80'
}
@@ -74,17 +74,16 @@ module.exports.run = function (argv) {
module.exports.help = function () {
console.log("\nUsage: run [ --device | --emulator | --target=<id> ] [ --debug | --release | --nobuild ]");
- console.log(" [ --x86 | --x64 | --arm ] [--phone | --store | --store81 | --store80]");
+ console.log(" [ --x86 | --x64 | --arm ] [--phone | --win]");
console.log(" --device : Deploys and runs the project on the connected device.");
console.log(" --emulator : Deploys and runs the project on an emulator.");
console.log(" --target=<id> : Deploys and runs the project on the specified target.");
console.log(" --debug : Builds project in debug mode.");
console.log(" --release : Builds project in release mode.");
- console.log(" --nobuild : Uses pre-built xap, or errors if project is not built.");
- console.log(" --x86, --x64, --arm");
- console.log(" : Specifies chip architecture.");
- console.log(" --phone, --store, --store81, --store80");
- console.log(" : Specifies, what type of project to deploy");
+ console.log(" --nobuild : Uses pre-built package, or errors if project is not built.");
+ console.log(" --archs : Specific chip architectures (`anycpu`, `arm`, `x86`, `x64`).");
+ console.log(" --phone, --win");
+ console.log(" : Specifies project type to deploy");
console.log("");
console.log("Examples:");
console.log(" run");
@@ -98,7 +97,7 @@ module.exports.help = function () {
};
-function getStoreTargetVersion() {
+function getWindowsTargetVersion() {
var config = new ConfigParser(path.join(ROOT, 'config.xml'));
var windowsTargetVersion = config.getPreference('windows-target-version')
switch(windowsTargetVersion) {