Updated projects and the build.

- Things compile with ifdefs for coreclr now.
This commit is contained in:
David Fowler 2014-01-23 23:52:20 -08:00
parent 27ff7762e9
commit 3ef8197d18
49 changed files with 1220 additions and 380 deletions

View File

@ -3,40 +3,36 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013 # Visual Studio 2013
VisualStudioVersion = 12.0.21005.1 VisualStudioVersion = 12.0.21005.1
MinimumVisualStudioVersion = 10.0.40219.1 MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.AspNet.Abstractions", "src\Microsoft.AspNet.Abstractions\Microsoft.AspNet.Abstractions.csproj", "{4E1520B1-01F4-481B-96A2-24067EAA52FA}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.AspNet.FeatureModel", "src\Microsoft.AspNet.FeatureModel\Microsoft.AspNet.FeatureModel.csproj", "{A780873E-09F9-4E44-AE06-AF00C4E88E1E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.AspNet.HttpFeature", "src\Microsoft.AspNet.HttpFeature\Microsoft.AspNet.HttpFeature.csproj", "{42309978-0661-41D8-8654-39453265C5F9}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.AspNet.PipelineCore", "src\Microsoft.AspNet.PipelineCore\Microsoft.AspNet.PipelineCore.csproj", "{A4D3E280-8838-4614-9B99-4874C3CBDF82}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.AspNet.PipelineCore.Tests", "src\Microsoft.AspNet.PipelineCore.Tests\Microsoft.AspNet.PipelineCore.Tests.csproj", "{86942914-0334-4352-87ED-B971281C74E2}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.AspNet.PipelineCore.Tests", "src\Microsoft.AspNet.PipelineCore.Tests\Microsoft.AspNet.PipelineCore.Tests.csproj", "{86942914-0334-4352-87ED-B971281C74E2}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.AspNet.FeatureModel.Tests", "test\Microsoft.AspNet.FeatureModel.Tests\Microsoft.AspNet.FeatureModel.Tests.csproj", "{8C671AE3-1188-499F-A2A2-3A0B117B33CE}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.AspNet.FeatureModel.Tests", "test\Microsoft.AspNet.FeatureModel.Tests\Microsoft.AspNet.FeatureModel.Tests.csproj", "{8C671AE3-1188-499F-A2A2-3A0B117B33CE}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.AspNet.Abstractions.net45", "src\Microsoft.AspNet.Abstractions\Microsoft.AspNet.Abstractions.net45.csproj", "{D36288AF-8A0E-48DD-8AF8-15B72F91C70A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.AspNet.Abstractions.k10", "src\Microsoft.AspNet.Abstractions\Microsoft.AspNet.Abstractions.k10.csproj", "{7D19BA93-ABFD-4D49-9AA9-DB55AF6BD6F1}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.AspNet.FeatureModel.net45", "src\Microsoft.AspNet.FeatureModel\Microsoft.AspNet.FeatureModel.net45.csproj", "{95AEE59D-BF51-47CB-A957-C03D909CC148}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.AspNet.FeatureModel.k10", "src\Microsoft.AspNet.FeatureModel\Microsoft.AspNet.FeatureModel.k10.csproj", "{E9AF7046-E24C-4071-B7AF-7981F2D1A613}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.AspNet.HttpFeature.net45", "src\Microsoft.AspNet.HttpFeature\Microsoft.AspNet.HttpFeature.net45.csproj", "{A6DEB0D3-982E-4A07-8EE7-39269F192AF7}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.AspNet.HttpFeature.k10", "src\Microsoft.AspNet.HttpFeature\Microsoft.AspNet.HttpFeature.k10.csproj", "{9295515C-6603-46BB-92EB-1C5F6B0E84C9}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.AspNet.PipelineCore.net45", "src\Microsoft.AspNet.PipelineCore\Microsoft.AspNet.PipelineCore.net45.csproj", "{68A538BA-D542-49CB-9615-B4F5A4E78C87}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.AspNet.PipelineCore.k10", "src\Microsoft.AspNet.PipelineCore\Microsoft.AspNet.PipelineCore.k10.csproj", "{E31D45AC-70F3-47D4-9625-A4D8C6AA1B6B}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{D38DDB2B-1138-4F45-8A6A-9499E880F620}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{1D737C82-F2F1-40B6-AE95-A3D878612E91}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU Release|Any CPU = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution GlobalSection(ProjectConfigurationPlatforms) = postSolution
{4E1520B1-01F4-481B-96A2-24067EAA52FA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4E1520B1-01F4-481B-96A2-24067EAA52FA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4E1520B1-01F4-481B-96A2-24067EAA52FA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4E1520B1-01F4-481B-96A2-24067EAA52FA}.Release|Any CPU.Build.0 = Release|Any CPU
{A780873E-09F9-4E44-AE06-AF00C4E88E1E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A780873E-09F9-4E44-AE06-AF00C4E88E1E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A780873E-09F9-4E44-AE06-AF00C4E88E1E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A780873E-09F9-4E44-AE06-AF00C4E88E1E}.Release|Any CPU.Build.0 = Release|Any CPU
{42309978-0661-41D8-8654-39453265C5F9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{42309978-0661-41D8-8654-39453265C5F9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{42309978-0661-41D8-8654-39453265C5F9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{42309978-0661-41D8-8654-39453265C5F9}.Release|Any CPU.Build.0 = Release|Any CPU
{A4D3E280-8838-4614-9B99-4874C3CBDF82}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A4D3E280-8838-4614-9B99-4874C3CBDF82}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A4D3E280-8838-4614-9B99-4874C3CBDF82}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A4D3E280-8838-4614-9B99-4874C3CBDF82}.Release|Any CPU.Build.0 = Release|Any CPU
{86942914-0334-4352-87ED-B971281C74E2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {86942914-0334-4352-87ED-B971281C74E2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{86942914-0334-4352-87ED-B971281C74E2}.Debug|Any CPU.Build.0 = Debug|Any CPU {86942914-0334-4352-87ED-B971281C74E2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{86942914-0334-4352-87ED-B971281C74E2}.Release|Any CPU.ActiveCfg = Release|Any CPU {86942914-0334-4352-87ED-B971281C74E2}.Release|Any CPU.ActiveCfg = Release|Any CPU
@ -45,8 +41,52 @@ Global
{8C671AE3-1188-499F-A2A2-3A0B117B33CE}.Debug|Any CPU.Build.0 = Debug|Any CPU {8C671AE3-1188-499F-A2A2-3A0B117B33CE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8C671AE3-1188-499F-A2A2-3A0B117B33CE}.Release|Any CPU.ActiveCfg = Release|Any CPU {8C671AE3-1188-499F-A2A2-3A0B117B33CE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8C671AE3-1188-499F-A2A2-3A0B117B33CE}.Release|Any CPU.Build.0 = Release|Any CPU {8C671AE3-1188-499F-A2A2-3A0B117B33CE}.Release|Any CPU.Build.0 = Release|Any CPU
{D36288AF-8A0E-48DD-8AF8-15B72F91C70A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D36288AF-8A0E-48DD-8AF8-15B72F91C70A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D36288AF-8A0E-48DD-8AF8-15B72F91C70A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D36288AF-8A0E-48DD-8AF8-15B72F91C70A}.Release|Any CPU.Build.0 = Release|Any CPU
{7D19BA93-ABFD-4D49-9AA9-DB55AF6BD6F1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7D19BA93-ABFD-4D49-9AA9-DB55AF6BD6F1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7D19BA93-ABFD-4D49-9AA9-DB55AF6BD6F1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7D19BA93-ABFD-4D49-9AA9-DB55AF6BD6F1}.Release|Any CPU.Build.0 = Release|Any CPU
{95AEE59D-BF51-47CB-A957-C03D909CC148}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{95AEE59D-BF51-47CB-A957-C03D909CC148}.Debug|Any CPU.Build.0 = Debug|Any CPU
{95AEE59D-BF51-47CB-A957-C03D909CC148}.Release|Any CPU.ActiveCfg = Release|Any CPU
{95AEE59D-BF51-47CB-A957-C03D909CC148}.Release|Any CPU.Build.0 = Release|Any CPU
{E9AF7046-E24C-4071-B7AF-7981F2D1A613}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E9AF7046-E24C-4071-B7AF-7981F2D1A613}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E9AF7046-E24C-4071-B7AF-7981F2D1A613}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E9AF7046-E24C-4071-B7AF-7981F2D1A613}.Release|Any CPU.Build.0 = Release|Any CPU
{A6DEB0D3-982E-4A07-8EE7-39269F192AF7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A6DEB0D3-982E-4A07-8EE7-39269F192AF7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A6DEB0D3-982E-4A07-8EE7-39269F192AF7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A6DEB0D3-982E-4A07-8EE7-39269F192AF7}.Release|Any CPU.Build.0 = Release|Any CPU
{9295515C-6603-46BB-92EB-1C5F6B0E84C9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9295515C-6603-46BB-92EB-1C5F6B0E84C9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9295515C-6603-46BB-92EB-1C5F6B0E84C9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9295515C-6603-46BB-92EB-1C5F6B0E84C9}.Release|Any CPU.Build.0 = Release|Any CPU
{68A538BA-D542-49CB-9615-B4F5A4E78C87}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{68A538BA-D542-49CB-9615-B4F5A4E78C87}.Debug|Any CPU.Build.0 = Debug|Any CPU
{68A538BA-D542-49CB-9615-B4F5A4E78C87}.Release|Any CPU.ActiveCfg = Release|Any CPU
{68A538BA-D542-49CB-9615-B4F5A4E78C87}.Release|Any CPU.Build.0 = Release|Any CPU
{E31D45AC-70F3-47D4-9625-A4D8C6AA1B6B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E31D45AC-70F3-47D4-9625-A4D8C6AA1B6B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E31D45AC-70F3-47D4-9625-A4D8C6AA1B6B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E31D45AC-70F3-47D4-9625-A4D8C6AA1B6B}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
EndGlobalSection EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{7D19BA93-ABFD-4D49-9AA9-DB55AF6BD6F1} = {D38DDB2B-1138-4F45-8A6A-9499E880F620}
{D36288AF-8A0E-48DD-8AF8-15B72F91C70A} = {D38DDB2B-1138-4F45-8A6A-9499E880F620}
{E9AF7046-E24C-4071-B7AF-7981F2D1A613} = {D38DDB2B-1138-4F45-8A6A-9499E880F620}
{95AEE59D-BF51-47CB-A957-C03D909CC148} = {D38DDB2B-1138-4F45-8A6A-9499E880F620}
{9295515C-6603-46BB-92EB-1C5F6B0E84C9} = {D38DDB2B-1138-4F45-8A6A-9499E880F620}
{A6DEB0D3-982E-4A07-8EE7-39269F192AF7} = {D38DDB2B-1138-4F45-8A6A-9499E880F620}
{E31D45AC-70F3-47D4-9625-A4D8C6AA1B6B} = {D38DDB2B-1138-4F45-8A6A-9499E880F620}
{68A538BA-D542-49CB-9615-B4F5A4E78C87} = {D38DDB2B-1138-4F45-8A6A-9499E880F620}
{86942914-0334-4352-87ED-B971281C74E2} = {1D737C82-F2F1-40B6-AE95-A3D878612E91}
{8C671AE3-1188-499F-A2A2-3A0B117B33CE} = {1D737C82-F2F1-40B6-AE95-A3D878612E91}
EndGlobalSection
EndGlobal EndGlobal

View File

@ -1,66 +0,0 @@
var PROJECT='AspNetAbstractions'
var VERSION='0.1.0'
var FULL_VERSION='${VERSION}'
var AUTHORS='${PROJECT} contributors'
var BASE_DIR='${Directory.GetCurrentDirectory()}'
var TARGET_DIR='${Path.Combine(BASE_DIR, "target")}'
var BUILD_DIR='${Path.Combine(TARGET_DIR, "build")}'
var TEST_DIR='${Path.Combine(TARGET_DIR, "test")}'
default SRC='.'
default BUILD_PROJECTS='${Files.Include(SRC+"/**/*.csproj")}'
default TEST_PROJECTS='${Files.Include(SRC+"/**/*.Tests.csproj")}'
use namespace='System.Xml.Linq'
-// include range of standard general targets. run "sake targets" to display
use-standard-lifecycle
-// include sets of standard work targets. features include 'nuget,xunit,nunit'
use-standard-goals features='nuget,xunit'
-// additional work targets are defined below
#nuget-prepare target='package-prepare' description='Compile primary project'
for each='var projectFile in BUILD_PROJECTS.Except(TEST_PROJECTS)'
var outputDirName='${Path.GetFileNameWithoutExtension(projectFile)}'
var outputDir='${Path.Combine(BUILD_DIR, outputDirName)}'
copy sourceDir='${Path.GetDirectoryName(projectFile)}' include='*.nuspec' overwrite='${true}'
var doc='${XDocument.Load(projectFile)}'
var ns='http://schemas.microsoft.com/developer/msbuild/2003'
var itemGroups='${doc.Elements(XName.Get("Project", ns)).Elements(XName.Get("ItemGroup", ns))}'
var compileItems='${itemGroups.Elements(XName.Get("Compile", ns))}'
var contentItems='${itemGroups.Elements(XName.Get("Content", ns))}'
var noneItems='${itemGroups.Elements(XName.Get("None", ns))}'
var razorItems='${contentItems.Union(noneItems).Where(x=>x.Attribute("Include").Value.EndsWith(".cshtml"))}'
for each='var compileElt in compileItems.Union(razorItems)'
var linkElt='${compileElt.Elements(XName.Get("Link", ns)).SingleOrDefault()}'
var sourceFile='${compileElt.Attribute("Include").Value}'
var targetFile='${linkElt == null ? sourceFile : linkElt.Value}'
var sourceFull='${Path.Combine(Path.GetDirectoryName(projectFile), sourceFile)}'
var targetFull='${Path.Combine(outputDir, "src", targetFile)}'
directory create='${Path.GetDirectoryName(targetFull)}'
-File.Copy(sourceFull, targetFull, true);
#nuget-package target='package' description='Create NuGet packages'
for each='var file in Files.Include(BUILD_DIR + "/**/*.nuspec")'
var baseName='${Path.GetFileNameWithoutExtension(file)}'
var nugetProperties='${new Dictionary<string,string> {
{"id", baseName},
{"authors", AUTHORS},
{"title", baseName},
{"description", baseName},
{"licenseUrl", "about:blank"},
{"projectUrl", "about:blank"},
{"tags", "Katana"},
}}'
var props='${string.Join(";", nugetProperties.Select(kv=>kv.Key+"="+kv.Value).ToArray())}'
nuget-pack nuspecFile='${file}' packageVersion='${FULL_VERSION}' outputDir='${TARGET_DIR}' extra='-NoPackageAnalysis -Properties "${props}"'

