Skip to content

Commit 8792daa

Browse files
committed
Merge remote-tracking branch 'refs/remotes/origin/lan-dev'
2 parents e2c1581 + 8f24064 commit 8792daa

File tree

54 files changed

+4384
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+4384
-0
lines changed

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[Oo]bj/
2+
[Bb]in/
3+
.vs/
4+
msbuild.*
5+
obj/
6+
packages/

.nuget/NuGet.Config

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<solution>
4+
<add key="disableSourceControlIntegration" value="true" />
5+
</solution>
6+
<packageSources>
7+
<add key="nuget.org" value="https://www.nuget.org/api/v2/" />
8+
</packageSources>
9+
</configuration>

.nuget/NuGet.exe

18 KB
Binary file not shown.

.nuget/NuGet.targets

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">$(MSBuildProjectDirectory)\..\</SolutionDir>
5+
6+
<!-- Enable the restore command to run before builds -->
7+
<RestorePackages Condition=" '$(RestorePackages)' == '' ">false</RestorePackages>
8+
9+
<!-- Property that enables building a package from a project -->
10+
<BuildPackage Condition=" '$(BuildPackage)' == '' ">false</BuildPackage>
11+
12+
<!-- Determines if package restore consent is required to restore packages -->
13+
<RequireRestoreConsent Condition=" '$(RequireRestoreConsent)' != 'false' ">true</RequireRestoreConsent>
14+
15+
<!-- Download NuGet.exe if it does not already exist -->
16+
<DownloadNuGetExe Condition=" '$(DownloadNuGetExe)' == '' ">false</DownloadNuGetExe>
17+
</PropertyGroup>
18+
19+
<ItemGroup Condition=" '$(PackageSources)' == '' ">
20+
<!-- Package sources used to restore packages. By default, registered sources under %APPDATA%\NuGet\NuGet.Config will be used -->
21+
<!-- The official NuGet package source (https://www.nuget.org/api/v2/) will be excluded if package sources are specified and it does not appear in the list -->
22+
<!--
23+
<PackageSource Include="https://www.nuget.org/api/v2/" />
24+
<PackageSource Include="https://my-nuget-source/nuget/" />
25+
-->
26+
</ItemGroup>
27+
28+
<PropertyGroup Condition=" '$(OS)' == 'Windows_NT'">
29+
<!-- Windows specific commands -->
30+
<NuGetToolsPath>$([System.IO.Path]::Combine($(SolutionDir), ".nuget"))</NuGetToolsPath>
31+
</PropertyGroup>
32+
33+
<PropertyGroup Condition=" '$(OS)' != 'Windows_NT'">
34+
<!-- We need to launch nuget.exe with the mono command if we're not on windows -->
35+
<NuGetToolsPath>$(SolutionDir).nuget</NuGetToolsPath>
36+
</PropertyGroup>
37+
38+
<PropertyGroup>
39+
<PackagesProjectConfig Condition=" '$(OS)' == 'Windows_NT'">$(MSBuildProjectDirectory)\packages.$(MSBuildProjectName.Replace(' ', '_')).config</PackagesProjectConfig>
40+
<PackagesProjectConfig Condition=" '$(OS)' != 'Windows_NT'">$(MSBuildProjectDirectory)\packages.$(MSBuildProjectName).config</PackagesProjectConfig>
41+
</PropertyGroup>
42+
43+
<PropertyGroup>
44+
<PackagesConfig Condition="Exists('$(MSBuildProjectDirectory)\packages.config')">$(MSBuildProjectDirectory)\packages.config</PackagesConfig>
45+
<PackagesConfig Condition="Exists('$(PackagesProjectConfig)')">$(PackagesProjectConfig)</PackagesConfig>
46+
</PropertyGroup>
47+
48+
<PropertyGroup>
49+
<!-- NuGet command -->
50+
<NuGetExePath Condition=" '$(NuGetExePath)' == '' ">$(NuGetToolsPath)\NuGet.exe</NuGetExePath>
51+
<PackageSources Condition=" $(PackageSources) == '' ">@(PackageSource)</PackageSources>
52+
53+
<NuGetCommand Condition=" '$(OS)' == 'Windows_NT'">"$(NuGetExePath)"</NuGetCommand>
54+
<NuGetCommand Condition=" '$(OS)' != 'Windows_NT' ">mono --runtime=v4.0.30319 $(NuGetExePath)</NuGetCommand>
55+
56+
<PackageOutputDir Condition="$(PackageOutputDir) == ''">$(TargetDir.Trim('\\'))</PackageOutputDir>
57+
58+
<RequireConsentSwitch Condition=" $(RequireRestoreConsent) == 'true' ">-RequireConsent</RequireConsentSwitch>
59+
<NonInteractiveSwitch Condition=" '$(VisualStudioVersion)' != '' AND '$(OS)' == 'Windows_NT' ">-NonInteractive</NonInteractiveSwitch>
60+
61+
<PaddedSolutionDir Condition=" '$(OS)' == 'Windows_NT'">"$(SolutionDir) "</PaddedSolutionDir>
62+
<PaddedSolutionDir Condition=" '$(OS)' != 'Windows_NT' ">"$(SolutionDir)"</PaddedSolutionDir>
63+
64+
<!-- Commands -->
65+
<RestoreCommand>$(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)" $(NonInteractiveSwitch) $(RequireConsentSwitch) -solutionDir $(PaddedSolutionDir)</RestoreCommand>
66+
<BuildCommand>$(NuGetCommand) pack "$(ProjectPath)" -Properties "Configuration=$(Configuration);Platform=$(Platform)" $(NonInteractiveSwitch) -OutputDirectory "$(PackageOutputDir)" -symbols</BuildCommand>
67+
68+
<!-- We need to ensure packages are restored prior to assembly resolve -->
69+
<BuildDependsOn Condition="$(RestorePackages) == 'true'">
70+
RestorePackages;
71+
$(BuildDependsOn);
72+
</BuildDependsOn>
73+
74+
<!-- Make the build depend on restore packages -->
75+
<BuildDependsOn Condition="$(BuildPackage) == 'true'">
76+
$(BuildDependsOn);
77+
BuildPackage;
78+
</BuildDependsOn>
79+
</PropertyGroup>
80+
81+
<Target Name="CheckPrerequisites">
82+
<!-- Raise an error if we're unable to locate nuget.exe -->
83+
<Error Condition="'$(DownloadNuGetExe)' != 'true' AND !Exists('$(NuGetExePath)')" Text="Unable to locate '$(NuGetExePath)'" />
84+
<!--
85+
Take advantage of MsBuild's build dependency tracking to make sure that we only ever download nuget.exe once.
86+
This effectively acts as a lock that makes sure that the download operation will only happen once and all
87+
parallel builds will have to wait for it to complete.
88+
-->
89+
<MsBuild Targets="_DownloadNuGet" Projects="$(MSBuildThisFileFullPath)" Properties="Configuration=NOT_IMPORTANT;DownloadNuGetExe=$(DownloadNuGetExe)" />
90+
</Target>
91+
92+
<Target Name="_DownloadNuGet">
93+
<DownloadNuGet OutputFilename="$(NuGetExePath)" Condition=" '$(DownloadNuGetExe)' == 'true' AND !Exists('$(NuGetExePath)')" />
94+
</Target>
95+
96+
<Target Name="RestorePackages" DependsOnTargets="CheckPrerequisites">
97+
<Exec Command="$(RestoreCommand)"
98+
Condition="'$(OS)' != 'Windows_NT' And Exists('$(PackagesConfig)')" />
99+
100+
<Exec Command="$(RestoreCommand)"
101+
LogStandardErrorAsError="true"
102+
Condition="'$(OS)' == 'Windows_NT' And Exists('$(PackagesConfig)')" />
103+
</Target>
104+
105+
<Target Name="BuildPackage" DependsOnTargets="CheckPrerequisites">
106+
<Exec Command="$(BuildCommand)"
107+
Condition=" '$(OS)' != 'Windows_NT' " />
108+
109+
<Exec Command="$(BuildCommand)"
110+
LogStandardErrorAsError="true"
111+
Condition=" '$(OS)' == 'Windows_NT' " />
112+
</Target>
113+
114+
<UsingTask TaskName="DownloadNuGet" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll">
115+
<ParameterGroup>
116+
<OutputFilename ParameterType="System.String" Required="true" />
117+
</ParameterGroup>
118+
<Task>
119+
<Reference Include="System.Core" />
120+
<Using Namespace="System" />
121+
<Using Namespace="System.IO" />
122+
<Using Namespace="System.Net" />
123+
<Using Namespace="Microsoft.Build.Framework" />
124+
<Using Namespace="Microsoft.Build.Utilities" />
125+
<Code Type="Fragment" Language="cs">
126+
<![CDATA[
127+
try {
128+
OutputFilename = Path.GetFullPath(OutputFilename);
129+
130+
Log.LogMessage("Downloading latest version of NuGet.exe...");
131+
WebClient webClient = new WebClient();
132+
webClient.DownloadFile("https://www.nuget.org/nuget.exe", OutputFilename);
133+
134+
return true;
135+
}
136+
catch (Exception ex) {
137+
Log.LogErrorFromException(ex);
138+
return false;
139+
}
140+
]]>
141+
</Code>
142+
</Task>
143+
</UsingTask>
144+
</Project>

Microsoft.AspNet.OutputCache.sln

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio 14
4+
VisualStudioVersion = 14.0.25420.1
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.AspNet.OutputCache.OutputCacheModuleAsync", "src\OutputCacheModuleAsync\Microsoft.AspNet.OutputCache.OutputCacheModuleAsync.csproj", "{3B446E33-7B1C-4A32-AEB8-92DC6CE94F77}"
7+
EndProject
8+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.AspNet.OutputCache.CustomOutputCacheProvider", "test\CustomOutputCacheProvider\Microsoft.AspNet.OutputCache.CustomOutputCacheProvider.csproj", "{A8F3E399-BCAF-4F3E-BC16-5CA98A779916}"
9+
EndProject
10+
Global
11+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
12+
Debug|Any CPU = Debug|Any CPU
13+
Release|Any CPU = Release|Any CPU
14+
EndGlobalSection
15+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
16+
{3B446E33-7B1C-4A32-AEB8-92DC6CE94F77}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
17+
{3B446E33-7B1C-4A32-AEB8-92DC6CE94F77}.Debug|Any CPU.Build.0 = Debug|Any CPU
18+
{3B446E33-7B1C-4A32-AEB8-92DC6CE94F77}.Release|Any CPU.ActiveCfg = Release|Any CPU
19+
{3B446E33-7B1C-4A32-AEB8-92DC6CE94F77}.Release|Any CPU.Build.0 = Release|Any CPU
20+
{A8F3E399-BCAF-4F3E-BC16-5CA98A779916}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
21+
{A8F3E399-BCAF-4F3E-BC16-5CA98A779916}.Debug|Any CPU.Build.0 = Debug|Any CPU
22+
{A8F3E399-BCAF-4F3E-BC16-5CA98A779916}.Release|Any CPU.ActiveCfg = Release|Any CPU
23+
{A8F3E399-BCAF-4F3E-BC16-5CA98A779916}.Release|Any CPU.Build.0 = Release|Any CPU
24+
{1D14BBD9-C8D6-4A08-949C-2395005E22A4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
25+
{1D14BBD9-C8D6-4A08-949C-2395005E22A4}.Debug|Any CPU.Build.0 = Debug|Any CPU
26+
{1D14BBD9-C8D6-4A08-949C-2395005E22A4}.Release|Any CPU.ActiveCfg = Release|Any CPU
27+
{1D14BBD9-C8D6-4A08-949C-2395005E22A4}.Release|Any CPU.Build.0 = Release|Any CPU
28+
{DA686514-993E-4FA9-8B1D-9A5DCCF9CD4E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
29+
{DA686514-993E-4FA9-8B1D-9A5DCCF9CD4E}.Debug|Any CPU.Build.0 = Debug|Any CPU
30+
{DA686514-993E-4FA9-8B1D-9A5DCCF9CD4E}.Release|Any CPU.ActiveCfg = Release|Any CPU
31+
{DA686514-993E-4FA9-8B1D-9A5DCCF9CD4E}.Release|Any CPU.Build.0 = Release|Any CPU
32+
EndGlobalSection
33+
GlobalSection(SolutionProperties) = preSolution
34+
HideSolutionNode = FALSE
35+
EndGlobalSection
36+
EndGlobal

MicrosoftAspNetOutputCache.msbuild

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2+
<Import Project="tools\MicrosoftAspNetOutputCache.settings.targets"/>
3+
4+
<ItemGroup>
5+
<AssemblyProject Include="src\OutputCacheModuleAsync\Microsoft.AspNet.OutputCache.OutputCacheModuleAsync.csproj" />
6+
<AssemblyProject Include="test\CustomOutputCacheProvider\Microsoft.AspNet.OutputCache.CustomOutputCacheProvider.csproj" />
7+
</ItemGroup>
8+
<ItemGroup>
9+
<PackageProject Include="src\Packages\Packages.csproj" />
10+
</ItemGroup>
11+
12+
<Target Name="Build" DependsOnTargets="BuildAssemblies;BuildPackages" />
13+
<Target Name="Clean" DependsOnTargets="CleanPackages;CleanAssemblies" />
14+
<Target Name="Rebuild" DependsOnTargets="Clean;Build" />
15+
16+
<Target Name="BuildAssemblies" DependsOnTargets="RestorePackages">
17+
<MSBuild Targets="Build" Projects="@(AssemblyProject)" />
18+
</Target>
19+
20+
<Target Name="CleanAssemblies">
21+
<MSBuild Targets="Clean" Projects="Microsoft.Aspnet.OutputCache.sln" />
22+
</Target>
23+
24+
<Target Name="RebuildAssemblies" DependsOnTargets="Clean;Build" />
25+
26+
<!-- Packages build -->
27+
28+
<Target Name="BuildPackages" DependsOnTargets="RestorePackages">
29+
<MSBuild Targets="" Projects="@(PackageProject)" />
30+
</Target>
31+
32+
<Target Name="CleanPackages">
33+
<MSBuild Targets="Clean" Projects="@(PackageProject)" />
34+
</Target>
35+
36+
<Target Name="RebuildPackages" DependsOnTargets="CleanPackages;BuildPackages" />
37+
38+
<Target Name="RestorePackages">
39+
<Exec Command=".nuget\NuGet.exe restore" />
40+
</Target>
41+
42+
<!--
43+
<Target Name="UnitTest">
44+
<ItemGroup>
45+
<TestDLLs Include="test\SystemWebProvidersUnitTest\bin\$(Configuration)\*Test.dll" />
46+
</ItemGroup>
47+
48+
<PropertyGroup>
49+
<TestSettingsFile Condition=" '$(Configuration)' == 'CodeCoverage' ">$(MsBuildProjectDirectory)\test\CodeCoverage.testsettings</TestSettingsFile>
50+
<TestSettingsFile Condition=" '$(Configuration)' != 'CodeCoverage' ">$(MsBuildProjectDirectory)\unittest.testsettings</TestSettingsFile>
51+
</PropertyGroup>
52+
53+
<Delete Files="bin\$(Configuration)-TestResults.trx" />
54+
<Exec
55+
Command="&quot;$(VS100COMNTOOLS)..\IDE\MSTEST.EXE&quot; /nologo /usestderr /resultsfile:&quot;bin\$(Configuration)-TestResults.trx&quot; @(TestDLLs -> '/testcontainer:&quot;%(Identity)&quot;', ' ') /testsettings:&quot;$(TestSettingsFile)&quot;" />
56+
</Target>
57+
-->
58+
<Import Project="tools\MicrosoftAspNetOutputCache.targets"/>
59+
</Project>

ReadMe.txt

Whitespace-only changes.

build.cmd

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
@ECHO OFF
2+
3+
setlocal
4+
5+
set logOptions=/flp:Summary;Verbosity=diag;LogFile=msbuild.log /flp1:warningsonly;logfile=msbuild.wrn /flp2:errorsonly;logfile=msbuild.err
6+
7+
set MSBUILDEXE=
8+
if exist "%SystemDrive%\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe" (
9+
set MSBUILDEXE="%SystemDrive%\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe"
10+
GOTO BUILD
11+
)
12+
13+
if exist "%SystemDrive%\Program Files (x86)\MSBuild\12.0\Bin\MSBuild.exe" (
14+
set MSBUILDEXE="%SystemDrive%\Program Files (x86)\MSBuild\12.0\Bin\MSBuild.exe"
15+
GOTO BUILD
16+
)
17+
18+
if not defined MSBUILDEXE (
19+
set MSBUILDEXE="C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe"
20+
)
21+
22+
:BUILD
23+
REM %MSBUILDEXE% "%~dp0\MicrosoftAspNetOutputCache.msbuild" %logOptions% /v:d /maxcpucount /nodeReuse:false %*
24+
%MSBUILDEXE% "%~dp0\MicrosoftAspNetOutputCache.msbuild" %logOptions% /v:diag /maxcpucount /nodeReuse:false %*
25+
26+
endlocal
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
namespace Microsoft.AspNet.OutputCache {
2+
3+
sealed class CacheDirectives {
4+
public const string NoCache = "no-cache";
5+
public const string NoStore = "no-store";
6+
public const string MaxAge = "max-age=";
7+
public const string MinFresh = "min-fresh=";
8+
}
9+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
namespace Microsoft.AspNet.OutputCache {
2+
using System;
3+
4+
sealed class CachedRawResponse {
5+
6+
public Guid CachedVaryId { get; set; }
7+
8+
public HttpRawResponse RawResponse { get; set; }
9+
10+
public string KernelCacheUrl { get; set; }
11+
12+
public HttpCachePolicySettings CachePolicy { get; set; }
13+
}
14+
}
15+
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
namespace Microsoft.AspNet.OutputCache {
2+
using System;
3+
4+
sealed class CachedVary {
5+
public string[] ContentEncodings { get; set; }
6+
public string[] Headers { get; set; }
7+
public string[] Params { get; set; }
8+
public string VaryByCustom { get; set; }
9+
public bool VaryByAllParams { get; set; }
10+
public Guid CachedVaryId { get; set; }
11+
12+
public CachedVary() {
13+
CachedVaryId = Guid.NewGuid();
14+
}
15+
16+
public override bool Equals(object obj) {
17+
if (Object.ReferenceEquals(obj, this)) {
18+
return true;
19+
}
20+
var cv = obj as CachedVary;
21+
if (cv == null) {
22+
return false;
23+
}
24+
return VaryByAllParams == cv.VaryByAllParams
25+
&& VaryByCustom == cv.VaryByCustom
26+
&& StringUtil.StringArrayEquals(ContentEncodings, cv.ContentEncodings)
27+
&& StringUtil.StringArrayEquals(Headers, cv.Headers)
28+
&& StringUtil.StringArrayEquals(Params, cv.Params);
29+
}
30+
31+
public override int GetHashCode() {
32+
return base.GetHashCode();
33+
}
34+
}
35+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
namespace Microsoft.AspNet.OutputCache {
2+
using System;
3+
using System.Web.Caching;
4+
5+
sealed class DependencyCacheEntry {
6+
public string RawResponseKey;
7+
public string KernelCacheUrl;
8+
public string Name;
9+
}
10+
11+
sealed class DependencyCacheEntryWrapper {
12+
public DependencyCacheEntry DependencyCacheEntry;
13+
public CacheDependency Dependencies;
14+
public TimeSpan DependencyCacheTimeSpan;
15+
public CacheItemPriority CacheItemPriority;
16+
public CacheItemRemovedCallback DependencyRemovedCallback;
17+
}
18+
}

0 commit comments

Comments
 (0)