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/11 02:08:10 UTC
[1/2] git commit: Support for adding UI elements to windows phone
plugins
Updated Branches:
refs/heads/master f99d0f400 -> 83cfd5cce
Support for adding UI elements to windows phone plugins
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugman/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugman/commit/e3043a68
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugman/tree/e3043a68
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugman/diff/e3043a68
Branch: refs/heads/master
Commit: e3043a68506ea1ac66b87ace7561f449aff330a5
Parents: f99d0f4
Author: Benn Mapes <be...@gmail.com>
Authored: Mon Jun 10 17:06:35 2013 -0700
Committer: Benn Mapes <be...@gmail.com>
Committed: Mon Jun 10 17:06:35 2013 -0700
----------------------------------------------------------------------
src/util/csproj.js | 55 +++++++++++++++++++++++++++++++++++++++----------
1 file changed, 44 insertions(+), 11 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/e3043a68/src/util/csproj.js
----------------------------------------------------------------------
diff --git a/src/util/csproj.js b/src/util/csproj.js
index 12ed5db..34be9a5 100644
--- a/src/util/csproj.js
+++ b/src/util/csproj.js
@@ -14,22 +14,55 @@ csproj.prototype = {
},
addSourceFile:function(relative_path) {
relative_path = relative_path.split('/').join('\\');
+ // make ItemGroup to hold file.
var item = new et.Element('ItemGroup');
- var compile = new et.Element('Compile');
- compile.attrib.Include = relative_path;
- item.append(compile);
+ // check if it's a .xaml page
+ if(relative_path.indexOf('.xaml', relative_path.length - 5) > -1) {
+ var page = new et.Element('Page');
+ 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);
+ }
+ // 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) {
+ var compile = new et.Element('Compile');
+ compile.attrib.Include = relative_path;
+ var dep = new et.Element('DependentUpon');
+ var parts = relative_path.split('\\');
+ var xaml_file = parts[parts.length - 1].substr(0, parts[parts.length - 1].length - 3);
+ dep.text = xaml_file;
+ compile.append(dep);
+ item.append(compile);
+ }
+ // otherwise add it normally
+ else {
+ var compile = new et.Element('Compile');
+ compile.attrib.Include = relative_path;
+ item.append(compile);
+ }
this.xml.getroot().append(item);
},
removeSourceFile:function(relative_path) {
relative_path = relative_path.split('/').join('\\');
- var groups = this.xml.findall('ItemGroup');
- for (var i = 0, l = groups.length; i < l; i++) {
- var group = groups[i];
- var compiles = group.findall('Compile');
- for (var j = 0, k = compiles.length; j < k; j++) {
- var compile = compiles[j];
- if (compile.attrib.Include == relative_path) {
- group.remove(0, compile);
+ var item_groups = this.xml.findall('ItemGroup');
+ for (var i = 0, l = item_groups.length; i < l; i++) {
+ var group = item_groups[i];
+ var files = group.findall('Compile').concat(group.findall('Page'));
+ for (var j = 0, k = files.length; j < k; j++) {
+ var file = files[j];
+ if (file.attrib.Include == relative_path) {
+ // remove file reference
+ group.remove(0, file);
+ // remove ItemGroup if empty
+ var new_group = group.findall('Compile').concat(group.findall('Page'));
+ if(new_group.length < 1) {
+ this.xml.getroot().remove(0, group);
+ }
return true;
}
}
[2/2] git commit: 0.7.11
Posted by be...@apache.org.
0.7.11
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugman/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugman/commit/83cfd5cc
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugman/tree/83cfd5cc
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugman/diff/83cfd5cc
Branch: refs/heads/master
Commit: 83cfd5cce53b53d3a811ce91bbc9ba4848d5dbbe
Parents: e3043a6
Author: Benn Mapes <be...@gmail.com>
Authored: Mon Jun 10 17:06:55 2013 -0700
Committer: Benn Mapes <be...@gmail.com>
Committed: Mon Jun 10 17:06:55 2013 -0700
----------------------------------------------------------------------
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/83cfd5cc/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 85c83c7..25de20f 100644
--- a/package.json
+++ b/package.json
@@ -2,7 +2,7 @@
"author": "Andrew Lunny <al...@gmail.com>",
"name": "plugman",
"description": "install/uninstall Cordova plugins",
- "version": "0.7.10",
+ "version": "0.7.11",
"repository": {
"type": "git",
"url": "git://git-wip-us.apache.org/repos/asf/cordova-plugman.git"