View File

@ -9,4 +9,4 @@ mkdir .nuget
:part2 :part2
set EnableNuGetPackageRestore=true set EnableNuGetPackageRestore=true
.nuget\NuGet.exe install Sake -version 0.2 -o packages .nuget\NuGet.exe install Sake -version 0.2 -o packages
packages\Sake.0.2\tools\Sake.exe -I build -f Sakefile.shade %* packages\Sake.0.2\tools\Sake.exe -I build -f makefile.shade %*

View File

@ -1,6 +0,0 @@
#!/bin/sh
export EnableNuGetPackageRestore=true
mono --runtime=v4.0 ".nuget/NuGet.exe" install Sake -pre -o packages
mono $(find packages/Sake.*/tools/Sake.exe|sort -r|head -n1) -f Sakefile.shade -I src/build "$@"

9
build/_git-clone.shade Normal file
View File

@ -0,0 +1,9 @@
default gitBranch=''
var gitCommand='clone ${gitUri}'
set gitCommand='${gitCommand} --branch ${gitBranch}' if='!string.IsNullOrEmpty(gitBranch)'
git

8
build/_git-pull.shade Normal file
View File

@ -0,0 +1,8 @@
default gitBranch=''
var gitCommand='pull ${gitUri}'
set gitCommand='${gitCommand} ${gitBranch}' if='!string.IsNullOrEmpty(gitBranch)'
git

5
build/_git.shade Normal file
View File

@ -0,0 +1,5 @@
default gitFolder=''
exec program='git' commandline='${gitCommand}' workingdir='${gitFolder}'

17
build/_k-build.shade Normal file
View File

