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 2013/06/11 01:42:54 UTC
[05/12] wp7 commit: [CB-3529] moved excess cleaning to create script
[CB-3529] moved excess cleaning to create script
Project: http://git-wip-us.apache.org/repos/asf/cordova-wp7/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-wp7/commit/5cddc2f4
Tree: http://git-wip-us.apache.org/repos/asf/cordova-wp7/tree/5cddc2f4
Diff: http://git-wip-us.apache.org/repos/asf/cordova-wp7/diff/5cddc2f4
Branch: refs/heads/master
Commit: 5cddc2f4cc5d959142b35a802f9626ab4a58afd0
Parents: 6877492
Author: Benn Mapes <be...@gmail.com>
Authored: Tue Jun 4 13:24:10 2013 -0700
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Fri Jun 7 20:40:26 2013 -0700
----------------------------------------------------------------------
bin/create.js | 22 ++++++++---
templates/standalone/cordova/lib/clean.js | 51 +-------------------------
2 files changed, 19 insertions(+), 54 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-wp7/blob/5cddc2f4/bin/create.js
----------------------------------------------------------------------
diff --git a/bin/create.js b/bin/create.js
index d8b67a9..93236f8 100644
--- a/bin/create.js
+++ b/bin/create.js
@@ -207,15 +207,27 @@ function create(path, namespace, name) {
//clean up any Bin/obj or other generated files
exec('cscript ' + path + '\\cordova\\lib\\clean.js //nologo');
- Log("CREATE SUCCESS : " + path);
+ // delete any .user and .sou files if any
+ if (fso.FolderExists(path)) {
+ var proj_folder = fso.GetFolder(path);
+ var proj_files = new Enumerator(proj_folder.Files);
+ for (;!proj_files.atEnd(); proj_files.moveNext()) {
+ if (fso.GetExtensionName(proj_files.item()) == 'user') {
+ fso.DeleteFile(proj_files.item());
+ } else if (fso.GetExtensionName(proj_files.item()) == 'sou') {
+ fso.DeleteFile(proj_files.item());
+ }
+ }
+ }
- // TODO: Name the project according to the arguments
- // update the solution to include the new project by name
- // version BS
- // index.html title set to project name ?
+ Log("CREATE SUCCESS : " + path);
+ // TODO:
+ // index.html title set to project name?
}
+
+
if (args.Count() > 0) {
// support help flags
if (args(0) == "--help" || args(0) == "/?" ||
http://git-wip-us.apache.org/repos/asf/cordova-wp7/blob/5cddc2f4/templates/standalone/cordova/lib/clean.js
----------------------------------------------------------------------
diff --git a/templates/standalone/cordova/lib/clean.js b/templates/standalone/cordova/lib/clean.js
index b091425..f5bdbfc 100644
--- a/templates/standalone/cordova/lib/clean.js
+++ b/templates/standalone/cordova/lib/clean.js
@@ -28,11 +28,8 @@ var ROOT = WScript.ScriptFullName.split('\\cordova\\lib\\clean.js').join('');
// help function
function Usage() {
Log("");
- Log("Usage: clean [ --debug | --release ]");
- Log(" --debug : Cleans generated debug files in project.");
- Log(" --release : Cleans generated release files in project.");
+ Log("Usage: clean");
Log("examples:");
- Log(" clean --debug");
Log(" clean");
Log(" - deletes all generated files in project");
Log("");
@@ -52,32 +49,6 @@ function Log(msg, error) {
function clean_project(path) {
delete_if_exists(path + "\\obj");
delete_if_exists(path + "\\Bin");
-
- // checks to see if a .csproj file exists in the project root
- if (fso.FolderExists(path)) {
- var proj_folder = fso.GetFolder(path);
- var proj_files = new Enumerator(proj_folder.Files);
- for (;!proj_files.atEnd(); proj_files.moveNext()) {
- if (fso.GetExtensionName(proj_files.item()) == 'user') {
- delete_if_exists(proj_files.item())
- } else if (fso.GetExtensionName(proj_files.item()) == 'sou') {
- delete_if_exists(proj_files.item())
- }
- }
- }
- //TODO: delete Service References?
-}
-
-// cleans any files generated by build --debug
-function clean_debug(path) {
- delete_if_exists(path + "\\obj\\Debug");
- delete_if_exists(path + "\\Bin\\Debug");
-}
-
-// cleans any files generated by build --release
-function clean_release(path) {
- delete_if_exists(path + "\\obj\\Release");
- delete_if_exists(path + "\\Bin\\Release");
}
// deletes the path element if it exists
@@ -98,26 +69,8 @@ if (args.Count() > 0) {
Usage();
WScript.Quit(2);
}
- else if (args.Count() > 1) {
- Log("Error: Too many arguments.", true);
- Usage();
- WScript.Quit(2);
- }
- else if (fso.FolderExists(ROOT)) {
- if (args(0) == "--debug" || args(0) == "-d") {
- clean_debug(ROOT);
- }
- else if (args(0) == "--release" || args(0) == "-r") {
- clean_release(ROOT);
- }
- else {
- Log("Error: \"" + args(0) + "\" is not recognized as a build option", true);
- Usage();
- WScript.Quit(2);
- }
- }
else {
- Log("Error: Project directory not found,", true);
+ Log("Error: \"" + args(0) + "\" is not recognized as a valid option", true);
Usage();
WScript.Quit(2);
}