Imported Upstream version 3.6.0

Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
This commit is contained in:
Jo Shields
2014-08-13 10:39:27 +01:00
commit a575963da9
50588 changed files with 8155799 additions and 0 deletions

Binary file not shown.

View File

@@ -0,0 +1,164 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="WebStack.tasks.targets"/>
<ItemGroup>
<WebStackNuGetPackages Include="DotNetOpenAuth.AspNet"/>
<WebStackNuGetPackages Include="DotNetOpenAuth.Core"/>
<WebStackNuGetPackages Include="DotNetOpenAuth.OAuth.Consumer"/>
<WebStackNuGetPackages Include="DotNetOpenAuth.OAuth.Core"/>
<WebStackNuGetPackages Include="DotNetOpenAuth.OpenId.Core"/>
<WebStackNuGetPackages Include="DotNetOpenAuth.OpenId.RelyingParty"/>
<WebStackNuGetPackages Include="EntityFramework"/>
<WebStackNuGetPackages Include="Microsoft.Web.FxCop"/>
<WebStackNuGetPackages Include="Microsoft.Web.Infrastructure"/>
<WebStackNuGetPackages Include="Moq"/>
<WebStackNuGetPackages Include="Newtonsoft.Json"/>
<WebStackNuGetPackages Include="Nuget.Core"/>
<WebStackNuGetPackages Include="StyleCop"/>
<WebStackNuGetPackages Include="xunit"/>
<WebStackNuGetPackages Include="xunit.extensions"/>
</ItemGroup>
<PropertyGroup>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">$(MSBuildProjectDirectory)\..\</SolutionDir>
<NuGetToolsPath>$([System.IO.Path]::Combine($(SolutionDir), "Tools"))</NuGetToolsPath>
<NuGetExePath>$(NuGetToolsPath)\NuGet.exe</NuGetExePath>
<PackagesConfig>$([System.IO.Path]::Combine($(ProjectDir), "packages.config"))</PackagesConfig>
<PackagesDir>$([System.IO.Path]::Combine($(SolutionDir), "packages"))</PackagesDir>
<PackageOutputDir Condition="'$(PackageOutputDir)' == ''">$(TargetDir.Trim('\\'))</PackageOutputDir>
<PreReleasePackagesUrl Condition="'$(PreReleasePackagesUrl)' == ''">http://www.myget.org/F/f05dce941ae4485090b04586209c8b08/</PreReleasePackagesUrl>
<CompactMessage Condition=" '$(CompactMessage)' == '' ">true</CompactMessage>
<!-- Package sources used to restore packages. By default will used the registered sources under %APPDATA%\NuGet\NuGet.Config -->
<PackageSources>"https://go.microsoft.com/fwlink/?LinkID=230477;$(PreReleasePackagesUrl)"</PackageSources>
<!-- Enable the restore command to run before builds -->
<RestorePackages Condition="$(RestorePackages) == ''">false</RestorePackages>
<!-- Property that enables building a package from a project -->
<BuildPackage Condition="$(BuildPackage) == ''">false</BuildPackage>
<!-- Commands -->
<RestoreCommand>"$(NuGetExePath)" install "$(PackagesConfig)" -source $(PackageSources) -o "$(PackagesDir)" > NUL</RestoreCommand>
<BuildCommand>"$(NuGetExePath)" pack "$(ProjectPath)" -p Configuration=$(Configuration) -o "$(PackageOutputDir)" -symbols</BuildCommand>
<!-- Make the build depend on restore packages -->
<BuildDependsOn Condition="$(RestorePackages) != 'true'">
VerifyPackages;
$(BuildDependsOn);
</BuildDependsOn>
<BuildDependsOn Condition="$(RestorePackages) == 'true'">
RestorePackages;
$(BuildDependsOn);
</BuildDependsOn>
<!-- Make the build depend on restore packages -->
<BuildDependsOn Condition="$(BuildPackage) == 'true'">
$(BuildDependsOn);
BuildPackage;
</BuildDependsOn>
</PropertyGroup>
<Target Name="VerifyPackages">
<CheckForPackages Packages="@(WebStackNuGetPackages)" PackagesDir="$(PackagesDir)" CompactMessage="$(CompactMessage)" />
</Target>
<Target Name="CheckPrerequisites">
<DownloadNuGet OutputFilename="$(NuGetExePath)" Condition="!Exists('$(NuGetExePath)')" />
</Target>
<Target Name="RestorePackages" DependsOnTargets="CheckPrerequisites">
<Exec Command="$(RestoreCommand)"
LogStandardErrorAsError="true"
Condition="Exists('$(PackagesConfig)')" />
</Target>
<Target Name="RestoreBinaryDependencies">
<Exec
Command='"$(NuGetExePath)" install StyleCop -source $(PackageSources) -o "$(PackagesDir)" -Version 4.7.10.0 > NUL'
LogStandardErrorAsError="true" />
<Exec
Command='"$(NuGetExePath)" install Microsoft.Web.FxCop -source $(PackageSources) -o "$(PackagesDir)" -ExcludeVersion > NUL'
LogStandardErrorAsError="true"
Condition=" !Exists('$(PackagesDir)\Microsoft.Web.FxCop') " />
</Target>
<Target Name="BuildPackage" DependsOnTargets="CheckPrerequisites">
<Exec Command="$(BuildCommand)"
LogStandardErrorAsError="true" />
</Target>
<UsingTask TaskName="DownloadNuGet" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll">
<ParameterGroup>
<OutputFilename ParameterType="System.String" Required="true" />
</ParameterGroup>
<Task>
<Reference Include="System.Core" />
<Reference Include="System.Xml" />
<Reference Include="WindowsBase" />
<Using Namespace="System" />
<Using Namespace="System.IO" />
<Using Namespace="System.IO.Packaging" />
<Using Namespace="System.Linq" />
<Using Namespace="System.Net" />
<Using Namespace="System.Xml" />
<Using Namespace="Microsoft.Build.Framework" />
<Using Namespace="Microsoft.Build.Utilities" />
<Code Type="Fragment" Language="cs">
<![CDATA[
string zipTempPath = null;
try {
OutputFilename = Path.GetFullPath(OutputFilename);
if (File.Exists(OutputFilename)) {
return true;
}
Log.LogMessage("Determining latest version of NuGet.CommandLine...");
WebClient webClient = new WebClient();
XmlDocument xml = new XmlDocument();
xml.LoadXml(webClient.DownloadString("http://nuget.org/v1/FeedService.svc/Packages()?$filter=tolower(Id)%20eq%20'nuget.commandline'&$top=1&$orderby=Version%20desc"));
XmlNamespaceManager xns = new XmlNamespaceManager(xml.NameTable);
xns.AddNamespace("atom", "http://www.w3.org/2005/Atom");
xns.AddNamespace("d", "http://schemas.microsoft.com/ado/2007/08/dataservices");
xns.AddNamespace("m", "http://schemas.microsoft.com/ado/2007/08/dataservices/metadata");
string version = xml.SelectSingleNode("//atom:entry/m:properties/d:Version", xns).InnerText;
string zipUrl = xml.SelectSingleNode("//atom:entry/atom:content", xns).Attributes["src"].Value;
Log.LogMessage("Downloading NuGet.CommandLine v{0}...", version);
zipTempPath = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString());
webClient.DownloadFile(zipUrl, zipTempPath);
Log.LogMessage("Copying to {0}...", OutputFilename);
using (Package package = Package.Open(zipTempPath)) {
PackagePart exePart = package.GetParts().Where(p => p.Uri.ToString().ToLowerInvariant() == "/tools/nuget.exe").Single();
using (Stream inputStream = exePart.GetStream(FileMode.Open, FileAccess.Read))
using (Stream outputStream = File.Create(OutputFilename)) {
byte[] buffer = new byte[16384];
while (true) {
int read = inputStream.Read(buffer, 0, buffer.Length);
if (read == 0) {
break;
}
outputStream.Write(buffer, 0, read);
}
}
}
return true;
}
catch (Exception ex) {
Log.LogErrorFromException(ex);
return false;
}
finally {
if (zipTempPath != null) File.Delete(zipTempPath);
}
]]>
</Code>
</Task>
</UsingTask>
</Project>