@ -0,0 +1,17 @@
@{/*
k-build
Builds project. Downloads and executes k sdk tools.
projectFile=''
Required. Path to the project.json to build.
*/}
var projectFolder='${Path.GetDirectoryName(projectFile)}'
var projectName='${Path.GetFileName(projectFolder)}'
var projectBin='${Path.Combine(projectFolder, "bin")}'
directory delete="${projectBin}"
k command='build ${projectFolder}'
copy sourceDir='${projectBin}' outputDir='${Path.Combine(BUILD_DIR, projectName)}'

13
build/_k-clean.shade Normal file
View File

@ -0,0 +1,13 @@
@{/*
k-clean
Cleans project. Downloads and executes k sdk tools.
projectFile=''
Required. Path to the project.json to build.
*/}
var projectFolder='${Path.GetDirectoryName(projectFile)}'
k command='clean ${projectFolder}'

View File

@ -0,0 +1,330 @@
use namespace="System"
use namespace="System.Collections.Generic"
use namespace="System.IO"
use namespace="System.Linq"
use namespace="System.Reflection"
use namespace="System.Text"
use namespace="System.Web.Script.Serialization"
use namespace="System.Xml.Linq"
use assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
@{/*
k-generate-projects
Generate csproj files from project.json
solutionPath=''
Required. Path to the solution directory
*/}
content var='net45' include href='net45.txt'
content var='k10' include href='k10.txt'
@{
ProjectGenerator.Logger = Log;
var templates = new Dictionary<string, string> {
{ "net45", net45 },
{ "k10", k10 }
};
ProjectGenerator.MakeProjects(solutionPath, templates);
}
functions
@{
class ProjectGenerator
{
public static Sake.Engine.Logging.ILog Logger { get; set; }
static void Log(string message, params object[] args)
{
Logger.Info(String.Format(message, args));
}
static void Warn(string message, params object[] args)
{
Logger.Warn(String.Format(message, args));
}
public static void MakeProjects(string solutionPath, IDictionary<string, string> templates)
{
var jsonFiles = GetJsonFiles(solutionPath);
var projectMapping = GetProjectMapping(solutionPath, jsonFiles);
Log("Found {0} projects", jsonFiles.Length);
foreach (var p in jsonFiles)
{
Log(p);
}
foreach (var path in jsonFiles)
{
ProduceProjectFilesForProject(path, projectMapping, templates);
}
}
private static string[] GetJsonFiles(string solutionPath)
{
Func<string, string[]> getFiles = dir =>
{
string path = Path.Combine(solutionPath, dir);
if (!Directory.Exists(path))
{
return new string[0];
}
return Directory.GetFiles(path, "project.json", SearchOption.AllDirectories);
};
return getFiles("src").Concat(getFiles("samples"))
.Concat(getFiles("test"))
.ToArray();
}
private static IDictionary<string, object> GetProjectMapping(string solutionPath, string[] jsonFiles)
{
var dict = new Dictionary<string, object>();
foreach (var path in jsonFiles)
{
string projectDir = Path.GetDirectoryName(path);
string projectName = projectDir.Substring(Path.GetDirectoryName(projectDir).Length).Trim(Path.DirectorySeparatorChar);
// {
// "p1" : { "net45" : "id", "k10" : "pid1", path: "src\p1" },
// "p2" : { "net45" : "id", "k10" : "pid2", path: "src\p2" }
// }
//
string net45Project = Path.Combine(projectDir, GetProjectFileName(projectName, "net45"));
string k10Project = Path.Combine(projectDir, GetProjectFileName(projectName, "k10"));
var configs = new Dictionary<string, object>();
configs["net45"] = GetProjectGuidFromFileOrCreateNew(net45Project);
configs["k10"] = GetProjectGuidFromFileOrCreateNew(k10Project);
configs["path"] = Path.GetDirectoryName(path.Substring(solutionPath.Length).TrimStart(Path.DirectorySeparatorChar));
dict[projectName] = configs;
}
return dict;
}
private static string GetProjectGuidFromFileOrCreateNew(string projectPath)
{
if (!File.Exists(projectPath))
{
return Guid.NewGuid().ToString().ToUpper();
}
var projectGuid = XDocument.Parse(File.ReadAllText(projectPath))
.Descendants()
.FirstOrDefault(e => e.Name.LocalName.Equals("ProjectGuid"));
if (projectGuid == null)
{
return Guid.NewGuid().ToString();
}
return projectGuid.Value.Trim((char)'{', (char)'}');
}
private static void ProduceProjectFilesForProject(string jsonPath,
IDictionary<string, object> projectMapping,
IDictionary<string, string> templates)
{
var serializer = new JavaScriptSerializer();
string projectDir = Path.GetDirectoryName(jsonPath);
string projectName = projectDir.Substring(Path.GetDirectoryName(projectDir).Length).Trim(Path.DirectorySeparatorChar);
Log("Generated projects for {0}", projectName);
var jsonText = File.ReadAllText(jsonPath);
var d = serializer.DeserializeObject(jsonText) as IDictionary<string, object>;
var configs = GetObject(d, "configurations");
var references = GetObject(d, "dependencies") ?? new Dictionary<string, object>();
// Get the list of files
var filesString = String.Join(Environment.NewLine,
Directory.GetFiles(projectDir, "*.cs", SearchOption.AllDirectories)
.Select(p => p.Substring(projectDir.Length).Trim(Path.DirectorySeparatorChar))
.Where(p => !p.StartsWith("obj"))
.Select(p => String.Format(
@"<Compile Include=""{0}"" />", p)));
// Add the config file if it's there
if (File.Exists(Path.Combine(projectDir, "packages.config")))
{
filesString += "<Content Include=\"packages.config\" />";
}
var packageReferences = references.Where(r => !String.IsNullOrEmpty((string)r.Value))
.ToDictionary(k => k.Key, k => (string)k.Value);
var projectReferences = references.Where(r => String.IsNullOrEmpty((string)r.Value))
.Select(r => r.Key)
.ToArray();
// HACK: Assume the packages folder is 2 up from the projectDir
string packagesDir = Path.GetFullPath(Path.Combine(projectDir, "..", "..", "packages"));
foreach (var targetFramework in configs.Keys)
{
string id = (string)GetObject(projectMapping, projectName)[targetFramework];
var template = templates[targetFramework]
.Replace("{ProjectGuid}", id)
.Replace("{Name}", projectName)
.Replace("{Files}", filesString)
.Replace("{ProjectReferences}", BuildProjectReferences(projectReferences, targetFramework, projectMapping))
.Replace("{References}", BuildReferences(packageReferences, packagesDir, targetFramework, GetCandidates(targetFramework)));
if (targetFramework.StartsWith("k"))
{
template = template.Replace("{CSharpTargetsPath}", GetProjectKTargets(packagesDir));
}
string output = Path.Combine(projectDir, GetProjectFileName(projectName, targetFramework));
Log("Generated {0}", output);
File.WriteAllText(output, template);
}
}
private static string GetProjectKTargets(string packagesDir)
{
var projectK = Directory.GetDirectories(packagesDir, "ProjectK*")
.Select(p => new { Path = p, Build = Int32.Parse(p.Substring(p.LastIndexOf('-') + 1)) })
.OrderByDescending(p => p.Build)
.FirstOrDefault();
if (projectK == null)
{
Warn("Project K targets aren't installed");
return "";
}
return Path.Combine("..", "..", projectK.Path.Substring(projectK.Path.IndexOf("packages")), "Framework\\K\\v1.0\\ProjectK.CSharp.targets");
}
private static string GetProjectFileName(string projectName, string config)
{
return projectName + "." + config + ".csproj";
}
private static string BuildProjectReferences(string[] projectReferences, string config, IDictionary<string, object> projectMapping)
{
if (projectReferences.Length == 0)
{
return "";
}
var sb = new StringBuilder();
foreach (var reference in projectReferences)
{
var info = GetObject(projectMapping, reference);
if (info == null)
{
Warn("No project reference found for {0}", reference);
continue;
}
string projectFileName = GetProjectFileName(reference, config);
string path = Path.Combine((string)info["path"], projectFileName);
sb.AppendFormat(@"<ProjectReference Include=""..\..\{0}"">
<Project>{{{1}}}</Project>
<Name>{2}</Name>
</ProjectReference>", path, info[config], reference);
}
return sb.ToString();
}
private static string[] GetCandidates(string config)
{
if (config == "net45")
{
return new[] { "net45", "net40", "net35", "net20" };
}
return new[] { config };
}
private static string BuildReferences(IDictionary<string, string> references, string packagesDir, string configName, string[] candidates)
{
if (references.Count == 0)
{
return "";
}
Log("Building package references for {0}", configName);
var sb = new StringBuilder();
foreach (var reference in references)
{
var version = (string)reference.Value;
string pattern = version.IndexOf("*") != -1 ? reference.Key + "*" : reference.Key + "." + reference.Value;
var packageDir = Directory.GetDirectories(packagesDir, pattern).FirstOrDefault();
if (packageDir == null)
{
Warn(reference.Key + " = " + version + " ==> UNRESOLVED");
continue;
}
Log(reference.Key + " = " + version + " ==> " + packageDir);
var candidate = candidates.Select(c => Path.Combine(packageDir, "lib", c))
.FirstOrDefault(Directory.Exists);
if (candidate == null)
{
Warn("Unable to find package reference for {0}, target framework = {1}", reference.Key, configName);
continue;
}
var dlls = Directory.EnumerateFiles(candidate, "*.dll")
.Distinct()
.Where(File.Exists)
.ToList();
foreach (var dllPath in dlls)
{
sb.AppendFormat(@"
<Reference Include=""{0}"">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\{1}</HintPath>
</Reference>", AssemblyName.GetAssemblyName(dllPath).FullName, dllPath.Substring(dllPath.IndexOf("packages")));
}
}
return sb.ToString();
}
private static IDictionary<string, object> GetObject(IDictionary<string, object> obj, string key)
{
object value;
if (obj.TryGetValue(key, out value))
{
return value as IDictionary<string, object>;
}
return null;
}
}
}

7
build/_k-restore.shade Normal file
View File

@ -0,0 +1,7 @@
@{/*
k-restore
Restores nuget packages required for k projects. Downloads and executes k sdk tools.
*/}
k command='restore'

View File

@ -0,0 +1,47 @@
use namespace="System"
use namespace="System.IO"
use import="Files"
default BASE_DIR='${Directory.GetCurrentDirectory()}'
default TARGET_DIR='${Path.Combine(BASE_DIR, "artifacts")}'
default BUILD_DIR='${Path.Combine(TARGET_DIR, "build")}'
default TEST_DIR='${Path.Combine(TARGET_DIR, "test")}'
@{
E("K_BUILD_VERSION", "t" + DateTime.UtcNow.ToString("yyMMddHHmmss"));
}
#target-default target='default'
k-restore
k-generate-projects solutionPath='${BASE_DIR}'
#target-dir-clean target='clean'
directory delete="${TARGET_DIR}"
#build-clean target='clean'
k-clean each='var projectFile in Files.Include("src/**/project.json")'
#build-compile target='compile'
k-build each='var projectFile in Files.Include("src/**/project.json")'
@{
foreach (var nupkg in Files.Include(Path.Combine(BUILD_DIR, "*/*.nupkg")))
{
File.Copy(nupkg, Path.Combine(BUILD_DIR, Path.GetFileName(nupkg)), true);
}
}
#nuget-install target='install' description='Copy NuGet packages to local repo'
@{
var HOME_DIR = E("HOME");
if (string.IsNullOrEmpty(HOME_DIR))
{
HOME_DIR = E("HOMEDRIVE") + E("HOMEPATH");
}
}
copy sourceDir='${BUILD_DIR}' include='*.nupkg' outputDir='${Path.Combine(HOME_DIR, ".nuget")}' overwrite='${true}'
functions @{
string E(string key) { return Environment.GetEnvironmentVariable(key); }
void E(string key, string value) { Environment.SetEnvironmentVariable(key, value); }
}

31
build/_k.shade Normal file
View File

@ -0,0 +1,31 @@
@{/*
k
Run klr commands in your project. Downloads and executes k sdk.
kVersion='0.0.1-pre-30109-087'
May be passed to override the nuget package version holding xunit console runner.
kProgram='...'
May be passed to override the path to the xunit program that will be executed
command=''
*/}
default kLatestSuccessful='\\wsr-teamcity\Drops\ProjectK.Main\latest-successful\sdk'
default kVersion=''
test if='string.IsNullOrEmpty(kVersion)'
for each='var file in System.IO.Directory.EnumerateFiles(kLatestSuccessful).Select(System.IO.Path.GetFileName)'
test if='file.StartsWith("ProjectK.") && file.EndsWith(".nupkg")'
- kVersion = file.Substring("ProjectK.".Length, file.Length - "ProjectK.".Length - ".nupkg".Length);
default kProgram='packages/ProjectK.${kVersion}/tools/k.cmd'
-// Download xunit from nuget sources if not already present
test if='!File.Exists(kProgram)'
log info='Installing ProjectK ${kVersion} from ${kLatestSuccessful}'
nuget-install package='ProjectK' packageVersion='${kVersion}' outputDir='packages' extra='-Source ${kLatestSuccessful}'
exec program='${Path.GetFullPath(kProgram)}' commandline='${command}'

50
build/k10.txt Normal file
View File

@ -0,0 +1,50 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{{ProjectGuid}}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>{Name}</RootNamespace>
<AssemblyName>{Name}</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<BaseIntermediateOutputPath>obj/K</BaseIntermediateOutputPath>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\K</OutputPath>
<DefineConstants>DEBUG;TRACE;K10</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\K</OutputPath>
<DefineConstants>TRACE;K10</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
{Files}
<Content Include="project.json" />
</ItemGroup>
<ItemGroup>
{ProjectReferences}
</ItemGroup>
<Import Project="{CSharpTargetsPath}" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@ -4,44 +4,47 @@
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{A780873E-09F9-4E44-AE06-AF00C4E88E1E}</ProjectGuid> <ProjectGuid>{{ProjectGuid}}</ProjectGuid>
<OutputType>Library</OutputType> <OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Microsoft.AspNet.FeatureModel</RootNamespace> <RootNamespace>{Name}</RootNamespace>
<AssemblyName>Microsoft.AspNet.FeatureModel</AssemblyName> <AssemblyName>{Name}</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion> <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<BaseIntermediateOutputPath>obj/net45</BaseIntermediateOutputPath>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType> <DebugType>full</DebugType>
<Optimize>false</Optimize> <Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath> <OutputPath>bin\Debug\net45</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE;NET45</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>
<Optimize>true</Optimize> <Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath> <OutputPath>bin\Release\net45</OutputPath>
<DefineConstants>TRACE</DefineConstants> <DefineConstants>TRACE;NET45</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<DocumentationFile>bin\Release\Microsoft.AspNet.FeatureModel.XML</DocumentationFile>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="mscorlib" />
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="Microsoft.CSharp" />
{References}
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="IInterfaceDictionary.cs" /> {Files}
<Compile Include="InterfaceDictionary.cs" /> <Content Include="project.json" />
<Compile Include="Implementation\Converter.cs" />
<Compile Include="InterfaceObject.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="Microsoft.AspNet.FeatureModel.nuspec" /> {ProjectReferences}
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.

7
makefile.shade Normal file
View File

@ -0,0 +1,7 @@
var VERSION='0.1'
var FULL_VERSION='0.1'
var AUTHORS='Microsoft'
use-standard-lifecycle
k-standard-goals

View File

@ -1,52 +1,52 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8" ?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')"/>
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{4E1520B1-01F4-481B-96A2-24067EAA52FA}</ProjectGuid> <ProjectGuid>{7D19BA93-ABFD-4D49-9AA9-DB55AF6BD6F1}</ProjectGuid>
<OutputType>Library</OutputType> <OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Microsoft.AspNet.Abstractions</RootNamespace> <RootNamespace>Microsoft.AspNet.Abstractions</RootNamespace>
<AssemblyName>Microsoft.AspNet.Abstractions</AssemblyName> <AssemblyName>Microsoft.AspNet.Abstractions</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion> <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<BaseIntermediateOutputPath>obj/K</BaseIntermediateOutputPath>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType> <DebugType>full</DebugType>
<Optimize>false</Optimize> <Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath> <OutputPath>bin\Debug\K</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE;K10</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>
<Optimize>true</Optimize> <Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath> <OutputPath>bin\Release\K</OutputPath>
<DefineConstants>TRACE</DefineConstants> <DefineConstants>TRACE;K10</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<DocumentationFile>bin\Release\Microsoft.AspNet.Abstractions.XML</DocumentationFile>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="System" />
</ItemGroup>
<ItemGroup>
<Compile Include="IBuilder.cs" />
<Compile Include="PathString.cs" />
<Compile Include="HttpContext.cs" /> <Compile Include="HttpContext.cs" />
<Compile Include="HttpRequest.cs" /> <Compile Include="HttpRequest.cs" />
<Compile Include="HttpResponse.cs" /> <Compile Include="HttpResponse.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="IBuilder.cs" />
<Compile Include="QueryString.cs" /> <Compile Include="PathString.cs" />
<Compile Include="RequestDelegate.cs" /> <Compile Include="QueryString.cs" />
<Compile Include="RequestDelegate.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Content Include="project.json"/>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="Microsoft.AspNet.Abstractions.nuspec" />
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="..\..\packages\ProjectK.0.0.1-pre-30121-096\Framework\K\v1.0\ProjectK.CSharp.targets"/>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets. Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild"> <Target Name="BeforeBuild">

View File

@ -0,0 +1,64 @@
<?xml version="1.0" encoding="utf-8" ?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')"/>
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{D36288AF-8A0E-48DD-8AF8-15B72F91C70A}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Microsoft.AspNet.Abstractions</RootNamespace>
<AssemblyName>Microsoft.AspNet.Abstractions</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<BaseIntermediateOutputPath>obj/net45</BaseIntermediateOutputPath>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\net45</OutputPath>
<DefineConstants>DEBUG;TRACE;NET45</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\net45</OutputPath>
<DefineConstants>TRACE;NET45</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="mscorlib"/>
<Reference Include="System"/>
<Reference Include="System.Core"/>
<Reference Include="Microsoft.CSharp"/>
</ItemGroup>
<ItemGroup>
<Compile Include="HttpContext.cs" />
<Compile Include="HttpRequest.cs" />
<Compile Include="HttpResponse.cs" />
<Compile Include="IBuilder.cs" />
<Compile Include="PathString.cs" />
<Compile Include="QueryString.cs" />
<Compile Include="RequestDelegate.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Content Include="project.json"/>
</ItemGroup>
<ItemGroup>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets"/>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@ -1,22 +0,0 @@
<package >
<metadata>
<id>$id$</id>
<version>$version$</version>
<authors>$authors$</authors>
<owners>$authors$</owners>
<licenseUrl>$licenseUrl$</licenseUrl>
<projectUrl>$projectUrl$</projectUrl>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<title>$title$</title>
<description>$title$</description>
<tags>$tags$</tags>
<dependencies>
</dependencies>
</metadata>
<files>
<file src="$id$.dll" target="lib\net45" />
<file src="$id$.xml" target="lib\net45" />
<file src="$id$.pdb" target="lib\net45" />
<file src="src\**" target="src" />
</files>
</package>

View File

@ -0,0 +1,7 @@
{
"dependencies": {},
"configurations": {
"net45": { },
"k10" : { }
}
}

View File

@ -7,6 +7,7 @@ using System.Runtime.CompilerServices;
namespace Microsoft.AspNet.FeatureModel.Implementation namespace Microsoft.AspNet.FeatureModel.Implementation
{ {
#if NET45
public abstract class NonGenericProxyBase public abstract class NonGenericProxyBase
{ {
public readonly Type WrappedType; public readonly Type WrappedType;
@ -381,4 +382,5 @@ namespace Microsoft.AspNet.FeatureModel.Implementation
} }
} }
} #endif
}

