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:10:21 UTC
[1/2] wp7 commit: Fixed ambiguous build error
Updated Branches:
refs/heads/2.8.x 24a8f5011 -> 064be0e1b
Fixed ambiguous build error
Project: http://git-wip-us.apache.org/repos/asf/cordova-wp7/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-wp7/commit/20febccb
Tree: http://git-wip-us.apache.org/repos/asf/cordova-wp7/tree/20febccb
Diff: http://git-wip-us.apache.org/repos/asf/cordova-wp7/diff/20febccb
Branch: refs/heads/2.8.x
Commit: 20febccb354d6c67d7cc354c8295bcb37af1496b
Parents: 24a8f50
Author: Benn Mapes <be...@gmail.com>
Authored: Fri May 24 16:04:03 2013 -0700
Committer: Benn Mapes <be...@gmail.com>
Committed: Tue Jun 4 14:09:29 2013 -0700
----------------------------------------------------------------------
templates/standalone/cordova/lib/build.js | 25 ++++++++++++++++++-----
1 files changed, 19 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-wp7/blob/20febccb/templates/standalone/cordova/lib/build.js
----------------------------------------------------------------------
diff --git a/templates/standalone/cordova/lib/build.js b/templates/standalone/cordova/lib/build.js
index 9986a7e..1375c54 100644
--- a/templates/standalone/cordova/lib/build.js
+++ b/templates/standalone/cordova/lib/build.js
@@ -85,14 +85,27 @@ function is_cordova_project(path) {
return false;
}
+function get_solution_name(path) {
+ 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()) == 'sln') {
+ return proj_files.item();
+ }
+ }
+ }
+ return null;
+}
+
// builds the project and .xap in release mode
function build_xap_release(path) {
- Log("Building Cordova-WP8 Project:");
+ Log("Building Cordova-WP7 Project:");
Log("\tConfiguration : Release");
Log("\tDirectory : " + path);
wscript_shell.CurrentDirectory = path;
- exec_verbose('msbuild /clp:NoSummary;NoItemAndPropertyList;Verbosity=minimal /nologo /p:Configuration=Release');
+ exec_verbose('msbuild ' + get_solution_name(path) + ' /clp:NoSummary;NoItemAndPropertyList;Verbosity=minimal /nologo /p:Configuration=Release');
// check if file xap was created
if (fso.FolderExists(path + '\\Bin\\Release')) {
@@ -105,18 +118,18 @@ function build_xap_release(path) {
}
}
}
- Log('ERROR: MSBuild failed to create .xap when building cordova-wp8 for release.', true);
+ Log('ERROR: MSBuild failed to create .xap when building cordova-wp7 for release.', true);
WScript.Quit(2);
}
// builds the project and .xap in debug mode
function build_xap_debug(path) {
- Log("Building Cordova-WP8 Project:");
+ Log("Building Cordova-WP7 Project:");
Log("\tConfiguration : Debug");
Log("\tDirectory : " + path);
wscript_shell.CurrentDirectory = path;
- exec_verbose('msbuild /clp:NoSummary;NoItemAndPropertyList;Verbosity=minimal /nologo /p:Configuration=Debug');
+ exec_verbose('msbuild ' + get_solution_name(path) + ' /clp:NoSummary;NoItemAndPropertyList;Verbosity=minimal /nologo /p:Configuration=Debug');
// check if file xap was created
if (fso.FolderExists(path + '\\Bin\\Debug')) {
@@ -129,7 +142,7 @@ function build_xap_debug(path) {
}
}
}
- Log('ERROR: MSBuild failed to create .xap when building cordova-wp8 for debugging.', true);
+ Log('ERROR: MSBuild failed to create .xap when building cordova-wp7 for debugging.', true);
WScript.Quit(2);
}
[2/2] wp7 commit: [CB-3529] moved excess cleaning to create script
Posted by be...@apache.org.
[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 <be...@gmail.com>
Authored: Tue Jun 4 13:24:10 2013 -0700
Committer: Benn Mapes <be...@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);
}