View File

@@ -0,0 +1,126 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<StyleCopMsBuildRunner Include="$(WebStackRootPath)packages\**\StyleCop.dll"/>
</ItemGroup>
<PropertyGroup>
<StyleCopEnabled Condition=" '$(StyleCopMsBuildRunner)' == '' ">false</StyleCopEnabled>
</PropertyGroup>
<UsingTask AssemblyFile="@(StyleCopMsBuildRunner)" TaskName="StyleCopTask" Condition=" '$(StyleCopEnabled)' != 'false' " />
<PropertyGroup>
<BuildDependsOn>$(BuildDependsOn);StyleCop</BuildDependsOn>
<RebuildDependsOn>StyleCopForceFullAnalysis;$(RebuildDependsOn)</RebuildDependsOn>
</PropertyGroup>
<!-- Define StyleCopForceFullAnalysis property. -->
<PropertyGroup Condition="('$(SourceAnalysisForceFullAnalysis)' != '') and ('$(StyleCopForceFullAnalysis)' == '')">
<StyleCopForceFullAnalysis>$(SourceAnalysisForceFullAnalysis)</StyleCopForceFullAnalysis>
</PropertyGroup>
<PropertyGroup Condition="'$(StyleCopForceFullAnalysis)' == ''">
<StyleCopForceFullAnalysis>false</StyleCopForceFullAnalysis>
</PropertyGroup>
<!-- Define StyleCopCacheResults property. -->
<PropertyGroup Condition="('$(SourceAnalysisCacheResults)' != '') and ('$(StyleCopCacheResults)' == '')">
<StyleCopCacheResults>$(SourceAnalysisCacheResults)</StyleCopCacheResults>
</PropertyGroup>
<PropertyGroup Condition="'$(StyleCopCacheResults)' == ''">
<StyleCopCacheResults>true</StyleCopCacheResults>
</PropertyGroup>
<!-- Define StyleCopTreatErrorsAsWarnings property. -->
<PropertyGroup Condition="('$(SourceAnalysisTreatErrorsAsWarnings)' != '') and ('$(StyleCopTreatErrorsAsWarnings)' == '')">
<StyleCopTreatErrorsAsWarnings>$(SourceAnalysisTreatErrorsAsWarnings)</StyleCopTreatErrorsAsWarnings>
</PropertyGroup>
<PropertyGroup Condition="'$(StyleCopTreatErrorsAsWarnings)' == ''">
<StyleCopTreatErrorsAsWarnings>true</StyleCopTreatErrorsAsWarnings>
</PropertyGroup>
<!-- Define StyleCopEnabled property. -->
<PropertyGroup Condition="('$(SourceAnalysisEnabled)' != '') and ('$(StyleCopEnabled)' == '')">
<StyleCopEnabled>$(SourceAnalysisEnabled)</StyleCopEnabled>
</PropertyGroup>
<PropertyGroup Condition="'$(StyleCopEnabled)' == ''">
<StyleCopEnabled>true</StyleCopEnabled>
</PropertyGroup>
<!-- Define StyleCopOverrideSettingsFile property. -->
<PropertyGroup Condition="('$(SourceAnalysisOverrideSettingsFile)' != '') and ('$(StyleCopOverrideSettingsFile)' == '')">
<StyleCopOverrideSettingsFile>$(SourceAnalysisOverrideSettingsFile)</StyleCopOverrideSettingsFile>
</PropertyGroup>
<PropertyGroup Condition="'$(StyleCopOverrideSettingsFile)' == ''">
<StyleCopOverrideSettingsFile> </StyleCopOverrideSettingsFile>
</PropertyGroup>
<!-- Define StyleCopOutputFile property. -->
<PropertyGroup Condition="('$(SourceAnalysisOutputFile)' != '') and ('$(StyleCopOutputFile)' == '')">
<StyleCopOutputFile>$(SourceAnalysisOutputFile)</StyleCopOutputFile>
</PropertyGroup>
<PropertyGroup Condition="'$(StyleCopOutputFile)' == ''">
<StyleCopOutputFile>$(IntermediateOutputPath)StyleCopViolations.xml</StyleCopOutputFile>
</PropertyGroup>
<!-- Define all new properties which do not need to have both StyleCop and SourceAnalysis variations. -->
<PropertyGroup>
<!-- Specifying 0 will cause StyleCop to use the default violation count limit.
Specifying any positive number will cause StyleCop to use that number as the violation count limit.
Specifying any negative number will cause StyleCop to allow any number of violations without limit. -->
<StyleCopMaxViolationCount Condition="'$(StyleCopMaxViolationCount)' == ''">0</StyleCopMaxViolationCount>
</PropertyGroup>
<!-- Define target: StyleCopForceFullAnalysis -->
<Target Name="StyleCopForceFullAnalysis">
<CreateProperty Value="true">
<Output TaskParameter="Value" PropertyName="StyleCopForceFullAnalysis" />
</CreateProperty>
</Target>
<!-- Define target: StyleCop -->
<Target Name="StyleCop" Condition="'$(StyleCopEnabled)' != 'false'">
<Message Text="Forcing full StyleCop reanalysis." Condition="'$(StyleCopForceFullAnalysis)' == 'true'" Importance="Low" />
<!-- Determine what files should be checked. Take all Compile items, but exclude those that have
set ExcludeFromStyleCop=true or ExcludeFromSourceAnalysis=true. -->
<CreateItem Include="@(Compile)" Condition="('%(Compile.ExcludeFromStyleCop)' != 'true') and ('%(Compile.ExcludeFromSourceAnalysis)' != 'true')">
<Output TaskParameter="Include" ItemName="StyleCopFiles"/>
</CreateItem>
<Message Text="Analyzing @(StyleCopFiles)" Importance="Low" />
<!-- Show list of what files should be excluded. checked. Take all Compile items, but exclude those that have
set ExcludeFromStyleCop=true or ExcludeFromSourceAnalysis=true. -->
<CreateItem Include="@(Compile)" Condition="('%(Compile.ExcludeFromStyleCop)' == 'true') or ('%(Compile.ExcludeFromSourceAnalysis)' == 'true')">
<Output TaskParameter="Include" ItemName="StyleCopExcludedFiles"/>
</CreateItem>
<ItemGroup>
<StyleCopFiles Remove="@(ExcludeFromStyleCop)" />
</ItemGroup>
<Message Text="Excluding @(StyleCopExcludedFiles)" Importance="Normal" Condition=" '@(StyleCopExcludedFiles)' != '' "/>
<!-- Run the StyleCop MSBuild task. -->
<StyleCopTask
ProjectFullPath="$(MSBuildProjectDirectory)"
SourceFiles="@(StyleCopFiles)"
AdditionalAddinPaths="@(StyleCopAdditionalAddinPaths)"
ForceFullAnalysis="$(StyleCopForceFullAnalysis)"
DefineConstants="$(DefineConstants)"
TreatErrorsAsWarnings="$(StyleCopTreatErrorsAsWarnings)"
CacheResults="$(StyleCopCacheResults)"
OverrideSettingsFile="$(StyleCopOverrideSettingsFile)"
OutputFile="$(StyleCopOutputFile)"
MaxViolationCount="$(StyleCopMaxViolationCount)"
/>
<!-- Make output files cleanable -->
<CreateItem Include="$(StyleCopOutputFile)">
<Output TaskParameter="Include" ItemName="FileWrites"/>
</CreateItem>
<!-- Add the StyleCop.cache file to the list of files we've written - so they can be cleaned up on a Build Clean. -->
<CreateItem Include="StyleCop.Cache" Condition="'$(StyleCopCacheResults)' == 'true'">
<Output TaskParameter="Include" ItemName="FileWrites"/>
</CreateItem>
</Target>
</Project>