View File

@ -42,11 +42,19 @@ namespace Microsoft.AspNet.FeatureModel
{ {
if (_featureByFeatureType.TryGetValue(actualType, out feature)) if (_featureByFeatureType.TryGetValue(actualType, out feature))
{ {
if (type.IsInstanceOfType(feature)) #if NET45
var isInstanceOfType = type.IsInstanceOfType(feature);
#else
var isInstanceOfType = feature != null && type == feature.GetType();
#endif
if (isInstanceOfType)
{ {
return feature; return feature;
} }
#if NET45
return Converter.Convert(type, actualType, feature); return Converter.Convert(type, actualType, feature);
#endif
} }
} }

View File

@ -1,4 +1,5 @@
using System; using System;
using System.Reflection;
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using Microsoft.AspNet.FeatureModel.Implementation; using Microsoft.AspNet.FeatureModel.Implementation;
@ -25,10 +26,12 @@ namespace Microsoft.AspNet.FeatureModel
public object GetInterface(Type type) public object GetInterface(Type type)
{ {
#if NET45
if (type.IsInstanceOfType(_instance)) if (type.IsInstanceOfType(_instance))
{ {
return _instance; return _instance;
} }
foreach (var interfaceType in _instance.GetType().GetInterfaces()) foreach (var interfaceType in _instance.GetType().GetInterfaces())
{ {
if (interfaceType.FullName == type.FullName) if (interfaceType.FullName == type.FullName)
@ -36,6 +39,7 @@ namespace Microsoft.AspNet.FeatureModel
return Converter.Convert(interfaceType, type, _instance); return Converter.Convert(interfaceType, type, _instance);
} }
} }
#endif
return null; return null;
} }

