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 2016/03/05 09:19:54 UTC
[1/2] cordova-windows git commit: CB-10730 Move plugin handlers tests
for into platform's repo
Repository: cordova-windows
Updated Branches:
refs/heads/master 49812d448 -> 60cca717a
http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/60cca717/spec/unit/pluginHandler/windows.spec.js
----------------------------------------------------------------------
diff --git a/spec/unit/pluginHandler/windows.spec.js b/spec/unit/pluginHandler/windows.spec.js
new file mode 100644
index 0000000..cf9d956
--- /dev/null
+++ b/spec/unit/pluginHandler/windows.spec.js
@@ -0,0 +1,510 @@
+/**
+ 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 fs = require('fs');
+var os = require('os');
+var et = require('elementtree');
+var path = require('path');
+var shell = require('shelljs');
+var rewire = require('rewire');
+
+var PluginHandler = rewire('../../../template/cordova/lib/PluginHandler');
+var JsprojManager = require('../../../template/cordova/lib/JsprojManager');
+var cordovaProjectDir = path.join(os.tmpdir(), 'plugman');
+
+var cordovaProjectWindowsPlatformDir = path.join(cordovaProjectDir, 'platforms', 'windows');
+var cordovaProjectPluginsDir = path.join(cordovaProjectDir, 'plugins');
+var PluginInfo = require('cordova-common').PluginInfo;
+
+var dummyplugin = path.join(__dirname, '../fixtures/org.test.plugins.dummyplugin');
+var dummyPluginInfo = new PluginInfo(dummyplugin);
+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 faultyplugin = path.join(__dirname, '../fixtures/org.test.plugins.faultyplugin');
+var faultyPluginInfo = new PluginInfo(faultyplugin);
+var invalid_source = faultyPluginInfo.getSourceFiles('windows');
+var invalid_resourceFiles = faultyPluginInfo.getResourceFiles('windows');
+var invalid_libfiles = faultyPluginInfo.getLibFiles('windows');
+
+function copyArray(arr) {
+ return Array.prototype.slice.call(arr, 0);
+}
+
+function winJoin() {
+ // use Node API when possible
+ if (path.win32) return path.win32.join.apply(path, arguments);
+ return copyArray(arguments).join('\\').replace(/\//g, '\\');
+}
+
+beforeEach(function () {
+ this.addMatchers({
+ toContainXmlPath: function (xpath) {
+ var xml = this.actual;
+ var notText = this.isNot ? 'not ' : '';
+ this.message = function () {
+ return 'Expected xml \'' + et.tostring(xml) + '\' ' + notText + 'to contain elements matching \'' + xpath + '\'.';
+ };
+
+ return xml.find(xpath) !== null;
+ } });
+});
+
+var getPluginFilePath = PluginHandler.__get__('getPluginFilePath');
+var computeResourcePath = function(resourceFile) {
+ return getPluginFilePath(dummyPluginInfo, resourceFile.src, cordovaProjectWindowsPlatformDir);
+};
+
+var PLATFORM_PROJECTS = {
+ all: 'CordovaApp.projitems',
+ phone: 'CordovaApp.Phone.jsproj',
+ windows: 'CordovaApp.Windows.jsproj',
+ windows8: 'CordovaApp.Windows80.jsproj',
+ windows10: 'CordovaApp.Windows10.jsproj'
+};
+
+describe('windows project handler', function () {
+ var dummyProject;
+ beforeEach(function () {
+ shell.mkdir('-p', cordovaProjectWindowsPlatformDir);
+ shell.cp('-rf', path.join(__dirname, '../fixtures/DummyProject/*'), cordovaProjectWindowsPlatformDir);
+ dummyProject = JsprojManager.getProject(cordovaProjectWindowsPlatformDir);
+ shell.mkdir('-p', cordovaProjectPluginsDir);
+ });
+
+ afterEach(function () {
+ shell.rm('-rf', cordovaProjectDir);
+ });
+
+ describe('installation', function () {
+ var copyFileOrig = PluginHandler.__get__('copyFile');
+ var copyFileSpy = jasmine.createSpy('copyFile');
+
+ beforeEach(function () {
+ PluginHandler.__set__('copyFile', copyFileSpy.andCallFake(copyFileOrig));
+ });
+
+ afterEach(function() {
+ PluginHandler.__set__('copyFile', copyFileOrig);
+ });
+
+ function validateInstalledProjects(tag, elementToInstall, xpath, supportedPlatforms) {
+ jasmine.getEnv().currentSpec.removeAllSpies();
+
+ var projects = copyArray(dummyProject.projects);
+ projects.push(dummyProject.master);
+
+ // Check that installed framework reference is properly added to project.
+ var checkInstalledFrameworkReference = function (tag, elementToInstall, xml) {
+ var frameworkCustomPathElement = xml.find(xpath);
+ expect(frameworkCustomPathElement).not.toBe(null);
+ var frameworkCustomPath = frameworkCustomPathElement.text;
+ expect(frameworkCustomPath).not.toBe(null);
+ var targetDir = elementToInstall.targetDir || '';
+ var frameworkCustomExpectedPath = path.join('plugins', dummyPluginInfo.id, targetDir,
+ path.basename(elementToInstall.src));
+ expect(frameworkCustomPath).toEqual(frameworkCustomExpectedPath);
+ };
+
+ // Check that framework file was copied to correct path
+ var checkInstalledFrameworkPath = function (framework) {
+ var targetDir = framework.targetDir || '';
+ var dest = path.join(cordovaProjectWindowsPlatformDir, 'plugins', dummyPluginInfo.id, targetDir, path.basename(framework.src));
+ var copiedSuccessfully = fs.existsSync(path.resolve(dest));
+ expect(copiedSuccessfully).toBe(true);
+ };
+
+ var appendToRootFake = function (itemGroup) {
+ // 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;
+ }
+
+ expect(itemGroup).toContainXmlPath(xpath);
+ };
+
+ var projectsAddedToSpies = [];
+ var projectsNotAddedToSpies = [];
+
+ var projectsAddedTo = [];
+ supportedPlatforms.forEach(function (platform) {
+ var platformProject = PLATFORM_PROJECTS[platform];
+ if (platformProject) {
+ projectsAddedTo.push(PLATFORM_PROJECTS[platform]);
+ }
+ });
+
+ projects.forEach(function (project) {
+ if (projectsAddedTo.indexOf(path.basename(project.location)) > -1) {
+ projectsAddedToSpies.push(spyOn(project, 'appendToRoot').andCallFake(appendToRootFake));
+ } else {
+ projectsNotAddedToSpies.push(spyOn(project, 'appendToRoot'));
+ }
+ });
+
+ PluginHandler.getInstaller(tag)(elementToInstall, dummyPluginInfo, dummyProject);
+
+ projectsAddedToSpies.forEach(function (spy) {
+ expect(spy).toHaveBeenCalled();
+ });
+
+ projectsNotAddedToSpies.forEach(function (spy) {
+ expect(spy).not.toHaveBeenCalled();
+ });
+ }
+
+ describe('of <source-file> elements', function () {
+
+ var install = PluginHandler.getInstaller('source-file');
+
+ it('should copy stuff from one location to another by calling common.copyFile', function () {
+ var source = copyArray(valid_source);
+ install(source[0], dummyPluginInfo, dummyProject);
+ expect(copyFileSpy).toHaveBeenCalledWith(dummyplugin, 'src/windows/dummer.js', cordovaProjectWindowsPlatformDir, path.join('plugins', 'org.test.plugins.dummyplugin', 'dummer.js'), false);
+ });
+ it('should throw if source-file src cannot be found', function () {
+ var source = copyArray(invalid_source);
+ copyFileSpy.andCallFake(copyFileOrig);
+ expect(function () {
+ install(source[1], faultyPluginInfo, dummyProject);
+ }).toThrow('"' + path.resolve(faultyplugin, 'src/windows/NotHere.js') + '" not found!');
+ });
+ it('should throw if source-file target already exists', function () {
+ var source = copyArray(valid_source);
+ var target = path.join(cordovaProjectWindowsPlatformDir, 'plugins', dummyPluginInfo.id, 'dummer.js');
+ shell.mkdir('-p', path.dirname(target));
+ fs.writeFileSync(target, 'some bs', 'utf-8');
+ expect(function () {
+ install(source[0], dummyPluginInfo, dummyProject);
+ }).toThrow('"' + target + '" already exists!');
+ });
+ });
+
+ describe('of <resource-file> elements', function () {
+ var resourceFiles = copyArray(valid_resourceFiles);
+ var invalidResourceFiles = copyArray(invalid_resourceFiles);
+ var install = PluginHandler.getInstaller('resource-file');
+
+ // 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="' + computeResourcePath(resourceFiles[0]) + '"][@Condition="\'$(Platform)\'==\'x86\'"]';
+ validateInstalledProjects('resource-file', resourceFiles[0], xpath, ['all']);
+
+ xpath = 'Content[@Include="' + computeResourcePath(resourceFiles[1]) + '"]';
+ validateInstalledProjects('resource-file', resourceFiles[1], xpath, ['windows', 'phone', 'windows10']);
+
+ xpath = 'Content[@Include="' + computeResourcePath(resourceFiles[2]) + '"]';
+ validateInstalledProjects('resource-file', resourceFiles[2], xpath, ['phone']);
+
+ xpath = 'Content[@Include="' + computeResourcePath(resourceFiles[3]) + '"][@Condition="\'$(Platform)\'==\'x64\'"]';
+ validateInstalledProjects('resource-file', resourceFiles[3], xpath, ['windows8']);
+ });
+
+ it('should throw if conditions are invalid', function () {
+ expect(function () {
+ install(invalidResourceFiles[0], faultyPluginInfo, dummyProject);
+ }).toThrow('Invalid arch attribute (must be "x86", "x64" or "ARM"): x85');
+
+ expect(function () {
+ install(invalidResourceFiles[1], faultyPluginInfo, dummyProject);
+ }).toThrow('Invalid versions attribute (must be a valid semantic version range): 8.0a');
+
+ expect(function () {
+ install(invalidResourceFiles[2], faultyPluginInfo, dummyProject);
+ }).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);
+ var install = PluginHandler.getInstaller('lib-file');
+
+ // 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 = 'SDKReference[@Include="TestSDK1, Version=1.0"][@Condition="\'$(Platform)\'==\'x86\'"]';
+ validateInstalledProjects('lib-file', libfiles[0], xpath, ['all']);
+
+ xpath = 'SDKReference[@Include="TestSDK2, Version=1.0"]';
+ validateInstalledProjects('lib-file', libfiles[1], xpath, ['windows', 'phone', 'windows10']);
+
+ xpath = 'SDKReference[@Include="TestSDK3, Version=1.0"]';
+ validateInstalledProjects('lib-file', libfiles[2], xpath, ['phone']);
+
+ xpath = 'SDKReference[@Include="TestSDK4, Version=1.0"]';
+ validateInstalledProjects('lib-file', libfiles[3], xpath, ['windows8']);
+ });
+
+ it('should throw if conditions are invalid', function () {
+ expect(function () {
+ install(invalidLibFiles[0], faultyPluginInfo, dummyProject);
+ }).toThrow('Invalid arch attribute (must be "x86", "x64" or "ARM"): x85');
+
+ expect(function () {
+ install(invalidLibFiles[1], faultyPluginInfo, dummyProject);
+ }).toThrow('Invalid versions attribute (must be a valid semantic version range): 8.0a');
+
+ expect(function () {
+ install(invalidLibFiles[2], faultyPluginInfo, dummyProject);
+ }).toThrow('Invalid device-target attribute (must be "all", "phone", "windows" or "win"): daphne');
+ });
+ });
+
+ describe('of <framework> elements', function () {
+ var frameworks = copyArray(valid_frameworks);
+
+ // 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 = 'Reference[@Include="dummy1"][@Condition="\'$(Platform)\'==\'x64\'"]/HintPath';
+ validateInstalledProjects('framework', frameworks[0], xpath, ['all']);
+
+ xpath = 'Reference[@Include="dummy2"]/HintPath';
+ validateInstalledProjects('framework', frameworks[1], xpath, ['all']);
+
+ xpath = 'Reference[@Include="dummy3"]/HintPath';
+ validateInstalledProjects('framework', frameworks[2], xpath, ['windows', 'windows8', 'windows10']);
+
+ xpath = 'Reference[@Include="dummy4"][@Condition="\'$(Platform)\'==\'ARM\'"]/HintPath';
+ validateInstalledProjects('framework', frameworks[3], xpath, ['phone']);
+
+ xpath = 'Reference[@Include="dummy5"]/HintPath';
+ validateInstalledProjects('framework', frameworks[4], xpath, ['phone']);
+
+ xpath = 'Reference[@Include="dummy6"]/HintPath';
+ validateInstalledProjects('framework', frameworks[5], xpath, ['windows', 'windows10', 'phone']);
+ });
+ });
+
+ describe('of <framework> elements of type \'projectReference\'', function () {
+ var frameworks = copyArray(valid_frameworks);
+
+ it('should write to correct project files when conditions are specified', function () {
+ var xpath = 'ProjectReference[@Include="' + winJoin(dummyplugin, 'src', 'windows', 'dummy1.vcxproj') + '"][@Condition="\'$(Platform)\'==\'x64\'"]';
+ validateInstalledProjects('framework', frameworks[6], xpath, ['all']);
+
+ xpath = 'ProjectReference[@Include="' + winJoin(dummyplugin, 'src', 'windows', 'dummy2.vcxproj') + '"]';
+ validateInstalledProjects('framework', frameworks[7], xpath, ['windows8']);
+
+ xpath = 'ProjectReference[@Include="' + winJoin(dummyplugin, 'src', 'windows', 'dummy3.vcxproj') + '"]';
+ validateInstalledProjects('framework', frameworks[8], xpath, ['windows', 'windows8', 'windows10']);
+
+ xpath = 'ProjectReference[@Include="' + winJoin(dummyplugin, 'src', 'windows', 'dummy4.vcxproj') + '"][@Condition="\'$(Platform)\'==\'x86\'"]';
+ validateInstalledProjects('framework', frameworks[9], xpath, ['windows', 'phone']);
+ });
+ });
+ });
+
+ describe('uninstallation', function () {
+ var removeFileOrig = PluginHandler.__get__('removeFile');
+ var removeFileSpy = jasmine.createSpy('removeFile');
+
+ beforeEach(function () {
+ PluginHandler.__set__('removeFile', removeFileSpy.andCallFake(removeFileOrig));
+ });
+
+ afterEach(function () {
+ PluginHandler.__set__('removeFile', removeFileOrig);
+ });
+
+ function validateUninstalledProjects(tag, elementToUninstall, xmlPath, incText, targetConditions, supportedPlatforms) {
+ jasmine.getEnv().currentSpec.removeAllSpies();
+
+ var projects = copyArray(dummyProject.projects);
+ projects.push(dummyProject.master);
+
+ var projectsAddedToSpies = [];
+ var projectsNotAddedToSpies = [];
+
+ var projectsAddedTo = [];
+ supportedPlatforms.forEach(function (platform) {
+ var platformProject = PLATFORM_PROJECTS[platform];
+ if (platformProject) {
+ projectsAddedTo.push(PLATFORM_PROJECTS[platform]);
+ }
+ });
+
+ projects.forEach(function (project) {
+ var spy = spyOn(project, 'removeItemGroupElement');
+ if (projectsAddedTo.indexOf(path.basename(project.location)) > -1) {
+ projectsAddedToSpies.push(spy);
+ } else {
+ projectsNotAddedToSpies.push(spy);
+ }
+ });
+
+ PluginHandler.getUninstaller(tag)(elementToUninstall, dummyPluginInfo, dummyProject);
+
+ projectsAddedToSpies.forEach(function (spy) {
+ expect(spy).toHaveBeenCalledWith(xmlPath, incText, targetConditions);
+ });
+
+ projectsNotAddedToSpies.forEach(function (spy) {
+ expect(spy).not.toHaveBeenCalled();
+ });
+ }
+
+ describe('of <source-file> elements', function () {
+ var install = PluginHandler.getInstaller('source-file');
+ var uninstall = PluginHandler.getUninstaller('source-file');
+
+ it('should remove stuff by calling common.removeFile', function () {
+ var source = copyArray(valid_source);
+ install(source[0], dummyPluginInfo, dummyProject);
+ uninstall(source[0], dummyPluginInfo, dummyProject);
+ expect(removeFileSpy).toHaveBeenCalledWith(cordovaProjectWindowsPlatformDir, path.join('plugins', 'org.test.plugins.dummyplugin', 'dummer.js'));
+ });
+ });
+
+ 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.
+ var install = PluginHandler.getInstaller('resource-file');
+
+ it('should remove from correct project files when conditions specified', function () {
+ var resourcefiles = copyArray(valid_resourceFiles);
+
+ resourcefiles.forEach(function(resourceFile) {
+ install(resourceFile, dummyPluginInfo, dummyProject);
+ });
+
+ 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']);
+
+ incText = computeResourcePath(resourcefiles[1]);
+ targetConditions = {versions: '>=8.1', deviceTarget: undefined, arch: undefined};
+ validateUninstalledProjects('resource-file', resourcefiles[1], path, incText, targetConditions, ['windows', 'phone', 'windows10']);
+
+ incText = computeResourcePath(resourcefiles[2]);
+ targetConditions = {versions: undefined, deviceTarget: 'phone', arch: undefined};
+ validateUninstalledProjects('resource-file', resourcefiles[2], path, incText, targetConditions, ['phone']);
+
+ incText = computeResourcePath(resourcefiles[3]);
+ targetConditions = {versions: '8.0', deviceTarget: 'windows', arch: 'x64'};
+ validateUninstalledProjects('resource-file', resourcefiles[3], path, incText, targetConditions, ['windows8']);
+ });
+ });
+
+ 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.
+ it('should remove from correct project files when conditions specified', function () {
+ var libfiles = copyArray(valid_libfiles);
+
+ libfiles.forEach(function(libfile) {
+ PluginHandler.getInstaller('lib-file')(libfile, dummyPluginInfo, dummyProject);
+ });
+
+ var path = 'ItemGroup/SDKReference';
+ var incText = 'TestSDK1, Version=1.0';
+ var targetConditions = {versions: undefined, deviceTarget: undefined, arch: 'x86'};
+ validateUninstalledProjects('lib-file', libfiles[0], path, incText, targetConditions, ['all']);
+
+ incText = 'TestSDK2, Version=1.0';
+ targetConditions = {versions: '>=8.1', deviceTarget: undefined, arch: undefined};
+ validateUninstalledProjects('lib-file', libfiles[1], path, incText, targetConditions, ['windows', 'phone', 'windows10']);
+
+ incText = 'TestSDK3, Version=1.0';
+ targetConditions = {versions: undefined, deviceTarget: 'phone', arch: undefined};
+ validateUninstalledProjects('lib-file', libfiles[2], path, incText, targetConditions, ['phone']);
+
+ incText = 'TestSDK4, Version=1.0';
+ targetConditions = {versions: '8.0', deviceTarget: 'windows', arch: 'x86'};
+ validateUninstalledProjects('lib-file', libfiles[3], path, incText, targetConditions, ['windows8']);
+ });
+ });
+
+ describe('of <framework> 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 () {
+ var frameworks = copyArray(valid_frameworks);
+
+ frameworks.forEach(function(framework) {
+ PluginHandler.getInstaller('framework')(framework, dummyPluginInfo, dummyProject);
+ });
+
+ var path = 'ItemGroup/Reference';
+ var incText = 'dummy1';
+ var targetConditions = {versions: undefined, deviceTarget: undefined, arch: 'x64'};
+ validateUninstalledProjects('framework', frameworks[0], path, incText, targetConditions, ['all']);
+
+ incText = 'dummy2';
+ targetConditions = {versions: '>=8.0', deviceTarget: undefined, arch: undefined};
+ validateUninstalledProjects('framework', frameworks[1], path, incText, targetConditions, ['all']);
+
+ incText = 'dummy3';
+ targetConditions = {versions: undefined, deviceTarget: 'windows', arch: undefined};
+ validateUninstalledProjects('framework', frameworks[2], path, incText, targetConditions, ['windows', 'windows8', 'windows10']);
+
+ incText = 'dummy4';
+ targetConditions = {versions: '8.1', deviceTarget: 'phone', arch: 'ARM'};
+ validateUninstalledProjects('framework', frameworks[3], path, incText, targetConditions, ['phone']);
+
+ incText = 'dummy5';
+ targetConditions = {versions: undefined, deviceTarget: 'phone', arch: undefined};
+ validateUninstalledProjects('framework', frameworks[4], path, incText, targetConditions, ['phone']);
+
+ incText = 'dummy6';
+ targetConditions = {versions: '>=8.1', deviceTarget: undefined, arch: undefined};
+ validateUninstalledProjects('framework', frameworks[5], path, incText, targetConditions, ['windows', 'windows10', 'phone']);
+ });
+ });
+
+ describe('of <framework> elements of type \'projectReference\'', 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 () {
+ var frameworks = copyArray(valid_frameworks);
+
+ frameworks.forEach(function(framework) {
+ PluginHandler.getInstaller('framework')(framework, dummyPluginInfo, dummyProject);
+ });
+
+ var xmlPath = 'ItemGroup/ProjectReference';
+ var incText = winJoin(dummyPluginInfo.dir, frameworks[6].src);
+ var targetConditions = {versions: undefined, deviceTarget: undefined, arch: 'x64'};
+ validateUninstalledProjects('framework', frameworks[6], xmlPath, incText, targetConditions, ['all']);
+
+ incText = winJoin(dummyPluginInfo.dir, frameworks[7].src);
+ targetConditions = {versions: '<8.1', deviceTarget: undefined, arch: undefined};
+ validateUninstalledProjects('framework', frameworks[7], xmlPath, incText, targetConditions, ['windows8']);
+
+ incText = winJoin(dummyPluginInfo.dir, frameworks[8].src);
+ targetConditions = {versions: undefined, deviceTarget: 'win', arch: undefined};
+ validateUninstalledProjects('framework', frameworks[8], xmlPath, incText, targetConditions, ['windows', 'windows8', 'windows10']);
+
+ incText = winJoin(dummyPluginInfo.dir, frameworks[9].src);
+ targetConditions = {versions: '8.1', deviceTarget: 'all', arch: 'x86'};
+ validateUninstalledProjects('framework', frameworks[9], xmlPath, incText, targetConditions, ['windows', 'phone']);
+ });
+ });
+ });
+});
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org
[2/2] cordova-windows git commit: CB-10730 Move plugin handlers tests
for into platform's repo
Posted by an...@apache.org.
CB-10730 Move plugin handlers tests for into platform's repo
This closes #155
Project: http://git-wip-us.apache.org/repos/asf/cordova-windows/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-windows/commit/60cca717
Tree: http://git-wip-us.apache.org/repos/asf/cordova-windows/tree/60cca717
Diff: http://git-wip-us.apache.org/repos/asf/cordova-windows/diff/60cca717
Branch: refs/heads/master
Commit: 60cca717a5ea8c0c8ababadd32258728a7880aac
Parents: 49812d4
Author: Vladimir Kotikov <ko...@gmail.com>
Authored: Mon Feb 29 17:37:37 2016 +0300
Committer: Vladimir Kotikov <ko...@gmail.com>
Committed: Sat Mar 5 11:18:42 2016 +0300
----------------------------------------------------------------------
.jshintignore | 1 +
package.json | 100 ++--
spec/unit/JsprojManager.spec.js | 13 +-
...ovaApp.Phone_0.0.1.0_AnyCPU_debug.appxbundle | 1 +
...CordovaApp.Windows_0.0.1.0_anycpu_debug.appx | 1 +
.../DummyProject/CordovaApp.Phone.jsproj | 99 ++++
.../DummyProject/CordovaApp.Windows.jsproj | 99 ++++
.../DummyProject/CordovaApp.Windows10.jsproj | 61 +++
.../DummyProject/CordovaApp.Windows80.jsproj | 93 ++++
.../fixtures/DummyProject/CordovaApp.projitems | 32 ++
.../fixtures/DummyProject/CordovaApp.shproj | 30 ++
spec/unit/fixtures/DummyProject/CordovaApp.sln | 106 ++++
.../fixtures/DummyProject/CordovaApp.vs2012.sln | 64 +++
.../DummyProject/CordovaApp_TemporaryKey.pfx | Bin 0 -> 2544 bytes
spec/unit/fixtures/DummyProject/VERSION | 1 +
spec/unit/fixtures/DummyProject/config.xml | 14 +
.../DummyProject/package.phone.appxmanifest | 57 +++
.../DummyProject/package.windows.appxmanifest | 58 +++
.../DummyProject/package.windows80.appxmanifest | 50 ++
...ovaApp.Phone_0.0.1.0_AnyCPU_debug.appxbundle | 1 -
...CordovaApp.Windows_0.0.1.0_anycpu_debug.appx | 1 -
.../org.test.plugins.dummyplugin/plugin.xml | 79 +++
.../src/windows/dummer.js | 1 +
.../src/windows/dummy1.dll | 0
.../src/windows/dummy1.vcxproj | 7 +
.../src/windows/dummy2.dll | 0
.../src/windows/dummy2.vcxproj | 7 +
.../src/windows/dummy3.dll | 0
.../src/windows/dummy3.vcxproj | 7 +
.../src/windows/dummy4.dll | 0
.../src/windows/dummy4.vcxproj | 7 +
.../src/windows/dummy5.dll | 0
.../src/windows/dummy6.dll | 0
.../src/windows/text_sample1.txt | 0
.../src/windows/text_sample2.txt | 0
.../src/windows/text_sample3.txt | 0
.../src/windows/text_sample4.txt | 0
.../www/dummyplugin.js | 1 +
.../www/dummyplugin/image.jpg | 1 +
.../org.test.plugins.faultyplugin/plugin.xml | 58 +++
.../src/windows/faultyPlugin.js | 1 +
.../src/windows/text_sample1.txt | 0
.../src/windows/text_sample2.txt | 0
.../src/windows/text_sample3.txt | 0
spec/unit/package.spec.js | 2 +-
spec/unit/pluginHandler/common.spec.js | 163 ++++++
spec/unit/pluginHandler/windows.spec.js | 510 +++++++++++++++++++
47 files changed, 1670 insertions(+), 56 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/60cca717/.jshintignore
----------------------------------------------------------------------
diff --git a/.jshintignore b/.jshintignore
index 7e102e2..451e6d3 100644
--- a/.jshintignore
+++ b/.jshintignore
@@ -1,2 +1,3 @@
template/www/*
template/WinJS/*
+spec/unit/fixtures/*
http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/60cca717/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 5b113a0..80a3589 100644
--- a/package.json
+++ b/package.json
@@ -1,51 +1,51 @@
{
- "name": "cordova-windows",
- "version": "4.4.0-dev",
- "description": "cordova-windows release",
- "bin": "bin/create",
- "main": "template/cordova/Api.js",
- "repository": {
- "type": "git",
- "url": "https://github.com/apache/cordova-windows"
- },
- "keywords": [
- "windows",
- "cordova",
- "apache"
- ],
- "scripts": {
- "test": "npm run jshint && npm run test-unit && npm run test-e2e",
- "test-unit": "jasmine-node --captureExceptions spec/unit",
- "test-e2e": "jasmine-node --captureExceptions spec/e2e",
- "cover": "istanbul cover --root template --print detail node_modules/jasmine-node/bin/jasmine-node -- spec/unit",
- "jshint": "jshint bin && jshint template && jshint spec"
- },
- "dependencies": {
- "cordova-common": "^1.0.0",
- "elementtree": "^0.1.6",
- "node-uuid": "^1.4.3",
- "nopt": "^3.0.4",
- "q": "^1.4.1",
- "semver": "^5.0.3",
- "shelljs": "^0.5.3",
- "winjs": "^4.4.0"
- },
- "devDependencies": {
- "istanbul": "^0.4.0",
- "jasmine-node": "1.14.5",
- "jshint": "^2.8.0",
- "rewire": "^2.1.3"
- },
- "bundledDependencies": [
- "cordova-common",
- "elementtree",
- "node-uuid",
- "nopt",
- "q",
- "semver",
- "shelljs",
- "winjs"
- ],
- "author": "Apache Software Foundation",
- "license": "Apache-2.0"
-}
\ No newline at end of file
+ "name": "cordova-windows",
+ "version": "4.4.0-dev",
+ "description": "cordova-windows release",
+ "bin": "bin/create",
+ "main": "template/cordova/Api.js",
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/apache/cordova-windows"
+ },
+ "keywords": [
+ "windows",
+ "cordova",
+ "apache"
+ ],
+ "scripts": {
+ "test": "npm run jshint && npm run test-unit && npm run test-e2e",
+ "test-unit": "jasmine-node --captureExceptions spec/unit",
+ "test-e2e": "jasmine-node --captureExceptions spec/e2e",
+ "cover": "istanbul cover --root template --print detail node_modules/jasmine-node/bin/jasmine-node -- spec/unit",
+ "jshint": "jshint bin && jshint template && jshint spec"
+ },
+ "dependencies": {
+ "cordova-common": "^1.0.0",
+ "elementtree": "^0.1.6",
+ "node-uuid": "^1.4.3",
+ "nopt": "^3.0.4",
+ "q": "^1.4.1",
+ "semver": "^5.0.3",
+ "shelljs": "^0.5.3",
+ "winjs": "^4.4.0"
+ },
+ "devDependencies": {
+ "istanbul": "^0.4.0",
+ "jasmine-node": "1.14.5",
+ "jshint": "^2.8.0",
+ "rewire": "^2.5.1"
+ },
+ "bundledDependencies": [
+ "cordova-common",
+ "elementtree",
+ "node-uuid",
+ "nopt",
+ "q",
+ "semver",
+ "shelljs",
+ "winjs"
+ ],
+ "author": "Apache Software Foundation",
+ "license": "Apache-2.0"
+}
http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/60cca717/spec/unit/JsprojManager.spec.js
----------------------------------------------------------------------
diff --git a/spec/unit/JsprojManager.spec.js b/spec/unit/JsprojManager.spec.js
index 0fc6c65..5e1834f 100644
--- a/spec/unit/JsprojManager.spec.js
+++ b/spec/unit/JsprojManager.spec.js
@@ -24,7 +24,8 @@ var xml = require('cordova-common').xmlHelpers;
var AppxManifest = require('../../template/cordova/lib/AppxManifest');
var JsprojManager = rewire('../../template/cordova/lib/JsprojManager');
-var PROJECT_PATH = 'spec/unit/fixtures/EmptyProject';
+var PROJECT_PATH = 'spec/unit/fixtures/DummyProject';
+var INVALID_PROJECT_PATH = 'spec/unit/fixtures/FakeProject';
var FAKE_MANIFEST = new et.ElementTree(et.XML(
'<?xml version="1.0" encoding="UTF-8"?>' +
'<Package>' +
@@ -42,7 +43,7 @@ describe('JsprojManager', function () {
JsprojManager.__set__('proj', jasmine.createSpy('proj'));
- spyOn(shell, 'ls').andReturn([PROJECT_PATH + '/EmptyProject.projitems']);
+ spyOn(shell, 'ls').andReturn([PROJECT_PATH + '/CordovaApp.projitems']);
spyOn(xml, 'parseElementtreeSync').andReturn(FAKE_MANIFEST);
spyOn(AppxManifest, 'get').andCallThrough();
@@ -53,6 +54,13 @@ describe('JsprojManager', function () {
JsprojManager.__set__('proj', origProj);
});
+ it('should throw if project is not a windows project', function () {
+ shell.ls.andCallThrough();
+ expect(function () {
+ JsprojManager.getProject(INVALID_PROJECT_PATH);
+ }).toThrow();
+ });
+
it('should use AppxManifest class to get package name', function () {
expect(project.getPackageName()).toBe('HelloCordova');
expect(AppxManifest.get).toHaveBeenCalled();
@@ -60,4 +68,3 @@ describe('JsprojManager', function () {
expect(AppxManifest.get.calls[0].args[1]).toBe(true);
});
});
-
http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/60cca717/spec/unit/fixtures/DummyProject/AppPackages/CordovaApp.Phone_0.0.1.0_debug_Test/CordovaApp.Phone_0.0.1.0_AnyCPU_debug.appxbundle
----------------------------------------------------------------------
diff --git a/spec/unit/fixtures/DummyProject/AppPackages/CordovaApp.Phone_0.0.1.0_debug_Test/CordovaApp.Phone_0.0.1.0_AnyCPU_debug.appxbundle b/spec/unit/fixtures/DummyProject/AppPackages/CordovaApp.Phone_0.0.1.0_debug_Test/CordovaApp.Phone_0.0.1.0_AnyCPU_debug.appxbundle
new file mode 100644
index 0000000..654e7f0
--- /dev/null
+++ b/spec/unit/fixtures/DummyProject/AppPackages/CordovaApp.Phone_0.0.1.0_debug_Test/CordovaApp.Phone_0.0.1.0_AnyCPU_debug.appxbundle
@@ -0,0 +1 @@
+(dummy package)
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/60cca717/spec/unit/fixtures/DummyProject/AppPackages/CordovaApp.Windows_0.0.1.0_anycpu_debug_Test/CordovaApp.Windows_0.0.1.0_anycpu_debug.appx
----------------------------------------------------------------------
diff --git a/spec/unit/fixtures/DummyProject/AppPackages/CordovaApp.Windows_0.0.1.0_anycpu_debug_Test/CordovaApp.Windows_0.0.1.0_anycpu_debug.appx b/spec/unit/fixtures/DummyProject/AppPackages/CordovaApp.Windows_0.0.1.0_anycpu_debug_Test/CordovaApp.Windows_0.0.1.0_anycpu_debug.appx
new file mode 100644
index 0000000..654e7f0
--- /dev/null
+++ b/spec/unit/fixtures/DummyProject/AppPackages/CordovaApp.Windows_0.0.1.0_anycpu_debug_Test/CordovaApp.Windows_0.0.1.0_anycpu_debug.appx
@@ -0,0 +1 @@
+(dummy package)
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/60cca717/spec/unit/fixtures/DummyProject/CordovaApp.Phone.jsproj
----------------------------------------------------------------------
diff --git a/spec/unit/fixtures/DummyProject/CordovaApp.Phone.jsproj b/spec/unit/fixtures/DummyProject/CordovaApp.Phone.jsproj
new file mode 100644
index 0000000..43e4fe2
--- /dev/null
+++ b/spec/unit/fixtures/DummyProject/CordovaApp.Phone.jsproj
@@ -0,0 +1,99 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ 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.
+-->
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <OutputPath>build\phone\$(Configuration)\$(Platform)\</OutputPath>
+ <IntermediateOutputPath>build\phone\bld\</IntermediateOutputPath>
+ </PropertyGroup>
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|AnyCPU">
+ <Configuration>Debug</Configuration>
+ <Platform>AnyCPU</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|ARM">
+ <Configuration>Debug</Configuration>
+ <Platform>ARM</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x86">
+ <Configuration>Debug</Configuration>
+ <Platform>x86</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|AnyCPU">
+ <Configuration>Release</Configuration>
+ <Platform>AnyCPU</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|ARM">
+ <Configuration>Release</Configuration>
+ <Platform>ARM</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x86">
+ <Configuration>Release</Configuration>
+ <Platform>x86</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>31b67a35-9503-4213-857e-f44eb42ae549</ProjectGuid>
+ </PropertyGroup>
+ <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+ <PropertyGroup Condition="'$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' < '12.0'">
+ <VisualStudioVersion>12.0</VisualStudioVersion>
+ </PropertyGroup>
+ <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\$(WMSJSProjectDirectory)\Microsoft.VisualStudio.$(WMSJSProject).Default.props" />
+ <PropertyGroup Label="Configuration">
+ <TargetPlatformIdentifier>WindowsPhoneApp</TargetPlatformIdentifier>
+ <TargetPlatformVersion>8.1</TargetPlatformVersion>
+ <RequiredPlatformVersion>8.1</RequiredPlatformVersion>
+ <MinimumVisualStudioVersion>12.0</MinimumVisualStudioVersion>
+ </PropertyGroup>
+ <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\$(WMSJSProjectDirectory)\Microsoft.VisualStudio.$(WMSJSProject).props" />
+ <PropertyGroup>
+ <DefaultLanguage>en-US</DefaultLanguage>
+ </PropertyGroup>
+ <ItemGroup>
+ <AppxManifest Include="package.phone.appxmanifest">
+ <SubType>Designer</SubType>
+ </AppxManifest>
+ <Content Include="images\*.png" Exclude="images\*.scale-180.*" />
+ </ItemGroup>
+ <ItemGroup>
+ <SDKReference Include="Microsoft.Phone.WinJS.2.1, Version=1.0" />
+ </ItemGroup>
+ <Import Project="CordovaApp.projitems" Label="Shared" />
+ <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\$(WMSJSProjectDirectory)\Microsoft.VisualStudio.$(WMSJSProject).targets" />
+ <!-- To modify your build process, add your task inside one of the targets below then uncomment
+ that target and the DisableFastUpToDateCheck PropertyGroup.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ <PropertyGroup>
+ <DisableFastUpToDateCheck>true</DisableFastUpToDateCheck>
+ </PropertyGroup>
+ -->
+</Project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/60cca717/spec/unit/fixtures/DummyProject/CordovaApp.Windows.jsproj
----------------------------------------------------------------------
diff --git a/spec/unit/fixtures/DummyProject/CordovaApp.Windows.jsproj b/spec/unit/fixtures/DummyProject/CordovaApp.Windows.jsproj
new file mode 100644
index 0000000..6905ba6
--- /dev/null
+++ b/spec/unit/fixtures/DummyProject/CordovaApp.Windows.jsproj
@@ -0,0 +1,99 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ 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.
+-->
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <OutputPath>build\windows\$(Configuration)\$(Platform)\</OutputPath>
+ <IntermediateOutputPath>build\windows\bld\</IntermediateOutputPath>
+ </PropertyGroup>
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|AnyCPU">
+ <Configuration>Debug</Configuration>
+ <Platform>AnyCPU</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|ARM">
+ <Configuration>Debug</Configuration>
+ <Platform>ARM</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x86">
+ <Configuration>Debug</Configuration>
+ <Platform>x86</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|AnyCPU">
+ <Configuration>Release</Configuration>
+ <Platform>AnyCPU</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|ARM">
+ <Configuration>Release</Configuration>
+ <Platform>ARM</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x86">
+ <Configuration>Release</Configuration>
+ <Platform>x86</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>58950fb6-2f93-4963-b9cd-637f83f3efbf</ProjectGuid>
+ </PropertyGroup>
+ <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+ <PropertyGroup Condition="'$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' < '12.0'">
+ <VisualStudioVersion>12.0</VisualStudioVersion>
+ </PropertyGroup>
+ <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\$(WMSJSProjectDirectory)\Microsoft.VisualStudio.$(WMSJSProject).Default.props" />
+ <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\$(WMSJSProjectDirectory)\Microsoft.VisualStudio.$(WMSJSProject).props" />
+ <PropertyGroup>
+ <TargetPlatformIdentifier>Windows</TargetPlatformIdentifier>
+ <TargetPlatformVersion>8.1</TargetPlatformVersion>
+ <RequiredPlatformVersion>8.1</RequiredPlatformVersion>
+ <MinimumVisualStudioVersion>12.0</MinimumVisualStudioVersion>
+ <DefaultLanguage>en-US</DefaultLanguage>
+ <PackageCertificateKeyFile>CordovaApp_TemporaryKey.pfx</PackageCertificateKeyFile>
+ </PropertyGroup>
+ <ItemGroup>
+ <AppxManifest Include="package.windows.appxmanifest">
+ <SubType>Designer</SubType>
+ </AppxManifest>
+ <Content Include="images\*.png" Exclude="images\*.scale-240.*" />
+ <None Include="CordovaApp_TemporaryKey.pfx" />
+ </ItemGroup>
+ <ItemGroup>
+ <SDKReference Include="Microsoft.WinJS.2.0, Version=1.0" />
+ </ItemGroup>
+ <Import Project="CordovaApp.projitems" Label="Shared" />
+ <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\$(WMSJSProjectDirectory)\Microsoft.VisualStudio.$(WMSJSProject).targets" />
+ <!-- To modify your build process, add your task inside one of the targets below then uncomment
+ that target and the DisableFastUpToDateCheck PropertyGroup.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ <PropertyGroup>
+ <DisableFastUpToDateCheck>true</DisableFastUpToDateCheck>
+ </PropertyGroup>
+ -->
+</Project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/60cca717/spec/unit/fixtures/DummyProject/CordovaApp.Windows10.jsproj
----------------------------------------------------------------------
diff --git a/spec/unit/fixtures/DummyProject/CordovaApp.Windows10.jsproj b/spec/unit/fixtures/DummyProject/CordovaApp.Windows10.jsproj
new file mode 100644
index 0000000..e4b9b06
--- /dev/null
+++ b/spec/unit/fixtures/DummyProject/CordovaApp.Windows10.jsproj
@@ -0,0 +1,61 @@
+<?xml version='1.0' encoding='utf-8'?>
+<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <OutputPath>build\windows\$(Configuration)\$(Platform)\</OutputPath>
+ <IntermediateOutputPath>build\windows\bld\</IntermediateOutputPath>
+ <AppxPackageSigningEnabled>true</AppxPackageSigningEnabled>
+ </PropertyGroup>
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|AnyCPU">
+ <Configuration>Debug</Configuration>
+ <Platform>AnyCPU</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|ARM">
+ <Configuration>Debug</Configuration>
+ <Platform>ARM</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x86">
+ <Configuration>Debug</Configuration>
+ <Platform>x86</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|AnyCPU">
+ <Configuration>Release</Configuration>
+ <Platform>AnyCPU</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|ARM">
+ <Configuration>Release</Configuration>
+ <Platform>ARM</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x86">
+ <Configuration>Release</Configuration>
+ <Platform>x86</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>f9b0ae20-c91c-42b9-9c6e-d3bc28b4509e</ProjectGuid>
+ </PropertyGroup>
+ <Import Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" />
+ <PropertyGroup Condition="'$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' < '14.0'">
+ <VisualStudioVersion>14.0</VisualStudioVersion>
+ </PropertyGroup>
+ <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\$(WMSJSProjectDirectory)\Microsoft.VisualStudio.$(WMSJSProject).Default.props" />
+ <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\$(WMSJSProjectDirectory)\Microsoft.VisualStudio.$(WMSJSProject).props" />
+ <PropertyGroup>
+ <TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
+ <TargetPlatformVersion>10.0.10240.0</TargetPlatformVersion>
+ <TargetPlatformMinVersion>10.0.10240.0</TargetPlatformMinVersion>
+ <MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(VisualStudioVersion)' < '14.0'">
+ <TargetPlatformVersion>10.0</TargetPlatformVersion>
+ <TargetPlatformMinVersion>10.0</TargetPlatformMinVersion>
+ </PropertyGroup>
+</Project>
http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/60cca717/spec/unit/fixtures/DummyProject/CordovaApp.Windows80.jsproj
----------------------------------------------------------------------
diff --git a/spec/unit/fixtures/DummyProject/CordovaApp.Windows80.jsproj b/spec/unit/fixtures/DummyProject/CordovaApp.Windows80.jsproj
new file mode 100644
index 0000000..34d1985
--- /dev/null
+++ b/spec/unit/fixtures/DummyProject/CordovaApp.Windows80.jsproj
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ 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.
+-->
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <OutputPath>build\windows80\$(Configuration)\$(Platform)\</OutputPath>
+ <IntermediateOutputPath>build\windows80\bld\</IntermediateOutputPath>
+ </PropertyGroup>
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|AnyCPU">
+ <Configuration>Debug</Configuration>
+ <Platform>AnyCPU</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|ARM">
+ <Configuration>Debug</Configuration>
+ <Platform>ARM</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x86">
+ <Configuration>Debug</Configuration>
+ <Platform>x86</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|AnyCPU">
+ <Configuration>Release</Configuration>
+ <Platform>AnyCPU</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|ARM">
+ <Configuration>Release</Configuration>
+ <Platform>ARM</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x86">
+ <Configuration>Release</Configuration>
+ <Platform>x86</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>efffab2f-bfc5-4eda-b545-45ef4995f55a</ProjectGuid>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' < '11.0'">
+ <VisualStudioVersion>11.0</VisualStudioVersion>
+ </PropertyGroup>
+ <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+ <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\$(WMSJSProjectDirectory)\Microsoft.VisualStudio.$(WMSJSProject).Default.props" />
+ <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\$(WMSJSProjectDirectory)\Microsoft.VisualStudio.$(WMSJSProject).props" />
+ <PropertyGroup>
+ <TargetPlatformIdentifier>Windows</TargetPlatformIdentifier>
+ <TargetPlatformVersion>8.0</TargetPlatformVersion>
+ <DefaultLanguage>en-US</DefaultLanguage>
+ <PackageCertificateKeyFile>CordovaApp_TemporaryKey.pfx</PackageCertificateKeyFile>
+ </PropertyGroup>
+ <ItemGroup>
+ <AppxManifest Include="package.windows80.appxmanifest">
+ <SubType>Designer</SubType>
+ </AppxManifest>
+ <Content Include="images\*.png" Exclude="images\*.scale-240.*" />
+ <None Include="CordovaApp_TemporaryKey.pfx" />
+ </ItemGroup>
+ <ItemGroup>
+ <SDKReference Include="Microsoft.WinJS.1.0, Version=1.0" />
+ </ItemGroup>
+ <Import Project="CordovaApp.projitems" Label="Shared" />
+ <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\$(WMSJSProjectDirectory)\Microsoft.VisualStudio.$(WMSJSProject).targets" />
+ <PropertyGroup>
+ <BuildFromCordovaTooling>false</BuildFromCordovaTooling>
+ <PreBuildEvent Condition="$(BuildFromCordovaTooling) != true">
+ cd /d $(MSBuildThisFileDirectory)
+ node -e "require('./cordova/lib/prepare.js').applyPlatformConfig()"
+ </PreBuildEvent>
+ </PropertyGroup>
+</Project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/60cca717/spec/unit/fixtures/DummyProject/CordovaApp.projitems
----------------------------------------------------------------------
diff --git a/spec/unit/fixtures/DummyProject/CordovaApp.projitems b/spec/unit/fixtures/DummyProject/CordovaApp.projitems
new file mode 100644
index 0000000..972a1a4
--- /dev/null
+++ b/spec/unit/fixtures/DummyProject/CordovaApp.projitems
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ 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.
+-->
+<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
+ <HasSharedItems>true</HasSharedItems>
+ <SharedGUID>9ebdb27f-d75b-4d8c-b53f-7be4a1fe89f9</SharedGUID>
+ </PropertyGroup>
+ <ItemGroup>
+ <Content Include="$(MSBuildThisFileDirectory)www\**" />
+ </ItemGroup>
+ <ItemGroup>
+ <Content Include="$(MSBuildThisFileDirectory)config.xml" />
+ </ItemGroup>
+</Project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/60cca717/spec/unit/fixtures/DummyProject/CordovaApp.shproj
----------------------------------------------------------------------
diff --git a/spec/unit/fixtures/DummyProject/CordovaApp.shproj b/spec/unit/fixtures/DummyProject/CordovaApp.shproj
new file mode 100644
index 0000000..08b59df
--- /dev/null
+++ b/spec/unit/fixtures/DummyProject/CordovaApp.shproj
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ 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.
+-->
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{9ebdb27f-d75b-4d8c-b53f-7be4a1fe89f9}</ProjectGuid>
+ </PropertyGroup>
+ <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+ <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.Default.props" />
+ <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.props" />
+ <PropertyGroup />
+ <Import Project="CordovaApp.projitems" Label="Shared" />
+ <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\$(WMSJSProjectDirectory)\Microsoft.CodeSharing.JavaScript.targets" />
+</Project>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/60cca717/spec/unit/fixtures/DummyProject/CordovaApp.sln
----------------------------------------------------------------------
diff --git a/spec/unit/fixtures/DummyProject/CordovaApp.sln b/spec/unit/fixtures/DummyProject/CordovaApp.sln
new file mode 100644
index 0000000..5d4c18f
--- /dev/null
+++ b/spec/unit/fixtures/DummyProject/CordovaApp.sln
@@ -0,0 +1,106 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 2013
+#
+# 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.
+#
+VisualStudioVersion = 12.0.30324.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CordovaApp", "CordovaApp", "{3A47E08D-7EA5-4F3F-AA6D-1D4A41F26944}"
+EndProject
+Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "CordovaApp", "CordovaApp.shproj", "{9EBDB27F-D75B-4D8C-B53F-7BE4A1FE89F9}"
+EndProject
+Project("{262852C6-CD72-467D-83FE-5EEB1973A190}") = "CordovaApp.Windows", "CordovaApp.Windows.jsproj", "{58950FB6-2F93-4963-B9CD-637F83F3EFBF}"
+EndProject
+Project("{262852C6-CD72-467D-83FE-5EEB1973A190}") = "CordovaApp.Phone", "CordovaApp.Phone.jsproj", "{31B67A35-9503-4213-857E-F44EB42AE549}"
+EndProject
+Global
+ GlobalSection(SharedMSBuildProjectFiles) = preSolution
+ CordovaApp.projitems*{58950fb6-2f93-4963-b9cd-637f83f3efbf}*SharedItemsImports = 5
+ CordovaApp.projitems*{9ebdb27f-d75b-4d8c-b53f-7be4a1fe89f9}*SharedItemsImports = 13
+ CordovaApp.projitems*{31b67a35-9503-4213-857e-f44eb42ae549}*SharedItemsImports = 5
+ EndGlobalSection
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Debug|ARM = Debug|ARM
+ Debug|x64 = Debug|x64
+ Debug|x86 = Debug|x86
+ Release|Any CPU = Release|Any CPU
+ Release|ARM = Release|ARM
+ Release|x64 = Release|x64
+ Release|x86 = Release|x86
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {58950FB6-2F93-4963-B9CD-637F83F3EFBF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {58950FB6-2F93-4963-B9CD-637F83F3EFBF}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {58950FB6-2F93-4963-B9CD-637F83F3EFBF}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
+ {58950FB6-2F93-4963-B9CD-637F83F3EFBF}.Debug|ARM.ActiveCfg = Debug|ARM
+ {58950FB6-2F93-4963-B9CD-637F83F3EFBF}.Debug|ARM.Build.0 = Debug|ARM
+ {58950FB6-2F93-4963-B9CD-637F83F3EFBF}.Debug|ARM.Deploy.0 = Debug|ARM
+ {58950FB6-2F93-4963-B9CD-637F83F3EFBF}.Debug|x64.ActiveCfg = Debug|x64
+ {58950FB6-2F93-4963-B9CD-637F83F3EFBF}.Debug|x64.Build.0 = Debug|x64
+ {58950FB6-2F93-4963-B9CD-637F83F3EFBF}.Debug|x64.Deploy.0 = Debug|x64
+ {58950FB6-2F93-4963-B9CD-637F83F3EFBF}.Debug|x86.ActiveCfg = Debug|x86
+ {58950FB6-2F93-4963-B9CD-637F83F3EFBF}.Debug|x86.Build.0 = Debug|x86
+ {58950FB6-2F93-4963-B9CD-637F83F3EFBF}.Debug|x86.Deploy.0 = Debug|x86
+ {58950FB6-2F93-4963-B9CD-637F83F3EFBF}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {58950FB6-2F93-4963-B9CD-637F83F3EFBF}.Release|Any CPU.Build.0 = Release|Any CPU
+ {58950FB6-2F93-4963-B9CD-637F83F3EFBF}.Release|Any CPU.Deploy.0 = Release|Any CPU
+ {58950FB6-2F93-4963-B9CD-637F83F3EFBF}.Release|ARM.ActiveCfg = Release|ARM
+ {58950FB6-2F93-4963-B9CD-637F83F3EFBF}.Release|ARM.Build.0 = Release|ARM
+ {58950FB6-2F93-4963-B9CD-637F83F3EFBF}.Release|ARM.Deploy.0 = Release|ARM
+ {58950FB6-2F93-4963-B9CD-637F83F3EFBF}.Release|x64.ActiveCfg = Release|x64
+ {58950FB6-2F93-4963-B9CD-637F83F3EFBF}.Release|x64.Build.0 = Release|x64
+ {58950FB6-2F93-4963-B9CD-637F83F3EFBF}.Release|x64.Deploy.0 = Release|x64
+ {58950FB6-2F93-4963-B9CD-637F83F3EFBF}.Release|x86.ActiveCfg = Release|x86
+ {58950FB6-2F93-4963-B9CD-637F83F3EFBF}.Release|x86.Build.0 = Release|x86
+ {58950FB6-2F93-4963-B9CD-637F83F3EFBF}.Release|x86.Deploy.0 = Release|x86
+ {31B67A35-9503-4213-857E-F44EB42AE549}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {31B67A35-9503-4213-857E-F44EB42AE549}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {31B67A35-9503-4213-857E-F44EB42AE549}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
+ {31B67A35-9503-4213-857E-F44EB42AE549}.Debug|ARM.ActiveCfg = Debug|ARM
+ {31B67A35-9503-4213-857E-F44EB42AE549}.Debug|ARM.Build.0 = Debug|ARM
+ {31B67A35-9503-4213-857E-F44EB42AE549}.Debug|ARM.Deploy.0 = Debug|ARM
+ {31B67A35-9503-4213-857E-F44EB42AE549}.Debug|x64.ActiveCfg = Debug|x64
+ {31B67A35-9503-4213-857E-F44EB42AE549}.Debug|x64.Build.0 = Debug|x64
+ {31B67A35-9503-4213-857E-F44EB42AE549}.Debug|x64.Deploy.0 = Debug|x64
+ {31B67A35-9503-4213-857E-F44EB42AE549}.Debug|x86.ActiveCfg = Debug|x86
+ {31B67A35-9503-4213-857E-F44EB42AE549}.Debug|x86.Build.0 = Debug|x86
+ {31B67A35-9503-4213-857E-F44EB42AE549}.Debug|x86.Deploy.0 = Debug|x86
+ {31B67A35-9503-4213-857E-F44EB42AE549}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {31B67A35-9503-4213-857E-F44EB42AE549}.Release|Any CPU.Build.0 = Release|Any CPU
+ {31B67A35-9503-4213-857E-F44EB42AE549}.Release|Any CPU.Deploy.0 = Release|Any CPU
+ {31B67A35-9503-4213-857E-F44EB42AE549}.Release|ARM.ActiveCfg = Release|ARM
+ {31B67A35-9503-4213-857E-F44EB42AE549}.Release|ARM.Build.0 = Release|ARM
+ {31B67A35-9503-4213-857E-F44EB42AE549}.Release|ARM.Deploy.0 = Release|ARM
+ {31B67A35-9503-4213-857E-F44EB42AE549}.Release|x64.ActiveCfg = Release|x64
+ {31B67A35-9503-4213-857E-F44EB42AE549}.Release|x64.Build.0 = Release|x64
+ {31B67A35-9503-4213-857E-F44EB42AE549}.Release|x64.Deploy.0 = Release|x64
+ {31B67A35-9503-4213-857E-F44EB42AE549}.Release|x86.ActiveCfg = Release|x86
+ {31B67A35-9503-4213-857E-F44EB42AE549}.Release|x86.Build.0 = Release|x86
+ {31B67A35-9503-4213-857E-F44EB42AE549}.Release|x86.Deploy.0 = Release|x86
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(NestedProjects) = preSolution
+ {9EBDB27F-D75B-4D8C-B53F-7BE4A1FE89F9} = {3A47E08D-7EA5-4F3F-AA6D-1D4A41F26944}
+ {58950FB6-2F93-4963-B9CD-637F83F3EFBF} = {3A47E08D-7EA5-4F3F-AA6D-1D4A41F26944}
+ {31B67A35-9503-4213-857E-F44EB42AE549} = {3A47E08D-7EA5-4F3F-AA6D-1D4A41F26944}
+ EndGlobalSection
+EndGlobal
http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/60cca717/spec/unit/fixtures/DummyProject/CordovaApp.vs2012.sln
----------------------------------------------------------------------
diff --git a/spec/unit/fixtures/DummyProject/CordovaApp.vs2012.sln b/spec/unit/fixtures/DummyProject/CordovaApp.vs2012.sln
new file mode 100644
index 0000000..b08ca94
--- /dev/null
+++ b/spec/unit/fixtures/DummyProject/CordovaApp.vs2012.sln
@@ -0,0 +1,64 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 2012
+#
+# 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.
+#
+Project("{262852C6-CD72-467D-83FE-5EEB1973A190}") = "CordovaApp.Windows8.0", "CordovaApp.Windows80.jsproj", "{EFFFAB2F-BFC5-4EDA-B545-45EF4995F55A}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|AnyCPU = Debug|AnyCPU
+ Debug|ARM = Debug|ARM
+ Debug|x64 = Debug|x64
+ Debug|x86 = Debug|x86
+ Release|AnyCPU = Release|AnyCPU
+ Release|ARM = Release|ARM
+ Release|x64 = Release|x64
+ Release|x86 = Release|x86
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {EFFFAB2F-BFC5-4EDA-B545-45EF4995F55A}.Debug|AnyCPU.ActiveCfg = Debug|Any CPU
+ {EFFFAB2F-BFC5-4EDA-B545-45EF4995F55A}.Debug|AnyCPU.Build.0 = Debug|Any CPU
+ {EFFFAB2F-BFC5-4EDA-B545-45EF4995F55A}.Debug|AnyCPU.Deploy.0 = Debug|Any CPU
+ {EFFFAB2F-BFC5-4EDA-B545-45EF4995F55A}.Debug|ARM.ActiveCfg = Debug|ARM
+ {EFFFAB2F-BFC5-4EDA-B545-45EF4995F55A}.Debug|ARM.Build.0 = Debug|ARM
+ {EFFFAB2F-BFC5-4EDA-B545-45EF4995F55A}.Debug|ARM.Deploy.0 = Debug|ARM
+ {EFFFAB2F-BFC5-4EDA-B545-45EF4995F55A}.Debug|x64.ActiveCfg = Debug|x64
+ {EFFFAB2F-BFC5-4EDA-B545-45EF4995F55A}.Debug|x64.Build.0 = Debug|x64
+ {EFFFAB2F-BFC5-4EDA-B545-45EF4995F55A}.Debug|x64.Deploy.0 = Debug|x64
+ {EFFFAB2F-BFC5-4EDA-B545-45EF4995F55A}.Debug|x86.ActiveCfg = Debug|x86
+ {EFFFAB2F-BFC5-4EDA-B545-45EF4995F55A}.Debug|x86.Build.0 = Debug|x86
+ {EFFFAB2F-BFC5-4EDA-B545-45EF4995F55A}.Debug|x86.Deploy.0 = Debug|x86
+ {EFFFAB2F-BFC5-4EDA-B545-45EF4995F55A}.Release|AnyCPU.ActiveCfg = Release|Any CPU
+ {EFFFAB2F-BFC5-4EDA-B545-45EF4995F55A}.Release|AnyCPU.Build.0 = Release|Any CPU
+ {EFFFAB2F-BFC5-4EDA-B545-45EF4995F55A}.Release|AnyCPU.Deploy.0 = Release|Any CPU
+ {EFFFAB2F-BFC5-4EDA-B545-45EF4995F55A}.Release|ARM.ActiveCfg = Release|ARM
+ {EFFFAB2F-BFC5-4EDA-B545-45EF4995F55A}.Release|ARM.Build.0 = Release|ARM
+ {EFFFAB2F-BFC5-4EDA-B545-45EF4995F55A}.Release|ARM.Deploy.0 = Release|ARM
+ {EFFFAB2F-BFC5-4EDA-B545-45EF4995F55A}.Release|x64.ActiveCfg = Release|x64
+ {EFFFAB2F-BFC5-4EDA-B545-45EF4995F55A}.Release|x64.Build.0 = Release|x64
+ {EFFFAB2F-BFC5-4EDA-B545-45EF4995F55A}.Release|x64.Deploy.0 = Release|x64
+ {EFFFAB2F-BFC5-4EDA-B545-45EF4995F55A}.Release|x86.ActiveCfg = Release|x86
+ {EFFFAB2F-BFC5-4EDA-B545-45EF4995F55A}.Release|x86.Build.0 = Release|x86
+ {EFFFAB2F-BFC5-4EDA-B545-45EF4995F55A}.Release|x86.Deploy.0 = Release|x86
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/60cca717/spec/unit/fixtures/DummyProject/CordovaApp_TemporaryKey.pfx
----------------------------------------------------------------------
diff --git a/spec/unit/fixtures/DummyProject/CordovaApp_TemporaryKey.pfx b/spec/unit/fixtures/DummyProject/CordovaApp_TemporaryKey.pfx
new file mode 100644
index 0000000..90d7ab2
Binary files /dev/null and b/spec/unit/fixtures/DummyProject/CordovaApp_TemporaryKey.pfx differ
http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/60cca717/spec/unit/fixtures/DummyProject/VERSION
----------------------------------------------------------------------
diff --git a/spec/unit/fixtures/DummyProject/VERSION b/spec/unit/fixtures/DummyProject/VERSION
new file mode 100644
index 0000000..a76ccff
--- /dev/null
+++ b/spec/unit/fixtures/DummyProject/VERSION
@@ -0,0 +1 @@
+3.7.1
http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/60cca717/spec/unit/fixtures/DummyProject/config.xml
----------------------------------------------------------------------
diff --git a/spec/unit/fixtures/DummyProject/config.xml b/spec/unit/fixtures/DummyProject/config.xml
new file mode 100644
index 0000000..621d9c9
--- /dev/null
+++ b/spec/unit/fixtures/DummyProject/config.xml
@@ -0,0 +1,14 @@
+<?xml version='1.0' encoding='utf-8'?>
+<widget id="io.cordova.cordovaapp" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
+ <preference name="windows-target-version" value="8.0" />
+ <preference name="windows-phone-target-version" value="8.1" />
+ <name>CordovaApp</name>
+ <description>
+ A sample Apache Cordova application that responds to the deviceready event.
+ </description>
+ <author email="dev@cordova.apache.org" href="http://cordova.io">
+ Apache Cordova Team
+ </author>
+ <content src="index.html" />
+ <access origin="*" />
+</widget>
http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/60cca717/spec/unit/fixtures/DummyProject/package.phone.appxmanifest
----------------------------------------------------------------------
diff --git a/spec/unit/fixtures/DummyProject/package.phone.appxmanifest b/spec/unit/fixtures/DummyProject/package.phone.appxmanifest
new file mode 100644
index 0000000..c8644d4
--- /dev/null
+++ b/spec/unit/fixtures/DummyProject/package.phone.appxmanifest
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ 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.
+-->
+<Package xmlns="http://schemas.microsoft.com/appx/2010/manifest" xmlns:m2="http://schemas.microsoft.com/appx/2013/manifest" xmlns:m3="http://schemas.microsoft.com/appx/2014/manifest" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest">
+ <Identity Name="d409db80-9793-11e4-8ffa-f71ca5ee087f" Version="1.0.0.0" Publisher="CN=$username$" />
+ <mp:PhoneIdentity PhoneProductId="d409db80-9793-11e4-8ffa-f71ca5ee087f" PhonePublisherId="db093ed5-53b1-45f7-af72-751e8f36ab80" />
+ <Properties>
+ <DisplayName>CordovaApp</DisplayName>
+ <PublisherDisplayName>$username$</PublisherDisplayName>
+ <Logo>images\StoreLogo.png</Logo>
+ </Properties>
+ <Prerequisites>
+ <OSMinVersion>6.3.1</OSMinVersion>
+ <OSMaxVersionTested>6.3.1</OSMaxVersionTested>
+ </Prerequisites>
+ <Resources>
+ <Resource Language="x-generate" />
+ </Resources>
+ <Applications>
+ <Application Id="io.cordova.cordovaapp" StartPage="www/index.html">
+ <m3:VisualElements DisplayName="CordovaApp"
+ Square150x150Logo="images\Square150x150Logo.png"
+ Square44x44Logo="images\Square44x44Logo.png"
+ Description="CordovaApp"
+ ForegroundText="light"
+ BackgroundColor="transparent">
+ <m3:DefaultTile Wide310x150Logo="images\Wide310x150Logo.png"
+ Square71x71Logo="images\Square71x71Logo.png">
+ <m3:ShowNameOnTiles>
+ <m3:ShowOn Tile="square150x150Logo" />
+ <m3:ShowOn Tile="wide310x150Logo" />
+ </m3:ShowNameOnTiles>
+ </m3:DefaultTile>
+ <m3:SplashScreen Image="images\SplashScreenPhone.png" />
+ </m3:VisualElements>
+ </Application>
+ </Applications>
+ <Capabilities>
+ <Capability Name="internetClientServer" />
+ </Capabilities>
+</Package>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/60cca717/spec/unit/fixtures/DummyProject/package.windows.appxmanifest
----------------------------------------------------------------------
diff --git a/spec/unit/fixtures/DummyProject/package.windows.appxmanifest b/spec/unit/fixtures/DummyProject/package.windows.appxmanifest
new file mode 100644
index 0000000..782980e
--- /dev/null
+++ b/spec/unit/fixtures/DummyProject/package.windows.appxmanifest
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ 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.
+-->
+<Package xmlns="http://schemas.microsoft.com/appx/2010/manifest" xmlns:m2="http://schemas.microsoft.com/appx/2013/manifest">
+ <Identity Name="d409db80-9793-11e4-8ffa-f71ca5ee087f" Version="1.0.0.0" Publisher="CN=$username$" />
+ <Properties>
+ <DisplayName>CordovaApp</DisplayName>
+ <PublisherDisplayName>$username$</PublisherDisplayName>
+ <Logo>images\StoreLogo.png</Logo>
+ </Properties>
+ <Prerequisites>
+ <OSMinVersion>6.3.0</OSMinVersion>
+ <OSMaxVersionTested>6.3.0</OSMaxVersionTested>
+ </Prerequisites>
+ <Resources>
+ <Resource Language="x-generate" />
+ </Resources>
+ <Applications>
+ <Application Id="io.cordova.cordovaapp" StartPage="www/index.html">
+ <m2:VisualElements DisplayName="CordovaApp"
+ Description="CordovaApp"
+ ForegroundText="light"
+ BackgroundColor="#464646"
+ Square150x150Logo="images\Square150x150Logo.png"
+ Square30x30Logo="images\Square30x30Logo.png">
+ <m2:DefaultTile Square70x70Logo="images\Square70x70Logo.png"
+ Square310x310Logo="images\Square310x310Logo.png"
+ Wide310x150Logo="images\Wide310x150Logo.png">
+ <m2:ShowNameOnTiles>
+ <m2:ShowOn Tile="square150x150Logo" />
+ <m2:ShowOn Tile="wide310x150Logo" />
+ <m2:ShowOn Tile="square310x310Logo" />
+ </m2:ShowNameOnTiles>
+ </m2:DefaultTile>
+ <m2:SplashScreen Image="images\SplashScreen.png" />
+ </m2:VisualElements>
+ </Application>
+ </Applications>
+ <Capabilities>
+ <Capability Name="internetClient" />
+ </Capabilities>
+</Package>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/60cca717/spec/unit/fixtures/DummyProject/package.windows80.appxmanifest
----------------------------------------------------------------------
diff --git a/spec/unit/fixtures/DummyProject/package.windows80.appxmanifest b/spec/unit/fixtures/DummyProject/package.windows80.appxmanifest
new file mode 100644
index 0000000..af9b9d9
--- /dev/null
+++ b/spec/unit/fixtures/DummyProject/package.windows80.appxmanifest
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ 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.
+-->
+<Package xmlns="http://schemas.microsoft.com/appx/2010/manifest">
+ <Identity Name="d409db80-9793-11e4-8ffa-f71ca5ee087f" Version="1.0.0.0" Publisher="CN=$username$" />
+ <Properties>
+ <DisplayName>CordovaApp</DisplayName>
+ <PublisherDisplayName>$username$</PublisherDisplayName>
+ <Logo>images\storelogo.png</Logo>
+ </Properties>
+ <Prerequisites>
+ <OSMinVersion>6.2.1</OSMinVersion>
+ <OSMaxVersionTested>6.2.1</OSMaxVersionTested>
+ </Prerequisites>
+ <Resources>
+ <Resource Language="x-generate" />
+ </Resources>
+ <Applications>
+ <Application Id="io.cordova.cordovaapp" StartPage="www/index.html">
+ <VisualElements DisplayName="CordovaApp"
+ Logo="images\Square150x150Logo.png"
+ SmallLogo="images\Square30x30Logo.png"
+ Description="CordovaApp"
+ ForegroundText="light"
+ BackgroundColor="#464646">
+ <DefaultTile ShowName="allLogos" WideLogo="images\Wide310x150Logo.png"/>
+ <SplashScreen Image="images\splashscreen.png" />
+ </VisualElements>
+ </Application>
+ </Applications>
+ <Capabilities>
+ <Capability Name="internetClient" />
+ </Capabilities>
+</Package>
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/60cca717/spec/unit/fixtures/EmptyProject/AppPackages/CordovaApp.Phone_0.0.1.0_debug_Test/CordovaApp.Phone_0.0.1.0_AnyCPU_debug.appxbundle
----------------------------------------------------------------------
diff --git a/spec/unit/fixtures/EmptyProject/AppPackages/CordovaApp.Phone_0.0.1.0_debug_Test/CordovaApp.Phone_0.0.1.0_AnyCPU_debug.appxbundle b/spec/unit/fixtures/EmptyProject/AppPackages/CordovaApp.Phone_0.0.1.0_debug_Test/CordovaApp.Phone_0.0.1.0_AnyCPU_debug.appxbundle
deleted file mode 100644
index 654e7f0..0000000
--- a/spec/unit/fixtures/EmptyProject/AppPackages/CordovaApp.Phone_0.0.1.0_debug_Test/CordovaApp.Phone_0.0.1.0_AnyCPU_debug.appxbundle
+++ /dev/null
@@ -1 +0,0 @@
-(dummy package)
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/60cca717/spec/unit/fixtures/EmptyProject/AppPackages/CordovaApp.Windows_0.0.1.0_anycpu_debug_Test/CordovaApp.Windows_0.0.1.0_anycpu_debug.appx
----------------------------------------------------------------------
diff --git a/spec/unit/fixtures/EmptyProject/AppPackages/CordovaApp.Windows_0.0.1.0_anycpu_debug_Test/CordovaApp.Windows_0.0.1.0_anycpu_debug.appx b/spec/unit/fixtures/EmptyProject/AppPackages/CordovaApp.Windows_0.0.1.0_anycpu_debug_Test/CordovaApp.Windows_0.0.1.0_anycpu_debug.appx
deleted file mode 100644
index 654e7f0..0000000
--- a/spec/unit/fixtures/EmptyProject/AppPackages/CordovaApp.Windows_0.0.1.0_anycpu_debug_Test/CordovaApp.Windows_0.0.1.0_anycpu_debug.appx
+++ /dev/null
@@ -1 +0,0 @@
-(dummy package)
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/60cca717/spec/unit/fixtures/org.test.plugins.dummyplugin/plugin.xml
----------------------------------------------------------------------
diff --git a/spec/unit/fixtures/org.test.plugins.dummyplugin/plugin.xml b/spec/unit/fixtures/org.test.plugins.dummyplugin/plugin.xml
new file mode 100644
index 0000000..3a316b1
--- /dev/null
+++ b/spec/unit/fixtures/org.test.plugins.dummyplugin/plugin.xml
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright 2013 Anis Kadri
+
+ Licensed 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.
+
+-->
+
+<plugin xmlns="http://cordova.apache.org/ns/plugins/1.0"
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ id="org.test.plugins.dummyplugin"
+ version="0.6.0">
+
+ <!-- new requirement: NO SPACES -->
+ <name>dummyplugin</name>
+ <!-- These are going to be required by plugman-registry -->
+ <description>my description</description>
+ <author>Jackson Badman</author>
+ <keywords>dummy,plugin</keywords>
+ <license>BSD</license>
+ <!-- end plugman-registry requirements -->
+
+ <asset src="www/dummyplugin.js" target="dummyplugin.js" />
+ <asset src="www/dummyplugin" target="dummyplugin" />
+
+ <config-file target="config.xml" parent="/*">
+ <access origin="build.phonegap.com" />
+ <access origin="s3.amazonaws.com" />
+ </config-file>
+
+ <!-- windows -->
+ <platform name="windows">
+ <config-file target="config.xml" parent="/*">
+ <feature id="dummyPlugin" required="true" version="1.0.0.0"/>
+ </config-file>
+
+ <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=">=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"/>
+ <lib-file src="TestSDK4, Version=1.0" device-target="windows" versions="8.0" arch="x86"/>
+
+ <framework src="src/windows/dummy1.dll" arch="x64"/>
+ <framework src="src/windows/dummy2.dll" versions=">=8.0"/>
+ <framework src="src/windows/dummy3.dll" device-target="windows"/>
+ <framework src="src/windows/dummy4.dll" device-target="phone" versions="8.1" arch="ARM"/>
+ <framework src="src/windows/dummy5.dll" custom="true" target-dir="phoneDir" device-target="phone" />
+ <framework src="src/windows/dummy6.dll" custom="true" target-dir="sharedDir" versions=">=8.1" />
+
+ <framework src="src/windows/dummy1.vcxproj" type="projectReference" arch="x64"/>
+ <framework src="src/windows/dummy2.vcxproj" type="projectReference" versions="<8.1"/>
+ <!-- "target" attribute is an alias for "device-target" (but is deprecated) - test for it here -->
+ <framework src="src/windows/dummy3.vcxproj" type="projectReference" target="win"/>
+ <framework src="src/windows/dummy4.vcxproj" type="projectReference" device-target="all" versions="8.1" arch="x86"/>
+
+ <js-module src="www/dummyplugin.js" name="Dummy">
+ <clobbers target="dummy" />
+ </js-module>
+ </platform>
+
+</plugin>
http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/60cca717/spec/unit/fixtures/org.test.plugins.dummyplugin/src/windows/dummer.js
----------------------------------------------------------------------
diff --git a/spec/unit/fixtures/org.test.plugins.dummyplugin/src/windows/dummer.js b/spec/unit/fixtures/org.test.plugins.dummyplugin/src/windows/dummer.js
new file mode 100644
index 0000000..48388bc
--- /dev/null
+++ b/spec/unit/fixtures/org.test.plugins.dummyplugin/src/windows/dummer.js
@@ -0,0 +1 @@
+./org.test.plugins.dummyplugin/src/windows8/dummer.js
http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/60cca717/spec/unit/fixtures/org.test.plugins.dummyplugin/src/windows/dummy1.dll
----------------------------------------------------------------------
diff --git a/spec/unit/fixtures/org.test.plugins.dummyplugin/src/windows/dummy1.dll b/spec/unit/fixtures/org.test.plugins.dummyplugin/src/windows/dummy1.dll
new file mode 100644
index 0000000..e69de29
http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/60cca717/spec/unit/fixtures/org.test.plugins.dummyplugin/src/windows/dummy1.vcxproj
----------------------------------------------------------------------
diff --git a/spec/unit/fixtures/org.test.plugins.dummyplugin/src/windows/dummy1.vcxproj b/spec/unit/fixtures/org.test.plugins.dummyplugin/src/windows/dummy1.vcxproj
new file mode 100644
index 0000000..c454905
--- /dev/null
+++ b/spec/unit/fixtures/org.test.plugins.dummyplugin/src/windows/dummy1.vcxproj
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{ef7dd979-6f12-4bdf-8754-9468ce799c4d}</ProjectGuid>
+ <ProjectName>dummy1</ProjectName>
+ </PropertyGroup>
+</Project>
http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/60cca717/spec/unit/fixtures/org.test.plugins.dummyplugin/src/windows/dummy2.dll
----------------------------------------------------------------------
diff --git a/spec/unit/fixtures/org.test.plugins.dummyplugin/src/windows/dummy2.dll b/spec/unit/fixtures/org.test.plugins.dummyplugin/src/windows/dummy2.dll
new file mode 100644
index 0000000..e69de29
http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/60cca717/spec/unit/fixtures/org.test.plugins.dummyplugin/src/windows/dummy2.vcxproj
----------------------------------------------------------------------
diff --git a/spec/unit/fixtures/org.test.plugins.dummyplugin/src/windows/dummy2.vcxproj b/spec/unit/fixtures/org.test.plugins.dummyplugin/src/windows/dummy2.vcxproj
new file mode 100644
index 0000000..8edd706
--- /dev/null
+++ b/spec/unit/fixtures/org.test.plugins.dummyplugin/src/windows/dummy2.vcxproj
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{6a760eea-8c27-442e-b98b-a487964ded42}</ProjectGuid>
+ <ProjectName>dummy2</ProjectName>
+ </PropertyGroup>
+</Project>
http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/60cca717/spec/unit/fixtures/org.test.plugins.dummyplugin/src/windows/dummy3.dll
----------------------------------------------------------------------
diff --git a/spec/unit/fixtures/org.test.plugins.dummyplugin/src/windows/dummy3.dll b/spec/unit/fixtures/org.test.plugins.dummyplugin/src/windows/dummy3.dll
new file mode 100644
index 0000000..e69de29
http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/60cca717/spec/unit/fixtures/org.test.plugins.dummyplugin/src/windows/dummy3.vcxproj
----------------------------------------------------------------------
diff --git a/spec/unit/fixtures/org.test.plugins.dummyplugin/src/windows/dummy3.vcxproj b/spec/unit/fixtures/org.test.plugins.dummyplugin/src/windows/dummy3.vcxproj
new file mode 100644
index 0000000..600167c
--- /dev/null
+++ b/spec/unit/fixtures/org.test.plugins.dummyplugin/src/windows/dummy3.vcxproj
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{5318c3c8-0921-4870-b4ad-8cce06c88238}</ProjectGuid>
+ <ProjectName>dummy3</ProjectName>
+ </PropertyGroup>
+</Project>
http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/60cca717/spec/unit/fixtures/org.test.plugins.dummyplugin/src/windows/dummy4.dll
----------------------------------------------------------------------
diff --git a/spec/unit/fixtures/org.test.plugins.dummyplugin/src/windows/dummy4.dll b/spec/unit/fixtures/org.test.plugins.dummyplugin/src/windows/dummy4.dll
new file mode 100644
index 0000000..e69de29
http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/60cca717/spec/unit/fixtures/org.test.plugins.dummyplugin/src/windows/dummy4.vcxproj
----------------------------------------------------------------------
diff --git a/spec/unit/fixtures/org.test.plugins.dummyplugin/src/windows/dummy4.vcxproj b/spec/unit/fixtures/org.test.plugins.dummyplugin/src/windows/dummy4.vcxproj
new file mode 100644
index 0000000..d7acf04
--- /dev/null
+++ b/spec/unit/fixtures/org.test.plugins.dummyplugin/src/windows/dummy4.vcxproj
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{8e430a1b-094b-4c27-8b76-fdd7021dbfe9}</ProjectGuid>
+ <ProjectName>dummy4</ProjectName>
+ </PropertyGroup>
+</Project>
http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/60cca717/spec/unit/fixtures/org.test.plugins.dummyplugin/src/windows/dummy5.dll
----------------------------------------------------------------------
diff --git a/spec/unit/fixtures/org.test.plugins.dummyplugin/src/windows/dummy5.dll b/spec/unit/fixtures/org.test.plugins.dummyplugin/src/windows/dummy5.dll
new file mode 100644
index 0000000..e69de29
http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/60cca717/spec/unit/fixtures/org.test.plugins.dummyplugin/src/windows/dummy6.dll
----------------------------------------------------------------------
diff --git a/spec/unit/fixtures/org.test.plugins.dummyplugin/src/windows/dummy6.dll b/spec/unit/fixtures/org.test.plugins.dummyplugin/src/windows/dummy6.dll
new file mode 100644
index 0000000..e69de29
http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/60cca717/spec/unit/fixtures/org.test.plugins.dummyplugin/src/windows/text_sample1.txt
----------------------------------------------------------------------
diff --git a/spec/unit/fixtures/org.test.plugins.dummyplugin/src/windows/text_sample1.txt b/spec/unit/fixtures/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-windows/blob/60cca717/spec/unit/fixtures/org.test.plugins.dummyplugin/src/windows/text_sample2.txt
----------------------------------------------------------------------
diff --git a/spec/unit/fixtures/org.test.plugins.dummyplugin/src/windows/text_sample2.txt b/spec/unit/fixtures/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-windows/blob/60cca717/spec/unit/fixtures/org.test.plugins.dummyplugin/src/windows/text_sample3.txt
----------------------------------------------------------------------
diff --git a/spec/unit/fixtures/org.test.plugins.dummyplugin/src/windows/text_sample3.txt b/spec/unit/fixtures/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-windows/blob/60cca717/spec/unit/fixtures/org.test.plugins.dummyplugin/src/windows/text_sample4.txt
----------------------------------------------------------------------
diff --git a/spec/unit/fixtures/org.test.plugins.dummyplugin/src/windows/text_sample4.txt b/spec/unit/fixtures/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-windows/blob/60cca717/spec/unit/fixtures/org.test.plugins.dummyplugin/www/dummyplugin.js
----------------------------------------------------------------------
diff --git a/spec/unit/fixtures/org.test.plugins.dummyplugin/www/dummyplugin.js b/spec/unit/fixtures/org.test.plugins.dummyplugin/www/dummyplugin.js
new file mode 100644
index 0000000..631d6da
--- /dev/null
+++ b/spec/unit/fixtures/org.test.plugins.dummyplugin/www/dummyplugin.js
@@ -0,0 +1 @@
+./org.test.plugins.dummyplugin/www/dummyplugin.js
http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/60cca717/spec/unit/fixtures/org.test.plugins.dummyplugin/www/dummyplugin/image.jpg
----------------------------------------------------------------------
diff --git a/spec/unit/fixtures/org.test.plugins.dummyplugin/www/dummyplugin/image.jpg b/spec/unit/fixtures/org.test.plugins.dummyplugin/www/dummyplugin/image.jpg
new file mode 100644
index 0000000..219c78a
--- /dev/null
+++ b/spec/unit/fixtures/org.test.plugins.dummyplugin/www/dummyplugin/image.jpg
@@ -0,0 +1 @@
+./org.test.plugins.dummyplugin/www/dummyplugin/image.jpg
http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/60cca717/spec/unit/fixtures/org.test.plugins.faultyplugin/plugin.xml
----------------------------------------------------------------------
diff --git a/spec/unit/fixtures/org.test.plugins.faultyplugin/plugin.xml b/spec/unit/fixtures/org.test.plugins.faultyplugin/plugin.xml
new file mode 100644
index 0000000..bd54e17
--- /dev/null
+++ b/spec/unit/fixtures/org.test.plugins.faultyplugin/plugin.xml
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Copyright 2013 Anis Kadri
+
+ Licensed 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.
+
+-->
+
+<plugin xmlns="http://cordova.apache.org/ns/plugins/1.0"
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ id="org.test.plugins.faultyplugin"
+ version="0.6.0">
+
+ <name>Faulty Plugin</name>
+
+ <access origin="build.phonegap.com" />
+ <access origin="s3.amazonaws.com" />
+ <!-- file doesn't exist -->
+
+ <config-file target="config.xml" parent="/widget">
+ <asset src="www/main.js" target="faultyplugin/main.js" />
+ <asset src="www/index.js" target="faultyplugin/index.js" />
+ </config-file>
+
+ <!-- windows -->
+ <platform name="windows">
+ <config-file target="config.xml" parent="/*">
+ <feature name="org.test.plugins.faultyplugin">
+ <param name="windows-package" value="org.test.plugins.faultyplugin"/>
+ </feature>
+ </config-file>
+
+ <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"/>
+
+ <!-- does not exist -->
+ <source-file src="src/windows/NotHere.js" />
+ </platform>
+</plugin>
http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/60cca717/spec/unit/fixtures/org.test.plugins.faultyplugin/src/windows/faultyPlugin.js
----------------------------------------------------------------------
diff --git a/spec/unit/fixtures/org.test.plugins.faultyplugin/src/windows/faultyPlugin.js b/spec/unit/fixtures/org.test.plugins.faultyplugin/src/windows/faultyPlugin.js
new file mode 100644
index 0000000..784b850
--- /dev/null
+++ b/spec/unit/fixtures/org.test.plugins.faultyplugin/src/windows/faultyPlugin.js
@@ -0,0 +1 @@
+./org.test.plugins.faultyplugin/src/windows8/faultyPlugin.js
http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/60cca717/spec/unit/fixtures/org.test.plugins.faultyplugin/src/windows/text_sample1.txt
----------------------------------------------------------------------
diff --git a/spec/unit/fixtures/org.test.plugins.faultyplugin/src/windows/text_sample1.txt b/spec/unit/fixtures/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-windows/blob/60cca717/spec/unit/fixtures/org.test.plugins.faultyplugin/src/windows/text_sample2.txt
----------------------------------------------------------------------
diff --git a/spec/unit/fixtures/org.test.plugins.faultyplugin/src/windows/text_sample2.txt b/spec/unit/fixtures/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-windows/blob/60cca717/spec/unit/fixtures/org.test.plugins.faultyplugin/src/windows/text_sample3.txt
----------------------------------------------------------------------
diff --git a/spec/unit/fixtures/org.test.plugins.faultyplugin/src/windows/text_sample3.txt b/spec/unit/fixtures/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-windows/blob/60cca717/spec/unit/package.spec.js
----------------------------------------------------------------------
diff --git a/spec/unit/package.spec.js b/spec/unit/package.spec.js
index ac604b2..3315efd 100644
--- a/spec/unit/package.spec.js
+++ b/spec/unit/package.spec.js
@@ -23,7 +23,7 @@ var path = require('path'),
platformRoot = '../../template',
pkgRoot = './template/',
pkgPath = path.join(pkgRoot, 'AppPackages'),
- testPkgPath = './spec/unit/fixtures/EmptyProject/AppPackages',
+ testPkgPath = './spec/unit/fixtures/DummyProject/AppPackages',
pkg = rewire(platformRoot + '/cordova/lib/package.js');
var consoleLogOriginal;
http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/60cca717/spec/unit/pluginHandler/common.spec.js
----------------------------------------------------------------------
diff --git a/spec/unit/pluginHandler/common.spec.js b/spec/unit/pluginHandler/common.spec.js
new file mode 100644
index 0000000..cfc92f7
--- /dev/null
+++ b/spec/unit/pluginHandler/common.spec.js
@@ -0,0 +1,163 @@
+/*
+ *
+ *
+ * Licensed 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.
+ *
+*/
+
+/* jshint laxcomma:true */
+
+var rewire = require('rewire');
+var common = rewire('../../../template/cordova/lib/PluginHandler');
+var path = require('path');
+var fs = require('fs');
+var os = require('os');
+var shell = require('shelljs');
+
+var test_dir = path.join(os.tmpdir(), 'test_plugman');
+var project_dir = path.join(test_dir, 'project');
+var src = path.join(project_dir, 'src');
+var dest = path.join(project_dir, 'dest');
+var java_dir = path.join(src, 'one', 'two', 'three');
+var java_file = path.join(java_dir, 'test.java');
+var symlink_file = path.join(java_dir, 'symlink');
+var non_plugin_file = path.join(os.tmpdir(), 'non_plugin_file');
+
+var copyFile = common.__get__('copyFile');
+var copyNewFile = common.__get__('copyNewFile');
+var removeFileAndParents = common.__get__('removeFileAndParents');
+
+describe('common platform handler', function() {
+ describe('copyFile', function() {
+ it('should throw if source path not found', function(){
+ expect(function(){copyFile('/some/dir', src, project_dir, dest);})
+ .toThrow(new Error('"' + src + '" not found!'));
+ });
+
+ it('should throw if src not in plugin directory', function(){
+ shell.mkdir('-p', project_dir);
+ fs.writeFileSync(non_plugin_file, 'contents', 'utf-8');
+ expect(function(){copyFile(test_dir, '../non_plugin_file', project_dir, dest);})
+ .toThrow(new Error('"' + non_plugin_file + '" not located within plugin!'));
+ shell.rm('-rf', test_dir);
+ });
+
+ it('should allow symlink src, if inside plugin', function(){
+ shell.mkdir('-p', java_dir);
+ fs.writeFileSync(java_file, 'contents', 'utf-8');
+
+ // This will fail on windows if not admin - ignore the error in that case.
+ if (ignoreEPERMonWin32(java_file, symlink_file)) {
+ return;
+ }
+
+ copyFile(test_dir, symlink_file, project_dir, dest);
+ shell.rm('-rf', project_dir);
+ });
+
+ it('should throw if symlink is linked to a file outside the plugin', function(){
+ shell.mkdir('-p', java_dir);
+ fs.writeFileSync(non_plugin_file, 'contents', 'utf-8');
+
+ // This will fail on windows if not admin - ignore the error in that case.
+ if (ignoreEPERMonWin32(non_plugin_file, symlink_file)) {
+ return;
+ }
+
+ expect(function(){copyFile(test_dir, symlink_file, project_dir, dest);}).
+ toThrow(new Error('"' + symlink_file + '" not located within plugin!'));
+ shell.rm('-rf', project_dir);
+ });
+
+ it('should throw if dest is outside the project directory', function(){
+ shell.mkdir('-p', java_dir);
+ fs.writeFileSync(java_file, 'contents', 'utf-8');
+ expect(function(){copyFile(test_dir, java_file, project_dir, non_plugin_file);})
+ .toThrow(new Error('"' + non_plugin_file + '" not located within project!'));
+ shell.rm('-rf', project_dir);
+ });
+
+ it('should call mkdir -p on target path', function(){
+ shell.mkdir('-p', java_dir);
+ fs.writeFileSync(java_file, 'contents', 'utf-8');
+
+ var s = spyOn(shell, 'mkdir').andCallThrough();
+ copyFile(test_dir, java_file, project_dir, dest);
+
+ expect(s).toHaveBeenCalled();
+ expect(s).toHaveBeenCalledWith('-p', path.dirname(path.resolve(project_dir, dest)));
+ shell.rm('-rf', project_dir);
+ });
+
+ it('should call cp source/dest paths', function(){
+ shell.mkdir('-p', java_dir);
+ fs.writeFileSync(java_file, 'contents', 'utf-8');
+
+ var s = spyOn(shell, 'cp').andCallThrough();
+ copyFile(test_dir, java_file, project_dir, dest);
+
+ expect(s).toHaveBeenCalled();
+ expect(s).toHaveBeenCalledWith('-f', java_file, path.resolve(project_dir, dest));
+
+ shell.rm('-rf', project_dir);
+ });
+ });
+
+ describe('copyNewFile', function () {
+ it('should throw if target path exists', function(){
+ shell.mkdir('-p', dest);
+ expect(function(){copyNewFile(test_dir, src, project_dir, dest);})
+ .toThrow(new Error('"' + dest + '" already exists!'));
+ shell.rm('-rf', dest);
+ });
+ });
+
+ describe('deleteJava', function() {
+ it('should call fs.unlinkSync on the provided paths', function(){
+ shell.mkdir('-p', java_dir);
+ fs.writeFileSync(java_file, 'contents', 'utf-8');
+
+ var s = spyOn(fs, 'unlinkSync').andCallThrough();
+ removeFileAndParents(project_dir, java_file);
+ expect(s).toHaveBeenCalled();
+ expect(s).toHaveBeenCalledWith(path.resolve(project_dir, java_file));
+
+ shell.rm('-rf', java_dir);
+ });
+
+ it('should delete empty directories after removing source code in a java src path hierarchy', function(){
+ shell.mkdir('-p', java_dir);
+ fs.writeFileSync(java_file, 'contents', 'utf-8');
+
+ removeFileAndParents(project_dir, java_file);
+ expect(fs.existsSync(java_file)).not.toBe(true);
+ expect(fs.existsSync(java_dir)).not.toBe(true);
+ expect(fs.existsSync(path.join(src,'one'))).not.toBe(true);
+
+ shell.rm('-rf', java_dir);
+ });
+ });
+});
+
+function ignoreEPERMonWin32(symlink_src, symlink_dest) {
+ try {
+ fs.symlinkSync(symlink_src, symlink_dest);
+ } catch (e) {
+ if (process.platform === 'win32' && e.message.indexOf('Error: EPERM, operation not permitted' > -1)) {
+ return true;
+ }
+ throw e;
+ }
+ return false;
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org