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/07/19 03:39:46 UTC

git commit: [wp] tweak for adding pages in csproj

Updated Branches:
  refs/heads/master 9caee42ee -> f2fa75132


[wp] tweak for adding pages in csproj


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

Branch: refs/heads/master
Commit: f2fa75132a0eb70689c769b865a9cb6743c4d476
Parents: 9caee42
Author: Benn Mapes <be...@gmail.com>
Authored: Thu Jul 18 18:37:53 2013 -0700
Committer: Benn Mapes <be...@gmail.com>
Committed: Thu Jul 18 18:39:24 2013 -0700

----------------------------------------------------------------------
 src/util/csproj.js | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/f2fa7513/src/util/csproj.js
----------------------------------------------------------------------
diff --git a/src/util/csproj.js b/src/util/csproj.js
index d3b9180..fb67158 100644
--- a/src/util/csproj.js
+++ b/src/util/csproj.js
@@ -19,14 +19,19 @@ csproj.prototype = {
         // check if it's a .xaml page
         if(relative_path.indexOf('.xaml', relative_path.length - 5) > -1) {
             var page = new et.Element('Page');
+            var sub_type = new et.Element('SubType');
+            sub_type.text = "Designer";
+            page.append(sub_type);
             page.attrib.Include = relative_path;
             var gen = new et.Element('Generator');
             gen.text = "MSBuild:Compile";
             page.append(gen);
-            var sub_type = new et.Element('SubType');
-            sub_type.text = "Designer";
-            page.append(sub_type);
-            item.append(page);
+            var item_groups = this.xml.findall('ItemGroup');
+            if(item_groups.length == 0) {
+                item.append(page);
+            } else {
+                item_groups[0].append(page);
+            }
         }
         // check if it's a .xaml.cs page that would depend on a .xaml of the same name
         else if (relative_path.indexOf('.xaml.cs', relative_path.length - 8) > -1) {