You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by be...@apache.org on 2013/06/04 23:08:14 UTC
wp7 commit: [CB-3529] moved excess cleaning to create script
Updated Branches:
refs/heads/master d4ca7f62f -> 163a4f95f
[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/163a4f95
Tree: http://git-wip-us.apache.org/repos/asf/cordova-wp7/tree/163a4f95
Diff: http://git-wip-us.apache.org/repos/asf/cordova-wp7/diff/163a4f95
Branch: refs/heads/master
Commit: 163a4f95faf5e75d02a80d52300c3ce6f85b54c2
Parents: d4ca7f6
Author: Benn Mapes <be...@gmail.com>
Authored: Tue Jun 4 13:24:10 2013 -0700
Committer: Benn Mapes <be...@gmail.com>
Committed: Tue Jun 4 13:24:10 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/163a4f95/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/163a4f95/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);
}