cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject [01/50] git commit: CB-7255 Fixed writing plist unescaped
Date Fri, 05 Sep 2014 18:14:06 GMT
Repository: cordova-lib
Updated Branches:
  refs/heads/master 61aee683e -> 5f499aaf9


CB-7255 Fixed writing plist unescaped

- Use current plist npm instead of plist-with-patches
- Solve resulting deprecation warnings

We originally switched to plist-with-patches to add some patches which didn't
get through to the upstream plist at the time. The upstream plist has those
fixes now, and some more.

github: close #70


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

Branch: refs/heads/master
Commit: 62dd5f666ba875f18cf1898a4e3547025cdc5984
Parents: 04a624b
Author: Ulrich Geilmann <ugeilmann@googlemail.com>
Authored: Mon Aug 4 22:45:06 2014 +0200
Committer: Anis Kadri <anis@apache.org>
Committed: Fri Sep 5 11:12:17 2014 -0700

----------------------------------------------------------------------
 cordova-lib/package.json                             | 2 +-
 cordova-lib/spec-cordova/metadata/ios_parser.spec.js | 4 ++--
 cordova-lib/spec-plugman/platforms/ios.spec.js       | 2 +-
 cordova-lib/spec-plugman/util/config-changes.spec.js | 2 +-
 cordova-lib/src/cordova/metadata/ios_parser.js       | 4 ++--
 cordova-lib/src/plugman/platforms/ios.js             | 4 ++--
 cordova-lib/src/plugman/util/config-changes.js       | 7 ++++---
 cordova-lib/src/plugman/util/plist-helpers.js        | 6 +++---
 8 files changed, 16 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/62dd5f66/cordova-lib/package.json
----------------------------------------------------------------------
diff --git a/cordova-lib/package.json b/cordova-lib/package.json
index 1518065..6bffa4d 100644
--- a/cordova-lib/package.json
+++ b/cordova-lib/package.json
@@ -25,7 +25,7 @@
     "npm": "1.3.4",
     "npmconf": "0.1.x",
     "osenv": "0.0.x",
-    "plist-with-patches": "0.5.x",
+    "plist": "1.0.x",
     "properties-parser": "~0.2.3",
     "q": "~0.9",
     "rc": "0.3.0",

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/62dd5f66/cordova-lib/spec-cordova/metadata/ios_parser.spec.js
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/metadata/ios_parser.spec.js b/cordova-lib/spec-cordova/metadata/ios_parser.spec.js
index 7cceb98..b17ce0d 100644
--- a/cordova-lib/spec-cordova/metadata/ios_parser.spec.js
+++ b/cordova-lib/spec-cordova/metadata/ios_parser.spec.js
@@ -20,7 +20,7 @@ var platforms = require('../../src/cordova/platforms'),
     util = require('../../src/cordova/util'),
     path = require('path'),
     shell = require('shelljs'),
-    plist = require('plist-with-patches'),
+    plist = require('plist'),
     xcode = require('xcode'),
     et = require('elementtree'),
     fs = require('fs'),
