You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by pu...@apache.org on 2014/08/15 22:42:41 UTC

[1/2] git commit: CB-6699 Include files from www folder via single element (use ** glob pattern)

Repository: cordova-lib
Updated Branches:
  refs/heads/master 1cf81044a -> c8adbc2a0


CB-6699 Include files from www folder via single element (use ** glob pattern)


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

Branch: refs/heads/master
Commit: ede4a867fd76b8bbc49838f0c58133077f2d2e1f
Parents: 1cf8104
Author: Vladimir Kotikov <v-...@microsoft.com>
Authored: Fri Aug 15 14:56:13 2014 +0400
Committer: Vladimir Kotikov <v-...@microsoft.com>
Committed: Fri Aug 15 15:51:10 2014 +0400

----------------------------------------------------------------------
 .../src/cordova/metadata/windows_parser.js      | 40 +------------------
 cordova-lib/src/cordova/metadata/wp8_parser.js  | 41 +-------------------
 cordova-lib/src/plugman/prepare.js              | 20 ----------
 3 files changed, 2 insertions(+), 99 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/ede4a867/cordova-lib/src/cordova/metadata/windows_parser.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/cordova/metadata/windows_parser.js b/cordova-lib/src/cordova/metadata/windows_parser.js
index eaeacbb..aefb94e 100644
--- a/cordova-lib/src/cordova/metadata/windows_parser.js
+++ b/cordova-lib/src/cordova/metadata/windows_parser.js
@@ -30,8 +30,7 @@ var fs            = require('fs'),
     ConfigParser  = require('../../configparser/ConfigParser'),
     CordovaError  = require('../../CordovaError'),
     xml           = require('../../util/xml-helpers'),
