cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agri...@apache.org
Subject [3/4] cordova-lib git commit: Parsers: add base parser (parser.js) and make platform parsers inherit from it
Date Sun, 04 Jan 2015 01:53:31 GMT
Parsers: add base parser (parser.js) and make platform parsers inherit from it


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

Branch: refs/heads/master
Commit: 1c1a2cc0e059f054a023fdae1230fd2873043b02
Parents: dcd6a0c
Author: Marko Raatikka <marko.raatikka@gmail.com>
Authored: Thu Jan 1 22:03:09 2015 +0200
Committer: Andrew Grieve <agrieve@chromium.org>
Committed: Sat Jan 3 20:51:58 2015 -0500

----------------------------------------------------------------------
 .../metadata/android_parser.spec.js             |  4 +++
 .../metadata/blackberry_parser.spec.js          |  4 +++
 .../metadata/browser_parser.spec.js             |  6 +++-
 .../metadata/firefoxos_parser.spec.js           |  4 +++
 .../spec-cordova/metadata/ios_parser.spec.js    |  4 +++
 .../spec-cordova/metadata/parser.spec.js        | 34 ++++++++++++++++++++
 .../metadata/windows8_parser.spec.js            |  4 +++
 .../spec-cordova/metadata/wp8_parser.spec.js    |  4 +++
 .../cordova/metadata/amazon_fireos_parser.js    |  7 ++++
 .../src/cordova/metadata/android_parser.js      |  7 ++++
 .../src/cordova/metadata/blackberry10_parser.js |  7 ++++
 .../src/cordova/metadata/browser_parser.js      |  9 +++++-
 .../src/cordova/metadata/firefoxos_parser.js    |  7 ++++
 cordova-lib/src/cordova/metadata/ios_parser.js  |  7 ++++
 cordova-lib/src/cordova/metadata/parser.js      |  7 ++++
 .../src/cordova/metadata/ubuntu_parser.js       |  7 ++++
 .../src/cordova/metadata/windows_parser.js      |  7 ++++
 cordova-lib/src/cordova/metadata/wp8_parser.js  |  7 ++++
 18 files changed, 134 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/1c1a2cc0/cordova-lib/spec-cordova/metadata/android_parser.spec.js
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/metadata/android_parser.spec.js b/cordova-lib/spec-cordova/metadata/android_parser.spec.js
index 0aba397..def39b4 100644
--- a/cordova-lib/spec-cordova/metadata/android_parser.spec.js
+++ b/cordova-lib/spec-cordova/metadata/android_parser.spec.js
@@ -25,6 +25,7 @@ var platforms = require('../../src/cordova/platforms'),
     xmlHelpers = require('../../src/util/xml-helpers'),
     Q = require('q'),
     config = require('../../src/cordova/config'),
+    Parser = require('../../src/cordova/metadata/parser'),
     ConfigParser = require('../../src/configparser/ConfigParser'),
     cordova = require('../../src/cordova/cordova');
 
@@ -79,6 +80,9 @@ describe('android project parser', function() {
                 expect(p.android_config).toEqual(path.join(proj, 'res', 'xml', 'config.xml'));
             }).not.toThrow();
         });
+        it('should be an instance of Parser', function() {
+            expect(new platforms.android.parser(proj) instanceof Parser).toBeTruthy();
+        });
     });
 
     describe('instance', function() {

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/1c1a2cc0/cordova-lib/spec-cordova/metadata/blackberry_parser.spec.js
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/metadata/blackberry_parser.spec.js b/cordova-lib/spec-cordova/metadata/blackberry_parser.spec.js
index 2bc30c8..60484d0 100644
--- a/cordova-lib/spec-cordova/metadata/blackberry_parser.spec.js
+++ b/cordova-lib/spec-cordova/metadata/blackberry_parser.spec.js
@@ -26,6 +26,7 @@ var platforms = require('../../src/cordova/platforms'),
     xmlHelpers = require('../../src/util/xml-helpers'),
     Q = require('q'),
     config = require('../../src/cordova/config'),
+    Parser = require('../../src/cordova/metadata/parser'),
     ConfigParser = require('../../src/configparser/ConfigParser'),
     cordova = require('../../src/cordova/cordova');
 
@@ -87,6 +88,9 @@ describe('blackberry10 project parser', function() {
             }).not.toThrow();
             expect(project).toBeDefined();
         });
