You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by an...@apache.org on 2015/09/16 14:06:14 UTC

[3/3] cordova-lib git commit: CB-9588 Plugman. Add support for on Windows

CB-9588 Plugman. Add support for <resource-file> on Windows

* Also includes corresponding unit tests.

This closes #301


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

Branch: refs/heads/master
Commit: d146af3c5646272ca9d115ee9174f3a1becee21d
Parents: eefd7af
Author: Vladimir Kotikov <v-...@microsoft.com>
Authored: Wed Sep 16 15:03:06 2015 +0300
Committer: Vladimir Kotikov <v-...@microsoft.com>
Committed: Wed Sep 16 15:03:41 2015 +0300

----------------------------------------------------------------------
 .../spec-plugman/platforms/windows.spec.js      | 87 ++++++++++++++++++--
 .../org.test.plugins.dummyplugin/plugin.xml     |  5 ++
 .../src/windows/text_sample1.txt                |  0
 .../src/windows/text_sample2.txt                |  0
 .../src/windows/text_sample3.txt                |  0
 .../src/windows/text_sample4.txt                |  0
 .../org.test.plugins.faultyplugin/plugin.xml    |  4 +
 .../src/windows/text_sample1.txt                |  0
 .../src/windows/text_sample2.txt                |  0
 .../src/windows/text_sample3.txt                |  0
 cordova-lib/src/PluginInfo.js                   |  7 +-
 cordova-lib/src/plugman/platforms/windows.js    |  9 +-
 cordova-lib/src/util/windows/jsprojManager.js   | 52 +++++++++---
 13 files changed, 143 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/d146af3c/cordova-lib/spec-plugman/platforms/windows.spec.js
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-plugman/platforms/windows.spec.js b/cordova-lib/spec-plugman/platforms/windows.spec.js
index f9fe6cb..785f5b3 100644
--- a/cordova-lib/spec-plugman/platforms/windows.spec.js
+++ b/cordova-lib/spec-plugman/platforms/windows.spec.js
@@ -35,12 +35,14 @@ var PluginInfo = require('../../src/PluginInfo');
 var dummyPluginInfo = new PluginInfo(dummyplugin);
 var dummy_id = dummyPluginInfo.id;
 var valid_source = dummyPluginInfo.getSourceFiles('windows');
+var valid_resourceFiles = dummyPluginInfo.getResourceFiles('windows');
 var valid_libfiles = dummyPluginInfo.getLibFiles('windows');
 var valid_frameworks = dummyPluginInfo.getFrameworks('windows');
 
 var faultyPluginInfo = new PluginInfo(faultyplugin);
 var faulty_id = faultyPluginInfo.id;
 var invalid_source = faultyPluginInfo.getSourceFiles('windows');
+var invalid_resourceFiles = faultyPluginInfo.getResourceFiles('windows');
 var invalid_libfiles = faultyPluginInfo.getLibFiles('windows');
 
 function copyArray(arr) {
@@ -146,15 +148,25 @@ beforeEach(function () {
                     expect(copiedSuccessfully).toBe(true);
                 };
 
+                // Check that resource file was copied to correct path
+                var checkInstalledResourcePath = function (resource) {
+                    var dest = path.join(cordovaProjectWindowsPlatformDir, resource.target);
+                    var copiedSuccessfully = fs.existsSync(path.resolve(dest));
+                    expect(copiedSuccessfully).toBe(true);
+                };
+
                 var appendToRootFake = function (itemGroup) {
-                    expect(itemGroup).toContainXmlPath(xpath);
                     // In case we install framework with 'custom' attribute set to 'true'
                     // we verify that file is copied to correct dir and reference is added properly.
                     // This is not required in case of 'projectReference' attribute is used.
                     if (tag === 'framework' && elementToInstall.type !== 'projectReference') {
                         checkInstalledFrameworkReference(tag, elementToInstall, itemGroup);
                         checkInstalledFrameworkPath(elementToInstall);
+                        return;
+                    } else if (tag === 'resource-file') {
+                        checkInstalledResourcePath(elementToInstall);
                     }
+                    expect(itemGroup).toContainXmlPath(xpath);
                 };
 
                 var projectsAddedToSpies = [];
@@ -211,6 +223,41 @@ beforeEach(function () {
                 });
             });
 
