cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From purplecabb...@apache.org
Subject [1/4] git commit: Add pre_package event to wp8 project
Date Mon, 04 Nov 2013 19:53:00 GMT
Updated Branches:
  refs/heads/master 48dee19cc -> 95589c20c


Add pre_package event to wp8 project

WP7 project was already done in commit: bd2c667e947b3fda05541e0d1a124d23df60a132

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

Branch: refs/heads/master
Commit: 11a081c41d5d4c56c0606e362b75bba1ad382ff9
Parents: cebd776
Author: Dick van den Brink <d_vandenbrink@live.com>
Authored: Tue Sep 24 21:57:19 2013 +0200
Committer: Dick van den Brink <d_vandenbrink@live.com>
Committed: Tue Sep 24 21:57:19 2013 +0200

----------------------------------------------------------------------
 src/metadata/wp8_parser.js | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/11a081c4/src/metadata/wp8_parser.js
----------------------------------------------------------------------
diff --git a/src/metadata/wp8_parser.js b/src/metadata/wp8_parser.js
index bb2f862..881216e 100644
--- a/src/metadata/wp8_parser.js
+++ b/src/metadata/wp8_parser.js
@@ -26,7 +26,8 @@ var fs            = require('fs'),
     Q             = require('q'),
     config_parser = require('../config_parser'),
     xml           = require('../xml-helpers'),
-    config        = require('../config');
+    config        = require('../config'),
+    hooker        = require('../hooker'); 
 
 module.exports = function wp8_parser(project) {
     try {
@@ -175,7 +176,6 @@ module.exports.prototype = {
         if (custom_path) lib_path = custom_path;
         var cordovajs_path = path.join(lib_path, 'common', 'www', 'cordova.js');
         fs.writeFileSync(path.join(this.www_dir(), 'cordova.js'), fs.readFileSync(cordovajs_path,
'utf-8'), 'utf-8');
-        this.update_csproj();
     },
     // updates the csproj file to explicitly list all www content.
     update_csproj:function() {
@@ -200,7 +200,6 @@ module.exports.prototype = {
         }
 
         // now add all www references back in from the root www folder
-        var project_root = util.isCordova(this.wp8_proj_dir);
         var www_files = this.folder_contents('www', this.www_dir());
         for(file in www_files) {
             var item = new et.Element('ItemGroup');
@@ -256,6 +255,13 @@ module.exports.prototype = {
         }
         // overrides (merges) are handled in update_www()
         this.update_www();
+        
+         // trigger an event in case anyone needs to modify the contents of the www folder
before we package it.
+        var projectRoot = util.isCordova(process.cwd());
+        var hooks = new hooker(projectRoot);
+        hooks.fire('pre_package', { wwwPath:this.www_dir() }, function(err) { });
+        this.update_csproj();
+        
         this.update_staging();
         util.deleteSvnFolders(this.www_dir());
         return Q();


Mime
View raw message