View File

@@ -0,0 +1,45 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<!-- Define some basic reference paths -->
<WebStackRootPath>$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)..\'))</WebStackRootPath>
<WebStackToolsPath>$(MSBuildThisFileDirectory)</WebStackToolsPath>
<!-- Define default configuration (so building from command line is consistent) -->
<Configuration Condition=" '$(Configuration)' == '' ">Release</Configuration>
<!-- Define basic output paths -->
<OutputPath Condition=" '$(OutputPath)' == '' ">$(WebStackRootPath)bin\$(Configuration)\</OutputPath>
<WebStackIntermediateOutputPath>$(WebStackRootPath)obj\$(Configuration)\$(MSBuildProjectName)\</WebStackIntermediateOutputPath>
<!-- Variables for output redirection (localization, signing, etc)-->
<Language Condition=" '$(Language)' == '' ">ENU</Language>
<LocalizedPath Condition=" '$(LocalizedPath)' == '' "></LocalizedPath>
<!-- StyleCop support -->
<StyleCopTreatErrorsAsWarnings Condition=" '$(StyleCopTreatErrorsAsWarnings)' == '' ">false</StyleCopTreatErrorsAsWarnings>
<StyleCopEnabled Condition=" '$(StyleCopEnabled)' == '' ">false</StyleCopEnabled>
<!-- VisualStudioVersion does not appear in 4.0 so its absence defaults to Dev10 -->
<VisualStudioVersion Condition = "'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<!-- Target 4.0 for both VS2010 and VS 11 by default -->
<TargetFrameworkVersion Condition = "'$(TargetFrameworkVersion)' == ''">v4.0</TargetFrameworkVersion>
<!-- Enable NuGet package restore for all projects -->
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">$(WebStackRootPath)</SolutionDir>
<RestorePackages Condition=" '$(RestorePackages)' == '' ">$(EnableNuGetPackageRestore)</RestorePackages>
<RestorePackages Condition=" '$(RestorePackages)' == '' ">false</RestorePackages>
<!-- Use CustomAfterMicrosoftCommonTargets property (defined in Microsoft.Common.targets) to
inject post-Common targets files without requiring the inclusion -->
<CustomAfterMicrosoftCommonTargets>$(WebStackToolsPath)WebStack.targets</CustomAfterMicrosoftCommonTargets>
</PropertyGroup>
<!-- Everything is delay signed by default -->
<PropertyGroup>
<SignAssembly>true</SignAssembly>
<DelaySign>true</DelaySign>
<AssemblyOriginatorKeyFile>$(WebStackRootPath)\tools\35MSSharedLib1024.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
</Project>

