cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bennma...@apache.org
Subject [2/2] wp7 commit: [CB-3529] moved excess cleaning to create script
Date Tue, 04 Jun 2013 21:10:22 GMT
[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/064be0e1
Tree: http://git-wip-us.apache.org/repos/asf/cordova-wp7/tree/064be0e1
Diff: http://git-wip-us.apache.org/repos/asf/cordova-wp7/diff/064be0e1

Branch: refs/heads/2.8.x
Commit: 064be0e1b3f7fdf1ae90f05da74e82781307bd67
Parents: 20febcc
Author: Benn Mapes <benn.mapes@gmail.com>
Authored: Tue Jun 4 13:24:10 2013 -0700
Committer: Benn Mapes <benn.mapes@gmail.com>
Committed: Tue Jun 4 14:09:42 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/064be0e1/bin/create.js
----------------------------------------------------------------------
diff --git a/bin/create.js b/bin/create.js
index 7d89d0a..2e82d7d 100644
--- a/bin/create.js
+++ b/bin/create.js
@@ -206,15 +206,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/064be0e1/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);
     }


Mime
View raw message