Merge branch 'phoneblue' into 2.8.1

This commit is contained in:
feiling 2014-04-03 11:16:02 -07:00
Родитель 50fd609851 cc01846395
Коммит 8137761729
18 изменённых файлов: 414 добавлений и 36 удалений

Просмотреть файл

@ -866,6 +866,14 @@ namespace NuGet.Commands
continue;
}
// Skip target file paths containing msbuild variables since we do not offer a way to install files with variable paths.
// These are show up in shared files found in universal apps.
if (targetFilePath.IndexOf("$(MSBuild", StringComparison.OrdinalIgnoreCase) > -1)
{
Logger.Log(MessageLevel.Warning, LocalizedResourceManager.GetString("Warning_UnresolvedFilePath"), targetFilePath);
continue;
}
// if IncludeReferencedProjects is true and we are adding source files,
// add projectName as part of the target to avoid file conflicts.
string targetPath = IncludeReferencedProjects && itemType == SourcesItemType ?

Просмотреть файл

@ -237,6 +237,9 @@
<data name="Warning_FileDoesNotExist" xml:space="preserve">
<value>'{0}' was included in the project but doesn't exist. Skipping...</value>
</data>
<data name="Warning_UnresolvedFilePath" xml:space="preserve">
<value>'{0}' was included in the project but the path could not be resolved. Skipping...</value>
</data>
<data name="Warning_UnspecifiedField" xml:space="preserve">
<value>{0} was not specified. Using '{1}'.</value>
</data>

Просмотреть файл

