You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by an...@apache.org on 2015/02/09 10:29:04 UTC
[1/4] cordova-wp8 git commit: CB-8412 Enable jshint for wp8 platform
Repository: cordova-wp8
Updated Branches:
refs/heads/master cd90271b6 -> 62fa423ab
CB-8412 Enable jshint for wp8 platform
Project: http://git-wip-us.apache.org/repos/asf/cordova-wp8/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-wp8/commit/10db8dfd
Tree: http://git-wip-us.apache.org/repos/asf/cordova-wp8/tree/10db8dfd
Diff: http://git-wip-us.apache.org/repos/asf/cordova-wp8/diff/10db8dfd
Branch: refs/heads/master
Commit: 10db8dfd36209c01db72efe61cc261ce7df6385c
Parents: 0659160
Author: Murat Sutunc <mu...@microsoft.com>
Authored: Tue Feb 3 14:00:10 2015 -0800
Committer: Murat Sutunc <mu...@microsoft.com>
Committed: Tue Feb 3 14:00:10 2015 -0800
----------------------------------------------------------------------
.jshintignore | 1 +
.jshintrc | 10 ++++++++++
package.json | 6 ++++--
spec/.jshintrc | 11 +++++++++++
4 files changed, 26 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/10db8dfd/.jshintignore
----------------------------------------------------------------------
diff --git a/.jshintignore b/.jshintignore
new file mode 100644
index 0000000..31c0a5a
--- /dev/null
+++ b/.jshintignore
@@ -0,0 +1 @@
+template/www/*
http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/10db8dfd/.jshintrc
----------------------------------------------------------------------
diff --git a/.jshintrc b/.jshintrc
new file mode 100644
index 0000000..89a121c
--- /dev/null
+++ b/.jshintrc
@@ -0,0 +1,10 @@
+{
+ "node": true
+ , "bitwise": true
+ , "undef": true
+ , "trailing": true
+ , "quotmark": true
+ , "indent": 4
+ , "unused": "vars"
+ , "latedef": "nofunc"
+}
http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/10db8dfd/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 48e6b8d..e1d6569 100644
--- a/package.json
+++ b/package.json
@@ -27,14 +27,16 @@
],
"devDependencies": {
"jasmine-node": "~1",
+ "jshint": "^2.6.0",
"rewire": ">=2.1.3",
"istanbul": "^0.3.4"
},
"scripts": {
- "test": "npm run test-unit && npm run test-e2e",
+ "test": "npm run jshint && npm run test-unit && npm run test-e2e",
"test-unit": "node node_modules/jasmine-node/lib/jasmine-node/cli.js --captureExceptions spec/unit",
"test-e2e": "node node_modules/jasmine-node/lib/jasmine-node/cli.js --captureExceptions spec/e2e",
- "cover": "node node_modules/istanbul/lib/cli.js cover --root template --print detail node_modules/jasmine-node/bin/jasmine-node -- spec/unit"
+ "cover": "node node_modules/istanbul/lib/cli.js cover --root template --print detail node_modules/jasmine-node/bin/jasmine-node -- spec/unit",
+ "jshint": "node node_modules/jshint/bin/jshint bin && node node_modules/jshint/bin/jshint template && node node_modules/jshint/bin/jshint spec"
},
"author": "Apache Software Foundation",
"license": "Apache Version 2.0"
http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/10db8dfd/spec/.jshintrc
----------------------------------------------------------------------
diff --git a/spec/.jshintrc b/spec/.jshintrc
new file mode 100644
index 0000000..17eae32
--- /dev/null
+++ b/spec/.jshintrc
@@ -0,0 +1,11 @@
+{
+ "node": true
+ , "bitwise": true
+ , "undef": true
+ , "trailing": true
+ , "quotmark": true
+ , "indent": 4
+ , "unused": "vars"
+ , "latedef": "nofunc"
+ , "jasmine": true
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[3/4] cordova-wp8 git commit: CB-8325 minor test improvements with
e2e tests
Posted by an...@apache.org.
CB-8325 minor test improvements with e2e tests
Project: http://git-wip-us.apache.org/repos/asf/cordova-wp8/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-wp8/commit/c464b286
Tree: http://git-wip-us.apache.org/repos/asf/cordova-wp8/tree/c464b286
Diff: http://git-wip-us.apache.org/repos/asf/cordova-wp8/diff/c464b286
Branch: refs/heads/master
Commit: c464b2864d488f84523ec0115f35d9070ce33ac5
Parents: 656bf2f
Author: Murat Sutunc <mu...@microsoft.com>
Authored: Fri Feb 6 09:54:32 2015 -0800
Committer: Murat Sutunc <mu...@microsoft.com>
Committed: Fri Feb 6 09:54:32 2015 -0800
----------------------------------------------------------------------
spec/e2e/endtoend.spec.js | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/c464b286/spec/e2e/endtoend.spec.js
----------------------------------------------------------------------
diff --git a/spec/e2e/endtoend.spec.js b/spec/e2e/endtoend.spec.js
index 5f0685f..80a4d81 100644
--- a/spec/e2e/endtoend.spec.js
+++ b/spec/e2e/endtoend.spec.js
@@ -27,15 +27,19 @@ describe('Cordova create and build', function(){
anycpuPackageFolder = path.join(buildDirectory, projectFolder, 'Bin', 'Debug'),
x86PackageFolder = path.join(buildDirectory, projectFolder, 'Bin', 'x86', 'Debug'),
armPackageFolder = path.join(buildDirectory, projectFolder, 'Bin', 'ARM', 'Debug'),
- buildScriptPath = '"' + path.join(buildDirectory, projectFolder, 'cordova', 'build') + '"';
+ buildScriptPath = '"' + path.join(buildDirectory, projectFolder, 'cordova', 'build') + '"',
+ originalTimeout;
beforeEach(function(){
- shell.exec(path.join('bin', 'create') + ' "' + projectFolder + '" com.test.app 応用', {silent : true});
+ shell.exec(path.join('bin', 'create') + ' "' + projectFolder + '" com.test.app 応用', {silent : true});
+ originalTimeout = jasmine.getEnv().defaultTimeoutInterval;
+ jasmine.getEnv().defaultTimeoutInterval = 30000;
});
afterEach(function() {
shell.cd(buildDirectory);
shell.rm('-rf', projectFolder);
+ jasmine.getEnv().defaultTimeoutInterval = originalTimeout;
});
it('spec.1 should create new project', function(){
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[4/4] cordova-wp8 git commit: Merge branch 'CB-8412' of
https://github.com/MSOpenTech/cordova-wp8
Posted by an...@apache.org.
Merge branch 'CB-8412' of https://github.com/MSOpenTech/cordova-wp8
Project: http://git-wip-us.apache.org/repos/asf/cordova-wp8/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-wp8/commit/62fa423a
Tree: http://git-wip-us.apache.org/repos/asf/cordova-wp8/tree/62fa423a
Diff: http://git-wip-us.apache.org/repos/asf/cordova-wp8/diff/62fa423a
Branch: refs/heads/master
Commit: 62fa423ab5a3b13a9a763fbee49fc904d424eaa9
Parents: cd90271 c464b28
Author: Vladimir Kotikov <v-...@microsoft.com>
Authored: Mon Feb 9 12:27:39 2015 +0300
Committer: Vladimir Kotikov <v-...@microsoft.com>
Committed: Mon Feb 9 12:28:29 2015 +0300
----------------------------------------------------------------------
.jshintignore | 1 +
.jshintrc | 10 +++
bin/createTemplates.js | 121 +++++++++++-------------------
bin/lib/check_reqs.js | 4 +-
bin/lib/create.js | 74 +++++++++---------
bin/lib/update.js | 14 ++--
package.json | 6 +-
spec/.jshintrc | 11 +++
spec/e2e/endtoend.spec.js | 20 +++--
spec/unit/MSBuildTools.spec.js | 6 +-
spec/unit/build.spec.js | 4 +-
spec/unit/package.spec.js | 3 +-
spec/unit/run.spec.js | 4 +-
template/cordova/lib/MSBuildTools.js | 6 +-
template/cordova/lib/build.js | 34 +++++----
template/cordova/lib/device.js | 3 -
template/cordova/lib/package.js | 4 +-
template/cordova/lib/run.js | 68 ++++++++---------
template/cordova/lib/target-list.js | 24 +++---
template/cordova/lib/utils.js | 14 ++--
20 files changed, 213 insertions(+), 218 deletions(-)
----------------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[2/4] cordova-wp8 git commit: CB-8412 Fix all jshint issues for WP8
platform
Posted by an...@apache.org.
CB-8412 Fix all jshint issues for WP8 platform
Project: http://git-wip-us.apache.org/repos/asf/cordova-wp8/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-wp8/commit/656bf2fc
Tree: http://git-wip-us.apache.org/repos/asf/cordova-wp8/tree/656bf2fc
Diff: http://git-wip-us.apache.org/repos/asf/cordova-wp8/diff/656bf2fc
Branch: refs/heads/master
Commit: 656bf2fc60cea42931dbfc05da395709cf5c553c
Parents: 10db8df
Author: Murat Sutunc <mu...@microsoft.com>
Authored: Tue Feb 3 15:21:28 2015 -0800
Committer: Murat Sutunc <mu...@microsoft.com>
Committed: Tue Feb 3 15:21:28 2015 -0800
----------------------------------------------------------------------
bin/createTemplates.js | 121 +++++++++++-------------------
bin/lib/check_reqs.js | 4 +-
bin/lib/create.js | 74 +++++++++---------
bin/lib/update.js | 14 ++--
spec/e2e/endtoend.spec.js | 12 +--
spec/unit/MSBuildTools.spec.js | 6 +-
spec/unit/build.spec.js | 4 +-
spec/unit/package.spec.js | 3 +-
spec/unit/run.spec.js | 4 +-
template/cordova/lib/MSBuildTools.js | 6 +-
template/cordova/lib/build.js | 34 +++++----
template/cordova/lib/device.js | 3 -
template/cordova/lib/package.js | 4 +-
template/cordova/lib/run.js | 68 ++++++++---------
template/cordova/lib/target-list.js | 24 +++---
template/cordova/lib/utils.js | 14 ++--
16 files changed, 181 insertions(+), 214 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/656bf2fc/bin/createTemplates.js
----------------------------------------------------------------------
diff --git a/bin/createTemplates.js b/bin/createTemplates.js
index 6f0001f..259b89d 100755
--- a/bin/createTemplates.js
+++ b/bin/createTemplates.js
@@ -17,9 +17,11 @@
under the License.
*/
+/* jshint wsh:true, node:false, bitwise:false */
+
var fso = WScript.CreateObject('Scripting.FileSystemObject'),
- shell = WScript.CreateObject("shell.application"),
- wscript_shell = WScript.CreateObject("WScript.Shell");
+ shell = WScript.CreateObject('shell.application'),
+ wscript_shell = WScript.CreateObject('WScript.Shell');
//Set up directory structure of current release
//arguments passed in
@@ -41,9 +43,9 @@ var addToVS = false;
// help function
function Usage() {
- Log("\nUsage: createTemplates [-install]");
- Log("Build/zips up templates from the local repo")
- Log(" -install : also installs templates to user directory on success\n");
+ Log('\nUsage: createTemplates [-install]');
+ Log('Build/zips up templates from the local repo');
+ Log(' -install : also installs templates to user directory on success\n');
}
// logs messaged to stdout and stderr
@@ -69,9 +71,6 @@ function deleteFolderIfExists(path) {
}
}
-var ForReading = 1, ForWriting = 2, ForAppending = 8;
-var TristateUseDefault = -2, TristateTrue = -1, TristateFalse = 0;
-
// returns the contents of a file
function read(filename) {
if(fso.FileExists(filename))
@@ -89,19 +88,6 @@ function read(filename) {
return null;
}
-// writes the contents to the specified file
-function write(filename, contents) {
- var f=fso.OpenTextFile(filename, ForWriting, TristateTrue);
- f.Write(contents);
- f.Close();
-}
-
-// replaces the matches of regexp with replacement
-function replaceInFile(filename, regexp, replacement) {
- var text = read(filename).replace(regexp,replacement);
- write(filename,text);
-}
-
// executes a commmand in the shell
function exec(command) {
var oShell=wscript_shell.Exec(command);
@@ -112,30 +98,9 @@ function exec(command) {
WScript.sleep(100);
}
else {
- Log("Exec timed out with command :: " + command);
- }
- }
-}
-
-// executes a commmand in the shell
-function exec_verbose(command) {
- //Log("Command: " + command);
- var oShell=wscript_shell.Exec(command);
- while (oShell.Status === 0) {
- //Wait a little bit so we're not super looping
- WScript.sleep(100);
- //Print any stdout output from the script
- if(!oShell.StdOut.AtEndOfStream) {
- Log(oShell.StdOut.ReadLine());
+ Log('Exec timed out with command :: ' + command);
}
}
- //Check to make sure our scripts did not encounter an error
- if(!oShell.StdErr.AtEndOfStream)
- {
- var err_line = oShell.StdErr.ReadAll();
- WScript.StdErr.WriteLine(err_line);
- WScript.Quit(1);
- }
}
function copyFile(src,dest) {
@@ -143,24 +108,24 @@ function copyFile(src,dest) {
}
function copyCommonScripts() {
- var srcPath = platformRoot + "\\bin";
- var destPath = platformRoot + templatePath + "\\cordova";
+ var srcPath = platformRoot + '\\bin';
+ var destPath = platformRoot + templatePath + '\\cordova';
- copyFile(srcPath + "\\check_reqs.bat", destPath + "\\check_reqs.bat");
- copyFile(srcPath + "\\check_reqs.js", destPath + "\\check_reqs.js");
+ copyFile(srcPath + '\\check_reqs.bat', destPath + '\\check_reqs.bat');
+ copyFile(srcPath + '\\check_reqs.js', destPath + '\\check_reqs.js');
}
function removeCommonScripts() {
- var destPath = platformRoot + templatePath + "\\cordova";
+ var destPath = platformRoot + templatePath + '\\cordova';
- deleteFileIfExists(destPath + "\\check_reqs.bat");
- deleteFileIfExists(destPath + "\\check_reqs.js");
+ deleteFileIfExists(destPath + '\\check_reqs.bat');
+ deleteFileIfExists(destPath + '\\check_reqs.js');
}
// packages templates into .zip
function package_templates()
{
- Log("Creating template .zip files for wp8");
+ Log('Creating template .zip files for wp8');
var templateOutFilename = repoRoot + '\\CordovaWP8_' + versionNum.replace(/\./g, '_') + '.zip';
// clear the destination
@@ -171,7 +136,7 @@ function package_templates()
deleteFolderIfExists(platformRoot + templatePath + '\\obj');
deleteFolderIfExists(platformRoot + templatePath + '\\Service\ References');
- deleteFileIfExists(platformRoot + templatePath + "\\CordovaWP8Solution.v11.suo");
+ deleteFileIfExists(platformRoot + templatePath + '\\CordovaWP8Solution.v11.suo');
copyCommonScripts();
@@ -181,33 +146,34 @@ function package_templates()
// update .vstemplate files for the template zips.
- var cleanVersionName = "CordovaWP8_" + versionNum.replace(/\./g, '_');
+ var cleanVersionName = 'CordovaWP8_' + versionNum.replace(/\./g, '_');
- var projXml = WScript.CreateObject("Microsoft.XMLDOM");
+ var projXml = WScript.CreateObject('Microsoft.XMLDOM');
+ var xNode = null;
projXml.async = false;
var fullTemplatePath = platformRoot + templatePath + '\\MyTemplate.vstemplate';
if (projXml.load(fullTemplatePath)) {
// <Name>CordovaWP8_ + versionNum.replace(/\./g, '_')</Name>
- var xNode = projXml.selectSingleNode("VSTemplate/TemplateData/Name");
- if(xNode != null)
+ xNode = projXml.selectSingleNode('VSTemplate/TemplateData/Name');
+ if(xNode !== null)
{
// Log("replacing version in Name");
xNode.text = cleanVersionName;
}
// <DefaultName>CordovaWP8_ + versionNum</DefaultName>
- xNode = projXml.selectSingleNode("VSTemplate/TemplateData/DefaultName");
- if(xNode != null)
+ xNode = projXml.selectSingleNode('VSTemplate/TemplateData/DefaultName');
+ if(xNode !== null)
{
// Log("replacing version in DefaultName");
xNode.text = cleanVersionName + '_';
}
- xNode = projXml.selectSingleNode("VSTemplate/TemplateData/Description");
- if(xNode != null)
+ xNode = projXml.selectSingleNode('VSTemplate/TemplateData/Description');
+ if(xNode !== null)
{
- xNode.text = xNode.text.replace("0.0.0", versionNum);
+ xNode.text = xNode.text.replace('0.0.0', versionNum);
}
projXml.save(fullTemplatePath);
@@ -215,22 +181,22 @@ function package_templates()
// Use proper XML-DOM named nodes and replace them with cordova current version
- var projXml = WScript.CreateObject("Microsoft.XMLDOM");
+ projXml = WScript.CreateObject('Microsoft.XMLDOM');
projXml.async = false;
if (projXml.load(platformRoot + templatePath + '\\MyTemplate.vstemplate')) {
// <Name>CordovaWP7_ + versionNum.replace(/\./g, '_')</Name>
- var xNode = projXml.selectSingleNode("VSTemplate/TemplateData/Name");
- if(xNode != null)
+ xNode = projXml.selectSingleNode('VSTemplate/TemplateData/Name');
+ if(xNode !== null)
{
- xNode.text = "CordovaWP8_" + versionNum.replace(/\./g, '_');
+ xNode.text = 'CordovaWP8_' + versionNum.replace(/\./g, '_');
}
// <DefaultName>CordovaWP7_ + versionNum</DefaultName>
- xNode = projXml.selectSingleNode("VSTemplate/TemplateData/DefaultName");
- if(xNode != null)
+ xNode = projXml.selectSingleNode('VSTemplate/TemplateData/DefaultName');
+ if(xNode !== null)
{
- xNode.text = "CordovaWP8_" + versionNum;
+ xNode.text = 'CordovaWP8_' + versionNum;
}
projXml.save(platformRoot + templatePath + '\\MyTemplate.vstemplate');
@@ -241,7 +207,8 @@ function package_templates()
if(addToVS)
{
- var template_dir = wscript_shell.ExpandEnvironmentStrings("%USERPROFILE%") + '\\Documents\\Visual Studio 2012\\Templates\\ProjectTemplates';
+ var dest = null;
+ var template_dir = wscript_shell.ExpandEnvironmentStrings('%USERPROFILE%') + '\\Documents\\Visual Studio 2012\\Templates\\ProjectTemplates';
if(fso.FolderExists(template_dir ))
{
dest = shell.NameSpace(template_dir);
@@ -249,10 +216,10 @@ function package_templates()
}
else
{
- Log("WARNING: Could not find template directory in Visual Studio,\n you can manually copy over the template .zip files.");
+ Log('WARNING: Could not find template directory in Visual Studio,\n you can manually copy over the template .zip files.');
}
// add to VS-2013 as well
- template_dir = wscript_shell.ExpandEnvironmentStrings("%USERPROFILE%") + '\\Documents\\Visual Studio 2013\\Templates\\ProjectTemplates';
+ template_dir = wscript_shell.ExpandEnvironmentStrings('%USERPROFILE%') + '\\Documents\\Visual Studio 2013\\Templates\\ProjectTemplates';
if(fso.FolderExists(template_dir ))
{
dest = shell.NameSpace(template_dir);
@@ -262,7 +229,7 @@ function package_templates()
removeCommonScripts();
deleteFileIfExists(platformRoot + templatePath + '\\config.xml');
- deleteFileIfExists(platformRoot + templatePath + "\\VERSION");
+ deleteFileIfExists(platformRoot + templatePath + '\\VERSION');
}
function zip_project(zip_path, project_path) {
@@ -270,7 +237,7 @@ function zip_project(zip_path, project_path) {
var file = fso.CreateTextFile(zip_path, true);
// create twenty-two byte "fingerprint" for .zip
- file.write("PK");
+ file.write('PK');
file.write(String.fromCharCode(5));
file.write(String.fromCharCode(6));
file.write('\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0');
@@ -306,12 +273,12 @@ function parseArgs() {
if(args.Count() > 0) {
//Support help flags -help, --help, /?
- if(args(0).indexOf("-help") > -1 ||
- args(0).indexOf("/?") > -1 ) {
+ if(args(0).indexOf('-help') > -1 ||
+ args(0).indexOf('/?') > -1 ) {
Usage();
WScript.Quit(1);
}
- else if(args(0).indexOf("-install") > -1) {
+ else if(args(0).indexOf('-install') > -1) {
addToVS = true;
}
}
@@ -320,5 +287,5 @@ function parseArgs() {
// MAIN
parseArgs();
// build/package the templates
-versionNum = read(platformRoot + "\\VERSION");
+versionNum = read(platformRoot + '\\VERSION');
package_templates(repoRoot);
http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/656bf2fc/bin/lib/check_reqs.js
----------------------------------------------------------------------
diff --git a/bin/lib/check_reqs.js b/bin/lib/check_reqs.js
index 8a480e5..c87a06f 100644
--- a/bin/lib/check_reqs.js
+++ b/bin/lib/check_reqs.js
@@ -24,12 +24,12 @@ var Q = require('Q'),
module.exports.run = function () {
if (os.platform() != 'win32'){
// Build Universal windows apps available for windows platform only, so we reject on others platforms
- return Q.reject("ERROR: Cordova tooling for Windows requires Windows OS");
+ return Q.reject('ERROR: Cordova tooling for Windows requires Windows OS');
}
// Check whther MSBuild Tools are available
return MSBuildTools.findAvailableVersion();
};
module.exports.help = function () {
- console.log("Usage: check_reqs or node check_reqs");
+ console.log('Usage: check_reqs or node check_reqs');
};
http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/656bf2fc/bin/lib/create.js
----------------------------------------------------------------------
diff --git a/bin/lib/create.js b/bin/lib/create.js
index 5b1978f..ae11869 100644
--- a/bin/lib/create.js
+++ b/bin/lib/create.js
@@ -23,8 +23,8 @@ var Q = require('Q'),
shell = require('shelljs'),
uuid = require('node-uuid');
-var defaultAppName = "CordovaWP8AppProj";
-var defaultSlnName = "CordovaWP8Solution";
+var defaultAppName = 'CordovaWP8AppProj';
+var defaultSlnName = 'CordovaWP8Solution';
// Creates cordova-windows project at specified path with specified namespace, app name and GUID
module.exports.run = function (argv) {
@@ -36,76 +36,76 @@ module.exports.run = function (argv) {
var projectPath = args[0];
if (fs.existsSync(projectPath)){
- return Q.reject("Project directory already exists:\n\t" + projectPath);
+ return Q.reject('Project directory already exists:\n\t' + projectPath);
}
// Package name can't contain dashes, so replace it with underscores
// if replacing the - with a _ does not work, give up
- var packageName = args[1] ? args[1].replace("-", "_") : "Cordova.Example";
+ var packageName = args[1] ? args[1].replace('-', '_') : 'Cordova.Example';
if(!/^[a-zA-Z0-9._$]+$/g.test(packageName)) {
- return Q.reject("Invalid identifier. PackageName may only include letters, numbers, _ and $");
+ return Q.reject('Invalid identifier. PackageName may only include letters, numbers, _ and $');
}
var appName = args[2] || defaultAppName,
safeAppName = appName.replace(/(\.\s|\s\.|\s+|\.+)/g, '_'),
platformRoot = path.join(__dirname, '..', '..'),
- templatePath = path.join(platformRoot, "template"),
+ templatePath = path.join(platformRoot, 'template'),
customTemplate = args[3];
- console.log("Creating Cordova Windows Project:");
- console.log("\tApp Name : " + appName);
- console.log("\tNamespace : " + packageName);
- console.log("\tPath : " + projectPath);
+ console.log('Creating Cordova Windows Project:');
+ console.log('\tApp Name : ' + appName);
+ console.log('\tNamespace : ' + packageName);
+ console.log('\tPath : ' + projectPath);
if (customTemplate) {
- console.log("Custom template path: " + customTemplate);
+ console.log('Custom template path: ' + customTemplate);
}
console.log('Copying necessary files to ' + projectPath);
// Copy the template source files to the new destination
- shell.cp("-rf", path.join(templatePath, '*'), projectPath);
+ shell.cp('-rf', path.join(templatePath, '*'), projectPath);
// Copy our unique VERSION file, so peeps can tell what version this project was created from.
- shell.cp("-rf", path.join(platformRoot, 'VERSION'), projectPath);
+ shell.cp('-rf', path.join(platformRoot, 'VERSION'), projectPath);
// copy the defaults.xml into config.xml so this project can be built when create is called minus the cordova-cli
- shell.cp(path.join(projectPath, "cordova", "defaults.xml"), path.join(projectPath, "config.xml"));
+ shell.cp(path.join(projectPath, 'cordova', 'defaults.xml'), path.join(projectPath, 'config.xml'));
// CB-7618 node_modules must be copied to project folder
shell.cp('-r', path.join(platformRoot, 'node_modules'), path.join(projectPath, 'cordova'));
// if any custom template is provided, just copy it over created project
if (customTemplate && fs.existsSync(customTemplate)) {
console.log('Copying template overrides from ' + customTemplate + ' to ' + projectPath);
- shell.cp("-rf", customTemplate, projectPath);
+ shell.cp('-rf', customTemplate, projectPath);
}
- console.log("Updating project files");
+ console.log('Updating project files');
// replace values in the AppManifest
- var wmAppManifest = path.join(projectPath, "Properties", "WMAppManifest.xml"),
+ var wmAppManifest = path.join(projectPath, 'Properties', 'WMAppManifest.xml'),
guid = uuid.v1();
- shell.sed("-i", /\$guid1\$/g, guid, wmAppManifest);
- shell.sed("-i", /\$safeprojectname\$/g, appName, wmAppManifest);
+ shell.sed('-i', /\$guid1\$/g, guid, wmAppManifest);
+ shell.sed('-i', /\$safeprojectname\$/g, appName, wmAppManifest);
//replace projectname in project files
- ["App.xaml", "App.xaml.cs", "MainPage.xaml", "MainPage.xaml.cs", defaultAppName + ".csproj"].forEach(function (file) {
- shell.sed("-i", /\$safeprojectname\$/g, packageName, path.join(projectPath, file));
+ ['App.xaml', 'App.xaml.cs', 'MainPage.xaml', 'MainPage.xaml.cs', defaultAppName + '.csproj'].forEach(function (file) {
+ shell.sed('-i', /\$safeprojectname\$/g, packageName, path.join(projectPath, file));
});
if (appName != defaultAppName) {
- var slnFile = path.join(projectPath, defaultSlnName + ".sln"),
- csprojFile = path.join(projectPath, defaultAppName + ".csproj");
+ var slnFile = path.join(projectPath, defaultSlnName + '.sln'),
+ csprojFile = path.join(projectPath, defaultAppName + '.csproj');
- shell.sed("-i", new RegExp(defaultAppName, "g"), safeAppName, slnFile);
+ shell.sed('-i', new RegExp(defaultAppName, 'g'), safeAppName, slnFile);
// rename project and solution
- shell.mv("-f", slnFile, path.join(projectPath, safeAppName + ".sln"));
- shell.mv("-f", csprojFile, path.join(projectPath, safeAppName + ".csproj"));
+ shell.mv('-f', slnFile, path.join(projectPath, safeAppName + '.sln'));
+ shell.mv('-f', csprojFile, path.join(projectPath, safeAppName + '.csproj'));
}
// remove template cruft
- ["__PreviewImage.jpg", "__TemplateIcon.png", "MyTemplate.vstemplate"].forEach(function (file) {
+ ['__PreviewImage.jpg', '__TemplateIcon.png', 'MyTemplate.vstemplate'].forEach(function (file) {
shell.rm(path.join(projectPath, file));
});
// Delete bld forder and bin folder
- ["bld", "bin", "*.user", "*.suo"].forEach(function (file) {
+ ['bld', 'bin', '*.user', '*.suo'].forEach(function (file) {
shell.rm('-rf', path.join(projectPath, file));
});
@@ -113,13 +113,13 @@ module.exports.run = function (argv) {
};
module.exports.help = function () {
- console.log("Usage: create PathToNewProject [ PackageName [ AppName [ CustomTemplate ] ] ]");
- console.log(" PathToNewProject : The path to where you wish to create the project");
- console.log(" PackageName : The namespace for the project (default is Cordova.Example)");
- console.log(" AppName : The name of the application (default is CordovaAppProj)");
- console.log(" CustomTemplate : The path to project template overrides");
- console.log(" (will be copied over default platform template files)");
- console.log("examples:");
- console.log(" create C:\\Users\\anonymous\\Desktop\\MyProject");
- console.log(" create C:\\Users\\anonymous\\Desktop\\MyProject io.Cordova.Example AnApp");
+ console.log('Usage: create PathToNewProject [ PackageName [ AppName [ CustomTemplate ] ] ]');
+ console.log(' PathToNewProject : The path to where you wish to create the project');
+ console.log(' PackageName : The namespace for the project (default is Cordova.Example)');
+ console.log(' AppName : The name of the application (default is CordovaAppProj)');
+ console.log(' CustomTemplate : The path to project template overrides');
+ console.log(' (will be copied over default platform template files)');
+ console.log('examples:');
+ console.log(' create C:\\Users\\anonymous\\Desktop\\MyProject');
+ console.log(' create C:\\Users\\anonymous\\Desktop\\MyProject io.Cordova.Example AnApp');
};
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/656bf2fc/bin/lib/update.js
----------------------------------------------------------------------
diff --git a/bin/lib/update.js b/bin/lib/update.js
index 530852b..09ef06b 100644
--- a/bin/lib/update.js
+++ b/bin/lib/update.js
@@ -42,11 +42,11 @@ function extractMetadata(projectPath) {
}
module.exports.help = function () {
- console.log("WARNING : Make sure to back up your project before updating!");
- console.log("Usage: update PathToProject ");
- console.log(" PathToProject : The path the project you would like to update.");
- console.log("examples:");
- console.log(" update C:\\Users\\anonymous\\Desktop\\MyProject");
+ console.log('WARNING : Make sure to back up your project before updating!');
+ console.log('Usage: update PathToProject ');
+ console.log(' PathToProject : The path the project you would like to update.');
+ console.log('examples:');
+ console.log(' update C:\\Users\\anonymous\\Desktop\\MyProject');
};
// updates the cordova.js in project along with the cordova tooling.
@@ -54,8 +54,8 @@ module.exports.run = function (argv) {
var projectPath = argv[2];
if (!fs.existsSync(projectPath)){
// if specified project path is not valid then reject promise
- Q.reject("The given path to the project does not exist." +
- " Please provide a path to the project you would like to update.");
+ Q.reject('The given path to the project does not exist.' +
+ ' Please provide a path to the project you would like to update.');
}
return extractMetadata(projectPath).then(function (metadata) {
http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/656bf2fc/spec/e2e/endtoend.spec.js
----------------------------------------------------------------------
diff --git a/spec/e2e/endtoend.spec.js b/spec/e2e/endtoend.spec.js
index deb9521..5f0685f 100644
--- a/spec/e2e/endtoend.spec.js
+++ b/spec/e2e/endtoend.spec.js
@@ -20,9 +20,9 @@ var shell = require('shelljs'),
fs = require('fs'),
path = require('path');
-describe("Cordova create and build", function(){
+describe('Cordova create and build', function(){
- var projectFolder = "testcreate 応用",
+ var projectFolder = 'testcreate 応用',
buildDirectory = path.join(__dirname, '../..'),
anycpuPackageFolder = path.join(buildDirectory, projectFolder, 'Bin', 'Debug'),
x86PackageFolder = path.join(buildDirectory, projectFolder, 'Bin', 'x86', 'Debug'),
@@ -38,23 +38,23 @@ describe("Cordova create and build", function(){
shell.rm('-rf', projectFolder);
});
- it("spec.1 should create new project", function(){
+ it('spec.1 should create new project', function(){
expect(fs.existsSync(projectFolder)).toBe(true);
});
- it("spec.2 should build project", function(){
+ it('spec.2 should build project', function(){
shell.exec(buildScriptPath, {silent:true});
var packages = shell.ls(anycpuPackageFolder);
expect(packages.filter(function(file) { return file.match(/.*AnyCPU\.xap$/); }).length).toBe(1);
});
- it("spec.3 should build project for particular CPU", function(){
+ it('spec.3 should build project for particular CPU', function(){
shell.exec(buildScriptPath + ' --archs=\"x86\"', {silent : true});
var x86Package = shell.ls(x86PackageFolder);
expect(x86Package.filter(function(file) { return file.match(/.*x86\.xap$/); }).length).toBe(1);
});
- it("spec.4 should build project for CPUs separated by whitespaces", function(){
+ it('spec.4 should build project for CPUs separated by whitespaces', function(){
shell.exec(buildScriptPath + ' --archs=\"x86 arm anycpu\"', {silent : true});
var anycpuPackage = shell.ls(anycpuPackageFolder);
expect(anycpuPackage.filter(function(file) { return file.match(/.*AnyCPU\.xap$/); }).length).toBe(1);
http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/656bf2fc/spec/unit/MSBuildTools.spec.js
----------------------------------------------------------------------
diff --git a/spec/unit/MSBuildTools.spec.js b/spec/unit/MSBuildTools.spec.js
index 9958b29..c124df8 100644
--- a/spec/unit/MSBuildTools.spec.js
+++ b/spec/unit/MSBuildTools.spec.js
@@ -22,7 +22,7 @@ var Q = require('q'),
buildTools = rewire(platformRoot + '/cordova/lib/MSBuildTools.js');
var fakeToolsPath = function (version) {
- return "C:\\Program Files (x86)\\MSBuild\\" + version;
+ return 'C:\\Program Files (x86)\\MSBuild\\' + version;
};
describe('findAvailableVersion method', function(){
@@ -45,7 +45,7 @@ describe('findAvailableVersion method', function(){
done();
}
});
- }
+ };
beforeEach(function () {
checkMSBuildVersionOriginal = buildTools.__get__('checkMSBuildVersion');
@@ -102,7 +102,7 @@ describe('checkMSBuildVersion method', function(){
var version = '14.0';
buildTools.__set__('utils.exec', function(cmd) {
- return Q.resolve("\r\nHKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\MSBuild\\ToolsVersions\\12.0\r\n\tMSBuildToolsPath\tREG_SZ\t" + fakeToolsPath(version) + "\r\n\r\n");
+ return Q.resolve('\r\nHKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\MSBuild\\ToolsVersions\\12.0\r\n\tMSBuildToolsPath\tREG_SZ\t' + fakeToolsPath(version) + '\r\n\r\n');
});
checkMSBuildVersion(version).then(function (actual) {
http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/656bf2fc/spec/unit/build.spec.js
----------------------------------------------------------------------
diff --git a/spec/unit/build.spec.js b/spec/unit/build.spec.js
index 868c827..5f49d09 100644
--- a/spec/unit/build.spec.js
+++ b/spec/unit/build.spec.js
@@ -30,11 +30,11 @@ describe('run method', function() {
var isCordovaProjectFalse = function () {
return false;
- }
+ };
var isCordovaProjectTrue = function () {
return true;
- }
+ };
beforeEach(function () {
// console output suppression
http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/656bf2fc/spec/unit/package.spec.js
----------------------------------------------------------------------
diff --git a/spec/unit/package.spec.js b/spec/unit/package.spec.js
index 92a3b2c..ff87bbc 100644
--- a/spec/unit/package.spec.js
+++ b/spec/unit/package.spec.js
@@ -16,8 +16,7 @@
specific language governing permissions and limitations
under the License.
*/
-var Q = require('q'),
- path = require('path'),
+var path = require('path'),
rewire = require('rewire'),
shell = require('shelljs'),
platformRoot = '../../template',
http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/656bf2fc/spec/unit/run.spec.js
----------------------------------------------------------------------
diff --git a/spec/unit/run.spec.js b/spec/unit/run.spec.js
index d7d9307..9d59efa 100644
--- a/spec/unit/run.spec.js
+++ b/spec/unit/run.spec.js
@@ -31,11 +31,11 @@ describe('run method', function() {
var isCordovaProjectFalse = function () {
return false;
- }
+ };
var isCordovaProjectTrue = function () {
return true;
- }
+ };
beforeEach(function () {
// console output suppression
http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/656bf2fc/template/cordova/lib/MSBuildTools.js
----------------------------------------------------------------------
diff --git a/template/cordova/lib/MSBuildTools.js b/template/cordova/lib/MSBuildTools.js
index 23107cf..3c7f8c5 100644
--- a/template/cordova/lib/MSBuildTools.js
+++ b/template/cordova/lib/MSBuildTools.js
@@ -27,9 +27,9 @@ function MSBuildTools (version, path) {
}
MSBuildTools.prototype.buildProject = function(projFile, buildType, buildarch) {
- console.log("\nBuilding project: " + projFile);
- console.log("\tConfiguration : " + buildType);
- console.log("\tPlatform : " + buildarch);
+ console.log('\nBuilding project: ' + projFile);
+ console.log('\tConfiguration : ' + buildType);
+ console.log('\tPlatform : ' + buildarch);
var args = ['/clp:NoSummary;NoItemAndPropertyList;Verbosity=minimal', '/nologo',
'/p:Configuration=' + buildType,
http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/656bf2fc/template/cordova/lib/build.js
----------------------------------------------------------------------
diff --git a/template/cordova/lib/build.js b/template/cordova/lib/build.js
index 0b2bae2..3c8b0b2 100644
--- a/template/cordova/lib/build.js
+++ b/template/cordova/lib/build.js
@@ -17,6 +17,8 @@
under the License.
*/
+/* jshint sub:true */
+
var Q = require('Q'),
path = require('path'),
nopt = require('nopt'),
@@ -29,7 +31,7 @@ var ROOT = path.join(__dirname, '..', '..');
function parseAndValidateArgs(argv) {
// parse and validate args
- args = nopt({'debug': Boolean, 'release': Boolean, 'archs': [String]}, {'-r': '--release'}, argv);
+ var args = nopt({'debug': Boolean, 'release': Boolean, 'archs': [String]}, {'-r': '--release'}, argv);
// Validate args
if (args.debug && args.release) {
return Q.reject('Only one of "debug"/"release" options should be specified');
@@ -43,19 +45,19 @@ function parseAndValidateArgs(argv) {
// help/usage function
module.exports.help = function () {
- console.log("");
- console.log("Usage: build [ --debug | --release ] [--archs=\"<list of architectures...>\"]");
- console.log(" --help : Displays this dialog.");
- console.log(" --debug : Cleans and builds project in debug mode.");
- console.log(" --release : Cleans and builds project in release mode.");
- console.log(" --release : Cleans and builds project in release mode.");
- console.log(" --archs : Builds project binaries for specific chip architectures. `arm` and `x86` are supported for wp8");
- console.log("examples:");
- console.log(" build ");
- console.log(" build --debug");
- console.log(" build --release");
- console.log(" build --release --archs=\"arm x86\"");
- console.log("");
+ console.log('');
+ console.log('Usage: build [ --debug | --release ] [--archs="<list of architectures...>"]');
+ console.log(' --help : Displays this dialog.');
+ console.log(' --debug : Cleans and builds project in debug mode.');
+ console.log(' --release : Cleans and builds project in release mode.');
+ console.log(' --release : Cleans and builds project in release mode.');
+ console.log(' --archs : Builds project binaries for specific chip architectures. `arm` and `x86` are supported for wp8');
+ console.log('examples:');
+ console.log(' build ');
+ console.log(' build --debug');
+ console.log(' build --release');
+ console.log(' build --release --archs="arm x86"');
+ console.log('');
};
// builds cordova-windows application with parameters provided.
@@ -68,7 +70,7 @@ module.exports.run = function (argv) {
return parseAndValidateArgs(argv)
.then(function (buildopts) {
// WP8 requires x86 version of MSBuild, CB-6732
- var is64bitSystem = process.env["PROCESSOR_ARCHITECTURE"] != 'x86';
+ var is64bitSystem = process.env['PROCESSOR_ARCHITECTURE'] != 'x86';
// Get available msbuild tools
return MSBuildTools.findAvailableVersion(is64bitSystem)
@@ -77,7 +79,7 @@ module.exports.run = function (argv) {
// chain promises each after previous with reduce function
return buildopts.buildArchs.reduce(function (promise, buildarch) {
return promise.then(function () {
- buildarch = buildarch == "anycpu" ? "any cpu" : buildarch;
+ buildarch = buildarch == 'anycpu' ? 'any cpu' : buildarch;
// search for first solution file found
// this is performed due to solution file can be renamed in create
var solutionFiles = shell.ls(path.join(ROOT, '*.sln'));
http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/656bf2fc/template/cordova/lib/device.js
----------------------------------------------------------------------
diff --git a/template/cordova/lib/device.js b/template/cordova/lib/device.js
index 64ee00f..c85b1df 100644
--- a/template/cordova/lib/device.js
+++ b/template/cordova/lib/device.js
@@ -18,9 +18,6 @@
*/
var Q = require('q'),
- fs = require('fs'),
- path = require('path'),
- shell = require('shelljs'),
utils = require('./utils');
// returns one of available devices which name match with parovided string
http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/656bf2fc/template/cordova/lib/package.js
----------------------------------------------------------------------
diff --git a/template/cordova/lib/package.js b/template/cordova/lib/package.js
index 684edd1..a2e9e66 100644
--- a/template/cordova/lib/package.js
+++ b/template/cordova/lib/package.js
@@ -32,8 +32,8 @@ Package.prototype.deployTo = function (deployTarget) {
var pkg = this;
return utils.getXapDeploy()
.then(function (xapDeploy) {
- var getTarget = deployTarget == "device" ? Q("de") :
- deployTarget == "emulator" ? Q("xd") : device.findDevice(deployTarget);
+ var getTarget = deployTarget == 'device' ? Q('de') :
+ deployTarget == 'emulator' ? Q('xd') : device.findDevice(deployTarget);
return getTarget.then(function (target) {
return utils.spawn(xapDeploy, ['/installlaunch', pkg.packagePath, '/targetdevice:' + target]);
http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/656bf2fc/template/cordova/lib/run.js
----------------------------------------------------------------------
diff --git a/template/cordova/lib/run.js b/template/cordova/lib/run.js
index e9d3be8..99e3d89 100644
--- a/template/cordova/lib/run.js
+++ b/template/cordova/lib/run.js
@@ -28,13 +28,13 @@ var ROOT = path.join(__dirname, '..', '..');
module.exports.run = function (argv) {
if (!utils.isCordovaProject(ROOT)) {
- return Q.reject("Could not find project at " + ROOT);
+ return Q.reject('Could not find project at ' + ROOT);
}
// parse args
- var args = nopt({"debug": Boolean, "release": Boolean, "nobuild": Boolean,
- "device": Boolean, "emulator": Boolean, "target": String, "archs": String},
- {"r" : "--release"}, argv);
+ var args = nopt({'debug': Boolean, 'release': Boolean, 'nobuild': Boolean,
+ 'device': Boolean, 'emulator': Boolean, 'target': String, 'archs': String},
+ {'r' : '--release'}, argv);
// Validate args
if (args.debug && args.release) {
@@ -45,8 +45,8 @@ module.exports.run = function (argv) {
}
// Get build/deploy options
- var buildType = args.release ? "release" : "debug",
- buildArchs = args.archs ? args.archs.split(' ') : ["anycpu"];
+ var buildType = args.release ? 'release' : 'debug',
+ buildArchs = args.archs ? args.archs.split(' ') : ['anycpu'];
// if --nobuild isn't specified then build app first
var buildPackages = args.nobuild ? Q() : build.run(argv);
@@ -57,44 +57,44 @@ module.exports.run = function (argv) {
})
.then(function (builtPackage) {
// Get deploy options
- var deployTarget = args.target ? args.target : args.device ? "device" :
- args.emulator ? "emulator" : null;
+ var deployTarget = args.target ? args.target : args.device ? 'device' :
+ args.emulator ? 'emulator' : null;
if (deployTarget) {
console.log('\nDeploying package to ' + deployTarget);
return builtPackage.deployTo(deployTarget);
}
// no deploy target specified - try device first & then emulator
- console.log("\nTrying to deploy to device");
- return builtPackage.deployTo("device").catch(function (error) {
+ console.log('\nTrying to deploy to device');
+ return builtPackage.deployTo('device').catch(function (error) {
console.log(error);
- console.log("\nFalling back to deploy to emulator instead");
- return builtPackage.deployTo("emulator");
+ console.log('\nFalling back to deploy to emulator instead');
+ return builtPackage.deployTo('emulator');
});
});
};
module.exports.help = function () {
- console.log("");
- console.log("Usage:");
- console.log(" run [ --device || --emulator || --target=<id> ] ");
- console.log(" [ --debug || --release || --nobuild ]");
- console.log(" [--archs=\"<list of architectures...>\"]");
- console.log(" --device : Deploys and runs the project on the connected device.");
- console.log(" --emulator : [DEFAULT] Deploys and runs the project on an emulator.");
- console.log(" --target=<id> : Deploys and runs the project on the specified target.");
- console.log(" --debug : [DEFAULT] Builds project in debug mode.");
- console.log(" --release : Builds project in release mode.");
- console.log(" --nobuild : Ueses pre-built xap, or errors if project is not built.");
- console.log(" --archs : Builds project binaries for specific chip architectures.");
- console.log(" Deploys and runs package with first architecture specified.");
- console.log(" arm` and `x86` are supported for wp8");
- console.log("Examples:");
- console.log(" run");
- console.log(" run --emulator");
- console.log(" run --device");
- console.log(" run --target=7988B8C3-3ADE-488d-BA3E-D052AC9DC710");
- console.log(" run --device --release");
- console.log(" run --emulator --debug");
- console.log("");
+ console.log('');
+ console.log('Usage:');
+ console.log(' run [ --device || --emulator || --target=<id> ] ');
+ console.log(' [ --debug || --release || --nobuild ]');
+ console.log(' [--archs=\"<list of architectures...>\"]');
+ console.log(' --device : Deploys and runs the project on the connected device.');
+ console.log(' --emulator : [DEFAULT] Deploys and runs the project on an emulator.');
+ console.log(' --target=<id> : Deploys and runs the project on the specified target.');
+ console.log(' --debug : [DEFAULT] Builds project in debug mode.');
+ console.log(' --release : Builds project in release mode.');
+ console.log(' --nobuild : Ueses pre-built xap, or errors if project is not built.');
+ console.log(' --archs : Builds project binaries for specific chip architectures.');
+ console.log(' Deploys and runs package with first architecture specified.');
+ console.log(' arm` and `x86` are supported for wp8');
+ console.log('Examples:');
+ console.log(' run');
+ console.log(' run --emulator');
+ console.log(' run --device');
+ console.log(' run --target=7988B8C3-3ADE-488d-BA3E-D052AC9DC710');
+ console.log(' run --device --release');
+ console.log(' run --emulator --debug');
+ console.log('');
};
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/656bf2fc/template/cordova/lib/target-list.js
----------------------------------------------------------------------
diff --git a/template/cordova/lib/target-list.js b/template/cordova/lib/target-list.js
index 9d85510..80cd1ea 100644
--- a/template/cordova/lib/target-list.js
+++ b/template/cordova/lib/target-list.js
@@ -22,18 +22,18 @@ var devices = require('./device'),
// help/usage function
function help() {
- console.log("");
- console.log("Usage: node target-list.js [ --emulators | --devices | --started_emulators | --all ]");
- console.log(" --emulators : List the possible target emulators availible.");
- console.log(" --devices : List the possible target devices availible. *NOT IMPLEMENTED YET*");
- console.log(" --started_emulators : List any started emulators availible. *NOT IMPLEMENTED YET*");
- console.log(" --all : List all devices returned by CordovaDeploy.exe -devices ");
- console.log("examples:");
- console.log(" node target-list.js --emulators");
- console.log(" node target-list.js --devices");
- console.log(" node target-list.js --started_emulators");
- console.log(" node target-list.js --all");
- console.log("");
+ console.log('');
+ console.log('Usage: node target-list.js [ --emulators | --devices | --started_emulators | --all ]');
+ console.log(' --emulators : List the possible target emulators availible.');
+ console.log(' --devices : List the possible target devices availible. *NOT IMPLEMENTED YET*');
+ console.log(' --started_emulators : List any started emulators availible. *NOT IMPLEMENTED YET*');
+ console.log(' --all : List all devices returned by CordovaDeploy.exe -devices ');
+ console.log('examples:');
+ console.log(' node target-list.js --emulators');
+ console.log(' node target-list.js --devices');
+ console.log(' node target-list.js --started_emulators');
+ console.log(' node target-list.js --all');
+ console.log('');
}
// Handle help flag
http://git-wip-us.apache.org/repos/asf/cordova-wp8/blob/656bf2fc/template/cordova/lib/utils.js
----------------------------------------------------------------------
diff --git a/template/cordova/lib/utils.js b/template/cordova/lib/utils.js
index 8842996..eb664f1 100644
--- a/template/cordova/lib/utils.js
+++ b/template/cordova/lib/utils.js
@@ -17,6 +17,8 @@
under the License.
*/
+/* jshint sub:true */
+
var Q = require('Q'),
fs = require('fs'),
path = require('path'),
@@ -27,21 +29,21 @@ var Q = require('Q'),
module.exports.getXapDeploy = function () {
var toolsLookupLocations = [
// Windows Phone 8.0
- path.join((process.env["ProgramFiles(x86)"] || process.env["ProgramFiles"]),
+ path.join((process.env['ProgramFiles(x86)'] || process.env['ProgramFiles']),
'Microsoft SDKs', 'Windows Phone', 'v8.0', 'Tools', 'Xap Deployment', 'XapDeployCmd.exe'),
// Windows Phone 8.1
- path.join((process.env["ProgramFiles(x86)"] || process.env["ProgramFiles"]),
+ path.join((process.env['ProgramFiles(x86)'] || process.env['ProgramFiles']),
'Microsoft SDKs', 'Windows Phone', 'v8.1', 'Tools', 'AppDeploy', 'AppDeployCmd.exe')
];
- for (idx in toolsLookupLocations) {
+ for (var idx in toolsLookupLocations) {
if (fs.existsSync(toolsLookupLocations[idx])) {
return Q.resolve(toolsLookupLocations[idx]);
}
}
- console.warn("WARNING: XapDeploy tool (XapDeployCmd.exe) didn't found. Assume that it's in %PATH%");
- return Q.resolve("XapDeployCmd");
+ console.warn('WARNING: XapDeploy tool (XapDeployCmd.exe) didn\'t found. Assume that it\'s in %PATH%');
+ return Q.resolve('XapDeployCmd');
};
module.exports.getOSVersion = function () {
@@ -59,7 +61,7 @@ module.exports.getOSVersion = function () {
};
module.exports.getSDKVersion = function () {
- var is64bitSystem = process.env["PROCESSOR_ARCHITECTURE"] != 'x86';
+ var is64bitSystem = process.env['PROCESSOR_ARCHITECTURE'] != 'x86';
return msbuildTools.findAvailableVersion(is64bitSystem)
.then(function (msbuild) {
return module.exports.exec(module.exports.quote(path.join(msbuild.path, 'msbuild')) + ' -version')
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org