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 <[email protected]> Authored: Mon Feb 29 17:37:37 2016 +0300 Committer: Vladimir Kotikov <[email protected]> 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="[email protected]" 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: [email protected] For additional commands, e-mail: [email protected]