@ -12,6 +12,8 @@ namespace NuGet
{
public static class NetPortableProfileTable
{
private const string PortableReferenceAssemblyPathEnvironmentVariableName = "NuGetPortableReferenceAssemblyPath";
// This collection is the original indexed collection where profiles are indexed by
// the full "ProfileXXX" naming.
private static NetPortableProfileCollection _portableProfiles;
@ -133,10 +135,21 @@ namespace NuGet
private static NetPortableProfileCollection BuildPortableProfileCollection()
{
var profileCollection = new NetPortableProfileCollection();
string portableRootDirectory =
string portableRootDirectory;
string portableReferencePathOverride = Environment.GetEnvironmentVariable(PortableReferenceAssemblyPathEnvironmentVariableName);
if (!string.IsNullOrEmpty(portableReferencePathOverride))
{
portableRootDirectory = portableReferencePathOverride;
}
else
{
portableRootDirectory =
Path.Combine(
Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86, Environment.SpecialFolderOption.DoNotVerify),
@"Reference Assemblies\Microsoft\Framework\.NETPortable");
}
if (Directory.Exists(portableRootDirectory))
{

Просмотреть файл

@ -61,7 +61,9 @@ namespace NuGet
{ "MonoAndroid", "MonoAndroid" },
{ "MonoTouch", "MonoTouch" },
{ "MonoMac", "MonoMac" },
{ "native", "native"}
{ "native", "native"},
{ "WindowsPhoneApp", "WindowsPhoneApp"},
{ "wpa", "WindowsPhoneApp"}
};
private static readonly Dictionary<string, string> _knownProfiles = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase) {
@ -79,7 +81,8 @@ namespace NuGet
{ ".NETCore", "win"},
{ "Windows", "win"},
{ ".NETPortable", "portable" },
{ "WindowsPhone", "wp"}
{ "WindowsPhone", "wp"},
{ "WindowsPhoneApp", "wpa"}
};
private static readonly Dictionary<string, string> _identifierToProfileFolder = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase) {
@ -111,6 +114,7 @@ namespace NuGet
{ new FrameworkName("WindowsPhone, Version=v7.0"), new FrameworkName("Silverlight, Version=v3.0, Profile=WindowsPhone") },
{ new FrameworkName("WindowsPhone, Version=v7.1"), new FrameworkName("Silverlight, Version=v4.0, Profile=WindowsPhone71") },
{ new FrameworkName("WindowsPhone, Version=v8.0"), new FrameworkName("Silverlight, Version=v8.0, Profile=WindowsPhone") },
{ new FrameworkName("WindowsPhone, Version=v8.1"), new FrameworkName("Silverlight, Version=v8.1, Profile=WindowsPhone") },
{ new FrameworkName("Windows, Version=v0.0"), new FrameworkName(".NETCore, Version=v4.5") },
{ new FrameworkName("Windows, Version=v8.0"), new FrameworkName(".NETCore, Version=v4.5") },

Просмотреть файл

@ -1,19 +1,19 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Text.RegularExpressions;
using EnvDTE;
using Microsoft.Build.Construction;
using Microsoft.Build.Evaluation;
using Microsoft.VisualStudio;
using Microsoft.VisualStudio.Project;
using Microsoft.VisualStudio.Project.Designers;
using Microsoft.VisualStudio.Shell;
using Microsoft.VisualStudio.Shell.Interop;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Text.RegularExpressions;
using VSLangProj;
using VsWebSite;
using MsBuildProject = Microsoft.Build.Evaluation.Project;
@ -357,10 +357,20 @@ namespace NuGet.VisualStudio
if (project.IsJavaScriptProject())
{
// HACK: The JS Metro project does not have a TargetFrameworkMoniker property set.
// We read the TargetPlatformVersion instead
// JavaScript apps do not have a TargetFrameworkMoniker property set.
// We read the TargetPlatformIdentifier and TargetPlatformVersion instead
string platformIdentifier = project.GetPropertyValue<string>("TargetPlatformIdentifier");
string platformVersion = project.GetPropertyValue<string>("TargetPlatformVersion");
return String.IsNullOrEmpty(platformVersion) ? "Windows, Version=0.0" : "Windows, Version=" + platformVersion;
// use the default values for JS if they were not given
if (String.IsNullOrEmpty(platformVersion))
platformVersion = "0.0";
if (String.IsNullOrEmpty(platformIdentifier))
platformIdentifier = "Windows";
return String.Format(CultureInfo.InvariantCulture, "{0}, Version={1}", platformIdentifier, platformVersion);
}
if (project.IsNativeProject())
@ -999,5 +1009,29 @@ namespace NuGet.VisualStudio
return Path.GetFileName(obj).GetHashCode();
}
}
/// <summary>
/// Check if the project has the SharedAssetsProject capability. This is true
/// for shared projects in universal apps.
/// </summary>
public static bool IsSharedProject(this Project project)
{
bool isShared = false;
var hier = project.ToVsHierarchy();
// VSHPROPID_ProjectCapabilities is a space delimited list of capabilities (Dev11+)
object capObj;
if (ErrorHandler.Succeeded(hier.GetProperty((uint)VSConstants.VSITEMID.Root, (int)__VSHPROPID5.VSHPROPID_ProjectCapabilities, out capObj)) && capObj != null)
{
string cap = capObj as string;
if (!String.IsNullOrEmpty(cap))
{
isShared = cap.Split(' ').Any(s => StringComparer.OrdinalIgnoreCase.Equals("SharedAssetsProject", s));
}
}
return isShared;
}
}
}

Просмотреть файл

@ -91,7 +91,8 @@ namespace NuGet.VisualStudio
public static bool IsSupported(Project project)
{
Debug.Assert(project != null);
return project.Kind != null && _supportedProjectTypes.Contains(project.Kind);
return project.Kind != null && _supportedProjectTypes.Contains(project.Kind) && !project.IsSharedProject();
}
public static T GetPropertyValue<T>(Project project, string propertyName)

Просмотреть файл