+        it('should be an instance of Parser', function() {
+            expect(new platforms.blackberry10.parser(proj) instanceof Parser).toBeTruthy();
+        });
     });
 
     describe('instance', function() {

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/1c1a2cc0/cordova-lib/spec-cordova/metadata/browser_parser.spec.js
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/metadata/browser_parser.spec.js b/cordova-lib/spec-cordova/metadata/browser_parser.spec.js
index 0da4f7f..a869934 100644
--- a/cordova-lib/spec-cordova/metadata/browser_parser.spec.js
+++ b/cordova-lib/spec-cordova/metadata/browser_parser.spec.js
@@ -21,7 +21,8 @@ var platforms = require('../../src/cordova/platforms'),
     util = require('../../src/cordova/util'),
     path = require('path'),
     shell = require('shelljs'),
-    fs = require('fs');
+    fs = require('fs'),
+    Parser = require('../../src/cordova/metadata/parser');
 
 describe('browser project parser', function() {
     var proj = path.join('some', 'path');
@@ -38,6 +39,9 @@ describe('browser project parser', function() {
                 expect(p.path).toEqual(proj);
             }).not.toThrow();
         });
+        it('should be an instance of Parser', function() {
+            expect(new platforms.browser.parser(proj) instanceof Parser).toBeTruthy();
+        });
     });
 
     describe('instance', function() {

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/1c1a2cc0/cordova-lib/spec-cordova/metadata/firefoxos_parser.spec.js
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/metadata/firefoxos_parser.spec.js b/cordova-lib/spec-cordova/metadata/firefoxos_parser.spec.js
index 3b1faa3..40f6271 100644
--- a/cordova-lib/spec-cordova/metadata/firefoxos_parser.spec.js
+++ b/cordova-lib/spec-cordova/metadata/firefoxos_parser.spec.js
@@ -22,6 +22,7 @@ var platforms = require('../../src/cordova/platforms'),
     shell = require('shelljs'),
     fs = require('fs'),
     config = require('../../src/cordova/config'),
+    Parser = require('../../src/cordova/metadata/parser'),
     ConfigParser = require('../../src/configparser/ConfigParser'),
     cordova = require('../../src/cordova/cordova');
 
@@ -44,6 +45,9 @@ describe('firefoxos project parser', function() {
                 expect(p.path).toEqual(proj);
             }).not.toThrow();
         });
+        it('should be an instance of Parser', function() {
+            expect(new platforms.firefoxos.parser(proj) instanceof Parser).toBeTruthy();
+        });
     });
 
     describe('instance', function() {

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/1c1a2cc0/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 54fd768..c4dbe2c 100644
--- a/cordova-lib/spec-cordova/metadata/ios_parser.spec.js
+++ b/cordova-lib/spec-cordova/metadata/ios_parser.spec.js
@@ -26,6 +26,7 @@ var platforms = require('../../src/cordova/platforms'),
     fs = require('fs'),
     Q = require('q'),
     config = require('../../src/cordova/config'),
+    Parser = require('../../src/cordova/metadata/parser'),
     ConfigParser = require('../../src/configparser/ConfigParser'),
     cordova = require('../../src/cordova/cordova');
 
@@ -67,6 +68,9 @@ describe('ios project parser', function () {
                 expect(p.xcodeproj).toEqual(path.join(proj, 'test.xcodeproj'));
             }).not.toThrow();
         });
+        it('should be an instance of Parser', function() {
+            expect(new platforms.ios.parser(proj) instanceof Parser).toBeTruthy();
+        });
     });
 
     describe('instance', function() {

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/1c1a2cc0/cordova-lib/spec-cordova/metadata/parser.spec.js
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/metadata/parser.spec.js b/cordova-lib/spec-cordova/metadata/parser.spec.js
new file mode 100644
index 0000000..641193f
--- /dev/null
+++ b/cordova-lib/spec-cordova/metadata/parser.spec.js
@@ -0,0 +1,34 @@
+/**
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+*/
+
+var Parser = require('../../src/cordova/metadata/parser');
+
+describe('base parser', function() {
+
+    describe('instance', function() {
+
+        var parser;
+
+        beforeEach(function() {
+            parser = new Parser();
+        });
+
+    });
+
+});

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/1c1a2cc0/cordova-lib/spec-cordova/metadata/windows8_parser.spec.js
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/metadata/windows8_parser.spec.js b/cordova-lib/spec-cordova/metadata/windows8_parser.spec.js
index b7279b0..d733d26 100644
--- a/cordova-lib/spec-cordova/metadata/windows8_parser.spec.js
+++ b/cordova-lib/spec-cordova/metadata/windows8_parser.spec.js
@@ -27,6 +27,7 @@ var platforms = require('../../src/cordova/platforms'),
     Q = require('q'),
     fs = require('fs'),
     config = require('../../src/cordova/config'),
+    Parser = require('../../src/cordova/metadata/parser'),
     ConfigParser = require('../../src/configparser/ConfigParser'),
     cordova = require('../../src/cordova/cordova'),
     HooksRunner = require('../../src/hooks/HooksRunner');
@@ -89,6 +90,9 @@ describe('windows8 project parser', function() {
                 expect(parser.manifestPath).toEqual(path.join(proj, 'package.appxmanifest'));
             }).not.toThrow();
         });