View File

@ -0,0 +1,54 @@
<?xml version="1.0" encoding="utf-8" ?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')"/>
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{E9AF7046-E24C-4071-B7AF-7981F2D1A613}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Microsoft.AspNet.FeatureModel</RootNamespace>
<AssemblyName>Microsoft.AspNet.FeatureModel</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<BaseIntermediateOutputPath>obj/K</BaseIntermediateOutputPath>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\K</OutputPath>
<DefineConstants>DEBUG;TRACE;K10</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\K</OutputPath>
<DefineConstants>TRACE;K10</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Compile Include="IInterfaceDictionary.cs" />
<Compile Include="InterfaceDictionary.cs" />
<Compile Include="InterfaceObject.cs" />
<Compile Include="Implementation\Converter.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Content Include="project.json"/>
</ItemGroup>
<ItemGroup>
</ItemGroup>
<Import Project="..\..\packages\ProjectK.0.0.1-pre-30121-096\Framework\K\v1.0\ProjectK.CSharp.targets"/>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@ -0,0 +1,61 @@
<?xml version="1.0" encoding="utf-8" ?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')"/>
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{95AEE59D-BF51-47CB-A957-C03D909CC148}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Microsoft.AspNet.FeatureModel</RootNamespace>
<AssemblyName>Microsoft.AspNet.FeatureModel</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<BaseIntermediateOutputPath>obj/net45</BaseIntermediateOutputPath>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\net45</OutputPath>
<DefineConstants>DEBUG;TRACE;NET45</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\net45</OutputPath>
<DefineConstants>TRACE;NET45</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="mscorlib"/>
<Reference Include="System"/>
<Reference Include="System.Core"/>
<Reference Include="Microsoft.CSharp"/>
</ItemGroup>
<ItemGroup>
<Compile Include="IInterfaceDictionary.cs" />
<Compile Include="InterfaceDictionary.cs" />
<Compile Include="InterfaceObject.cs" />
<Compile Include="Implementation\Converter.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Content Include="project.json"/>
</ItemGroup>
<ItemGroup>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets"/>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@ -1,22 +0,0 @@
<package >
<metadata>
<id>$id$</id>
<version>$version$</version>
<authors>$authors$</authors>
<owners>$authors$</owners>
<licenseUrl>$licenseUrl$</licenseUrl>
<projectUrl>$projectUrl$</projectUrl>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<title>$title$</title>
<description>$title$</description>
<tags>$tags$</tags>
<dependencies>
</dependencies>
</metadata>
<files>
<file src="$id$.dll" target="lib\net45" />
<file src="$id$.xml" target="lib\net45" />
<file src="$id$.pdb" target="lib\net45" />
<file src="src\**" target="src" />
</files>
</package>

View File

@ -0,0 +1,7 @@
{
"dependencies": {},
"configurations": {
"net45": { },
"k10" : { }
}
}

View File