@ -208,6 +208,24 @@ namespace NuGet.Test
}
}
[Fact]
public void ParseFrameworkNameNormalizesSupportedWindowsPhoneAppNames()
{
// Arrange
var knownNameFormats = new[] { "WindowsPhoneApp", "wpa" };
Version defaultVersion = new Version("0.0");
// Act
var frameworkNames = knownNameFormats.Select(fmt => VersionUtility.ParseFrameworkName(fmt));
// Assert
foreach (var frameworkName in frameworkNames)
{
Assert.Equal("WindowsPhoneApp", frameworkName.Identifier);
Assert.Equal(defaultVersion, frameworkName.Version);
}
}
[Fact]
public void ParseFrameworkNameNormalizesSupportedWinRTFrameworkNames()
{
@ -904,6 +922,8 @@ namespace NuGet.Test
FrameworkName wp7 = VersionUtility.ParseFrameworkName("sl3-wp");
FrameworkName wp7Mango = VersionUtility.ParseFrameworkName("sl4-wp71");
FrameworkName wp8 = new FrameworkName("WindowsPhone, Version=v8.0");
FrameworkName wp81 = new FrameworkName("WindowsPhone, Version=v8.1");
FrameworkName wpa81 = VersionUtility.ParseFrameworkName("wpa81");
// Act
bool wp7MangoCompatibleWithwp7 = VersionUtility.IsCompatible(wp7, wp7Mango);
@ -915,6 +935,10 @@ namespace NuGet.Test
bool wp8CompatibleWithwp7 = VersionUtility.IsCompatible(wp7, wp8);
bool wp8CompatbielWithwp7Mango = VersionUtility.IsCompatible(wp7Mango, wp8);
bool wp81CompatibleWithwp8 = VersionUtility.IsCompatible(wp81, wp8);
bool wpa81CompatibleWithwp81 = VersionUtility.IsCompatible(wpa81, wp81);
// Assert
Assert.False(wp7MangoCompatibleWithwp7);
Assert.True(wp7CompatibleWithwp7Mango);
@ -924,6 +948,10 @@ namespace NuGet.Test
Assert.False(wp8CompatibleWithwp7);
Assert.False(wp8CompatbielWithwp7Mango);
Assert.True(wp81CompatibleWithwp8);
Assert.False(wpa81CompatibleWithwp81);
}
[Theory]
@ -1298,15 +1326,17 @@ namespace NuGet.Test
Assert.Equal("wp71", shortName);
}
[Fact]
public void IsCompatibleReturnsTrueForPortableFrameworkAndNormalFramework()
[Theory]
[InlineData("portable-netcore45+sl4", "silverlight45")]
[InlineData("portable-net40+win8+sl4+wp71+wpa81", "wp81")]
public void IsCompatibleReturnsTrueForPortableFrameworkAndNormalFramework(string packageFramework, string projectFramework)
{
// Arrange
var portableFramework = VersionUtility.ParseFrameworkName("portable-netcore45+sl4");
var normalFramework = VersionUtility.ParseFrameworkName("silverlight45");
var packagePortableFramework = VersionUtility.ParseFrameworkName(packageFramework);
var projectPortableFramework = VersionUtility.ParseFrameworkName(projectFramework);
// Act
bool isCompatible = VersionUtility.IsCompatible(normalFramework, portableFramework);
bool isCompatible = VersionUtility.IsCompatible(projectPortableFramework, packagePortableFramework);
// Assert
Assert.True(isCompatible);
@ -1363,6 +1393,10 @@ namespace NuGet.Test
[InlineData("portable-netcore45+sl4+wp", "portable-netcore45+sl4")]
[InlineData("portable-netcore45+sl4+wp", "portable-netcore5+wp7")]
[InlineData("portable-netcore45+sl4+wp+net", "portable-wp7")]
[InlineData("portable-net40+win8+sl4+wp71+wpa81", "portable-wpa81+wp81")]
[InlineData("portable-wp8+wpa81", "portable-wpa81+wp81")]
[InlineData("portable-wp81+wpa81", "portable-wpa81+wp81")]
[InlineData("portable-wpa81+wp81", "portable-wpa81+wp81")]
public void IsCompatibleReturnsTrueForPortableFrameworkAndPortableFramework(string packageFramework, string projectFramework)
{
// Arrange
@ -1381,6 +1415,7 @@ namespace NuGet.Test
[InlineData("portable-netcore45+sl4+wp", "portable-netcore5+wp7+net")]
[InlineData("portable-netcore45+sl4+wp+net", "portable-wp7+netcore4")]
[InlineData("portable-netcore45+sl4", "portable-net4+wp7")]
[InlineData("portable-net40+win8+sl4+wp71", "portable-wpa81+wp81")]
public void IsCompatibleReturnsFalseForPortableFrameworkAndPortableFramework(string packageFramework, string projectFramework)
{
// Arrange

Просмотреть файл

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>Java</id>
<version>1.0.0</version>
<authors>juste</authors>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Contains content files for both WindowsPhoneApp 8.1 and Windows 8.1 projects.</description>
</metadata>
<files>
<file src="content\windowsphoneapp81\phone.txt" target="content\windowsphoneapp81\phone.txt" />
<file src="content\wpa81\phone2.txt" target="content\wpa81\phone2.txt" />
<file src="content\windows81\store.txt" target="content\windows81\store.txt" />
</files>
</package>

Просмотреть файл

@ -0,0 +1,23 @@
<VSTemplate Version="3.0.0" xmlns="http://schemas.microsoft.com/developer/vstemplate/2005" Type="Project">
<TemplateData>
<Name>WindowsPhoneAppJS81</Name>
<Description>windows phone app </Description>
<ProjectType>JavaScript</ProjectType>
<ProjectSubType>
</ProjectSubType>
<SortOrder>1000</SortOrder>
<CreateNewFolder>true</CreateNewFolder>
<DefaultName>WindowsPhoneAppJS81</DefaultName>
<ProvideDefaultName>true</ProvideDefaultName>
<LocationField>Enabled</LocationField>
<EnableLocationBrowseButton>true</EnableLocationBrowseButton>
<Icon>__TemplateIcon.ico</Icon>
</TemplateData>
<TemplateContent>
<Project TargetFileName="WindowsPhoneAppJS81.jsproj" File="WindowsPhoneAppJS81.jsproj" ReplaceParameters="true">
<ProjectItem ReplaceParameters="true" TargetFileName="default.html">default.html</ProjectItem>
<ProjectItem ReplaceParameters="true" TargetFileName="default.js">default.js</ProjectItem>
<ProjectItem ReplaceParameters="false" TargetFileName="package.appxmanifest">package.appxmanifest</ProjectItem>
</Project>
</TemplateContent>
</VSTemplate>

Просмотреть файл

@ -0,0 +1,69 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<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|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|x86">
<Configuration>Release</Configuration>
<Platform>x86</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>d4c6567d-aca4-4bdd-9584-6f01d1edf9b1</ProjectGuid>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup Condition="'$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '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.appxmanifest">
<SubType>Designer</SubType>
</AppxManifest>
<Content Include="default.html" />
<Content Include="default.js" />
</ItemGroup>
<ItemGroup>
<SDKReference Include="Microsoft.Phone.WinJS.2.1, Version=1.0" />
</ItemGroup>
<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>

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 9.9 KiB

Просмотреть файл

@ -0,0 +1,19 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>$safeprojectname$</title>
<!-- WinJS references -->
<link href="/css/ui-themed.css" rel="stylesheet" />
<script src="//Microsoft.Phone.WinJS.2.1/js/base.js"></script>
<script src="//Microsoft.Phone.WinJS.2.1/js/ui.js"></script>
<!-- $safeprojectname$ references -->
<link href="/css/default.css" rel="stylesheet" />
<script src="/js/default.js"></script>
</head>
<body>
<p>Content goes here</p>
</body>
</html>

Просмотреть файл

@ -0,0 +1,32 @@
// For an introduction to the Blank template, see the following documentation:
// http://go.microsoft.com/fwlink/?LinkID=329104
(function () {
"use strict";
var app = WinJS.Application;
var activation = Windows.ApplicationModel.Activation;
app.onactivated = function (args) {
if (args.detail.kind === activation.ActivationKind.launch) {
if (args.detail.previousExecutionState !== activation.ApplicationExecutionState.terminated) {
// TODO: This application has been newly launched. Initialize
// your application here.
} else {
// TODO: This application has been reactivated from suspension.
// Restore application state here.
}
args.setPromise(WinJS.UI.processAll());
}
};
app.oncheckpoint = function (args) {
// TODO: This application is about to be suspended. Save any state
// that needs to persist across suspensions here. You might use the
// WinJS.Application.sessionState object, which is automatically
// saved and restored across suspension. If you need to complete an
// asynchronous operation before your application is suspended, call
// args.setPromise().
};
app.start();
})();

Просмотреть файл

@ -0,0 +1,50 @@
<?xml version="1.0" encoding="utf-8"?>
<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="$guid1$"
Version="1.0.0.0"
Publisher="$XmlEscapedPublisherDistinguishedName$" />
<mp:PhoneIdentity PhoneProductId="ddb21aea-a1f8-4aa4-9ffd-0312ddaae7c2" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>
<Properties>
<DisplayName>$projectname$</DisplayName>
<PublisherDisplayName>$XmlEscapedPublisher$</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="App"
StartPage="default.html">
<m3:VisualElements
DisplayName="$projectname$"
Square150x150Logo="images\Logo.png"
Square44x44Logo="images\SmallLogo.png"
Description="$projectname$"
ForegroundText="light"
BackgroundColor="transparent">
<m3:DefaultTile Wide310x150Logo="images\WideLogo.png" Square71x71Logo="images\Square71x71Logo.png" />
<m3:SplashScreen Image="images\SplashScreen.png" />
<m3:ApplicationView MinWidth="width320"/>
<!--Used in XAML Designer. DO NOT REMOVE-->
</m3:VisualElements>
</Application>
</Applications>
<Capabilities>
<Capability Name="internetClient" />
</Capabilities>
</Package>

Просмотреть файл

@ -2280,7 +2280,7 @@ function Test-NonFrameworkAssemblyReferenceShouldHaveABindingRedirect
Assert-BindingRedirect $p app.config System.Web.Razor '0.0.0.0-3.0.0.0' '3.0.0.0'
}
function Test-InstallPackageIntoJavascriptApplication
function Test-InstallPackageIntoJavaScriptApplication
{
if ($dte.Version -eq "10.0")
{
@ -2297,6 +2297,24 @@ function Test-InstallPackageIntoJavascriptApplication
Assert-Package $p "jQuery"
}
function Test-InstallPackageIntoJavaScriptWindowsPhoneApp
{
# this test is only applicable to VS 2013 on Windows 8.1
if ($dte.Version -eq "10.0" -or $dte.Version -eq "11.0" -or [System.Environment]::OSVersion.Version -lt 6.3)
{
return;
}
# Arrange
$p = New-JavaScriptWindowsPhoneApp81
# Act
Install-Package jQuery -ProjectName $p.Name
# Assert
Assert-Package $p "jQuery"
}
function Test-InstallPackageIntoNativeWinStoreApplication
{
if ($dte.Version -eq "10.0")
@ -2337,6 +2355,31 @@ function Test-InstallPackageIntoJSAppOnWin81UseTheCorrectFxFolder
Assert-Null (Get-ProjectItem $p 'windows8.txt')
}
function Test-InstallPackageIntoJSWindowsPhoneAppOnWin81UseTheCorrectFxFolder
{
param($context)
# this test is only applicable to VS 2013 on Windows 8.1
if ($dte.Version -eq "10.0" -or $dte.Version -eq "11.0" -or [System.Environment]::OSVersion.Version -lt 6.3)
{
return
}
# Arrange
$p = New-JavaScriptWindowsPhoneApp81
# Act
Install-Package Java -ProjectName $p.Name -source $context.RepositoryPath
# Assert
Assert-Package $p Java
Assert-NotNull (Get-ProjectItem $p 'phone.txt')
Assert-NotNull (Get-ProjectItem $p 'phone2.txt')
Assert-Null (Get-ProjectItem $p 'store.txt')
}
function Test-SpecifyDifferentVersionThenServerVersion
{
# In this test, we explicitly set the version as "2.0",

Просмотреть файл

@ -540,11 +540,11 @@ function Test-UpdatePackageInAllProjects {
Update-Package Ninject
# Assert
Assert-SolutionPackage Ninject 3.2.0.0
Assert-Package $p1 Ninject 3.2.0.0
Assert-Package $p2 Ninject 3.2.0.0
Assert-Package $p3 Ninject 3.2.0.0
Assert-Package $p4 Ninject 3.2.0.0
Assert-SolutionPackage Ninject 3.2.2.0
Assert-Package $p1 Ninject 3.2.2.0
Assert-Package $p2 Ninject 3.2.2.0
Assert-Package $p3 Ninject 3.2.2.0
Assert-Package $p4 Ninject 3.2.2.0
Assert-Null (Get-SolutionPackage Ninject 2.0.1.0)
Assert-Null (Get-SolutionPackage Ninject 2.1.0.76)
Assert-Null (Get-SolutionPackage Ninject 2.2.0.0)

Просмотреть файл

@ -87,7 +87,7 @@ function New-Project {
if (!$ProjectName) {
$ProjectName = $TemplateName + "_$id"
}
# Make sure there is a solution
Ensure-Solution
@ -287,6 +287,24 @@ function New-JavaScriptApplication81
}
}
function New-JavaScriptWindowsPhoneApp81
{
param(
[string]$ProjectName,
[parameter(ValueFromPipeline = $true)]$SolutionFolder
)
try
{
$SolutionFolder | New-Project WindowsPhoneApp81JS $ProjectName
}
catch {
# If we're unable to create the project that means we probably don't have some SDK installed
# Signal to the runner that we want to skip this test
throw "SKIP: $($_)"
}
}
function New-NativeWinStoreApplication
{
param(

Просмотреть файл

@ -23,21 +23,32 @@ namespace NuGet.VisualStudio.Test
}
[Theory]
[InlineData("", "Windows, Version=0.0")]
[InlineData(null, "Windows, Version=0.0")]
[InlineData("8.0", "Windows, Version=8.0")]
[InlineData("8.1", "Windows, Version=8.1")]
public void GetTargetFrameworkForJSProjectReturnsCorrectPlatformVersion(string platformVersion, string exptectedTargetFramework)
[InlineData("", "", "Windows, Version=0.0")]
[InlineData(null, null, "Windows, Version=0.0")]
[InlineData("", "Windows", "Windows, Version=0.0")]
[InlineData(null, "Windows", "Windows, Version=0.0")]
[InlineData("8.0", "Windows", "Windows, Version=8.0")]
[InlineData("8.1", "Windows", "Windows, Version=8.1")]
[InlineData("", "WindowsPhoneApp", "WindowsPhoneApp, Version=0.0")]
[InlineData("8.1", "WindowsPhoneApp", "WindowsPhoneApp, Version=8.1")]
[InlineData("10", "vNextJSApp", "vNextJSApp, Version=10")]
public void GetTargetFrameworkForJSProjectReturnsCorrectPlatformVersion(string platformVersion, string platformIdentifier, string exptectedTargetFramework)
{
// Arrange
var project = new Mock<Project>();
project.Setup(p => p.Kind).Returns(VsConstants.JsProjectTypeGuid);
var fxProperty = new Mock<Property>();
fxProperty.Setup(x => x.Value).Returns(platformVersion);
var verProp = new Mock<Property>();
verProp.Setup(x => x.Value).Returns(platformVersion);
var idProp = new Mock<Property>();
idProp.Setup(x => x.Value).Returns(platformIdentifier);
project.Setup(p => p.Properties.Item(It.Is<object>(v => "TargetPlatformVersion".Equals(v))))
.Returns(fxProperty.Object);
.Returns(verProp.Object);
project.Setup(p => p.Properties.Item(It.Is<object>(v => "TargetPlatformIdentifier".Equals(v))))
.Returns(idProp.Object);
// Act
string targetFramework = ProjectExtensions.GetTargetFramework(project.Object);