cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From purplecabb...@apache.org
Subject [1/2] wp7 commit: fix for csproj wildcard www inclusion
Date Mon, 08 Apr 2013 23:53:53 GMT
Updated Branches:
  refs/heads/master 84261e8aa -> 1dd6d9919


fix for csproj wildcard www inclusion


Project: http://git-wip-us.apache.org/repos/asf/cordova-wp7/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-wp7/commit/fa0662a8
Tree: http://git-wip-us.apache.org/repos/asf/cordova-wp7/tree/fa0662a8
Diff: http://git-wip-us.apache.org/repos/asf/cordova-wp7/diff/fa0662a8

Branch: refs/heads/master
Commit: fa0662a82f68bcf946ed7a14c065d540a5804f7e
Parents: 84261e8
Author: Jesse MacFadyen <purplecabbage@gmail.com>
Authored: Mon Apr 8 16:47:01 2013 -0700
Committer: Jesse MacFadyen <purplecabbage@gmail.com>
Committed: Mon Apr 8 16:47:01 2013 -0700

----------------------------------------------------------------------
 templates/standalone/BuildManifestProcessor.js |   28 ++++++++++++++++++-
 1 files changed, 27 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-wp7/blob/fa0662a8/templates/standalone/BuildManifestProcessor.js
----------------------------------------------------------------------
diff --git a/templates/standalone/BuildManifestProcessor.js b/templates/standalone/BuildManifestProcessor.js
index 67073d2..ab2ac9d 100644
--- a/templates/standalone/BuildManifestProcessor.js
+++ b/templates/standalone/BuildManifestProcessor.js
@@ -34,6 +34,24 @@ outFile.WriteLine('<?xml version="1.0" encoding="utf-8"?>');
 outFile.WriteLine('<!-- This file is auto-generated, do not edit! -jm -->');
 outFile.WriteLine('<CordovaSourceDictionary>');
 
+
+function getDirectoryListing(path) {
+    var retList = [];
+    var fso = new ActiveXObject("Scripting.FileSystemObject");
+    var folder = fso.GetFolder(path);
+    // iterate over the files in the folder
+    for (var files = new Enumerator(folder.files) ; !files.atEnd() ; files.moveNext()) {
+        retList.push(path + files.item().name);
+    }
+    // iterate over the child folders in the folder
+    for (var subFlds = new Enumerator(folder.SubFolders) ; !subFlds.atEnd() ; subFlds.moveNext())
{
+        var subDirList = getDirectoryListing(path + subFlds.item().name + "\\");
+        retList = retList.concat(subDirList);
+    }
+    return retList;
+}
+
+
 // We need to get any Linked files from the project
 
 WScript.Echo("Adding Source Files ...");
@@ -65,7 +83,15 @@ if (projectFilePath != null) {
 
                 if (nodes[n].attributes[i].name == "Include") {
                     var val = nodes[n].attributes[i].value;
-                    if (val.indexOf("www") == 0) {
+                    if (val.indexOf("www\\**") == 0 ){
+                        WScript.echo("adding wildcard files");
+                        var fileList = getDirectoryListing("..\\..\\www\\");
+                        for (var index = 0 ; index < fileList.length; index++)
+                        {
+                            outFile.WriteLine('    <FilePath Value="' + fileList[index].replace(/..\\..\\www/g,"www")
+ '"/>');
+                        }
+                    }
+                    else if (val.indexOf("www") == 0) {
                         WScript.Echo("adding value :: " + val);
                         outFile.WriteLine('    <FilePath Value="' + val + '"/>');
                     }


Mime
View raw message