You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by fi...@apache.org on 2013/05/18 01:47:21 UTC
[04/12] git commit: start of rework of windows phone support to
adhere to new arch
start of rework of windows phone support to adhere to new arch
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugman/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugman/commit/d4d9c240
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugman/tree/d4d9c240
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugman/diff/d4d9c240
Branch: refs/heads/master
Commit: d4d9c24053c50c6647f92620fa7876dae52fadc4
Parents: 0c5097e
Author: Fil Maj <ma...@gmail.com>
Authored: Fri May 17 11:35:56 2013 -0700
Committer: Fil Maj <ma...@gmail.com>
Committed: Fri May 17 16:46:01 2013 -0700
----------------------------------------------------------------------
src/platforms/wp7.js | 70 ++++++++++++--------------------------------
1 files changed, 19 insertions(+), 51 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugman/blob/d4d9c240/src/platforms/wp7.js
----------------------------------------------------------------------
diff --git a/src/platforms/wp7.js b/src/platforms/wp7.js
index 5220395..ce38882 100644
--- a/src/platforms/wp7.js
+++ b/src/platforms/wp7.js
@@ -17,17 +17,6 @@
*
*/
-/*
-node plugman --platform wp7 --project '/c//users/jesse/documents/visual studio 2012/Projects/TestPlugin7/' --plugin '.\test\plugins\ChildBrowser\'
-
-TODO: ( Apr. 16, 2013 - jm )
-- Update WMAppManifest.xml with any new required capabilities
-- add references for any new libraries required by plugin
-
-
-
-*/
-
var fs = require('fs'),
path = require('path'),
glob = require('glob'),
@@ -47,31 +36,6 @@ var unix_projPath, // for use with glob
hosts, // ./access inside root
projectChanges; // <config-file target=".csproj" parent=".">, inside platform
-
-
-function copyFileSync(srcPath, destPath) {
-
- var stats = fs.statSync(srcPath);
- if(stats.isDirectory()) {
- shell.mkdir('-p', destPath);
- // without the added slash at the end, we will get an extra folder inside destination
- shell.cp('-r', srcPath + "/" , destPath);
- }
- else if(fs.existsSync(srcPath)) {
- shell.cp(srcPath, destPath);
- }
- else {
- console.log("File does not exist :: " + srcPath);
- return;
- }
-
- var msg = shell.error();
- if(msg) {
- console.log("msg" + msg);
- throw { name: "ShellError", message: msg};
- }
-}
-
function initPaths(project_dir, plugin_dir, plugin_et, variables) {
unix_projPath = project_dir.split("\\").join("/");
@@ -218,19 +182,23 @@ function uninstall(project_dir, plugin_dir, plugin_et, variables) {
});
}
-exports.handlePlugin = function (action, project_dir, plugin_dir, plugin_et, variables) {
- console.log("action = " + action);
- switch(action) {
- case 'install' :
- initPaths(project_dir, plugin_dir, plugin_et, variables);
- install(project_dir, plugin_dir, plugin_et, variables);
- break;
- case 'uninstall' :
- initPaths(project_dir, plugin_dir, plugin_et, variables);
- uninstall(project_dir, plugin_dir, plugin_et, variables);
- break;
- default :
- throw 'error unknown action';
- break;
+module.exports = {
+ www_dir:function(project_dir) {
+ return path.join(project_dir, 'www');
+ },
+ package_name:function(project_dir) {
+ return xml_helpers.parseElementtreeSync(path.join(project_dir, 'Properties', 'WMAppManifest.xml')).find('App').attrib.ProductID;
+ },
+ "source-file":{
+ install:function(source_el, plugin_dir, project_dir, plugin_id) {
+ var dest = path.join(source_el.attrib['target-dir'], path.basename(source_el.attrib['src']));
+ common.copyFile(plugin_dir, source_el.attrib['src'], project_dir, dest);
+ },
+ uninstall:function(source_el, project_dir, plugin_id) {
+ var dest = path.join(source_el.attrib['target-dir'], path.basename(source_el.attrib['src']));
+ common.removeFile(project_dir, dest);
+ }
+ },
+ "lib-file":{
}
-}
+};