@ -1,53 +1,50 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8" ?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')"/>
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{46D69EC9-7096-49D8-A184-A9BB5B2419A1}</ProjectGuid> <ProjectGuid>{F677AA06-54DB-43E0-B193-CC04D1095A2B}</ProjectGuid>
<OutputType>Library</OutputType> <OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Microsoft.AspNet.HttpEnvironment</RootNamespace> <RootNamespace>Microsoft.AspNet.HttpEnvironment</RootNamespace>
<AssemblyName>Microsoft.AspNet.HttpEnvironment</AssemblyName> <AssemblyName>Microsoft.AspNet.HttpEnvironment</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion> <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<BaseIntermediateOutputPath>obj/K</BaseIntermediateOutputPath>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType> <DebugType>full</DebugType>
<Optimize>false</Optimize> <Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath> <OutputPath>bin\Debug\K</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE;K10</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>
<Optimize>true</Optimize> <Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath> <OutputPath>bin\Release\K</OutputPath>
<DefineConstants>TRACE</DefineConstants> <DefineConstants>TRACE;K10</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<DocumentationFile>bin\Release\Microsoft.AspNet.HttpEnvironment.XML</DocumentationFile>
</PropertyGroup> </PropertyGroup>
<ItemGroup>
<Reference Include="System" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="HttpEnvironment.cs" /> <Compile Include="HttpEnvironment.cs" />
<Compile Include="IHttpEnvironment.cs" /> <Compile Include="IHttpEnvironment.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Content Include="project.json"/>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Microsoft.AspNet.FeatureModel\Microsoft.AspNet.FeatureModel.csproj"> <ProjectReference Include="..\..\src\Microsoft.AspNet.FeatureModel\Microsoft.AspNet.FeatureModel.k10.csproj">
<Project>{A780873E-09F9-4E44-AE06-AF00C4E88E1E}</Project> <Project>{E9AF7046-E24C-4071-B7AF-7981F2D1A613}</Project>
<Name>Microsoft.AspNet.FeatureModel</Name> <Name>Microsoft.AspNet.FeatureModel</Name>
</ProjectReference> </ProjectReference>
</ItemGroup> </ItemGroup>
<ItemGroup> <Import Project="..\..\packages\ProjectK.0.0.1-pre-30121-096\Framework\K\v1.0\ProjectK.CSharp.targets"/>
<None Include="Microsoft.AspNet.HttpEnvironment.nuspec" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets. Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild"> <Target Name="BeforeBuild">

View File

@ -0,0 +1,62 @@
<?xml version="1.0" encoding="utf-8" ?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')"/>
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{619C3A71-2D70-4387-8026-F414CAC8022B}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Microsoft.AspNet.HttpEnvironment</RootNamespace>
<AssemblyName>Microsoft.AspNet.HttpEnvironment</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<BaseIntermediateOutputPath>obj/net45</BaseIntermediateOutputPath>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\net45</OutputPath>
<DefineConstants>DEBUG;TRACE;NET45</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\net45</OutputPath>
<DefineConstants>TRACE;NET45</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="mscorlib"/>
<Reference Include="System"/>
<Reference Include="System.Core"/>
<Reference Include="Microsoft.CSharp"/>
</ItemGroup>
<ItemGroup>
<Compile Include="HttpEnvironment.cs" />
<Compile Include="IHttpEnvironment.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Content Include="project.json"/>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\Microsoft.AspNet.FeatureModel\Microsoft.AspNet.FeatureModel.net45.csproj">
<Project>{95AEE59D-BF51-47CB-A957-C03D909CC148}</Project>
<Name>Microsoft.AspNet.FeatureModel</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets"/>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@ -1,22 +0,0 @@
<package >
<metadata>
<id>$id$</id>
<version>$version$</version>
<authors>$authors$</authors>
<owners>$authors$</owners>
<licenseUrl>$licenseUrl$</licenseUrl>
<projectUrl>$projectUrl$</projectUrl>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<title>$title$</title>
<description>$title$</description>
<tags>$tags$</tags>
<dependencies>
</dependencies>
</metadata>
<files>
<file src="$id$.dll" target="lib\net45" />
<file src="$id$.xml" target="lib\net45" />
<file src="$id$.pdb" target="lib\net45" />
<file src="src\**" target="src" />
</files>
</package>

View File

@ -0,0 +1,9 @@
{
"dependencies": {
"Microsoft.AspNet.FeatureModel" : ""
},
"configurations": {
"net45": { },
"k10" : { }
}
}

View File

@ -4,9 +4,11 @@ namespace Microsoft.AspNet.HttpFeature
{ {
public interface IHttpConnection public interface IHttpConnection
{ {
#if NET45
IPAddress RemoteIpAddress { get; set; } IPAddress RemoteIpAddress { get; set; }
int RemotePort { get; set; }
IPAddress LocalIpAddress { get; set; } IPAddress LocalIpAddress { get; set; }
#endif
int RemotePort { get; set; }
int LocalPort { get; set; } int LocalPort { get; set; }
bool IsLocal { get; set; } bool IsLocal { get; set; }
} }

View File

@ -1,11 +1,15 @@
#if NET45
using System.Security.Cryptography.X509Certificates; using System.Security.Cryptography.X509Certificates;
#endif
using System.Threading.Tasks; using System.Threading.Tasks;
namespace Microsoft.AspNet.HttpFeature namespace Microsoft.AspNet.HttpFeature
{ {
public interface IHttpTransportLayerSecurity public interface IHttpTransportLayerSecurity
{ {
#if NET45
X509Certificate ClientCertificate { get; set; } X509Certificate ClientCertificate { get; set; }
#endif
Task LoadAsync(); Task LoadAsync();
} }
} }

View File

@ -1,3 +1,4 @@
#if NET45
using System.Net.WebSockets; using System.Net.WebSockets;
using System.Threading.Tasks; using System.Threading.Tasks;
@ -9,3 +10,4 @@ namespace Microsoft.AspNet.HttpFeature
Task<WebSocket> AcceptAsync(); Task<WebSocket> AcceptAsync();
} }
} }
#endif

View File

@ -0,0 +1,64 @@
<?xml version="1.0" encoding="utf-8" ?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')"/>
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{9295515C-6603-46BB-92EB-1C5F6B0E84C9}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Microsoft.AspNet.HttpFeature</RootNamespace>
<AssemblyName>Microsoft.AspNet.HttpFeature</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<BaseIntermediateOutputPath>obj/K</BaseIntermediateOutputPath>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\K</OutputPath>
<DefineConstants>DEBUG;TRACE;K10</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\K</OutputPath>
<DefineConstants>TRACE;K10</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Compile Include="IHttpApplicationInformation.cs" />
<Compile Include="IHttpBuffering.cs" />
<Compile Include="IHttpConnection.cs" />
<Compile Include="IHttpRequestInformation.cs" />
<Compile Include="IHttpResponseInformation.cs" />
<Compile Include="IHttpSendFile.cs" />
<Compile Include="IHttpTransportLayerSecurity.cs" />
<Compile Include="IHttpWebSocketAccept.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Security\IAuthenticationChallenge.cs" />
<Compile Include="Security\IAuthenticationDescription.cs" />
<Compile Include="Security\IAuthenticationResult.cs" />
<Compile Include="Security\IAuthenticationSignIn.cs" />
<Compile Include="Security\IAuthenticationSignOut.cs" />
<Compile Include="Security\IHttpAuthentication.cs" />
<Content Include="project.json"/>
</ItemGroup>
<ItemGroup>
</ItemGroup>
<Import Project="..\..\packages\ProjectK.0.0.1-pre-30121-096\Framework\K\v1.0\ProjectK.CSharp.targets"/>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@ -1,59 +1,66 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8" ?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')"/>
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{42309978-0661-41D8-8654-39453265C5F9}</ProjectGuid> <ProjectGuid>{A6DEB0D3-982E-4A07-8EE7-39269F192AF7}</ProjectGuid>
<OutputType>Library</OutputType> <OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Microsoft.AspNet.HttpFeature</RootNamespace> <RootNamespace>Microsoft.AspNet.HttpFeature</RootNamespace>
<AssemblyName>Microsoft.AspNet.HttpFeature</AssemblyName> <AssemblyName>Microsoft.AspNet.HttpFeature</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion> <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<BaseIntermediateOutputPath>obj/net45</BaseIntermediateOutputPath>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols> <DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType> <DebugType>full</DebugType>
<Optimize>false</Optimize> <Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath> <OutputPath>bin\Debug\net45</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE;NET45</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType> <DebugType>pdbonly</DebugType>
<Optimize>true</Optimize> <Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath> <OutputPath>bin\Release\net45</OutputPath>
<DefineConstants>TRACE</DefineConstants> <DefineConstants>TRACE;NET45</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
<DocumentationFile>bin\Release\Microsoft.AspNet.HttpFeature.xml</DocumentationFile>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="System" /> <Reference Include="mscorlib"/>
<Reference Include="System"/>
<Reference Include="System.Core"/>
<Reference Include="Microsoft.CSharp"/>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="IHttpApplicationInformation.cs" /> <Compile Include="IHttpApplicationInformation.cs" />
<Compile Include="IHttpSendFile.cs" /> <Compile Include="IHttpBuffering.cs" />
<Compile Include="IHttpTransportLayerSecurity.cs" /> <Compile Include="IHttpConnection.cs" />
<Compile Include="IHttpWebSocketAccept.cs" /> <Compile Include="IHttpRequestInformation.cs" />
<Compile Include="Security\IAuthenticationChallenge.cs" /> <Compile Include="IHttpResponseInformation.cs" />
<Compile Include="Security\IAuthenticationDescription.cs" /> <Compile Include="IHttpSendFile.cs" />
<Compile Include="Security\IAuthenticationResult.cs" /> <Compile Include="IHttpTransportLayerSecurity.cs" />
<Compile Include="Security\IAuthenticationSignIn.cs" /> <Compile Include="IHttpWebSocketAccept.cs" />
<Compile Include="Security\IAuthenticationSignOut.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Security\IHttpAuthentication.cs" /> <Compile Include="Security\IAuthenticationChallenge.cs" />
<Compile Include="IHttpBuffering.cs" /> <Compile Include="Security\IAuthenticationDescription.cs" />
<Compile Include="IHttpConnection.cs" /> <Compile Include="Security\IAuthenticationResult.cs" />
<Compile Include="IHttpRequestInformation.cs" /> <Compile Include="Security\IAuthenticationSignIn.cs" />
<Compile Include="IHttpResponseInformation.cs" /> <Compile Include="Security\IAuthenticationSignOut.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Security\IHttpAuthentication.cs" />
<Content Include="project.json"/>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="Microsoft.AspNet.HttpFeature.nuspec" />
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets"/>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets. Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild"> <Target Name="BeforeBuild">