+            describe('of <resource-file> elements', function () {
+                var resourceFiles = copyArray(valid_resourceFiles);
+                var invalidResourceFiles = copyArray(invalid_resourceFiles);
+
+                // This could be separated into individual specs, but that results in a lot of copying and deleting the
+                // project files, which is not needed.
+                it('should write to correct project files when conditions are specified', function () {
+                    var xpath = 'Content[@Include="' + resourceFiles[0].target + '"][@Condition="\'$(Platform)\'==\'x86\'"]';
+                    validateInstalledProjects('resource-file', resourceFiles[0], xpath, ['all']);
+
+                    xpath = 'Content[@Include="' + resourceFiles[1].target + '"]';
+                    validateInstalledProjects('resource-file', resourceFiles[1], xpath, ['windows', 'phone', 'windows10']);
+
+                    xpath = 'Content[@Include="' + resourceFiles[2].target + '"]';
+                    validateInstalledProjects('resource-file', resourceFiles[2], xpath, ['phone']);
+
+                    xpath = 'Content[@Include="' + resourceFiles[3].target + '"][@Condition="\'$(Platform)\'==\'x64\'"]';
+                    validateInstalledProjects('resource-file', resourceFiles[3], xpath, ['windows8']);
+                });
+
+                it('should throw if conditions are invalid', function () {
+                    expect(function () {
+                        windows['resource-file'].install(invalidResourceFiles[0], faultyplugin, cordovaProjectWindowsPlatformDir, faulty_id, null, proj_files);
+                    }).toThrow('Invalid arch attribute (must be "x86", "x64" or "ARM"): x85');
+
+                    expect(function () {
+                        windows['resource-file'].install(invalidResourceFiles[1], faultyplugin, cordovaProjectWindowsPlatformDir, faulty_id, null, proj_files);
+                    }).toThrow('Invalid versions attribute (must be a valid a valid node semantic version range): 8.0a');
+
+                    expect(function () {
+                        windows['resource-file'].install(invalidResourceFiles[2], faultyplugin, cordovaProjectWindowsPlatformDir, faulty_id, null, proj_files);
+                    }).toThrow('Invalid device-target attribute (must be "all", "phone", "windows" or "win"): daphne');
+                });
+            });
+
             describe('of <lib-file> elements', function () {
                 var libfiles = copyArray(valid_libfiles);
                 var invalidLibFiles = copyArray(invalid_libfiles);
@@ -234,15 +281,15 @@ beforeEach(function () {
                 it('should throw if conditions are invalid', function () {
                     expect(function () {
                         windows['lib-file'].install(invalidLibFiles[0], faultyplugin, cordovaProjectWindowsPlatformDir, faulty_id, null, proj_files);
-                    }).toThrow('Invalid lib-file arch attribute (must be "x86", "x64" or "ARM"): x85');
+                    }).toThrow('Invalid arch attribute (must be "x86", "x64" or "ARM"): x85');
 
                     expect(function () {
                         windows['lib-file'].install(invalidLibFiles[1], faultyplugin, cordovaProjectWindowsPlatformDir, faulty_id, null, proj_files);
-                    }).toThrow('Invalid lib-file versions attribute (must be a valid a valid node semantic version range): 8.0a');
+                    }).toThrow('Invalid versions attribute (must be a valid a valid node semantic version range): 8.0a');
 
                     expect(function () {
                         windows['lib-file'].install(invalidLibFiles[2], faultyplugin, cordovaProjectWindowsPlatformDir, faulty_id, null, proj_files);
-                    }).toThrow('Invalid lib-file target attribute (must be "all", "phone", "windows" or "win"): daphne');
+                    }).toThrow('Invalid device-target attribute (must be "all", "phone", "windows" or "win"): daphne');
                 });
             });
 