@@ -89,7 +89,7 @@ describe('ios project parser', function () {
             var update_name, xc_write;
             beforeEach(function() {
                 mv = spyOn(shell, 'mv');
-                plist_parse = spyOn(plist, 'parseFileSync').andReturn({
+                plist_parse = spyOn(plist, 'parse').andReturn({
                 });
                 plist_build = spyOn(plist, 'build').andReturn('');
                 update_name = jasmine.createSpy('update_name');

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/62dd5f66/cordova-lib/spec-plugman/platforms/ios.spec.js
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-plugman/platforms/ios.spec.js b/cordova-lib/spec-plugman/platforms/ios.spec.js
index cc8dcfd..d0acd9e 100644
--- a/cordova-lib/spec-plugman/platforms/ios.spec.js
+++ b/cordova-lib/spec-plugman/platforms/ios.spec.js
@@ -23,7 +23,7 @@ var ios = require('../../src/plugman/platforms/ios'),
     et = require('elementtree'),
     shell = require('shelljs'),
     os = require('osenv'),
-    plist = require('plist-with-patches'),
+    plist = require('plist'),
     bplist = require('bplist-parser'),
     temp = path.join(os.tmpdir(), 'plugman'),
     plugins_dir = path.join(temp, 'cordova', 'plugins'),

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/62dd5f66/cordova-lib/spec-plugman/util/config-changes.spec.js
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-plugman/util/config-changes.spec.js b/cordova-lib/spec-plugman/util/config-changes.spec.js
index c7137ee..d745c18 100644
--- a/cordova-lib/spec-plugman/util/config-changes.spec.js
+++ b/cordova-lib/spec-plugman/util/config-changes.spec.js
@@ -28,7 +28,7 @@ var configChanges = require('../../src/plugman/util/config-changes'),
     events  = require('../../src/events'),
     et      = require('elementtree'),
     path    = require('path'),
-    plist = require('plist-with-patches'),
+    plist = require('plist'),
     shell   = require('shelljs'),
     xcode = require('xcode'),
     temp    = path.join(os.tmpdir(), 'plugman'),

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/62dd5f66/cordova-lib/src/cordova/metadata/ios_parser.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/cordova/metadata/ios_parser.js b/cordova-lib/src/cordova/metadata/ios_parser.js
index fa136dc..a6254ac 100644
--- a/cordova-lib/src/cordova/metadata/ios_parser.js
+++ b/cordova-lib/src/cordova/metadata/ios_parser.js
@@ -29,7 +29,7 @@ var fs            = require('fs'),
     util          = require('../util'),
     events        = require('../../events'),
     shell         = require('shelljs'),
-    plist         = require('plist-with-patches'),
+    plist         = require('plist'),
     Q             = require('q'),
     ConfigParser  = require('../../configparser/ConfigParser'),
     CordovaError  = require('../../CordovaError');
@@ -65,7 +65,7 @@ module.exports.prototype = {
 
         // Update package id (bundle id)
         var plistFile = path.join(this.cordovaproj, this.originalName + '-Info.plist');
-        var infoPlist = plist.parseFileSync(plistFile);
+        var infoPlist = plist.parse(fs.readFileSync(plistFile, 'utf8'));
         infoPlist['CFBundleIdentifier'] = pkg;
 
         // Update version (bundle version)

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/62dd5f66/cordova-lib/src/plugman/platforms/ios.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/plugman/platforms/ios.js b/cordova-lib/src/plugman/platforms/ios.js
index 6e2f3fd..49336fc 100644
--- a/cordova-lib/src/plugman/platforms/ios.js
+++ b/cordova-lib/src/plugman/platforms/ios.js
@@ -26,7 +26,7 @@ var path = require('path')
   , fs   = require('fs')
   , glob = require('glob')
   , xcode = require('xcode')
-  , plist = require('plist-with-patches')
+  , plist = require('plist')
   , shell = require('shelljs')
   , events = require('../../events')
   , cachedProjectFiles = {}
@@ -38,7 +38,7 @@ module.exports = {
     },
     package_name:function(project_dir) {
         var plist_file = glob.sync(path.join(project_dir, '**', '*-Info.plist'))[0];
-        return plist.parseFileSync(plist_file).CFBundleIdentifier;
+        return plist.parse(fs.readFileSync(plist_file, 'utf8')).CFBundleIdentifier;
     },
     'source-file':{
         install:function(source_el, plugin_dir, project_dir, plugin_id, project) {

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/62dd5f66/cordova-lib/src/plugman/util/config-changes.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/plugman/util/config-changes.js b/cordova-lib/src/plugman/util/config-changes.js
index f93a9b5..6e713f5 100644
--- a/cordova-lib/src/plugman/util/config-changes.js
+++ b/cordova-lib/src/plugman/util/config-changes.js
@@ -38,7 +38,7 @@
 var fs   = require('fs'),
     path = require('path'),
     glob = require('glob'),
-    plist = require('plist-with-patches'),
+    plist = require('plist'),
     bplist = require('bplist-parser'),
     et   = require('elementtree'),
     semver = require('semver'),
@@ -554,8 +554,9 @@ function ConfigFile_load() {
         //       We always write out text plist, not binary.
         //       Do we still need to support binary plist?
         //       If yes, use plist.parseStringSync() and read the file once.
-        self.plist_module = (isBinaryPlist(filepath) ? bplist : plist);
-        self.data = self.plist_module.parseFileSync(filepath);
+        self.data = isBinaryPlist(filepath) ?
+                bplist.parseBuffer(fs.readFileSync(filepath)) :
+                plist.parse(fs.readFileSync(filepath, 'utf8'));
     }
 }
 

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/62dd5f66/cordova-lib/src/plugman/util/plist-helpers.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/plugman/util/plist-helpers.js b/cordova-lib/src/plugman/util/plist-helpers.js
index b8d93f2..605a6c2 100644
--- a/cordova-lib/src/plugman/util/plist-helpers.js
+++ b/cordova-lib/src/plugman/util/plist-helpers.js
@@ -23,12 +23,12 @@
 
 // contains PLIST utility functions
 
-var plist = require('plist-with-patches');
+var plist = require('plist');
 
 // adds node to doc at selector
 module.exports.graftPLIST = graftPLIST;
 function graftPLIST(doc, xml, selector) {
-    var obj = plist.parseStringSync('<plist>'+xml+'</plist>');
+    var obj = plist.parse('<plist>'+xml+'</plist>');
 
     var node = doc[selector];
     if (node && Array.isArray(node) && Array.isArray(obj))
@@ -42,7 +42,7 @@ function graftPLIST(doc, xml, selector) {
 // removes node from doc at selector
 module.exports.prunePLIST = prunePLIST;
 function prunePLIST(doc, xml, selector) {
-    var obj = plist.parseStringSync('<plist>'+xml+'</plist>');
+    var obj = plist.parse('<plist>'+xml+'</plist>');
 
     pruneOBJECT(doc, selector, obj);
 


Mime
View raw message