View File

@ -1,22 +0,0 @@
<package >
<metadata>
<id>$id$</id>
<version>$version$</version>
<authors>$authors$</authors>
<owners>$authors$</owners>
<licenseUrl>$licenseUrl$</licenseUrl>
<projectUrl>$projectUrl$</projectUrl>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<title>$title$</title>
<description>$title$</description>
<tags>$tags$</tags>
<dependencies>
</dependencies>
</metadata>
<files>
<file src="$id$.dll" target="lib\net45" />
<file src="$id$.xml" target="lib\net45" />
<file src="$id$.pdb" target="lib\net45" />
<file src="src\**" target="src" />
</files>
</package>

View File

@ -1,5 +1,7 @@
using System.Collections.Generic; using System.Collections.Generic;
#if NET45
using System.Security.Claims; using System.Security.Claims;
#endif
using Microsoft.AspNet.HttpFeature.Security; using Microsoft.AspNet.HttpFeature.Security;
// ReSharper disable once CheckNamespace // ReSharper disable once CheckNamespace
@ -7,7 +9,11 @@ namespace Microsoft.AspNet.Interfaces.Security
{ {
public interface IAuthenticationResult public interface IAuthenticationResult
{ {
#if NET45
ClaimsIdentity Identity { get; } ClaimsIdentity Identity { get; }
#else
#endif
IDictionary<string, object> Properties { get; } IDictionary<string, object> Properties { get; }
IAuthenticationDescription Description { get; } IAuthenticationDescription Description { get; }
} }

View File

@ -1,11 +1,15 @@
using System.Collections.Generic; using System.Collections.Generic;
#if NET45
using System.Security.Claims; using System.Security.Claims;
#endif
namespace Microsoft.AspNet.HttpFeature.Security namespace Microsoft.AspNet.HttpFeature.Security
{ {
public interface IAuthenticationSignIn public interface IAuthenticationSignIn
{ {
#if NET45
ClaimsPrincipal User { get; } ClaimsPrincipal User { get; }
#endif
IDictionary<string, string> Properties { get; } IDictionary<string, string> Properties { get; }
} }
} }

View File

@ -0,0 +1,6 @@
{
"configurations": {
"net45": { },
"k10" : { }
}
}

View File

@ -21,4 +21,4 @@ namespace Microsoft.AspNet.PipelineCore.Tests
mockHttpContext.Object.Response.StatusCode.ShouldBe(404); mockHttpContext.Object.Response.StatusCode.ShouldBe(404);
} }
} }
} }

View File

@ -59,15 +59,18 @@
<None Include="packages.config" /> <None Include="packages.config" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\..\src\Microsoft.AspNet.PipelineCore\Microsoft.AspNet.PipelineCore.csproj"> <ProjectReference Include="..\Microsoft.AspNet.Abstractions\Microsoft.AspNet.Abstractions.net45.csproj">
<Project>{A4D3E280-8838-4614-9B99-4874C3CBDF82}</Project> <Project>{d36288af-8a0e-48dd-8af8-15b72f91c70a}</Project>
<Name>Microsoft.AspNet.PipelineCore</Name> <Name>Microsoft.AspNet.Abstractions.net45</Name>
</ProjectReference> </ProjectReference>
<ProjectReference Include="..\..\src\Microsoft.AspNet.Abstractions\Microsoft.AspNet.Abstractions.csproj"> <ProjectReference Include="..\Microsoft.AspNet.PipelineCore\Microsoft.AspNet.PipelineCore.net45.csproj">
<Project>{4E1520B1-01F4-481B-96A2-24067EAA52FA}</Project> <Project>{68a538ba-d542-49cb-9615-b4f5a4e78c87}</Project>
<Name>Microsoft.AspNet.Abstractions</Name> <Name>Microsoft.AspNet.PipelineCore.net45</Name>
</ProjectReference> </ProjectReference>
</ItemGroup> </ItemGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets. Other similar extension points exist, see Microsoft.Common.targets.

View File

