diff --git a/AspNetAbstractions.sln b/AspNetAbstractions.sln index 82b860829b..b3df2a2bfa 100644 --- a/AspNetAbstractions.sln +++ b/AspNetAbstractions.sln @@ -3,40 +3,36 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2013 VisualStudioVersion = 12.0.21005.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}" 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}" 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 GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection 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.Build.0 = Debug|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}.Release|Any CPU.ActiveCfg = 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 GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE 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 diff --git a/Sakefile.shade b/Sakefile.shade deleted file mode 100644 index 56c6a45839..0000000000 --- a/Sakefile.shade +++ /dev/null @@ -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 { - {"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}"' diff --git a/build.cmd b/build.cmd index 65dfe408fd..e2ce3f1317 100644 --- a/build.cmd +++ b/build.cmd @@ -9,4 +9,4 @@ mkdir .nuget :part2 set EnableNuGetPackageRestore=true .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 %* diff --git a/build.sh b/build.sh deleted file mode 100644 index 8a58a5e2a9..0000000000 --- a/build.sh +++ /dev/null @@ -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 "$@" - diff --git a/build/_git-clone.shade b/build/_git-clone.shade new file mode 100644 index 0000000000..32355ab5a3 --- /dev/null +++ b/build/_git-clone.shade @@ -0,0 +1,9 @@ + + + +default gitBranch='' + +var gitCommand='clone ${gitUri}' +set gitCommand='${gitCommand} --branch ${gitBranch}' if='!string.IsNullOrEmpty(gitBranch)' + +git diff --git a/build/_git-pull.shade b/build/_git-pull.shade new file mode 100644 index 0000000000..1e7971020f --- /dev/null +++ b/build/_git-pull.shade @@ -0,0 +1,8 @@ + + +default gitBranch='' + +var gitCommand='pull ${gitUri}' +set gitCommand='${gitCommand} ${gitBranch}' if='!string.IsNullOrEmpty(gitBranch)' + +git diff --git a/build/_git.shade b/build/_git.shade new file mode 100644 index 0000000000..7495a598bb --- /dev/null +++ b/build/_git.shade @@ -0,0 +1,5 @@ + +default gitFolder='' + +exec program='git' commandline='${gitCommand}' workingdir='${gitFolder}' + diff --git a/build/_k-build.shade b/build/_k-build.shade new file mode 100644 index 0000000000..435bdca74a --- /dev/null +++ b/build/_k-build.shade @@ -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)}' diff --git a/build/_k-clean.shade b/build/_k-clean.shade new file mode 100644 index 0000000000..7f8b643682 --- /dev/null +++ b/build/_k-clean.shade @@ -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}' diff --git a/build/_k-generate-projects.shade b/build/_k-generate-projects.shade new file mode 100644 index 0000000000..01af0cd018 --- /dev/null +++ b/build/_k-generate-projects.shade @@ -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 { + { "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 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 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 GetProjectMapping(string solutionPath, string[] jsonFiles) + { + var dict = new Dictionary(); + + 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(); + 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 projectMapping, + IDictionary 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; + var configs = GetObject(d, "configurations"); + var references = GetObject(d, "dependencies") ?? new Dictionary(); + + // 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( + @"", p))); + + // Add the config file if it's there + if (File.Exists(Path.Combine(projectDir, "packages.config"))) + { + filesString += ""; + } + + 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 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(@" + {{{1}}} + {2} + ", 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 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(@" + + False + ..\..\{1} + ", AssemblyName.GetAssemblyName(dllPath).FullName, dllPath.Substring(dllPath.IndexOf("packages"))); + } + } + + return sb.ToString(); + } + + private static IDictionary GetObject(IDictionary obj, string key) + { + object value; + if (obj.TryGetValue(key, out value)) + { + return value as IDictionary; + } + + return null; + } + } + } diff --git a/build/_k-restore.shade b/build/_k-restore.shade new file mode 100644 index 0000000000..0f20db0fc0 --- /dev/null +++ b/build/_k-restore.shade @@ -0,0 +1,7 @@ +@{/* + +k-restore + Restores nuget packages required for k projects. Downloads and executes k sdk tools. +*/} + +k command='restore' diff --git a/build/_k-standard-goals.shade b/build/_k-standard-goals.shade new file mode 100644 index 0000000000..b6a38ff7dd --- /dev/null +++ b/build/_k-standard-goals.shade @@ -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); } +} diff --git a/build/_k.shade b/build/_k.shade new file mode 100644 index 0000000000..c0e216dcae --- /dev/null +++ b/build/_k.shade @@ -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}' diff --git a/build/k10.txt b/build/k10.txt new file mode 100644 index 0000000000..60c669f855 --- /dev/null +++ b/build/k10.txt @@ -0,0 +1,50 @@ + + + + + Debug + AnyCPU + {{ProjectGuid}} + Library + Properties + {Name} + {Name} + v4.5 + 512 + obj/K + + + AnyCPU + true + full + false + bin\Debug\K + DEBUG;TRACE;K10 + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\K + TRACE;K10 + prompt + 4 + + + {Files} + + + + {ProjectReferences} + + + + \ No newline at end of file diff --git a/src/Microsoft.AspNet.FeatureModel/Microsoft.AspNet.FeatureModel.csproj b/build/net45.txt similarity index 68% rename from src/Microsoft.AspNet.FeatureModel/Microsoft.AspNet.FeatureModel.csproj rename to build/net45.txt index 5109def60a..8d2e271f7b 100644 --- a/src/Microsoft.AspNet.FeatureModel/Microsoft.AspNet.FeatureModel.csproj +++ b/build/net45.txt @@ -4,44 +4,47 @@ Debug AnyCPU - {A780873E-09F9-4E44-AE06-AF00C4E88E1E} + {{ProjectGuid}} Library Properties - Microsoft.AspNet.FeatureModel - Microsoft.AspNet.FeatureModel + {Name} + {Name} v4.5 512 + obj/net45 + AnyCPU true full false - bin\Debug\ - DEBUG;TRACE + bin\Debug\net45 + DEBUG;TRACE;NET45 prompt 4 + AnyCPU pdbonly true - bin\Release\ - TRACE + bin\Release\net45 + TRACE;NET45 prompt 4 - bin\Release\Microsoft.AspNet.FeatureModel.XML + + + + {References} - - - - - + {Files} + - + {ProjectReferences} + \ No newline at end of file diff --git a/src/Microsoft.AspNet.Abstractions/Microsoft.AspNet.Abstractions.nuspec b/src/Microsoft.AspNet.Abstractions/Microsoft.AspNet.Abstractions.nuspec deleted file mode 100644 index 1b6a2894c7..0000000000 --- a/src/Microsoft.AspNet.Abstractions/Microsoft.AspNet.Abstractions.nuspec +++ /dev/null @@ -1,22 +0,0 @@ - - - $id$ - $version$ - $authors$ - $authors$ - $licenseUrl$ - $projectUrl$ - true - $title$ - $title$ - $tags$ - - - - - - - - - - diff --git a/src/Microsoft.AspNet.Abstractions/project.json b/src/Microsoft.AspNet.Abstractions/project.json new file mode 100644 index 0000000000..d2bb6fd770 --- /dev/null +++ b/src/Microsoft.AspNet.Abstractions/project.json @@ -0,0 +1,7 @@ +{ + "dependencies": {}, + "configurations": { + "net45": { }, + "k10" : { } + } +} \ No newline at end of file diff --git a/src/Microsoft.AspNet.FeatureModel/Implementation/Converter.cs b/src/Microsoft.AspNet.FeatureModel/Implementation/Converter.cs index 918d9f2b8f..32f3943634 100644 --- a/src/Microsoft.AspNet.FeatureModel/Implementation/Converter.cs +++ b/src/Microsoft.AspNet.FeatureModel/Implementation/Converter.cs @@ -7,6 +7,7 @@ using System.Runtime.CompilerServices; namespace Microsoft.AspNet.FeatureModel.Implementation { + #if NET45 public abstract class NonGenericProxyBase { public readonly Type WrappedType; @@ -381,4 +382,5 @@ namespace Microsoft.AspNet.FeatureModel.Implementation } } -} + #endif +} \ No newline at end of file diff --git a/src/Microsoft.AspNet.FeatureModel/InterfaceDictionary.cs b/src/Microsoft.AspNet.FeatureModel/InterfaceDictionary.cs index 2181f686f8..a0f31a2306 100644 --- a/src/Microsoft.AspNet.FeatureModel/InterfaceDictionary.cs +++ b/src/Microsoft.AspNet.FeatureModel/InterfaceDictionary.cs @@ -42,11 +42,19 @@ namespace Microsoft.AspNet.FeatureModel { 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; } +#if NET45 return Converter.Convert(type, actualType, feature); +#endif } } diff --git a/src/Microsoft.AspNet.FeatureModel/InterfaceObject.cs b/src/Microsoft.AspNet.FeatureModel/InterfaceObject.cs index 6f81904e03..4673cd9c44 100644 --- a/src/Microsoft.AspNet.FeatureModel/InterfaceObject.cs +++ b/src/Microsoft.AspNet.FeatureModel/InterfaceObject.cs @@ -1,4 +1,5 @@ using System; +using System.Reflection; using System.Collections; using System.Collections.Generic; using Microsoft.AspNet.FeatureModel.Implementation; @@ -25,10 +26,12 @@ namespace Microsoft.AspNet.FeatureModel public object GetInterface(Type type) { +#if NET45 if (type.IsInstanceOfType(_instance)) { return _instance; } + foreach (var interfaceType in _instance.GetType().GetInterfaces()) { if (interfaceType.FullName == type.FullName) @@ -36,6 +39,7 @@ namespace Microsoft.AspNet.FeatureModel return Converter.Convert(interfaceType, type, _instance); } } +#endif return null; } diff --git a/src/Microsoft.AspNet.FeatureModel/Microsoft.AspNet.FeatureModel.k10.csproj b/src/Microsoft.AspNet.FeatureModel/Microsoft.AspNet.FeatureModel.k10.csproj new file mode 100644 index 0000000000..776ade7f7e --- /dev/null +++ b/src/Microsoft.AspNet.FeatureModel/Microsoft.AspNet.FeatureModel.k10.csproj @@ -0,0 +1,54 @@ + + + + + Debug + AnyCPU + {E9AF7046-E24C-4071-B7AF-7981F2D1A613} + Library + Properties + Microsoft.AspNet.FeatureModel + Microsoft.AspNet.FeatureModel + v4.5 + 512 + obj/K + + + AnyCPU + true + full + false + bin\Debug\K + DEBUG;TRACE;K10 + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\K + TRACE;K10 + prompt + 4 + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Microsoft.AspNet.FeatureModel/Microsoft.AspNet.FeatureModel.net45.csproj b/src/Microsoft.AspNet.FeatureModel/Microsoft.AspNet.FeatureModel.net45.csproj new file mode 100644 index 0000000000..a9c22f4ba0 --- /dev/null +++ b/src/Microsoft.AspNet.FeatureModel/Microsoft.AspNet.FeatureModel.net45.csproj @@ -0,0 +1,61 @@ + + + + + Debug + AnyCPU + {95AEE59D-BF51-47CB-A957-C03D909CC148} + Library + Properties + Microsoft.AspNet.FeatureModel + Microsoft.AspNet.FeatureModel + v4.5 + 512 + obj/net45 + + + AnyCPU + true + full + false + bin\Debug\net45 + DEBUG;TRACE;NET45 + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\net45 + TRACE;NET45 + prompt + 4 + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Microsoft.AspNet.FeatureModel/Microsoft.AspNet.FeatureModel.nuspec b/src/Microsoft.AspNet.FeatureModel/Microsoft.AspNet.FeatureModel.nuspec deleted file mode 100644 index 1b6a2894c7..0000000000 --- a/src/Microsoft.AspNet.FeatureModel/Microsoft.AspNet.FeatureModel.nuspec +++ /dev/null @@ -1,22 +0,0 @@ - - - $id$ - $version$ - $authors$ - $authors$ - $licenseUrl$ - $projectUrl$ - true - $title$ - $title$ - $tags$ - - - - - - - - - - diff --git a/src/Microsoft.AspNet.FeatureModel/project.json b/src/Microsoft.AspNet.FeatureModel/project.json new file mode 100644 index 0000000000..d2bb6fd770 --- /dev/null +++ b/src/Microsoft.AspNet.FeatureModel/project.json @@ -0,0 +1,7 @@ +{ + "dependencies": {}, + "configurations": { + "net45": { }, + "k10" : { } + } +} \ No newline at end of file diff --git a/src/Microsoft.AspNet.HttpEnvironment/Microsoft.AspNet.HttpEnvironment.csproj b/src/Microsoft.AspNet.HttpEnvironment/Microsoft.AspNet.HttpEnvironment.k10.csproj similarity index 61% rename from src/Microsoft.AspNet.HttpEnvironment/Microsoft.AspNet.HttpEnvironment.csproj rename to src/Microsoft.AspNet.HttpEnvironment/Microsoft.AspNet.HttpEnvironment.k10.csproj index 048afaa76f..91f02062eb 100644 --- a/src/Microsoft.AspNet.HttpEnvironment/Microsoft.AspNet.HttpEnvironment.csproj +++ b/src/Microsoft.AspNet.HttpEnvironment/Microsoft.AspNet.HttpEnvironment.k10.csproj @@ -1,53 +1,50 @@ - + - + Debug AnyCPU - {46D69EC9-7096-49D8-A184-A9BB5B2419A1} + {F677AA06-54DB-43E0-B193-CC04D1095A2B} Library Properties Microsoft.AspNet.HttpEnvironment Microsoft.AspNet.HttpEnvironment v4.5 512 + obj/K + AnyCPU true full false - bin\Debug\ - DEBUG;TRACE + bin\Debug\K + DEBUG;TRACE;K10 prompt 4 + AnyCPU pdbonly true - bin\Release\ - TRACE + bin\Release\K + TRACE;K10 prompt 4 - bin\Release\Microsoft.AspNet.HttpEnvironment.XML - - - - - + + + - - {A780873E-09F9-4E44-AE06-AF00C4E88E1E} - Microsoft.AspNet.FeatureModel - + + {E9AF7046-E24C-4071-B7AF-7981F2D1A613} + Microsoft.AspNet.FeatureModel + - - - - + + \ No newline at end of file diff --git a/src/Microsoft.AspNet.HttpEnvironment/Microsoft.AspNet.HttpEnvironment.nuspec b/src/Microsoft.AspNet.HttpEnvironment/Microsoft.AspNet.HttpEnvironment.nuspec deleted file mode 100644 index 1b6a2894c7..0000000000 --- a/src/Microsoft.AspNet.HttpEnvironment/Microsoft.AspNet.HttpEnvironment.nuspec +++ /dev/null @@ -1,22 +0,0 @@ - - - $id$ - $version$ - $authors$ - $authors$ - $licenseUrl$ - $projectUrl$ - true - $title$ - $title$ - $tags$ - - - - - - - - - - diff --git a/src/Microsoft.AspNet.HttpEnvironment/project.json b/src/Microsoft.AspNet.HttpEnvironment/project.json new file mode 100644 index 0000000000..bea3db51c3 --- /dev/null +++ b/src/Microsoft.AspNet.HttpEnvironment/project.json @@ -0,0 +1,9 @@ +{ + "dependencies": { + "Microsoft.AspNet.FeatureModel" : "" + }, + "configurations": { + "net45": { }, + "k10" : { } + } +} \ No newline at end of file diff --git a/src/Microsoft.AspNet.HttpFeature/IHttpConnection.cs b/src/Microsoft.AspNet.HttpFeature/IHttpConnection.cs index d659efd69c..fcb2318f3d 100644 --- a/src/Microsoft.AspNet.HttpFeature/IHttpConnection.cs +++ b/src/Microsoft.AspNet.HttpFeature/IHttpConnection.cs @@ -4,9 +4,11 @@ namespace Microsoft.AspNet.HttpFeature { public interface IHttpConnection { +#if NET45 IPAddress RemoteIpAddress { get; set; } - int RemotePort { get; set; } IPAddress LocalIpAddress { get; set; } +#endif + int RemotePort { get; set; } int LocalPort { get; set; } bool IsLocal { get; set; } } diff --git a/src/Microsoft.AspNet.HttpFeature/IHttpTransportLayerSecurity.cs b/src/Microsoft.AspNet.HttpFeature/IHttpTransportLayerSecurity.cs index 596462e28c..a08136b6aa 100644 --- a/src/Microsoft.AspNet.HttpFeature/IHttpTransportLayerSecurity.cs +++ b/src/Microsoft.AspNet.HttpFeature/IHttpTransportLayerSecurity.cs @@ -1,11 +1,15 @@ +#if NET45 using System.Security.Cryptography.X509Certificates; +#endif using System.Threading.Tasks; namespace Microsoft.AspNet.HttpFeature { public interface IHttpTransportLayerSecurity { +#if NET45 X509Certificate ClientCertificate { get; set; } +#endif Task LoadAsync(); } } \ No newline at end of file diff --git a/src/Microsoft.AspNet.HttpFeature/IHttpWebSocketAccept.cs b/src/Microsoft.AspNet.HttpFeature/IHttpWebSocketAccept.cs index ad0374c7f9..d7b230df24 100644 --- a/src/Microsoft.AspNet.HttpFeature/IHttpWebSocketAccept.cs +++ b/src/Microsoft.AspNet.HttpFeature/IHttpWebSocketAccept.cs @@ -1,3 +1,4 @@ +#if NET45 using System.Net.WebSockets; using System.Threading.Tasks; @@ -9,3 +10,4 @@ namespace Microsoft.AspNet.HttpFeature Task AcceptAsync(); } } +#endif \ No newline at end of file diff --git a/src/Microsoft.AspNet.HttpFeature/Microsoft.AspNet.HttpFeature.k10.csproj b/src/Microsoft.AspNet.HttpFeature/Microsoft.AspNet.HttpFeature.k10.csproj new file mode 100644 index 0000000000..5bbb67dd94 --- /dev/null +++ b/src/Microsoft.AspNet.HttpFeature/Microsoft.AspNet.HttpFeature.k10.csproj @@ -0,0 +1,64 @@ + + + + + Debug + AnyCPU + {9295515C-6603-46BB-92EB-1C5F6B0E84C9} + Library + Properties + Microsoft.AspNet.HttpFeature + Microsoft.AspNet.HttpFeature + v4.5 + 512 + obj/K + + + AnyCPU + true + full + false + bin\Debug\K + DEBUG;TRACE;K10 + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\K + TRACE;K10 + prompt + 4 + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Microsoft.AspNet.HttpFeature/Microsoft.AspNet.HttpFeature.csproj b/src/Microsoft.AspNet.HttpFeature/Microsoft.AspNet.HttpFeature.net45.csproj similarity index 54% rename from src/Microsoft.AspNet.HttpFeature/Microsoft.AspNet.HttpFeature.csproj rename to src/Microsoft.AspNet.HttpFeature/Microsoft.AspNet.HttpFeature.net45.csproj index 7b6ab541d0..dea0824cd3 100644 --- a/src/Microsoft.AspNet.HttpFeature/Microsoft.AspNet.HttpFeature.csproj +++ b/src/Microsoft.AspNet.HttpFeature/Microsoft.AspNet.HttpFeature.net45.csproj @@ -1,59 +1,66 @@ - + - + Debug AnyCPU - {42309978-0661-41D8-8654-39453265C5F9} + {A6DEB0D3-982E-4A07-8EE7-39269F192AF7} Library Properties Microsoft.AspNet.HttpFeature Microsoft.AspNet.HttpFeature v4.5 512 + obj/net45 + AnyCPU true full false - bin\Debug\ - DEBUG;TRACE + bin\Debug\net45 + DEBUG;TRACE;NET45 prompt 4 + AnyCPU pdbonly true - bin\Release\ - TRACE + bin\Release\net45 + TRACE;NET45 prompt 4 - bin\Release\Microsoft.AspNet.HttpFeature.xml - + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - + - + - \ No newline at end of file diff --git a/src/Microsoft.AspNet.PipelineCore/Microsoft.AspNet.PipelineCore.k10.csproj b/src/Microsoft.AspNet.PipelineCore/Microsoft.AspNet.PipelineCore.k10.csproj new file mode 100644 index 0000000000..969ff37c3e --- /dev/null +++ b/src/Microsoft.AspNet.PipelineCore/Microsoft.AspNet.PipelineCore.k10.csproj @@ -0,0 +1,65 @@ + + + + + Debug + AnyCPU + {E31D45AC-70F3-47D4-9625-A4D8C6AA1B6B} + Library + Properties + Microsoft.AspNet.PipelineCore + Microsoft.AspNet.PipelineCore + v4.5 + 512 + obj/K + + + AnyCPU + true + full + false + bin\Debug\K + DEBUG;TRACE;K10 + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\K + TRACE;K10 + prompt + 4 + + + + + + + + + + + + + + {E9AF7046-E24C-4071-B7AF-7981F2D1A613} + Microsoft.AspNet.FeatureModel + + {7D19BA93-ABFD-4D49-9AA9-DB55AF6BD6F1} + Microsoft.AspNet.Abstractions + + {9295515C-6603-46BB-92EB-1C5F6B0E84C9} + Microsoft.AspNet.HttpFeature + + + + + \ No newline at end of file diff --git a/src/Microsoft.AspNet.PipelineCore/Microsoft.AspNet.PipelineCore.net45.csproj b/src/Microsoft.AspNet.PipelineCore/Microsoft.AspNet.PipelineCore.net45.csproj new file mode 100644 index 0000000000..ff38272dce --- /dev/null +++ b/src/Microsoft.AspNet.PipelineCore/Microsoft.AspNet.PipelineCore.net45.csproj @@ -0,0 +1,72 @@ + + + + + Debug + AnyCPU + {68A538BA-D542-49CB-9615-B4F5A4E78C87} + Library + Properties + Microsoft.AspNet.PipelineCore + Microsoft.AspNet.PipelineCore + v4.5 + 512 + obj/net45 + + + AnyCPU + true + full + false + bin\Debug\net45 + DEBUG;TRACE;NET45 + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\net45 + TRACE;NET45 + prompt + 4 + + + + + + + + + + + + + + + + + + + + + {95AEE59D-BF51-47CB-A957-C03D909CC148} + Microsoft.AspNet.FeatureModel + + {D36288AF-8A0E-48DD-8AF8-15B72F91C70A} + Microsoft.AspNet.Abstractions + + {A6DEB0D3-982E-4A07-8EE7-39269F192AF7} + Microsoft.AspNet.HttpFeature + + + + + \ No newline at end of file diff --git a/src/Microsoft.AspNet.PipelineCore/Microsoft.AspNet.PipelineCore.nuspec b/src/Microsoft.AspNet.PipelineCore/Microsoft.AspNet.PipelineCore.nuspec deleted file mode 100644 index 1b6a2894c7..0000000000 --- a/src/Microsoft.AspNet.PipelineCore/Microsoft.AspNet.PipelineCore.nuspec +++ /dev/null @@ -1,22 +0,0 @@ - - - $id$ - $version$ - $authors$ - $authors$ - $licenseUrl$ - $projectUrl$ - true - $title$ - $title$ - $tags$ - - - - - - - - - - diff --git a/src/Microsoft.AspNet.PipelineCore/Owin/OwinHttpEnvironment.cs b/src/Microsoft.AspNet.PipelineCore/Owin/OwinHttpEnvironment.cs index 124f49e471..c8013ed522 100644 --- a/src/Microsoft.AspNet.PipelineCore/Owin/OwinHttpEnvironment.cs +++ b/src/Microsoft.AspNet.PipelineCore/Owin/OwinHttpEnvironment.cs @@ -3,7 +3,9 @@ using System.Collections.Generic; using System.Globalization; using System.IO; using System.Net; +#if NET45 using System.Security.Cryptography.X509Certificates; +#endif using System.Threading; using System.Threading.Tasks; using Microsoft.AspNet.HttpFeature; @@ -117,24 +119,24 @@ namespace Microsoft.AspNet.PipelineCore.Owin { // TODO: } - +#if NET45 IPAddress IHttpConnection.RemoteIpAddress { get { return IPAddress.Parse(Prop(OwinConstants.CommonKeys.RemoteIpAddress)); } set { Prop(OwinConstants.CommonKeys.RemoteIpAddress, value.ToString()); } } - int IHttpConnection.RemotePort - { - get { return int.Parse(Prop(OwinConstants.CommonKeys.RemotePort)); } - set { Prop(OwinConstants.CommonKeys.RemotePort, value.ToString(CultureInfo.InvariantCulture)); } - } - IPAddress IHttpConnection.LocalIpAddress { get { return IPAddress.Parse(Prop(OwinConstants.CommonKeys.LocalIpAddress)); } set { Prop(OwinConstants.CommonKeys.LocalIpAddress, value.ToString()); } } +#endif + int IHttpConnection.RemotePort + { + get { return int.Parse(Prop(OwinConstants.CommonKeys.RemotePort)); } + set { Prop(OwinConstants.CommonKeys.RemotePort, value.ToString(CultureInfo.InvariantCulture)); } + } int IHttpConnection.LocalPort { @@ -152,13 +154,13 @@ namespace Microsoft.AspNet.PipelineCore.Owin { throw new NotImplementedException(); } - +#if NET45 X509Certificate IHttpTransportLayerSecurity.ClientCertificate { get { return Prop(OwinConstants.CommonKeys.ClientCertificate); } set { Prop(OwinConstants.CommonKeys.ClientCertificate, value); } } - +#endif Task IHttpTransportLayerSecurity.LoadAsync() { throw new NotImplementedException(); diff --git a/src/Microsoft.AspNet.PipelineCore/project.json b/src/Microsoft.AspNet.PipelineCore/project.json new file mode 100644 index 0000000000..062ab51708 --- /dev/null +++ b/src/Microsoft.AspNet.PipelineCore/project.json @@ -0,0 +1,11 @@ +{ + "dependencies": { + "Microsoft.AspNet.FeatureModel" : "", + "Microsoft.AspNet.Abstractions" : "", + "Microsoft.AspNet.HttpFeature" : "" + }, + "configurations": { + "net45": { }, + "k10" : { } + } +} \ No newline at end of file diff --git a/test/Microsoft.AspNet.FeatureModel.Tests/Microsoft.AspNet.FeatureModel.Tests.csproj b/test/Microsoft.AspNet.FeatureModel.Tests/Microsoft.AspNet.FeatureModel.Tests.csproj index 98d1189ee4..5f11f27e55 100644 --- a/test/Microsoft.AspNet.FeatureModel.Tests/Microsoft.AspNet.FeatureModel.Tests.csproj +++ b/test/Microsoft.AspNet.FeatureModel.Tests/Microsoft.AspNet.FeatureModel.Tests.csproj @@ -47,11 +47,14 @@ - - {A780873E-09F9-4E44-AE06-AF00C4E88E1E} - Microsoft.AspNet.FeatureModel + + {95aee59d-bf51-47cb-a957-c03d909cc148} + Microsoft.AspNet.FeatureModel.net45 + + +