From 7ed3c997af55d818354f5b5c38453b7d76ec4aa7 Mon Sep 17 00:00:00 2001 From: daserge Date: Mon, 31 Oct 2016 15:31:43 +0300 Subject: [PATCH] CB-12071 Fix for CB-11825 breaks usage of InProcessServer in Cordova Windows The real issue in CB-11825 was in a wrong plugin configuration - resource-file.target (Content.Link) should use backslashes (reverted from commit 1417b932c836c0fe21cca902e5098fa12e98fe82) --- spec/unit/pluginHandler/windows.spec.js | 10 +++++----- template/cordova/lib/JsprojManager.js | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/spec/unit/pluginHandler/windows.spec.js b/spec/unit/pluginHandler/windows.spec.js index ae2cd56a..161f6f55 100644 --- a/spec/unit/pluginHandler/windows.spec.js +++ b/spec/unit/pluginHandler/windows.spec.js @@ -216,16 +216,16 @@ describe('windows project handler', function () { // project files, which is not needed. it('should write to correct project files when conditions are specified', function () { - var xpath = 'None[@Include="' + computeResourcePath(resourceFiles[0]) + '"][@Condition="\'$(Platform)\'==\'x86\'"]'; + var xpath = 'Content[@Include="' + computeResourcePath(resourceFiles[0]) + '"][@Condition="\'$(Platform)\'==\'x86\'"]'; validateInstalledProjects('resource-file', resourceFiles[0], xpath, ['all']); - xpath = 'None[@Include="' + computeResourcePath(resourceFiles[1]) + '"]'; + xpath = 'Content[@Include="' + computeResourcePath(resourceFiles[1]) + '"]'; validateInstalledProjects('resource-file', resourceFiles[1], xpath, ['windows', 'phone', 'windows10']); - xpath = 'None[@Include="' + computeResourcePath(resourceFiles[2]) + '"]'; + xpath = 'Content[@Include="' + computeResourcePath(resourceFiles[2]) + '"]'; validateInstalledProjects('resource-file', resourceFiles[2], xpath, ['phone']); - xpath = 'None[@Include="' + computeResourcePath(resourceFiles[3]) + '"][@Condition="\'$(Platform)\'==\'x64\'"]'; + xpath = 'Content[@Include="' + computeResourcePath(resourceFiles[3]) + '"][@Condition="\'$(Platform)\'==\'x64\'"]'; validateInstalledProjects('resource-file', resourceFiles[3], xpath, ['windows8']); }); @@ -454,7 +454,7 @@ describe('windows project handler', function () { resourcefiles.forEach(function(resourceFile) { install(resourceFile, dummyPluginInfo, dummyProject); }); - var path = 'ItemGroup/None'; + var path = 'ItemGroup/Content'; var incText = computeResourcePath(resourcefiles[0]); var targetConditions = {versions: undefined, deviceTarget: undefined, arch: 'x86'}; validateUninstalledProjects('resource-file', resourcefiles[0], path, incText, targetConditions, ['all']); diff --git a/template/cordova/lib/JsprojManager.js b/template/cordova/lib/JsprojManager.js index 3bd7ac6e..21ee8084 100644 --- a/template/cordova/lib/JsprojManager.js +++ b/template/cordova/lib/JsprojManager.js @@ -121,7 +121,7 @@ jsprojManager.prototype = { copyToOutputDirectory.text = 'Always'; children.push(copyToOutputDirectory); - var item = createItemGroupElement('ItemGroup/None', sourcePath, targetConditions, children); + var item = createItemGroupElement('ItemGroup/Content', sourcePath, targetConditions, children); this._getMatchingProjects(targetConditions).forEach(function (project) { project.appendToRoot(item); }); @@ -130,7 +130,7 @@ jsprojManager.prototype = { removeResourceFileFromProject: function (relPath, targetConditions) { events.emit('verbose', 'jsprojManager.removeResourceFile(relPath: ' + relPath + ', targetConditions: ' + JSON.stringify(targetConditions) + ')'); this._getMatchingProjects(targetConditions).forEach(function (project) { - project.removeItemGroupElement('ItemGroup/None', relPath, targetConditions); + project.removeItemGroupElement('ItemGroup/Content', relPath, targetConditions); }); },