+        it('should be an instance of Parser', function() {
+            expect(new platforms.windows8.parser(proj) instanceof Parser).toBeTruthy();
+        });
     });
 
     describe('instance', function() {

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/1c1a2cc0/cordova-lib/spec-cordova/metadata/wp8_parser.spec.js
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-cordova/metadata/wp8_parser.spec.js b/cordova-lib/spec-cordova/metadata/wp8_parser.spec.js
index aac5858..72a0be6 100644
--- a/cordova-lib/spec-cordova/metadata/wp8_parser.spec.js
+++ b/cordova-lib/spec-cordova/metadata/wp8_parser.spec.js
@@ -27,6 +27,7 @@ var platforms = require('../../src/cordova/platforms'),
     Q = require('q'),
     child_process = require('child_process'),
     config = require('../../src/cordova/config'),
+    Parser = require('../../src/cordova/metadata/parser'),
     ConfigParser = require('../../src/configparser/ConfigParser'),
     CordovaError = require('../../src/CordovaError'),
     cordova = require('../../src/cordova/cordova'),
@@ -96,6 +97,9 @@ describe('wp8 project parser', function() {
                 expect(p.manifest_path).toEqual(path.join(proj, 'Properties', 'WMAppManifest.xml'));
             }).not.toThrow();
         });