@ -1,71 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{A4D3E280-8838-4614-9B99-4874C3CBDF82}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Microsoft.AspNet.PipelineCore</RootNamespace>
<AssemblyName>Microsoft.AspNet.PipelineCore</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>bin\Release\Microsoft.AspNet.PipelineCore.XML</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="Microsoft.CSharp" />
</ItemGroup>
<ItemGroup>
<Compile Include="Builder.cs" />
<Compile Include="DefaultHttpContext.cs" />
<Compile Include="DefaultHttpRequest.cs" />
<Compile Include="DefaultHttpResponse.cs" />
<Compile Include="Owin\OwinConstants.cs" />
<Compile Include="Owin\OwinHttpEnvironment.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Microsoft.AspNet.FeatureModel\Microsoft.AspNet.FeatureModel.csproj">
<Project>{A780873E-09F9-4E44-AE06-AF00C4E88E1E}</Project>
<Name>Microsoft.AspNet.FeatureModel</Name>
</ProjectReference>
<ProjectReference Include="..\Microsoft.AspNet.Abstractions\Microsoft.AspNet.Abstractions.csproj">
<Project>{4e1520b1-01f4-481b-96a2-24067eaa52fa}</Project>
<Name>Microsoft.AspNet.Abstractions</Name>
</ProjectReference>
<ProjectReference Include="..\Microsoft.AspNet.HttpFeature\Microsoft.AspNet.HttpFeature.csproj">
<Project>{42309978-0661-41d8-8654-39453265c5f9}</Project>
<Name>Microsoft.AspNet.HttpFeature</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="Microsoft.AspNet.PipelineCore.nuspec" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@ -0,0 +1,65 @@
<?xml version="1.0" encoding="utf-8" ?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')"/>
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{E31D45AC-70F3-47D4-9625-A4D8C6AA1B6B}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Microsoft.AspNet.PipelineCore</RootNamespace>
<AssemblyName>Microsoft.AspNet.PipelineCore</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<BaseIntermediateOutputPath>obj/K</BaseIntermediateOutputPath>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\K</OutputPath>
<DefineConstants>DEBUG;TRACE;K10</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\K</OutputPath>
<DefineConstants>TRACE;K10</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Compile Include="Builder.cs" />
<Compile Include="DefaultHttpContext.cs" />
<Compile Include="DefaultHttpRequest.cs" />
<Compile Include="DefaultHttpResponse.cs" />
<Compile Include="Owin\OwinConstants.cs" />
<Compile Include="Owin\OwinHttpEnvironment.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Content Include="project.json"/>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\Microsoft.AspNet.FeatureModel\Microsoft.AspNet.FeatureModel.k10.csproj">
<Project>{E9AF7046-E24C-4071-B7AF-7981F2D1A613}</Project>
<Name>Microsoft.AspNet.FeatureModel</Name>
</ProjectReference><ProjectReference Include="..\..\src\Microsoft.AspNet.Abstractions\Microsoft.AspNet.Abstractions.k10.csproj">
<Project>{7D19BA93-ABFD-4D49-9AA9-DB55AF6BD6F1}</Project>
<Name>Microsoft.AspNet.Abstractions</Name>
</ProjectReference><ProjectReference Include="..\..\src\Microsoft.AspNet.HttpFeature\Microsoft.AspNet.HttpFeature.k10.csproj">
<Project>{9295515C-6603-46BB-92EB-1C5F6B0E84C9}</Project>
<Name>Microsoft.AspNet.HttpFeature</Name>
</ProjectReference>
</ItemGroup>
<Import Project="..\..\packages\ProjectK.0.0.1-pre-30121-096\Framework\K\v1.0\ProjectK.CSharp.targets"/>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@ -0,0 +1,72 @@
<?xml version="1.0" encoding="utf-8" ?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')"/>
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{68A538BA-D542-49CB-9615-B4F5A4E78C87}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Microsoft.AspNet.PipelineCore</RootNamespace>
<AssemblyName>Microsoft.AspNet.PipelineCore</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<BaseIntermediateOutputPath>obj/net45</BaseIntermediateOutputPath>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\net45</OutputPath>
<DefineConstants>DEBUG;TRACE;NET45</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\net45</OutputPath>
<DefineConstants>TRACE;NET45</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="mscorlib"/>
<Reference Include="System"/>
<Reference Include="System.Core"/>
<Reference Include="Microsoft.CSharp"/>
</ItemGroup>
<ItemGroup>
<Compile Include="Builder.cs" />
<Compile Include="DefaultHttpContext.cs" />
<Compile Include="DefaultHttpRequest.cs" />
<Compile Include="DefaultHttpResponse.cs" />
<Compile Include="Owin\OwinConstants.cs" />
<Compile Include="Owin\OwinHttpEnvironment.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Content Include="project.json"/>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\Microsoft.AspNet.FeatureModel\Microsoft.AspNet.FeatureModel.net45.csproj">
<Project>{95AEE59D-BF51-47CB-A957-C03D909CC148}</Project>
<Name>Microsoft.AspNet.FeatureModel</Name>
</ProjectReference><ProjectReference Include="..\..\src\Microsoft.AspNet.Abstractions\Microsoft.AspNet.Abstractions.net45.csproj">
<Project>{D36288AF-8A0E-48DD-8AF8-15B72F91C70A}</Project>
<Name>Microsoft.AspNet.Abstractions</Name>
</ProjectReference><ProjectReference Include="..\..\src\Microsoft.AspNet.HttpFeature\Microsoft.AspNet.HttpFeature.net45.csproj">
<Project>{A6DEB0D3-982E-4A07-8EE7-39269F192AF7}</Project>
<Name>Microsoft.AspNet.HttpFeature</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets"/>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View File

@ -1,22 +0,0 @@
<package >
<metadata>
<id>$id$</id>
<version>$version$</version>
<authors>$authors$</authors>
<owners>$authors$</owners>
<licenseUrl>$licenseUrl$</licenseUrl>
<projectUrl>$projectUrl$</projectUrl>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<title>$title$</title>
<description>$title$</description>
<tags>$tags$</tags>
<dependencies>
</dependencies>
</metadata>
<files>
<file src="$id$.dll" target="lib\net45" />
<file src="$id$.xml" target="lib\net45" />
<file src="$id$.pdb" target="lib\net45" />
<file src="src\**" target="src" />
</files>
</package>

View File

@ -3,7 +3,9 @@ using System.Collections.Generic;
using System.Globalization; using System.Globalization;
using System.IO; using System.IO;
using System.Net; using System.Net;
#if NET45
using System.Security.Cryptography.X509Certificates; using System.Security.Cryptography.X509Certificates;
#endif
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNet.HttpFeature; using Microsoft.AspNet.HttpFeature;
@ -117,24 +119,24 @@ namespace Microsoft.AspNet.PipelineCore.Owin
{ {
// TODO: // TODO:
} }
#if NET45
IPAddress IHttpConnection.RemoteIpAddress IPAddress IHttpConnection.RemoteIpAddress
{ {
get { return IPAddress.Parse(Prop<string>(OwinConstants.CommonKeys.RemoteIpAddress)); } get { return IPAddress.Parse(Prop<string>(OwinConstants.CommonKeys.RemoteIpAddress)); }
set { Prop(OwinConstants.CommonKeys.RemoteIpAddress, value.ToString()); } set { Prop(OwinConstants.CommonKeys.RemoteIpAddress, value.ToString()); }
} }
int IHttpConnection.RemotePort
{
get { return int.Parse(Prop<string>(OwinConstants.CommonKeys.RemotePort)); }
set { Prop(OwinConstants.CommonKeys.RemotePort, value.ToString(CultureInfo.InvariantCulture)); }
}
IPAddress IHttpConnection.LocalIpAddress IPAddress IHttpConnection.LocalIpAddress
{ {
get { return IPAddress.Parse(Prop<string>(OwinConstants.CommonKeys.LocalIpAddress)); } get { return IPAddress.Parse(Prop<string>(OwinConstants.CommonKeys.LocalIpAddress)); }
set { Prop(OwinConstants.CommonKeys.LocalIpAddress, value.ToString()); } set { Prop(OwinConstants.CommonKeys.LocalIpAddress, value.ToString()); }
} }
#endif
int IHttpConnection.RemotePort
{
get { return int.Parse(Prop<string>(OwinConstants.CommonKeys.RemotePort)); }
set { Prop(OwinConstants.CommonKeys.RemotePort, value.ToString(CultureInfo.InvariantCulture)); }
}
int IHttpConnection.LocalPort int IHttpConnection.LocalPort
{ {
@ -152,13 +154,13 @@ namespace Microsoft.AspNet.PipelineCore.Owin
{ {
throw new NotImplementedException(); throw new NotImplementedException();
} }
#if NET45
X509Certificate IHttpTransportLayerSecurity.ClientCertificate X509Certificate IHttpTransportLayerSecurity.ClientCertificate
{ {
get { return Prop<X509Certificate>(OwinConstants.CommonKeys.ClientCertificate); } get { return Prop<X509Certificate>(OwinConstants.CommonKeys.ClientCertificate); }
set { Prop(OwinConstants.CommonKeys.ClientCertificate, value); } set { Prop(OwinConstants.CommonKeys.ClientCertificate, value); }
} }
#endif
Task IHttpTransportLayerSecurity.LoadAsync() Task IHttpTransportLayerSecurity.LoadAsync()
{ {
throw new NotImplementedException(); throw new NotImplementedException();

View File

@ -0,0 +1,11 @@
{
"dependencies": {
"Microsoft.AspNet.FeatureModel" : "",
"Microsoft.AspNet.Abstractions" : "",
"Microsoft.AspNet.HttpFeature" : ""
},
"configurations": {
"net45": { },
"k10" : { }
}
}

View File

@ -47,11 +47,14 @@
<None Include="packages.config" /> <None Include="packages.config" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\..\src\Microsoft.AspNet.FeatureModel\Microsoft.AspNet.FeatureModel.csproj"> <ProjectReference Include="..\..\src\Microsoft.AspNet.FeatureModel\Microsoft.AspNet.FeatureModel.net45.csproj">
<Project>{A780873E-09F9-4E44-AE06-AF00C4E88E1E}</Project> <Project>{95aee59d-bf51-47cb-a957-c03d909cc148}</Project>
<Name>Microsoft.AspNet.FeatureModel</Name> <Name>Microsoft.AspNet.FeatureModel.net45</Name>
</ProjectReference> </ProjectReference>
</ItemGroup> </ItemGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets. Other similar extension points exist, see Microsoft.Common.targets.