@@ -321,7 +368,7 @@ beforeEach(function () {
                 });
 
                 projects.forEach(function (project) {
-                    var spy = spyOn(project, 'removeReferenceElementItemGroup');
+                    var spy = spyOn(project, 'removeItemGroupElement');
                     if (projectsAddedTo.indexOf(path.basename(project.location)) > -1) {
                         projectsAddedToSpies.push(spy);
                     } else {
@@ -354,6 +401,36 @@ beforeEach(function () {
                 });
             });
 
+            describe('of <resource-file> elements', function () {
+                // This could be separated into individual specs, but that results in a lot of copying and deleting the
+                // project files, which is not needed.
+                it('should remove from correct project files when conditions specified', function (done) {
+                    var resourcefiles = copyArray(valid_resourceFiles);
+
+                    install('windows', cordovaProjectWindowsPlatformDir, dummyplugin, cordovaProjectPluginsDir, {})
+                        .then(function () {
+                            var path = 'ItemGroup/Content';
+                            var incText = resourcefiles[0].target;
+                            var targetConditions = {versions: undefined, deviceTarget: undefined, arch: 'x86'};
+                            validateUninstalledProjects('resource-file', resourcefiles[0], path, incText, targetConditions, ['all']);
+
+                            incText = resourcefiles[1].target;
+                            targetConditions = {versions: '>=8.1', deviceTarget: undefined, arch: undefined};
+                            validateUninstalledProjects('resource-file', resourcefiles[1], path, incText, targetConditions, ['windows', 'phone', 'windows10']);
+
+                            incText = resourcefiles[2].target;
+                            targetConditions = {versions: undefined, deviceTarget: 'phone', arch: undefined};
+                            validateUninstalledProjects('resource-file', resourcefiles[2], path, incText, targetConditions, ['phone']);
+
+                            incText = resourcefiles[3].target;
+                            targetConditions = {versions: '8.0', deviceTarget: 'windows', arch: 'x64'};
+                            validateUninstalledProjects('resource-file', resourcefiles[3], path, incText, targetConditions, ['windows8']);
+
+                            done();
+                        });
+                });
+            });
+
             describe('of <lib-file> elements', function () {
                 // This could be separated into individual specs, but that results in a lot of copying and deleting the
                 // project files, which is not needed.

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/d146af3c/cordova-lib/spec-plugman/plugins/org.test.plugins.dummyplugin/plugin.xml
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-plugman/plugins/org.test.plugins.dummyplugin/plugin.xml b/cordova-lib/spec-plugman/plugins/org.test.plugins.dummyplugin/plugin.xml
index b8c4ec5..b2d7f75 100644
--- a/cordova-lib/spec-plugman/plugins/org.test.plugins.dummyplugin/plugin.xml
+++ b/cordova-lib/spec-plugman/plugins/org.test.plugins.dummyplugin/plugin.xml
@@ -183,6 +183,11 @@
 
         <source-file src="src/windows/dummer.js"/>
 
+        <resource-file src="src/windows/text_sample1.txt" target="text_samples/text_sample1.txt" arch="x86" />
+        <resource-file src="src/windows/text_sample2.txt" target="text_samples/text_sample2.txt" versions="&gt;=8.1" />
+        <resource-file src="src/windows/text_sample3.txt" target="text_samples/text_sample3.txt" device-target="phone"/>
+        <resource-file src="src/windows/text_sample4.txt" target="text_samples/text_sample4.txt" device-target="windows" versions="8.0" arch="x64"/>
+
         <lib-file src="TestSDK1, Version=1.0" arch="x86"/>
         <lib-file src="TestSDK2, Version=1.0" versions=">=8.1"/>
         <lib-file src="TestSDK3, Version=1.0" device-target="phone"/>

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/d146af3c/cordova-lib/spec-plugman/plugins/org.test.plugins.dummyplugin/src/windows/text_sample1.txt
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-plugman/plugins/org.test.plugins.dummyplugin/src/windows/text_sample1.txt b/cordova-lib/spec-plugman/plugins/org.test.plugins.dummyplugin/src/windows/text_sample1.txt
new file mode 100644
index 0000000..e69de29

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/d146af3c/cordova-lib/spec-plugman/plugins/org.test.plugins.dummyplugin/src/windows/text_sample2.txt
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-plugman/plugins/org.test.plugins.dummyplugin/src/windows/text_sample2.txt b/cordova-lib/spec-plugman/plugins/org.test.plugins.dummyplugin/src/windows/text_sample2.txt
new file mode 100644
index 0000000..e69de29

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/d146af3c/cordova-lib/spec-plugman/plugins/org.test.plugins.dummyplugin/src/windows/text_sample3.txt
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-plugman/plugins/org.test.plugins.dummyplugin/src/windows/text_sample3.txt b/cordova-lib/spec-plugman/plugins/org.test.plugins.dummyplugin/src/windows/text_sample3.txt
new file mode 100644
index 0000000..e69de29

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/d146af3c/cordova-lib/spec-plugman/plugins/org.test.plugins.dummyplugin/src/windows/text_sample4.txt
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-plugman/plugins/org.test.plugins.dummyplugin/src/windows/text_sample4.txt b/cordova-lib/spec-plugman/plugins/org.test.plugins.dummyplugin/src/windows/text_sample4.txt
new file mode 100644
index 0000000..e69de29

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/d146af3c/cordova-lib/spec-plugman/plugins/org.test.plugins.faultyplugin/plugin.xml
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-plugman/plugins/org.test.plugins.faultyplugin/plugin.xml b/cordova-lib/spec-plugman/plugins/org.test.plugins.faultyplugin/plugin.xml
index abe2f2e..78f037f 100644
--- a/cordova-lib/spec-plugman/plugins/org.test.plugins.faultyplugin/plugin.xml
+++ b/cordova-lib/spec-plugman/plugins/org.test.plugins.faultyplugin/plugin.xml
@@ -141,6 +141,10 @@
 
         <source-file src="src/windows/faultyPlugin.js" />
 
+        <resource-file src="src/windows/text_sample1.txt" target="text_samples/text_sample1.txt" arch="x85" />
+        <resource-file src="src/windows/text_sample2.txt" target="text_samples/text_sample2.txt" versions="8.0a" />
+        <resource-file src="src/windows/text_sample3.txt" target="text_samples/text_sample3.txt" device-target="daphne"/>
+
         <lib-file src="TestSDK1, Version=1.0" arch="x85"/>
         <lib-file src="TestSDK2, Version=1.0" versions="8.0a"/>
         <lib-file src="TestSDK3, Version=1.0" device-target="daphne"/>

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/d146af3c/cordova-lib/spec-plugman/plugins/org.test.plugins.faultyplugin/src/windows/text_sample1.txt
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-plugman/plugins/org.test.plugins.faultyplugin/src/windows/text_sample1.txt b/cordova-lib/spec-plugman/plugins/org.test.plugins.faultyplugin/src/windows/text_sample1.txt
new file mode 100644
index 0000000..e69de29

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/d146af3c/cordova-lib/spec-plugman/plugins/org.test.plugins.faultyplugin/src/windows/text_sample2.txt
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-plugman/plugins/org.test.plugins.faultyplugin/src/windows/text_sample2.txt b/cordova-lib/spec-plugman/plugins/org.test.plugins.faultyplugin/src/windows/text_sample2.txt
new file mode 100644
index 0000000..e69de29

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/d146af3c/cordova-lib/spec-plugman/plugins/org.test.plugins.faultyplugin/src/windows/text_sample3.txt
----------------------------------------------------------------------
diff --git a/cordova-lib/spec-plugman/plugins/org.test.plugins.faultyplugin/src/windows/text_sample3.txt b/cordova-lib/spec-plugman/plugins/org.test.plugins.faultyplugin/src/windows/text_sample3.txt
new file mode 100644
index 0000000..e69de29

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/d146af3c/cordova-lib/src/PluginInfo.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/PluginInfo.js b/cordova-lib/src/PluginInfo.js
index 78f07f7..8e75d4a 100644
--- a/cordova-lib/src/PluginInfo.js
+++ b/cordova-lib/src/PluginInfo.js
@@ -203,14 +203,17 @@ function PluginInfo(dirname) {
 
     // <resource-file>
     // Example:
-    // <resource-file src="FooPluginStrings.xml" target="res/values/FooPluginStrings.xml" />
+    // <resource-file src="FooPluginStrings.xml" target="res/values/FooPluginStrings.xml" device-target="win" arch="x86" versions="&gt;=8.1" />
     self.getResourceFiles = getResourceFiles;
     function getResourceFiles(platform) {
         var resourceFiles = _getTagsInPlatform(self._et, 'resource-file', platform, function(tag) {
             return {
                 itemType: 'resource-file',
                 src: tag.attrib.src,
-                target: tag.attrib.target
+                target: tag.attrib.target,
+                versions: tag.attrib.versions,
+                deviceTarget: tag.attrib['device-target'],
+                arch: tag.attrib.arch
             };
         });
         return resourceFiles;

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/d146af3c/cordova-lib/src/plugman/platforms/windows.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/plugman/platforms/windows.js b/cordova-lib/src/plugman/platforms/windows.js
index dd8aa07..7dd6ce8 100644
--- a/cordova-lib/src/plugman/platforms/windows.js
+++ b/cordova-lib/src/plugman/platforms/windows.js
@@ -87,9 +87,16 @@ module.exports = {
     },
     'resource-file':{
         install:function(obj, plugin_dir, project_dir, plugin_id, options, project_file) {
-            events.emit('verbose', 'resource-file is not supported for Windows');
+            var src = obj.src;
+            var dest = obj.target;
+            // as per specification resource-file target is specified relative to platform root
+            common.copyFile(plugin_dir, src, project_dir, dest);
+            project_file.addResourceFileToProject(dest, getTargetConditions(obj));
         },
         uninstall:function(obj, project_dir, plugin_id, options, project_file) {
+            var dest = obj.target;
+            common.removeFile(project_dir, dest);
+            project_file.removeResourceFileFromProject(dest, getTargetConditions(obj));
         }
     },
     'lib-file': {

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/d146af3c/cordova-lib/src/util/windows/jsprojManager.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/util/windows/jsprojManager.js b/cordova-lib/src/util/windows/jsprojManager.js
index eda78a2..e7a68c9 100644
--- a/cordova-lib/src/util/windows/jsprojManager.js
+++ b/cordova-lib/src/util/windows/jsprojManager.js
@@ -74,7 +74,7 @@ jsprojManager.prototype = {
     addSDKRef: function (incText, targetConditions) {
         events.emit('verbose', 'jsprojManager.addSDKRef(incText: ' + incText + ', targetConditions: ' + JSON.stringify(targetConditions) + ')');
 
-        var item = createReferenceElement('ItemGroup/SDKReference', incText, targetConditions);
+        var item = createItemGroupElement('ItemGroup/SDKReference', incText, targetConditions);
         this._getMatchingProjects(targetConditions).forEach(function (project) {
             project.appendToRoot(item);
         });
@@ -84,7 +84,33 @@ jsprojManager.prototype = {
         events.emit('verbose', 'jsprojManager.removeSDKRef(incText: ' + incText + ', targetConditions: ' + JSON.stringify(targetConditions) + ')');
 
         this._getMatchingProjects(targetConditions).forEach(function (project) {
-            project.removeReferenceElementItemGroup('ItemGroup/SDKReference', incText, targetConditions);
+            project.removeItemGroupElement('ItemGroup/SDKReference', incText, targetConditions);
+        });
+    },
+
+    addResourceFileToProject: function (relPath, targetConditions) {
+        events.emit('verbose', 'jsprojManager.addResourceFile(relPath: ' + relPath + ', targetConditions: ' + JSON.stringify(targetConditions) + ')');
+
+        // add hint path with full path
+        var link = new et.Element('Link');
+        link.text = relPath;
+        var children = [link];
+
+        var copyToOutputDirectory = new et.Element('CopyToOutputDirectory');
+        copyToOutputDirectory.text = 'Always';
+        children.push(copyToOutputDirectory);
+
+        var item = createItemGroupElement('ItemGroup/Content', relPath, targetConditions, children);
+        this._getMatchingProjects(targetConditions).forEach(function (project) {
+            project.appendToRoot(item);
+        });
+    },
+
+    removeResourceFileFromProject: function (relPath, targetConditions) {
+        events.emit('verbose', 'jsprojManager.removeResourceFile(relPath: ' + relPath + ', targetConditions: ' + JSON.stringify(targetConditions) + ')');
+
+        this._getMatchingProjects(targetConditions).forEach(function (project) {
+            project.removeItemGroupElement('ItemGroup/Content', relPath, targetConditions);
         });
     },
 
@@ -103,7 +129,7 @@ jsprojManager.prototype = {
             children.push(mdFileTag);
         }
 
-        var item = createReferenceElement('ItemGroup/Reference', path.basename(relPath, extName), targetConditions, children);
+        var item = createItemGroupElement('ItemGroup/Reference', path.basename(relPath, extName), targetConditions, children);
         this._getMatchingProjects(targetConditions).forEach(function (project) {
             project.appendToRoot(item);
         });
@@ -117,7 +143,7 @@ jsprojManager.prototype = {
         var includeText = path.basename(relPath, extName);
 
         this._getMatchingProjects(targetConditions).forEach(function (project) {
-            project.removeReferenceElementItemGroup('ItemGroup/Reference', includeText, targetConditions);
+            project.removeItemGroupElement('ItemGroup/Reference', includeText, targetConditions);
         });
     },
 
@@ -205,7 +231,7 @@ jsprojManager.prototype = {
 
         // Add the ItemGroup/ProjectReference to each matching cordova project :
         // <ItemGroup><ProjectReference Include="blahblah.csproj"/></ItemGroup>
-        var item = createReferenceElement('ItemGroup/ProjectReference', inserted_path, targetConditions);
+        var item = createItemGroupElement('ItemGroup/ProjectReference', inserted_path, targetConditions);
         matchingProjects.forEach(function (project) {
             project.appendToRoot(item);
         });
@@ -252,14 +278,14 @@ jsprojManager.prototype = {
         });
 
         this._getMatchingProjects(targetConditions).forEach(function (project) {
-            project.removeReferenceElementItemGroup('ItemGroup/ProjectReference', inserted_path, targetConditions);
+            project.removeItemGroupElement('ItemGroup/ProjectReference', inserted_path, targetConditions);
         });
     },
 
     _getMatchingProjects: function (targetConditions) {
         // If specified, target can be 'all' (default), 'phone' or 'windows'. Ultimately should probably allow a comma
         // separated list, but not needed now.
-        var target = getTarget(targetConditions);
+        var target = getDeviceTarget(targetConditions);
         var versions = getVersions(targetConditions);
 
         if (target || versions) {
@@ -336,7 +362,7 @@ function getProjectTypeGuid(projectPath) {
     return null;
 }
 
-function createReferenceElement(path, incText, targetConditions, children) {
+function createItemGroupElement(path, incText, targetConditions, children) {
     path = path.split('/');
     path.reverse();
 
@@ -365,7 +391,7 @@ function createReferenceElement(path, incText, targetConditions, children) {
     return lastElement;
 }
 
-function getTarget(targetConditions) {
+function getDeviceTarget(targetConditions) {
     var target = targetConditions.deviceTarget;
     if (target) {
         target = target.toLowerCase().trim();
@@ -375,7 +401,7 @@ function getTarget(targetConditions) {
             // Allow "win" as alternative to "windows"
             target = "windows";
         } else if (target !== 'phone' && target !== 'windows') {
-            throw new Error('Invalid lib-file target attribute (must be "all", "phone", "windows" or "win"): ' + target);
+            throw new Error('Invalid device-target attribute (must be "all", "phone", "windows" or "win"): ' + target);
         }
     }
     return target;
@@ -384,7 +410,7 @@ function getTarget(targetConditions) {
 function getVersions(targetConditions) {
     var versions = targetConditions.versions;
     if (versions && !semver.validRange(versions, /* loose */ true)) {
-        throw new Error('Invalid lib-file versions attribute (must be a valid a valid node semantic version range): ' + versions);
+        throw new Error('Invalid versions attribute (must be a valid semantic version range): ' + versions);
     }
     return versions;
 }
@@ -411,7 +437,7 @@ proj.prototype = {
         this.xml.getroot().append(element);
     },
 
-    removeReferenceElementItemGroup: function (path, incText, targetConditions) {
+    removeItemGroupElement: function (path, incText, targetConditions) {
         var xpath = path + '[@Include="' + incText + '"]';
         var condition = createConditionAttrib(targetConditions);
         if (condition) {
@@ -554,7 +580,7 @@ function createConditionAttrib(targetConditions) {
             // Specifcally allow "arm" as alternative to "ARM"
             arch = "ARM";
         } else if (arch !== "x86" && arch !== "x64" && arch !== "ARM") {
-            throw new Error('Invalid lib-file arch attribute (must be "x86", "x64" or "ARM"): ' + arch);
+            throw new Error('Invalid arch attribute (must be "x86", "x64" or "ARM"): ' + arch);
         }
         return "'$(Platform)'=='" + arch + "'";
     }


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