+        it('should be an instance of Parser', function() {
+            expect(new platforms.wp8.parser(proj) instanceof Parser).toBeTruthy();
+        });
     });
 
     describe('instance', function() {

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/1c1a2cc0/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 9a0af54..933ecdf 100644
--- a/cordova-lib/src/cordova/metadata/amazon_fireos_parser.js
+++ b/cordova-lib/src/cordova/metadata/amazon_fireos_parser.js
@@ -29,6 +29,7 @@ var fs            = require('fs'),
     events        = require('../../events'),
     shell         = require('shelljs'),
     Q             = require('q'),
+    Parser        = require('./parser'),
     ConfigParser = require('../../configparser/ConfigParser'),
     CordovaError = require('../../CordovaError');
 
@@ -37,12 +38,18 @@ function amazon_fireos_parser(project) {
     if (!fs.existsSync(path.join(project, 'AndroidManifest.xml'))) {
         throw new CordovaError('The provided path "' + project + '" is not an Android project.');
     }
+
+    // Call the base class constructor
+    Parser.apply(this, arguments);
+
     this.path = project;
     this.strings = path.join(this.path, 'res', 'values', 'strings.xml');
     this.manifest = path.join(this.path, 'AndroidManifest.xml');
     this.android_config = path.join(this.path, 'res', 'xml', 'config.xml');
 }
 
+require('util').inherits(amazon_fireos_parser, Parser);
+
 module.exports = amazon_fireos_parser;
 
 amazon_fireos_parser.prototype.findOrientationPreference = function(config) {

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/1c1a2cc0/cordova-lib/src/cordova/metadata/android_parser.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/cordova/metadata/android_parser.js b/cordova-lib/src/cordova/metadata/android_parser.js
index d9f33b3..c37b271 100644
--- a/cordova-lib/src/cordova/metadata/android_parser.js
+++ b/cordova-lib/src/cordova/metadata/android_parser.js
@@ -29,6 +29,7 @@ var fs            = require('fs'),
     events        = require('../../events'),
     shell         = require('shelljs'),
     Q             = require('q'),
+    Parser        = require('./parser'),
     ConfigParser  = require('../../configparser/ConfigParser'),
     CordovaError  = require('../../CordovaError');
 
@@ -37,12 +38,18 @@ function android_parser(project) {
     if (!fs.existsSync(path.join(project, 'AndroidManifest.xml'))) {
         throw new CordovaError('The provided path "' + project + '" is not an Android project.');
     }
+
+    // Call the base class constructor
+    Parser.apply(this, arguments);
+
     this.path = project;
     this.strings = path.join(this.path, 'res', 'values', 'strings.xml');
     this.manifest = path.join(this.path, 'AndroidManifest.xml');
     this.android_config = path.join(this.path, 'res', 'xml', 'config.xml');
 }
 
+require('util').inherits(android_parser, Parser);
+
 module.exports = android_parser;
 
 android_parser.prototype.findOrientationPreference = function(config) {

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/1c1a2cc0/cordova-lib/src/cordova/metadata/blackberry10_parser.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/cordova/metadata/blackberry10_parser.js b/cordova-lib/src/cordova/metadata/blackberry10_parser.js
index 1bd1e8f..ee2df6e 100644
--- a/cordova-lib/src/cordova/metadata/blackberry10_parser.js
+++ b/cordova-lib/src/cordova/metadata/blackberry10_parser.js
@@ -26,6 +26,7 @@ var fs            = require('fs'),
     shell         = require('shelljs'),
     util          = require('../util'),
     Q             = require('q'),
+    Parser        = require('./parser'),
     ConfigParser  = require('../../configparser/ConfigParser'),
     CordovaError  = require('../../CordovaError'),
     events        = require('../../events');
@@ -34,11 +35,17 @@ function blackberry_parser(project) {
     if (!fs.existsSync(path.join(project, 'www'))) {
         throw new CordovaError('The provided path "' + project + '" is not a Cordova BlackBerry10
project.');
     }
+
+    // Call the base class constructor
+    Parser.apply(this, arguments);
+
     this.path = project;
     this.config_path = path.join(this.path, 'www', 'config.xml');
     this.xml = new ConfigParser(this.config_path);
 }
 
+require('util').inherits(blackberry_parser, Parser);
+
 module.exports = blackberry_parser;
 
 blackberry_parser.prototype.update_from_config = function(config) {

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/1c1a2cc0/cordova-lib/src/cordova/metadata/browser_parser.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/cordova/metadata/browser_parser.js b/cordova-lib/src/cordova/metadata/browser_parser.js
index 23e3dfe..394fe8a 100644
--- a/cordova-lib/src/cordova/metadata/browser_parser.js
+++ b/cordova-lib/src/cordova/metadata/browser_parser.js
@@ -26,12 +26,19 @@ var fs = require('fs'),
     path = require('path'),
     shell = require('shelljs'),
     util = require('../util'),
-    Q = require('q');
+    Q = require('q'),
+    Parser = require('./parser');
 
 function browser_parser(project) {
+
+    // Call the base class constructor
+    Parser.apply(this, arguments);
+
     this.path = project;
 }
 
+require('util').inherits(browser_parser, Parser);
+
 module.exports = browser_parser;
 
 // Returns a promise.

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/1c1a2cc0/cordova-lib/src/cordova/metadata/firefoxos_parser.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/cordova/metadata/firefoxos_parser.js b/cordova-lib/src/cordova/metadata/firefoxos_parser.js
index f58e654..f143876 100644
--- a/cordova-lib/src/cordova/metadata/firefoxos_parser.js
+++ b/cordova-lib/src/cordova/metadata/firefoxos_parser.js
@@ -28,12 +28,19 @@ var fs = require('fs'),
     events = require('../../events'),
     util = require('../util'),
     Q = require('q'),
+    Parser = require('./parser'),
     ConfigParser = require('../../configparser/ConfigParser');
 
 function firefoxos_parser(project) {
+
+    // Call the base class constructor
+    Parser.apply(this, arguments);
+
     this.path = project;
 }
 
+require('util').inherits(firefoxos_parser, Parser);
+
 module.exports = firefoxos_parser;
 
 // Returns a promise.

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/1c1a2cc0/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 bfdd8d0..05e65ed 100644
--- a/cordova-lib/src/cordova/metadata/ios_parser.js
+++ b/cordova-lib/src/cordova/metadata/ios_parser.js
@@ -31,10 +31,15 @@ var fs            = require('fs'),
     shell         = require('shelljs'),
     plist         = require('plist'),
     Q             = require('q'),
+    Parser        = require('./parser'),
     ConfigParser  = require('../../configparser/ConfigParser'),
     CordovaError  = require('../../CordovaError');
 
 function ios_parser(project) {
+
+    // Call the base class constructor
+    Parser.apply(this, arguments);
+
     try {
         var xcodeproj_dir = fs.readdirSync(project).filter(function(e) { return e.match(/\.xcodeproj$/i);
})[0];
         if (!xcodeproj_dir) throw new CordovaError('The provided path "' + project + '" is
not a Cordova iOS project.');
@@ -49,6 +54,8 @@ function ios_parser(project) {
     this.config_path = path.join(this.cordovaproj, 'config.xml');
 }
 
+require('util').inherits(ios_parser, Parser);
+
 module.exports = ios_parser;
 
 // Returns a promise.

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/1c1a2cc0/cordova-lib/src/cordova/metadata/parser.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/cordova/metadata/parser.js b/cordova-lib/src/cordova/metadata/parser.js
new file mode 100644
index 0000000..dcad562
--- /dev/null
+++ b/cordova-lib/src/cordova/metadata/parser.js
@@ -0,0 +1,7 @@
+/**
+ * Base module for platform-specific parsers
+ */
+
+function Parser () {}
+
+module.exports = Parser;

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/1c1a2cc0/cordova-lib/src/cordova/metadata/ubuntu_parser.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/cordova/metadata/ubuntu_parser.js b/cordova-lib/src/cordova/metadata/ubuntu_parser.js
index 1ccd2a8..29c4dd5 100644
--- a/cordova-lib/src/cordova/metadata/ubuntu_parser.js
+++ b/cordova-lib/src/cordova/metadata/ubuntu_parser.js
@@ -27,10 +27,15 @@ var fs            = require('fs'),
     util          = require('../util'),
     shell         = require('shelljs'),
     Q             = require('q'),
+    Parser        = require('./parser'),
     os            = require('os'),
     ConfigParser  = require('../../configparser/ConfigParser');
 
 function ubuntu_parser(project) {
+
+    // Call the base class constructor
+    Parser.apply(this, arguments);
+
     this.path = project;
     this.config = new ConfigParser(this.config_xml());
     this.update_manifest();
@@ -40,6 +45,8 @@ function sanitize(str) {
     return str.replace(/\n/g, ' ').replace(/^\s+|\s+$/g, '');
 }
 
+require('util').inherits(ubuntu_parser, Parser);
+
 module.exports = ubuntu_parser;
 
 ubuntu_parser.prototype.update_from_config = function(config) {

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/1c1a2cc0/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 ba1b4b3..e385bc1 100644
--- a/cordova-lib/src/cordova/metadata/windows_parser.js
+++ b/cordova-lib/src/cordova/metadata/windows_parser.js
@@ -27,12 +27,17 @@ var fs            = require('fs'),
     events        = require('../../events'),
     shell         = require('shelljs'),
     Q             = require('q'),
+    Parser        = require('./parser'),
     ConfigParser  = require('../../configparser/ConfigParser'),
     CordovaError  = require('../../CordovaError'),
     xml           = require('../../util/xml-helpers'),
     HooksRunner        = require('../../hooks/HooksRunner');
 
 function windows_parser(project) {
+
+    // Call the base class constructor
+    Parser.apply(this, arguments);
+
     try {
         this.isOldProjectTemplate = false;
         // Check that it's a universal windows store project
@@ -56,6 +61,8 @@ function windows_parser(project) {
     }
 }
 
+require('util').inherits(windows_parser, Parser);
+
 module.exports = windows_parser;
 
 windows_parser.prototype.update_from_config = function(config) {

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/1c1a2cc0/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 23f2827..1d60f4d 100644
--- a/cordova-lib/src/cordova/metadata/wp8_parser.js
+++ b/cordova-lib/src/cordova/metadata/wp8_parser.js
@@ -27,12 +27,17 @@ var fs            = require('fs'),
     events        = require('../../events'),
     shell         = require('shelljs'),
     Q             = require('q'),
+    Parser        = require('./parser'),
     ConfigParser  = require('../../configparser/ConfigParser'),
     CordovaError  = require('../../CordovaError'),
     xml           = require('../../util/xml-helpers'),
     HooksRunner        = require('../../hooks/HooksRunner');
 
 function wp8_parser(project) {
+
+    // Call the base class constructor
+    Parser.apply(this, arguments);
+
     try {
         // TODO : Check that it's not a wp8 project?
         var csproj_file   = fs.readdirSync(project).filter(function(e) { return e.match(/\.csproj$/i);
})[0];
@@ -46,6 +51,8 @@ function wp8_parser(project) {
     this.manifest_path  = path.join(this.wp8_proj_dir, 'Properties', 'WMAppManifest.xml');
 }
 
+require('util').inherits(wp8_parser, Parser);
+
 module.exports = wp8_parser;
 
 wp8_parser.prototype.update_from_config = function(config) {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


Mime
View raw message