-    hooker        = require('../hooker'),
-    jsproj        = require('../../util/windows/jsproj');
+    hooker        = require('../hooker');
 
 module.exports = function windows_parser(project) {
     try {
@@ -229,42 +228,6 @@ module.exports.prototype = {
         shell.cp('-rf', path.join(platform_www, '*'), this.www_dir());
     },
 
-    // Returns an array of all the files in the given directory with relative paths
-    // - name     : the name of the top level directory (i.e all files will start with this in their path)
-    // - dir     : the directory whos contents will be listed under 'name' directory
-    folder_contents:function(name, dir) {
-        var results = [];
-        var folder_dir = fs.readdirSync(dir);
-        for(var item in folder_dir) {
-            var stat = fs.statSync(path.join(dir, folder_dir[item]));
-            // Add all subfolder item paths if it's not a .svn dir.
-            if( stat.isDirectory() && (folder_dir[item] !== '.svn') ) {
-                var sub_dir = this.folder_contents(path.join(name, folder_dir[item]), path.join(dir, folder_dir[item]));
-                for(var sub_item in sub_dir) {
-                    results.push(sub_dir[sub_item]);
-                }
-            } else if(stat.isFile()) {
-                results.push(path.join(name, folder_dir[item]));
-            }
-            // else { it is a FIFO, or a Socket, Symbolic Link or something ... }
-        }
-        return results;
-    },
-
-    // updates the jsproj file to explicitly list all www content.
-    update_jsproj:function() {
-        var projFile = new jsproj(this.projFilePath);
-        // remove any previous references to the www files
-        projFile.removeSourceFile(/^(\$\(MSBuildThisFileDirectory\))?www\\/i);
-
-        // now add all www references back in from the root www folder
-        var www_files = this.folder_contents('www', this.www_dir());
-        projFile.addSourceFile(www_files);
-
-        // save file
-        projFile.write();
-    },
-
     // calls the nessesary functions to update the windows8 project
     update_project:function(cfg) {
         // console.log("Updating windows8 project...");
@@ -282,7 +245,6 @@ module.exports.prototype = {
         return hooks.fire('pre_package', { wwwPath:this.www_dir(), platforms: ['windows8'] })
         .then(function() {
             // overrides (merges) are handled in update_www()
-            that.update_jsproj();
             that.add_bom();
             util.deleteSvnFolders(that.www_dir());
         });

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/ede4a867/cordova-lib/src/cordova/metadata/wp8_parser.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/cordova/metadata/wp8_parser.js b/cordova-lib/src/cordova/metadata/wp8_parser.js
index 0d458ee..4d5b332 100644
--- a/cordova-lib/src/cordova/metadata/wp8_parser.js
+++ b/cordova-lib/src/cordova/metadata/wp8_parser.js
@@ -30,8 +30,7 @@ var fs            = require('fs'),
     ConfigParser  = require('../../configparser/ConfigParser'),
     CordovaError  = require('../../CordovaError'),
     xml           = require('../../util/xml-helpers'),
-    hooker        = require('../hooker'),
-    csproj = require('../../util/windows/csproj');
+    hooker        = require('../hooker');
 
 module.exports = function wp8_parser(project) {
     try {
@@ -197,43 +196,6 @@ module.exports.prototype = {
         shell.cp('-rf', path.join(platform_www, '*'), this.www_dir());
     },
 
-    // updates the csproj file to explicitly list all www content.
-    update_csproj:function() {
-        var projFile = new csproj(this.csproj_path);
-
-        // remove any previous references to the www files
-        projFile.removeSourceFile(new RegExp('www\\\\*', 'i'));
-
-        // now add all www references back in from the root www folder
-        var www_files = this.folder_contents('www', this.www_dir());
-        projFile.addSourceFile(www_files);
-        // save file
-        projFile.write();
-    },
-    // Returns an array of all the files in the given directory with relative paths
-    // - name     : the name of the top level directory (i.e all files will start with this in their path)
-    // - dir     : the directory whos contents will be listed under 'name' directory
-    folder_contents:function(name, dir) {
-        var results = [];
-        var folder_dir = fs.readdirSync(dir);
-        for(var item in folder_dir) {
-            var stat = fs.statSync(path.join(dir, folder_dir[item]));
-
-            if(stat.isDirectory()) {
-                var sub_dir = this.folder_contents(path.join(name, folder_dir[item]), path.join(dir, folder_dir[item]));
-                //Add all subfolder item paths
-                for(var sub_item in sub_dir) {
-                    results.push(sub_dir[sub_item]);
-                }
-            }
-            else if(stat.isFile()) {
-                results.push(path.join(name, folder_dir[item]));
-            }
-            // else { it is a FIFO, or a Socket or something ... }
-        }
-        return results;
-    },
-
     // calls the nessesary functions to update the wp8 project
     // Returns a promise.
     update_project:function(cfg) {
@@ -250,7 +212,6 @@ module.exports.prototype = {
         var hooks = new hooker(projectRoot);
         return hooks.fire('pre_package', { wwwPath:this.www_dir(), platforms: ['wp8']  })
         .then(function() {
-            that.update_csproj();
             util.deleteSvnFolders(that.www_dir());
         });
     }

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/ede4a867/cordova-lib/src/plugman/prepare.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/plugman/prepare.js b/cordova-lib/src/plugman/prepare.js
index 6083cbf..284d164 100644
--- a/cordova-lib/src/plugman/prepare.js
+++ b/cordova-lib/src/plugman/prepare.js
@@ -26,8 +26,6 @@ var platform_modules = require('./platforms'),
     path            = require('path'),
     config_changes  = require('./util/config-changes'),
     xml_helpers     = require('../util/xml-helpers'),
-    wp8             = require('./platforms/wp8'),
-    windows        = require('./platforms/windows'),
     common          = require('./platforms/common'),
     fs              = require('fs'),
     shell           = require('shelljs'),
@@ -73,16 +71,6 @@ module.exports = function handlePrepare(project_dir, platform, plugins_dir, www_
     events.emit('verbose', 'Processing configuration changes for plugins.');
     config_changes.process(plugins_dir, project_dir, platform);
 
-    // for windows phone and windows8 platforms we need to add all www resources to the .csproj(.jsproj) file
-    // first we need to remove them all to prevent duplicates
-    var projFile;
-    if (platform == 'wp8' || platform == 'windows8' || platform == 'windows') {
-        projFile = (platform == 'wp8') ? wp8.parseProjectFile(project_dir) :
-            windows.parseProjectFile(project_dir);
-        // remove reference to cordova_plugins.js and all files inside plugins folder
-        projFile.removeSourceFile(/^(\$\(MSBuildThisFileDirectory\))?www\\(cordova_plugins.js|plugins\\)/i);
-    }
-
     platform_json = config_changes.get_platform_json(plugins_dir, platform);
     // This array holds all the metadata for each module and ends up in cordova_plugins.json
     var plugins = Object.keys(platform_json.installed_plugins).concat(Object.keys(platform_json.dependent_plugins));
@@ -155,9 +143,6 @@ module.exports = function handlePrepare(project_dir, platform, plugins_dir, www_
             }
             scriptContent = 'cordova.define("' + moduleName + '", function(require, exports, module) { ' + scriptContent + '\n});\n';
             fs.writeFileSync(path.join(platformPluginsDir, plugin_id, fsPath), scriptContent, 'utf-8');
-            if(platform == 'wp8' || platform == 'windows8') {
-                projFile.addSourceFile(path.join('www', 'plugins', plugin_id, fsPath));
-            }
 
             // Prepare the object for cordova_plugins.json.
             var obj = {
@@ -198,9 +183,4 @@ module.exports = function handlePrepare(project_dir, platform, plugins_dir, www_
 
     events.emit('verbose', 'Writing out cordova_plugins.js...');
     fs.writeFileSync(path.join(wwwDir, 'cordova_plugins.js'), final_contents, 'utf-8');
-
-    if(platform == 'wp8' || platform == 'windows8' || platform == 'windows') {
-        projFile.addSourceFile(path.join('www', 'cordova_plugins.js'));
-        projFile.write();
-    }
 };


[2/2] git commit: Fix jshint errors in amazon_fireos_parser : mixed single/double quotes

Posted by pu...@apache.org.
Fix jshint errors in amazon_fireos_parser : mixed single/double quotes


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

Branch: refs/heads/master
Commit: c8adbc2a0a45eefaae30297f44dabd7d19215518
Parents: ede4a86
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Fri Aug 15 13:42:52 2014 -0700
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Fri Aug 15 13:42:52 2014 -0700

----------------------------------------------------------------------
 .../src/cordova/metadata/amazon_fireos_parser.js      | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/c8adbc2a/cordova-lib/src/cordova/metadata/amazon_fireos_parser.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/cordova/metadata/amazon_fireos_parser.js b/cordova-lib/src/cordova/metadata/amazon_fireos_parser.js
index 4878f4e..517cd49 100644
--- a/cordova-lib/src/cordova/metadata/amazon_fireos_parser.js
+++ b/cordova-lib/src/cordova/metadata/amazon_fireos_parser.js
@@ -227,8 +227,8 @@ handleIcons: function(config) {
         // Update the version by changing the AndroidManifest android:versionName
         var version = config.version();
         var versionCode = config.android_versionCode() || default_versionCode(version);
-        manifest.getroot().attrib["android:versionName"] = version;
-        manifest.getroot().attrib["android:versionCode"] = versionCode;
+        manifest.getroot().attrib['android:versionName'] = version;
+        manifest.getroot().attrib['android:versionCode'] = versionCode;
 
         // Update package name by changing the AndroidManifest id and moving the entry class around to the proper package directory
         var pkg = config.packageName();
@@ -243,22 +243,22 @@ handleIcons: function(config) {
         if (orientationPref) {
             switch (orientationPref) {
                 case 'default':
-                    delete act.attrib["android:screenOrientation"];
+                    delete act.attrib['android:screenOrientation'];
                     break;
                 case 'portrait':
-                    act.attrib["android:screenOrientation"] = 'portrait';
+                    act.attrib['android:screenOrientation'] = 'portrait';
                     break;
                 case 'landscape':
-                    act.attrib["android:screenOrientation"] = 'landscape';
+                    act.attrib['android:screenOrientation'] = 'landscape';
             }
         }
 
         // Set android:launchMode in AndroidManifest
         var androidLaunchModePref = this.findAndroidLaunchModePreference(config);
         if (androidLaunchModePref) {
-            act.attrib["android:launchMode"] = androidLaunchModePref;
+            act.attrib['android:launchMode'] = androidLaunchModePref;
         } else { // User has (explicitly) set an invalid value for AndroidLaunchMode preference
-            delete act.attrib["android:launchMode"]; // use Android default value (standard)
+            delete act.attrib['android:launchMode']; // use Android default value (standard)
         }
 
         // Write out AndroidManifest.xml