View File

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(WebStackToolsPath)WebStack.StyleCop.targets"/>
<Import Project="$(WebStackToolsPath)WebStack.NuGet.targets"/>
</Project>

View File

@@ -0,0 +1,108 @@
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<UsingTask TaskName="CheckForPackages" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll">
<ParameterGroup>
<Packages ParameterType="Microsoft.Build.Framework.ITaskItem[]" Required="true" />
<PackagesDir ParameterType="System.String" Required="true" />
<CompactMessage ParameterType="System.Boolean" Required="false" />
</ParameterGroup>
<Task>
<Using Namespace="System" />
<Using Namespace="System.Collections.Generic" />
<Using Namespace="System.IO" />
<Using Namespace="System.Linq" />
<Using Namespace="Microsoft.Build.Framework" />
<Using Namespace="Microsoft.Build.Utilities" />
<Code Type="Fragment" Language="cs">
<![CDATA[
try {
string[] dirs = Directory.GetDirectories(PackagesDir);
var missingPackages = new List<string>();
foreach (ITaskItem package in Packages) {
string packageSpec = package.ItemSpec;
bool found = false;
foreach (var dir in dirs)
if (Path.GetFileName(dir).StartsWith(packageSpec, StringComparison.OrdinalIgnoreCase)) {
found = true;
break;
}
if (!found)
missingPackages.Add(packageSpec);
}
if (missingPackages.Any()) {
if (CompactMessage) {
Log.LogError("NuGet package restore is not currently enabled. For more information, please see: http://aspnetwebstack.codeplex.com/wikipage?title=NuGet+Packages");
}
else {
Log.LogMessage(MessageImportance.High, "The following NuGet packages have not yet been downloaded:");
foreach (var missingPackage in missingPackages)
Log.LogMessage(MessageImportance.High, " " + missingPackage);
Log.LogMessage(MessageImportance.High, "For more information on enabling package restore, please see:");
Log.LogMessage(MessageImportance.High, "http://aspnetwebstack.codeplex.com/wikipage?title=NuGet+Packages");
}
return false;
}
return true;
}
catch (Exception ex) {
Log.LogErrorFromException(ex);
return false;
}
]]>
</Code>
</Task>
</UsingTask>
<UsingTask TaskName="RegexReplace" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll">
<ParameterGroup>
<Files ParameterType="Microsoft.Build.Framework.ITaskItem[]" Required="true" />
<Find ParameterType="System.String" Required="true" />
<Replace ParameterType="System.String" Required="true" />
<WarnOnNoMatch ParameterType="System.Boolean" Required="false" />
</ParameterGroup>
<Task>
<Using Namespace="System" />
<Using Namespace="System.IO" />
<Using Namespace="System.Text" />
<Using Namespace="System.Text.RegularExpressions" />
<Using Namespace="Microsoft.Build.Framework" />
<Using Namespace="Microsoft.Build.Utilities" />
<Code Type="Fragment" Language="cs">
<![CDATA[
try {
Regex regex = new Regex(Find, RegexOptions.Multiline | RegexOptions.Compiled);
foreach (ITaskItem file in Files) {
string fullPath = Path.GetFullPath(file.ItemSpec);
string originalText = File.ReadAllText(fullPath);
bool matched = regex.IsMatch(originalText);
if (!matched) {
if (WarnOnNoMatch) {
Log.LogWarning("No matches for '{0}' in '{1}'.", Find, fullPath);
}
}
else {
File.SetAttributes(fullPath, File.GetAttributes(fullPath) & ~FileAttributes.ReadOnly);
File.WriteAllText(fullPath, regex.Replace(originalText, Replace), Encoding.UTF8);
}
}
return true;
}
catch (Exception ex) {
Log.LogErrorFromException(ex);
return false;
}
]]>
</Code>
</Task>
</UsingTask>
</Project>

View File

@@ -0,0 +1,20 @@
<Project ToolsVersion="4.0" DefaultTargets="Xunit" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildThisFileDirectory)WebStack.tasks.targets"/>
<!-- This is a separate MSBuild file so that we can survive upgrades of the xunit NuGet package
and also still work with NuGet Package Restore. -->
<ItemGroup>
<XunitMsBuildRunner Include="..\packages\**\xunit.runner.msbuild.dll"/>
</ItemGroup>
<UsingTask TaskName="Xunit.Runner.MSBuild.xunit" AssemblyFile="@(XunitMsBuildRunner)"/>
<Target Name="Xunit">
<xunit Assembly="$(TestAssembly)" Xml="$(XmlPath)"/>
<!-- Replace potentially illegal escaped characters -->
<RegexReplace
Files="$(XmlPath)"
Find="&amp;#x(?&lt;char&gt;[0-9A-Fa-f]+);"
Replace="\0x${char}"
WarnOnNoMatch="false"/>
</Target>
</Project>