From 48243bbc0cc25e80a84be37b714ae04833814cf1 Mon Sep 17 00:00:00 2001 From: Eilon Lipton Date: Tue, 1 Dec 2015 14:35:51 -0800 Subject: [PATCH 001/169] Create README.md --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000000..add6834eeb --- /dev/null +++ b/README.md @@ -0,0 +1,6 @@ +HtmlAbstractions +========== + +HTML abstractions such as `IHtmlContent` and related APIs. + +This project is part of ASP.NET 5. You can find samples, documentation and getting started instructions for ASP.NET 5 at the [Home](https://github.com/aspnet/home) repo. From 95ae9483491ce2f12e6d47fd0064132d1c59c065 Mon Sep 17 00:00:00 2001 From: Eilon Lipton Date: Tue, 1 Dec 2015 14:36:15 -0800 Subject: [PATCH 002/169] Create LICENSE.txt --- LICENSE.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 LICENSE.txt diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000000..0bdc1962b6 --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,12 @@ +Copyright (c) .NET Foundation. All rights reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +these files except in compliance with the License. You may obtain a copy of the +License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed +under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR +CONDITIONS OF ANY KIND, either express or implied. See the License for the +specific language governing permissions and limitations under the License. From b14fa9d990f65c3c07c4e800d1eccfa5479d6a5d Mon Sep 17 00:00:00 2001 From: Eilon Lipton Date: Tue, 1 Dec 2015 14:36:26 -0800 Subject: [PATCH 003/169] Create CONTRIBUTING.md --- CONTRIBUTING.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000000..64ff041d5c --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,4 @@ +Contributing +====== + +Information on contributing to this repo is in the [Contributing Guide](https://github.com/aspnet/Home/blob/dev/CONTRIBUTING.md) in the Home repo. From f9661e2bf1b799c68396bb38fa4d942516c9f16a Mon Sep 17 00:00:00 2001 From: Pranav K Date: Tue, 1 Dec 2015 14:58:47 -0800 Subject: [PATCH 004/169] Initial commit --- .gitattributes | 50 ++ .gitignore | 27 ++ .travis.yml | 18 + HtmlAbstractions.sln | 55 +++ NuGet.config | 7 + NuGetPackageVerifier.json | 25 + appveyor.yml | 7 + build.cmd | 40 ++ build.sh | 43 ++ global.json | 3 + makefile.shade | 10 + .../HtmlContentBuilder.cs | 138 ++++++ .../HtmlContentBuilderExtensions.cs | 324 +++++++++++++ .../HtmlEncodedString.cs | 49 ++ src/Microsoft.AspNet.Html/HtmlTextWriter.cs | 49 ++ src/Microsoft.AspNet.Html/IHtmlContent.cs | 22 + .../IHtmlContentBuilder.cs | 40 ++ .../Microsoft.AspNet.Html.xproj | 19 + .../Properties/AssemblyInfo.cs | 10 + src/Microsoft.AspNet.Html/project.json | 29 ++ .../HtmlContentBuilderExtensionsTest.cs | 436 ++++++++++++++++++ .../HtmlContentBuilderTest.cs | 145 ++++++ .../Microsoft.AspNet.Html.Test.xproj | 21 + test/Microsoft.AspNet.Html.Test/project.json | 19 + tools/Key.snk | Bin 0 -> 596 bytes 25 files changed, 1586 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 .travis.yml create mode 100644 HtmlAbstractions.sln create mode 100644 NuGet.config create mode 100644 NuGetPackageVerifier.json create mode 100644 appveyor.yml create mode 100644 build.cmd create mode 100755 build.sh create mode 100644 global.json create mode 100644 makefile.shade create mode 100644 src/Microsoft.AspNet.Html/HtmlContentBuilder.cs create mode 100644 src/Microsoft.AspNet.Html/HtmlContentBuilderExtensions.cs create mode 100644 src/Microsoft.AspNet.Html/HtmlEncodedString.cs create mode 100644 src/Microsoft.AspNet.Html/HtmlTextWriter.cs create mode 100644 src/Microsoft.AspNet.Html/IHtmlContent.cs create mode 100644 src/Microsoft.AspNet.Html/IHtmlContentBuilder.cs create mode 100644 src/Microsoft.AspNet.Html/Microsoft.AspNet.Html.xproj create mode 100644 src/Microsoft.AspNet.Html/Properties/AssemblyInfo.cs create mode 100644 src/Microsoft.AspNet.Html/project.json create mode 100644 test/Microsoft.AspNet.Html.Test/HtmlContentBuilderExtensionsTest.cs create mode 100644 test/Microsoft.AspNet.Html.Test/HtmlContentBuilderTest.cs create mode 100644 test/Microsoft.AspNet.Html.Test/Microsoft.AspNet.Html.Test.xproj create mode 100644 test/Microsoft.AspNet.Html.Test/project.json create mode 100644 tools/Key.snk diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000000..bdaa5ba982 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,50 @@ +*.doc diff=astextplain +*.DOC diff=astextplain +*.docx diff=astextplain +*.DOCX diff=astextplain +*.dot diff=astextplain +*.DOT diff=astextplain +*.pdf diff=astextplain +*.PDF diff=astextplain +*.rtf diff=astextplain +*.RTF diff=astextplain + +*.jpg binary +*.png binary +*.gif binary + +*.cs text=auto diff=csharp +*.vb text=auto +*.resx text=auto +*.c text=auto +*.cpp text=auto +*.cxx text=auto +*.h text=auto +*.hxx text=auto +*.py text=auto +*.rb text=auto +*.java text=auto +*.html text=auto +*.htm text=auto +*.css text=auto +*.scss text=auto +*.sass text=auto +*.less text=auto +*.js text=auto +*.lisp text=auto +*.clj text=auto +*.sql text=auto +*.php text=auto +*.lua text=auto +*.m text=auto +*.asm text=auto +*.erl text=auto +*.fs text=auto +*.fsx text=auto +*.hs text=auto + +*.csproj text=auto +*.vbproj text=auto +*.fsproj text=auto +*.dbproj text=auto +*.sln text=auto eol=crlf diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000..ac82da7568 --- /dev/null +++ b/.gitignore @@ -0,0 +1,27 @@ +[Oo]bj/ +[Bb]in/ +TestResults/ +.nuget/ +_ReSharper.*/ +packages/ +artifacts/ +PublishProfiles/ +*.user +*.suo +*.cache +*.docstates +_ReSharper.* +nuget.exe +*net45.csproj +*net451.csproj +*k10.csproj +*.psess +*.vsp +*.pidb +*.userprefs +*DS_Store +*.ncrunchsolution +*.*sdf +*.ipch +*.sln.ide +project.lock.json diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000000..c0befaffcf --- /dev/null +++ b/.travis.yml @@ -0,0 +1,18 @@ +language: csharp +sudo: required +dist: trusty +addons: + apt: + packages: + - gettext + - libcurl4-openssl-dev + - libicu-dev + - libssl-dev + - libunwind8 + - zlib1g +env: + - KOREBUILD_DNU_RESTORE_CORECLR=true KOREBUILD_TEST_DNXCORE=true +mono: + - 4.0.5 +script: + - ./build.sh --quiet verify diff --git a/HtmlAbstractions.sln b/HtmlAbstractions.sln new file mode 100644 index 0000000000..1d1f5118f3 --- /dev/null +++ b/HtmlAbstractions.sln @@ -0,0 +1,55 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.24711.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{A5A15F1C-885A-452A-A731-B0173DDBD913}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{F31FF137-390C-49BF-A3BD-7C6ED3597C21}" +EndProject +Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNet.Html", "src\Microsoft.AspNet.Html.Abstractions\Microsoft.AspNet.Html.xproj", "{68A28E4A-3ADE-4187-9625-4FF185887CB3}" +EndProject +Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNet.Html.Test", "test\Microsoft.AspNet.Html.Abstractions.Test\Microsoft.AspNet.Html.Test.xproj", "{2D187B88-94BD-4A39-AC97-F8F8B9363301}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|Mixed Platforms = Debug|Mixed Platforms + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|Mixed Platforms = Release|Mixed Platforms + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {68A28E4A-3ADE-4187-9625-4FF185887CB3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {68A28E4A-3ADE-4187-9625-4FF185887CB3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {68A28E4A-3ADE-4187-9625-4FF185887CB3}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {68A28E4A-3ADE-4187-9625-4FF185887CB3}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {68A28E4A-3ADE-4187-9625-4FF185887CB3}.Debug|x86.ActiveCfg = Debug|Any CPU + {68A28E4A-3ADE-4187-9625-4FF185887CB3}.Debug|x86.Build.0 = Debug|Any CPU + {68A28E4A-3ADE-4187-9625-4FF185887CB3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {68A28E4A-3ADE-4187-9625-4FF185887CB3}.Release|Any CPU.Build.0 = Release|Any CPU + {68A28E4A-3ADE-4187-9625-4FF185887CB3}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {68A28E4A-3ADE-4187-9625-4FF185887CB3}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {68A28E4A-3ADE-4187-9625-4FF185887CB3}.Release|x86.ActiveCfg = Release|Any CPU + {68A28E4A-3ADE-4187-9625-4FF185887CB3}.Release|x86.Build.0 = Release|Any CPU + {2D187B88-94BD-4A39-AC97-F8F8B9363301}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2D187B88-94BD-4A39-AC97-F8F8B9363301}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2D187B88-94BD-4A39-AC97-F8F8B9363301}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {2D187B88-94BD-4A39-AC97-F8F8B9363301}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {2D187B88-94BD-4A39-AC97-F8F8B9363301}.Debug|x86.ActiveCfg = Debug|Any CPU + {2D187B88-94BD-4A39-AC97-F8F8B9363301}.Debug|x86.Build.0 = Debug|Any CPU + {2D187B88-94BD-4A39-AC97-F8F8B9363301}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2D187B88-94BD-4A39-AC97-F8F8B9363301}.Release|Any CPU.Build.0 = Release|Any CPU + {2D187B88-94BD-4A39-AC97-F8F8B9363301}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {2D187B88-94BD-4A39-AC97-F8F8B9363301}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {2D187B88-94BD-4A39-AC97-F8F8B9363301}.Release|x86.ActiveCfg = Release|Any CPU + {2D187B88-94BD-4A39-AC97-F8F8B9363301}.Release|x86.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {68A28E4A-3ADE-4187-9625-4FF185887CB3} = {A5A15F1C-885A-452A-A731-B0173DDBD913} + {2D187B88-94BD-4A39-AC97-F8F8B9363301} = {F31FF137-390C-49BF-A3BD-7C6ED3597C21} + EndGlobalSection +EndGlobal diff --git a/NuGet.config b/NuGet.config new file mode 100644 index 0000000000..03704957e8 --- /dev/null +++ b/NuGet.config @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/NuGetPackageVerifier.json b/NuGetPackageVerifier.json new file mode 100644 index 0000000000..c57b2afb17 --- /dev/null +++ b/NuGetPackageVerifier.json @@ -0,0 +1,25 @@ +{ + "adx": { // Packages written by the ADX team and that ship on NuGet.org + "rules": [ + "AssemblyHasDocumentFileRule", + "AssemblyHasVersionAttributesRule", + "AssemblyHasServicingAttributeRule", + "AssemblyHasNeutralResourcesLanguageAttributeRule", + "SatellitePackageRule", + "StrictSemanticVersionValidationRule" + ], + "packages": { + "Microsoft.AspNet.Html.Abstractions": { } + } + }, + "Default": { // Rules to run for packages not listed in any other set. + "rules": [ + "AssemblyHasDocumentFileRule", + "AssemblyHasVersionAttributesRule", + "AssemblyHasServicingAttributeRule", + "AssemblyHasNeutralResourcesLanguageAttributeRule", + "SatellitePackageRule", + "StrictSemanticVersionValidationRule" + ] + } +} \ No newline at end of file diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 0000000000..636a7618d3 --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,7 @@ +init: + - git config --global core.autocrlf true +build_script: + - build.cmd --quiet verify +clone_depth: 1 +test: off +deploy: off \ No newline at end of file diff --git a/build.cmd b/build.cmd new file mode 100644 index 0000000000..553e3929a0 --- /dev/null +++ b/build.cmd @@ -0,0 +1,40 @@ +@echo off +cd %~dp0 + +SETLOCAL +SET NUGET_VERSION=latest +SET CACHED_NUGET=%LocalAppData%\NuGet\nuget.%NUGET_VERSION%.exe +SET BUILDCMD_KOREBUILD_VERSION= +SET BUILDCMD_DNX_VERSION= + +IF EXIST %CACHED_NUGET% goto copynuget +echo Downloading latest version of NuGet.exe... +IF NOT EXIST %LocalAppData%\NuGet md %LocalAppData%\NuGet +@powershell -NoProfile -ExecutionPolicy unrestricted -Command "$ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest 'https://dist.nuget.org/win-x86-commandline/%NUGET_VERSION%/nuget.exe' -OutFile '%CACHED_NUGET%'" + +:copynuget +IF EXIST .nuget\nuget.exe goto restore +md .nuget +copy %CACHED_NUGET% .nuget\nuget.exe > nul + +:restore +IF EXIST packages\Sake goto getdnx +IF "%BUILDCMD_KOREBUILD_VERSION%"=="" ( + .nuget\nuget.exe install KoreBuild -ExcludeVersion -o packages -nocache -pre +) ELSE ( + .nuget\nuget.exe install KoreBuild -version %BUILDCMD_KOREBUILD_VERSION% -ExcludeVersion -o packages -nocache -pre +) +.nuget\NuGet.exe install Sake -ExcludeVersion -Source https://www.nuget.org/api/v2/ -Out packages + +:getdnx +IF "%BUILDCMD_DNX_VERSION%"=="" ( + SET BUILDCMD_DNX_VERSION=latest +) +IF "%SKIP_DNX_INSTALL%"=="" ( + CALL packages\KoreBuild\build\dnvm install %BUILDCMD_DNX_VERSION% -runtime CoreCLR -arch x86 -alias default + CALL packages\KoreBuild\build\dnvm install default -runtime CLR -arch x86 -alias default +) ELSE ( + CALL packages\KoreBuild\build\dnvm use default -runtime CLR -arch x86 +) + +packages\Sake\tools\Sake.exe -I packages\KoreBuild\build -f makefile.shade %* diff --git a/build.sh b/build.sh new file mode 100755 index 0000000000..da4e3fcd1c --- /dev/null +++ b/build.sh @@ -0,0 +1,43 @@ +#!/usr/bin/env bash + +if test `uname` = Darwin; then + cachedir=~/Library/Caches/KBuild +else + if [ -z $XDG_DATA_HOME ]; then + cachedir=$HOME/.local/share + else + cachedir=$XDG_DATA_HOME; + fi +fi +mkdir -p $cachedir +nugetVersion=latest +cachePath=$cachedir/nuget.$nugetVersion.exe + +url=https://dist.nuget.org/win-x86-commandline/$nugetVersion/nuget.exe + +if test ! -f $cachePath; then + wget -O $cachePath $url 2>/dev/null || curl -o $cachePath --location $url /dev/null +fi + +if test ! -e .nuget; then + mkdir .nuget + cp $cachePath .nuget/nuget.exe +fi + +if test ! -d packages/Sake; then + mono .nuget/nuget.exe install KoreBuild -ExcludeVersion -o packages -nocache -pre + mono .nuget/nuget.exe install Sake -ExcludeVersion -Source https://www.nuget.org/api/v2/ -Out packages +fi + +if ! type dnvm > /dev/null 2>&1; then + source packages/KoreBuild/build/dnvm.sh +fi + +if ! type dnx > /dev/null 2>&1 || [ -z "$SKIP_DNX_INSTALL" ]; then + dnvm install latest -runtime coreclr -alias default + dnvm install default -runtime mono -alias default +else + dnvm use default -runtime mono +fi + +mono packages/Sake/tools/Sake.exe -I packages/KoreBuild/build -f makefile.shade "$@" diff --git a/global.json b/global.json new file mode 100644 index 0000000000..983ba0401e --- /dev/null +++ b/global.json @@ -0,0 +1,3 @@ +{ + "projects": ["src"] +} diff --git a/makefile.shade b/makefile.shade new file mode 100644 index 0000000000..d5e473d558 --- /dev/null +++ b/makefile.shade @@ -0,0 +1,10 @@ + +var VERSION='0.1' +var FULL_VERSION='0.1' +var AUTHORS='Microsoft Open Technologies, Inc.' + +use-standard-lifecycle +k-standard-goals + +#xml-docs-test .clean .build-compile description='Check generated XML documentation files for errors' target='package' + k-xml-docs-test diff --git a/src/Microsoft.AspNet.Html/HtmlContentBuilder.cs b/src/Microsoft.AspNet.Html/HtmlContentBuilder.cs new file mode 100644 index 0000000000..34e59d3318 --- /dev/null +++ b/src/Microsoft.AspNet.Html/HtmlContentBuilder.cs @@ -0,0 +1,138 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text.Encodings.Web; + +namespace Microsoft.AspNet.Html +{ + /// + /// An implementation using an in memory list. + /// + public class HtmlContentBuilder : IHtmlContentBuilder + { + /// + /// Creates a new . + /// + public HtmlContentBuilder() + : this(new List()) + { + } + + /// + /// Creates a new with the given initial capacity. + /// + /// The initial capacity of the backing store. + public HtmlContentBuilder(int capacity) + : this(new List(capacity)) + { + } + + /// + /// Creates a new with the given list of entries. + /// + /// + /// The list of entries. The will use this list without making a copy. + /// + public HtmlContentBuilder(IList entries) + { + if (entries == null) + { + throw new ArgumentNullException(nameof(entries)); + } + + Entries = entries; + } + + // This is not List because that would lead to wrapping all strings to IHtmlContent + // which is not space performant. + // + // In general unencoded strings are added here. We're optimizing for that case, and allocating + // a wrapper when encoded strings are used. + // + // internal for testing. + internal IList Entries { get; } + + /// + public IHtmlContentBuilder Append(string unencoded) + { + if (!string.IsNullOrEmpty(unencoded)) + { + Entries.Add(unencoded); + } + + return this; + } + + /// + public IHtmlContentBuilder Append(IHtmlContent htmlContent) + { + if (htmlContent == null) + { + return this; + } + + Entries.Add(htmlContent); + return this; + } + + /// + public IHtmlContentBuilder AppendHtml(string encoded) + { + if (!string.IsNullOrEmpty(encoded)) + { + Entries.Add(new HtmlEncodedString(encoded)); + } + + return this; + } + + /// + public IHtmlContentBuilder Clear() + { + Entries.Clear(); + return this; + } + + /// + public void WriteTo(TextWriter writer, HtmlEncoder encoder) + { + if (writer == null) + { + throw new ArgumentNullException(nameof(writer)); + } + + if (encoder == null) + { + throw new ArgumentNullException(nameof(encoder)); + } + + for (var i = 0; i < Entries.Count; i++) + { + var entry = Entries[i]; + + var entryAsString = entry as string; + if (entryAsString != null) + { + encoder.Encode(writer, entryAsString); + } + else + { + // Only string, IHtmlContent values can be added to the buffer. + ((IHtmlContent)entry).WriteTo(writer, encoder); + } + } + } + + private string DebuggerToString() + { + using (var writer = new StringWriter()) + { + WriteTo(writer, HtmlEncoder.Default); + return writer.ToString(); + } + } + } +} diff --git a/src/Microsoft.AspNet.Html/HtmlContentBuilderExtensions.cs b/src/Microsoft.AspNet.Html/HtmlContentBuilderExtensions.cs new file mode 100644 index 0000000000..eabfafbd12 --- /dev/null +++ b/src/Microsoft.AspNet.Html/HtmlContentBuilderExtensions.cs @@ -0,0 +1,324 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System; +using System.Diagnostics; +using System.Globalization; +using System.IO; +using System.Text.Encodings.Web; + +namespace Microsoft.AspNet.Html +{ + /// + /// Extension methods for . + /// + public static class HtmlContentBuilderExtensions + { + /// + /// Appends the specified to the existing content after replacing each format + /// item with the HTML encoded representation of the corresponding item in the + /// array. + /// + /// The . + /// + /// The composite format (see http://msdn.microsoft.com/en-us/library/txafckwd.aspx). + /// The format string is assumed to be HTML encoded as-provided, and no further encoding will be performed. + /// + /// + /// The object array to format. Each element in the array will be formatted and then HTML encoded. + /// + /// A reference to this instance after the append operation has completed. + public static IHtmlContentBuilder AppendFormat( + this IHtmlContentBuilder builder, + string format, + params object[] args) + { + if (builder == null) + { + throw new ArgumentNullException(nameof(builder)); + } + + if (format == null) + { + throw new ArgumentNullException(nameof(format)); + } + + if (args == null) + { + throw new ArgumentNullException(nameof(args)); + } + + builder.Append(new HtmlFormatString(format, args)); + return builder; + } + + /// + /// Appends the specified to the existing content with information from the + /// after replacing each format item with the HTML encoded + /// representation of the corresponding item in the array. + /// + /// The . + /// An object that supplies culture-specific formatting information. + /// + /// The composite format (see http://msdn.microsoft.com/en-us/library/txafckwd.aspx). + /// The format string is assumed to be HTML encoded as-provided, and no further encoding will be performed. + /// + /// + /// The object array to format. Each element in the array will be formatted and then HTML encoded. + /// + /// A reference to this instance after the append operation has completed. + public static IHtmlContentBuilder AppendFormat( + this IHtmlContentBuilder builder, + IFormatProvider formatProvider, + string format, + params object[] args) + { + if (builder == null) + { + throw new ArgumentNullException(nameof(builder)); + } + + if (format == null) + { + throw new ArgumentNullException(nameof(format)); + } + + if (args == null) + { + throw new ArgumentNullException(nameof(args)); + } + + builder.Append(new HtmlFormatString(formatProvider, format, args)); + return builder; + } + + /// + /// Appends an . + /// + /// The . + /// The . + public static IHtmlContentBuilder AppendLine(this IHtmlContentBuilder builder) + { + builder.Append(HtmlEncodedString.NewLine); + return builder; + } + + /// + /// Appends an after appending the value. + /// The value is treated as unencoded as-provided, and will be HTML encoded before writing to output. + /// + /// The . + /// The to append. + /// The . + public static IHtmlContentBuilder AppendLine(this IHtmlContentBuilder builder, string unencoded) + { + builder.Append(unencoded); + builder.Append(HtmlEncodedString.NewLine); + return builder; + } + + /// + /// Appends an after appending the value. + /// + /// The . + /// The to append. + /// The . + public static IHtmlContentBuilder AppendLine(this IHtmlContentBuilder builder, IHtmlContent content) + { + builder.Append(content); + builder.Append(HtmlEncodedString.NewLine); + return builder; + } + + /// + /// Appends an after appending the value. + /// The value is treated as HTML encoded as-provided, and no further encoding will be performed. + /// + /// The . + /// The HTML encoded to append. + /// The . + public static IHtmlContentBuilder AppendHtmlLine(this IHtmlContentBuilder builder, string encoded) + { + builder.AppendHtml(encoded); + builder.Append(HtmlEncodedString.NewLine); + return builder; + } + + /// + /// Sets the content to the value. The value is treated as unencoded as-provided, + /// and will be HTML encoded before writing to output. + /// + /// The . + /// The value that replaces the content. + /// The . + public static IHtmlContentBuilder SetContent(this IHtmlContentBuilder builder, string unencoded) + { + builder.Clear(); + builder.Append(unencoded); + return builder; + } + + /// + /// Sets the content to the value. + /// + /// The . + /// The value that replaces the content. + /// The . + public static IHtmlContentBuilder SetContent(this IHtmlContentBuilder builder, IHtmlContent content) + { + builder.Clear(); + builder.Append(content); + return builder; + } + + /// + /// Sets the content to the value. The value is treated as HTML encoded as-provided, and + /// no further encoding will be performed. + /// + /// The . + /// The HTML encoded that replaces the content. + /// The . + public static IHtmlContentBuilder SetHtmlContent(this IHtmlContentBuilder builder, string encoded) + { + builder.Clear(); + builder.AppendHtml(encoded); + return builder; + } + + [DebuggerDisplay("{DebuggerToString()}")] + private class HtmlFormatString : IHtmlContent + { + private readonly IFormatProvider _formatProvider; + private readonly string _format; + private readonly object[] _args; + + public HtmlFormatString(string format, object[] args) + : this(null, format, args) + { + } + + public HtmlFormatString(IFormatProvider formatProvider, string format, object[] args) + { + Debug.Assert(format != null); + Debug.Assert(args != null); + + _formatProvider = formatProvider ?? CultureInfo.CurrentCulture; + _format = format; + _args = args; + } + + public void WriteTo(TextWriter writer, HtmlEncoder encoder) + { + if (writer == null) + { + throw new ArgumentNullException(nameof(writer)); + } + + if (encoder == null) + { + throw new ArgumentNullException(nameof(encoder)); + } + + var formatProvider = new EncodingFormatProvider(_formatProvider, encoder); + writer.Write(string.Format(formatProvider, _format, _args)); + } + + private string DebuggerToString() + { + using (var writer = new StringWriter()) + { + WriteTo(writer, HtmlEncoder.Default); + return writer.ToString(); + } + } + } + + // This class implements Html encoding via an ICustomFormatter. Passing an instance of this + // class into a string.Format method or anything similar will evaluate arguments implementing + // IHtmlContent without HTML encoding them, and will give other arguments the standard + // composite format string treatment, and then HTML encode the result. + // + // Plenty of examples of ICustomFormatter and the interactions with string.Format here: + // https://msdn.microsoft.com/en-us/library/system.string.format(v=vs.110).aspx#Format6_Example + private class EncodingFormatProvider : IFormatProvider, ICustomFormatter + { + private readonly HtmlEncoder _encoder; + private readonly IFormatProvider _formatProvider; + + public EncodingFormatProvider(IFormatProvider formatProvider, HtmlEncoder encoder) + { + Debug.Assert(formatProvider != null); + Debug.Assert(encoder != null); + + _formatProvider = formatProvider; + _encoder = encoder; + } + + public string Format(string format, object arg, IFormatProvider formatProvider) + { + // This is the case we need to special case. We trust the IHtmlContent instance to do the + // right thing with encoding. + var htmlContent = arg as IHtmlContent; + if (htmlContent != null) + { + using (var writer = new StringWriter()) + { + htmlContent.WriteTo(writer, _encoder); + return writer.ToString(); + } + } + + // If we get here then 'arg' is not an IHtmlContent, and we want to handle it the way a normal + // string.Format would work, but then HTML encode the result. + // + // First check for an ICustomFormatter - if the IFormatProvider is a CultureInfo, then it's likely + // that ICustomFormatter will be null. + var customFormatter = (ICustomFormatter)_formatProvider.GetFormat(typeof(ICustomFormatter)); + if (customFormatter != null) + { + var result = customFormatter.Format(format, arg, _formatProvider); + if (result != null) + { + return _encoder.Encode(result); + } + } + + // Next check if 'arg' is an IFormattable (DateTime is an example). + // + // An IFormattable will likely call back into the IFormatterProvider and ask for more information + // about how to format itself. This is the typical case when IFormatterProvider is a CultureInfo. + var formattable = arg as IFormattable; + if (formattable != null) + { + var result = formattable.ToString(format, _formatProvider); + if (result != null) + { + return _encoder.Encode(result); + } + } + + // If we get here then there's nothing really smart left to try. + if (arg != null) + { + var result = arg.ToString(); + if (result != null) + { + return _encoder.Encode(result); + } + } + + return string.Empty; + } + + public object GetFormat(Type formatType) + { + if (formatType == typeof(ICustomFormatter)) + { + return this; + } + + return null; + } + } + } +} diff --git a/src/Microsoft.AspNet.Html/HtmlEncodedString.cs b/src/Microsoft.AspNet.Html/HtmlEncodedString.cs new file mode 100644 index 0000000000..348588800f --- /dev/null +++ b/src/Microsoft.AspNet.Html/HtmlEncodedString.cs @@ -0,0 +1,49 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System; +using System.Diagnostics; +using System.IO; +using System.Text.Encodings.Web; + +namespace Microsoft.AspNet.Html +{ + /// + /// An impelementation that wraps an HTML encoded . + /// + [DebuggerDisplay("{DebuggerToString()}")] + public class HtmlEncodedString : IHtmlContent + { + /// + /// An instance for . + /// + public static readonly IHtmlContent NewLine = new HtmlEncodedString(Environment.NewLine); + + private readonly string _value; + + /// + /// Creates a new . + /// + /// The HTML encoded value. + public HtmlEncodedString(string value) + { + if (value == null) + { + throw new ArgumentNullException(nameof(value)); + } + + _value = value; + } + + /// + public void WriteTo(TextWriter writer, HtmlEncoder encoder) + { + writer.Write(_value); + } + + private string DebuggerToString() + { + return _value; + } + } +} diff --git a/src/Microsoft.AspNet.Html/HtmlTextWriter.cs b/src/Microsoft.AspNet.Html/HtmlTextWriter.cs new file mode 100644 index 0000000000..56633f527d --- /dev/null +++ b/src/Microsoft.AspNet.Html/HtmlTextWriter.cs @@ -0,0 +1,49 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System.IO; + +namespace Microsoft.AspNet.Html +{ + /// + /// A which supports special processing of . + /// + public abstract class HtmlTextWriter : TextWriter + { + /// + /// Writes an value. + /// + /// The value. + public abstract void Write(IHtmlContent value); + + /// + public override void Write(object value) + { + var htmlContent = value as IHtmlContent; + if (htmlContent == null) + { + base.Write(value); + } + else + { + Write(htmlContent); + } + } + + /// + public override void WriteLine(object value) + { + var htmlContent = value as IHtmlContent; + if (htmlContent == null) + { + base.Write(value); + } + else + { + Write(htmlContent); + } + + base.WriteLine(); + } + } +} diff --git a/src/Microsoft.AspNet.Html/IHtmlContent.cs b/src/Microsoft.AspNet.Html/IHtmlContent.cs new file mode 100644 index 0000000000..0e21889d54 --- /dev/null +++ b/src/Microsoft.AspNet.Html/IHtmlContent.cs @@ -0,0 +1,22 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System.IO; +using System.Text.Encodings.Web; + +namespace Microsoft.AspNet.Html +{ + /// + /// HTML content which can be written to a TextWriter. + /// + public interface IHtmlContent + { + /// + /// Writes the content by encoding it with the specified + /// to the specified . + /// + /// The to which the content is written. + /// The which encodes the content to be written. + void WriteTo(TextWriter writer, HtmlEncoder encoder); + } +} \ No newline at end of file diff --git a/src/Microsoft.AspNet.Html/IHtmlContentBuilder.cs b/src/Microsoft.AspNet.Html/IHtmlContentBuilder.cs new file mode 100644 index 0000000000..de4b9ebd90 --- /dev/null +++ b/src/Microsoft.AspNet.Html/IHtmlContentBuilder.cs @@ -0,0 +1,40 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +namespace Microsoft.AspNet.Html +{ + /// + /// A builder for HTML content. + /// + public interface IHtmlContentBuilder : IHtmlContent + { + /// + /// Appends an instance. + /// + /// The to append. + /// The . + IHtmlContentBuilder Append(IHtmlContent content); + + /// + /// Appends a value. The value is treated as unencoded as-provided, and will be HTML + /// encoded before writing to output. + /// + /// The to append. + /// The . + IHtmlContentBuilder Append(string unencoded); + + /// + /// Appends an HTML encoded value. The value is treated as HTML encoded as-provided, and + /// no further encoding will be performed. + /// + /// The HTML encoded to append. + /// The . + IHtmlContentBuilder AppendHtml(string encoded); + + /// + /// Clears the content. + /// + /// The . + IHtmlContentBuilder Clear(); + } +} diff --git a/src/Microsoft.AspNet.Html/Microsoft.AspNet.Html.xproj b/src/Microsoft.AspNet.Html/Microsoft.AspNet.Html.xproj new file mode 100644 index 0000000000..564c800504 --- /dev/null +++ b/src/Microsoft.AspNet.Html/Microsoft.AspNet.Html.xproj @@ -0,0 +1,19 @@ + + + + 14.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + + 68a28e4a-3ade-4187-9625-4ff185887cb3 + Microsoft.AspNet.Html.Abstractions + ..\..\artifacts\obj\$(MSBuildProjectName) + ..\..\artifacts\bin\$(MSBuildProjectName)\ + + + + 2.0 + + + \ No newline at end of file diff --git a/src/Microsoft.AspNet.Html/Properties/AssemblyInfo.cs b/src/Microsoft.AspNet.Html/Properties/AssemblyInfo.cs new file mode 100644 index 0000000000..1951d644af --- /dev/null +++ b/src/Microsoft.AspNet.Html/Properties/AssemblyInfo.cs @@ -0,0 +1,10 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System.Reflection; +using System.Resources; +using System.Runtime.CompilerServices; + +[assembly: AssemblyMetadata("Serviceable", "True")] +[assembly: NeutralResourcesLanguage("en-us")] +[assembly: InternalsVisibleTo("Microsoft.AspNet.Html.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] \ No newline at end of file diff --git a/src/Microsoft.AspNet.Html/project.json b/src/Microsoft.AspNet.Html/project.json new file mode 100644 index 0000000000..55cc30d9b1 --- /dev/null +++ b/src/Microsoft.AspNet.Html/project.json @@ -0,0 +1,29 @@ +{ + "version": "1.0.0-*", + "description": "ASP.NET 5 HTML content interface.", + "repository": { + "type": "git", + "url": "git://github.com/aspnet/htmlabstractions" + }, + "compilationOptions": { + "warningsAsErrors": true, + "keyFile": "../../tools/Key.snk" + }, + "dependencies": { + "System.Text.Encodings.Web": "4.0.0-*" + }, + "frameworks": { + "net451": { + "frameworkAssemblies": { + "System.IO": "", + "System.Runtime": "" + } + }, + "dotnet5.4": { + "dependencies": { + "System.Collections": "4.0.11-*", + "System.Resources.ResourceManager": "4.0.1-*" + } + } + } +} diff --git a/test/Microsoft.AspNet.Html.Test/HtmlContentBuilderExtensionsTest.cs b/test/Microsoft.AspNet.Html.Test/HtmlContentBuilderExtensionsTest.cs new file mode 100644 index 0000000000..6253bf9be3 --- /dev/null +++ b/test/Microsoft.AspNet.Html.Test/HtmlContentBuilderExtensionsTest.cs @@ -0,0 +1,436 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.IO; +using System.Text.Encodings.Web; +using Microsoft.AspNet.Testing; +using Microsoft.Extensions.WebEncoders.Testing; +using Xunit; + +namespace Microsoft.AspNet.Html.Test +{ + public class HtmlContentBuilderExtensionsTest + { + [Fact] + public void Builder_AppendLine_Empty() + { + // Arrange + var builder = new TestHtmlContentBuilder(); + + // Act + builder.AppendLine(); + + // Assert + Assert.Collection( + builder.Entries, + entry => Assert.Equal(Environment.NewLine, HtmlContentToString(entry))); + } + + [Fact] + public void Builder_AppendLine_String() + { + // Arrange + var builder = new TestHtmlContentBuilder(); + + // Act + builder.AppendLine("Hi"); + + // Assert + Assert.Collection( + builder.Entries, + entry => Assert.Equal("Hi", Assert.IsType(entry).Value), + entry => Assert.Equal(Environment.NewLine, HtmlContentToString(entry))); + } + + [Fact] + public void Builder_AppendLine_IHtmlContent() + { + // Arrange + var builder = new TestHtmlContentBuilder(); + var content = new OtherHtmlContent("Hi"); + + // Act + builder.AppendLine(content); + + // Assert + Assert.Collection( + builder.Entries, + entry => Assert.Same(content, entry), + entry => Assert.Equal(Environment.NewLine, HtmlContentToString(entry))); + } + + [Fact] + public void Builder_AppendHtmlLine_String() + { + // Arrange + var builder = new TestHtmlContentBuilder(); + + // Act + builder.AppendHtmlLine("Hi"); + + // Assert + Assert.Collection( + builder.Entries, + entry => Assert.Equal("Hi", Assert.IsType(entry).Value), + entry => Assert.Equal(Environment.NewLine, HtmlContentToString(entry))); + } + + [Fact] + public void Builder_SetContent_String() + { + // Arrange + var builder = new TestHtmlContentBuilder(); + builder.Append("Existing Content. Will be Cleared."); + + // Act + builder.SetContent("Hi"); + + // Assert + Assert.Collection( + builder.Entries, + entry => Assert.Equal("Hi", Assert.IsType(entry).Value)); + } + + [Fact] + public void Builder_SetContent_IHtmlContent() + { + // Arrange + var builder = new TestHtmlContentBuilder(); + builder.Append("Existing Content. Will be Cleared."); + + var content = new OtherHtmlContent("Hi"); + + // Act + builder.SetContent(content); + + // Assert + Assert.Collection( + builder.Entries, + entry => Assert.Same(content, entry)); + } + + [Fact] + public void Builder_SetHtmlContent_String() + { + // Arrange + var builder = new TestHtmlContentBuilder(); + builder.Append("Existing Content. Will be Cleared."); + + // Act + builder.SetHtmlContent("Hi"); + + // Assert + Assert.Collection( + builder.Entries, + entry => Assert.Equal("Hi", Assert.IsType(entry).Value)); + } + + [Fact] + public void Builder_AppendFormat() + { + // Arrange + var builder = new TestHtmlContentBuilder(); + + // Act + builder.AppendFormat("{0} {1} {2} {3}!", "First", "Second", "Third", "Fourth"); + + // Assert + Assert.Equal( + "HtmlEncode[[First]] HtmlEncode[[Second]] HtmlEncode[[Third]] HtmlEncode[[Fourth]]!", + HtmlContentToString(builder)); + } + + [Fact] + public void Builder_AppendFormat_HtmlContent() + { + // Arrange + var builder = new TestHtmlContentBuilder(); + + // Act + builder.AppendFormat("{0}!", new EncodedString("First")); + + // Assert + Assert.Equal( + "First!", + HtmlContentToString(builder)); + } + + [Fact] + public void Builder_AppendFormatContent_With1Argument() + { + // Arrange + var builder = new TestHtmlContentBuilder(); + + // Act + builder.AppendFormat("0x{0:X} - hex equivalent for 50.", 50); + + // Assert + Assert.Equal( + "0xHtmlEncode[[32]] - hex equivalent for 50.", + HtmlContentToString(builder)); + } + + [Fact] + public void Builder_AppendFormatContent_With2Arguments() + { + // Arrange + var builder = new TestHtmlContentBuilder(); + + // Act + builder.AppendFormat("0x{0:X} - hex equivalent for {1}.", 50, 50); + + // Assert + Assert.Equal( + "0xHtmlEncode[[32]] - hex equivalent for HtmlEncode[[50]].", + HtmlContentToString(builder)); + } + + [Fact] + public void Builder_AppendFormatContent_With3Arguments() + { + // Arrange + var builder = new TestHtmlContentBuilder(); + + // Act + builder.AppendFormat("0x{0:X} - {1} equivalent for {2}.", 50, "hex", 50); + + // Assert + Assert.Equal( + "0xHtmlEncode[[32]] - HtmlEncode[[hex]] equivalent for HtmlEncode[[50]].", + HtmlContentToString(builder)); + } + + [Fact] + public void Builder_AppendFormat_WithAlignmentComponent() + { + // Arrange + var builder = new TestHtmlContentBuilder(); + + // Act + builder.AppendFormat("{0, -25} World!", "Hello"); + + // Assert + Assert.Equal( + "HtmlEncode[[Hello]] World!", + HtmlContentToString(builder)); + } + + [Fact] + public void Builder_AppendFormat_WithFormatStringComponent() + { + // Arrange + var builder = new TestHtmlContentBuilder(); + + // Act + builder.AppendFormat("0x{0:X}", 50); + + // Assert + Assert.Equal("0xHtmlEncode[[32]]", HtmlContentToString(builder)); + } + + [Fact] + public void Builder_AppendFormat_WithCulture() + { + // Arrange + var builder = new TestHtmlContentBuilder(); + + // Act + builder.AppendFormat( + CultureInfo.InvariantCulture, + "Numbers in InvariantCulture - {0, -5:N} {1} {2} {3}!", + 1.1, + 2.98, + 145.82, + 32.86); + + // Assert + Assert.Equal( + "Numbers in InvariantCulture - HtmlEncode[[1.10]] HtmlEncode[[2.98]] " + + "HtmlEncode[[145.82]] HtmlEncode[[32.86]]!", + HtmlContentToString(builder)); + } + + [Fact] + public void Builder_AppendFormat_WithCulture_1Argument() + { + // Arrange + var builder = new TestHtmlContentBuilder(); + + // Act + builder.AppendFormat( + CultureInfo.InvariantCulture, + "Numbers in InvariantCulture - {0:N}!", + 1.1); + + // Assert + Assert.Equal( + "Numbers in InvariantCulture - HtmlEncode[[1.10]]!", + HtmlContentToString(builder)); + } + + [Fact] + public void Builder_AppendFormat_WithCulture_2Arguments() + { + // Arrange + var builder = new TestHtmlContentBuilder(); + + // Act + builder.AppendFormat( + CultureInfo.InvariantCulture, + "Numbers in InvariantCulture - {0:N} {1}!", + 1.1, + 2.98); + + // Assert + Assert.Equal( + "Numbers in InvariantCulture - HtmlEncode[[1.10]] HtmlEncode[[2.98]]!", + HtmlContentToString(builder)); + } + + [Fact] + public void Builder_AppendFormat_WithCulture_3Arguments() + { + // Arrange + var builder = new TestHtmlContentBuilder(); + + // Act + builder.AppendFormat( + CultureInfo.InvariantCulture, + "Numbers in InvariantCulture - {0:N} {1} {2}!", + 1.1, + 2.98, + 3.12); + + // Assert + Assert.Equal( + "Numbers in InvariantCulture - HtmlEncode[[1.10]] HtmlEncode[[2.98]] HtmlEncode[[3.12]]!", + HtmlContentToString(builder)); + } + + [Fact] + public void Builder_AppendFormat_WithDifferentCulture() + { + // Arrange + var builder = new TestHtmlContentBuilder(); + var culture = new CultureInfo("fr-FR"); + + // Act + builder.AppendFormat(culture, "{0} in french!", 1.21); + + // Assert + Assert.Equal( + "HtmlEncode[[1,21]] in french!", + HtmlContentToString(builder)); + } + + [Fact] + [ReplaceCulture("de-DE", "de-DE")] + public void Builder_AppendFormat_WithDifferentCurrentCulture() + { + // Arrange + var builder = new TestHtmlContentBuilder(); + + // Act + builder.AppendFormat(CultureInfo.CurrentCulture, "{0:D}", DateTime.Parse("01/02/2015")); + + // Assert + Assert.Equal( + "HtmlEncode[[Sonntag, 1. Februar 2015]]", + HtmlContentToString(builder)); + } + + private static string HtmlContentToString(IHtmlContent content) + { + using (var writer = new StringWriter()) + { + content.WriteTo(writer, new HtmlTestEncoder()); + return writer.ToString(); + } + } + + private class TestHtmlContentBuilder : IHtmlContentBuilder + { + public List Entries { get; } = new List(); + + public IHtmlContentBuilder Append(string unencoded) + { + Entries.Add(new UnencodedString(unencoded)); + return this; + } + + public IHtmlContentBuilder Append(IHtmlContent content) + { + Entries.Add(content); + return this; + } + + public IHtmlContentBuilder AppendHtml(string encoded) + { + Entries.Add(new EncodedString(encoded)); + return this; + } + + public IHtmlContentBuilder Clear() + { + Entries.Clear(); + return this; + } + + public void WriteTo(TextWriter writer, HtmlEncoder encoder) + { + foreach (var entry in Entries) + { + entry.WriteTo(writer, encoder); + } + } + } + + private class EncodedString : IHtmlContent + { + public EncodedString(string value) + { + Value = value; + } + + public string Value { get; } + + public void WriteTo(TextWriter writer, HtmlEncoder encoder) + { + writer.Write(Value); + } + } + + private class UnencodedString : IHtmlContent + { + public UnencodedString(string value) + { + Value = value; + } + + public string Value { get; } + + public void WriteTo(TextWriter writer, HtmlEncoder encoder) + { + encoder.Encode(writer, Value); + } + } + + private class OtherHtmlContent : IHtmlContent + { + public OtherHtmlContent(string value) + { + Value = value; + } + + public string Value { get; } + + public void WriteTo(TextWriter writer, HtmlEncoder encoder) + { + throw new NotImplementedException(); + } + } + } +} diff --git a/test/Microsoft.AspNet.Html.Test/HtmlContentBuilderTest.cs b/test/Microsoft.AspNet.Html.Test/HtmlContentBuilderTest.cs new file mode 100644 index 0000000000..4eee28e219 --- /dev/null +++ b/test/Microsoft.AspNet.Html.Test/HtmlContentBuilderTest.cs @@ -0,0 +1,145 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System.IO; +using System.Text.Encodings.Web; +using Microsoft.AspNet.Html; +using Microsoft.Extensions.WebEncoders.Testing; +using Xunit; + +namespace Microsoft.Extensions.Internal +{ + public class HtmlContentBuilderTest + { + [Fact] + public void AppendString_AppendsAString() + { + // Arrange + var content = new HtmlContentBuilder(); + + // Act + content.Append("Hello"); + + // Assert + var result = Assert.Single(content.Entries); + Assert.IsType(result); + } + + [Fact] + public void AppendString_WrittenAsEncoded() + { + // Arrange + var content = new HtmlContentBuilder(); + content.Append("Hello"); + + var writer = new StringWriter(); + + // Act + content.WriteTo(writer, new HtmlTestEncoder()); + + // Assert + Assert.Equal("HtmlEncode[[Hello]]", writer.ToString()); + } + + [Fact] + public void AppendHtml_DoesNotGetWrittenAsEncoded() + { + // Arrange + var content = new HtmlContentBuilder(); + content.AppendHtml("Hello"); + + var writer = new StringWriter(); + + // Act + content.WriteTo(writer, new HtmlTestEncoder()); + + // Assert + Assert.Equal("Hello", writer.ToString()); + } + + [Fact] + public void AppendIHtmlContent_AppendsAsIs() + { + // Arrange + var content = new HtmlContentBuilder(); + var writer = new StringWriter(); + + // Act + content.Append(new TestHtmlContent("Hello")); + + // Assert + var result = Assert.Single(content.Entries); + var testHtmlContent = Assert.IsType(result); + testHtmlContent.WriteTo(writer, new HtmlTestEncoder()); + Assert.Equal("Written from TestHtmlContent: Hello", writer.ToString()); + } + + [Fact] + public void CanAppendMultipleItems() + { + // Arrange + var content = new HtmlContentBuilder(); + + // Act + content.Append(new TestHtmlContent("hello")); + content.Append("Test"); + + // Assert + Assert.Equal(2, content.Entries.Count); + Assert.Equal("Written from TestHtmlContent: hello", content.Entries[0].ToString()); + Assert.Equal("Test", content.Entries[1]); + } + + [Fact] + public void Clear_DeletesAllItems() + { + // Arrange + var content = new HtmlContentBuilder(); + content.Append(new TestHtmlContent("hello")); + content.Append("Test"); + + // Act + content.Clear(); + + // Assert + Assert.Equal(0, content.Entries.Count); + } + + [Fact] + public void WriteTo_WritesAllItems() + { + // Arrange + var content = new HtmlContentBuilder(); + var writer = new StringWriter(); + content.Append(new TestHtmlContent("Hello")); + content.Append("Test"); + + // Act + content.WriteTo(writer, new HtmlTestEncoder()); + + // Assert + Assert.Equal(2, content.Entries.Count); + Assert.Equal("Written from TestHtmlContent: HelloHtmlEncode[[Test]]", writer.ToString()); + } + + private class TestHtmlContent : IHtmlContent + { + private string _content; + + public TestHtmlContent(string content) + { + _content = content; + } + + public void WriteTo(TextWriter writer, HtmlEncoder encoder) + { + writer.Write(ToString()); + } + + public override string ToString() + { + return "Written from TestHtmlContent: " + _content; + } + } + } +} diff --git a/test/Microsoft.AspNet.Html.Test/Microsoft.AspNet.Html.Test.xproj b/test/Microsoft.AspNet.Html.Test/Microsoft.AspNet.Html.Test.xproj new file mode 100644 index 0000000000..4a03567677 --- /dev/null +++ b/test/Microsoft.AspNet.Html.Test/Microsoft.AspNet.Html.Test.xproj @@ -0,0 +1,21 @@ + + + + 14.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + + 2d187b88-94bd-4a39-ac97-f8f8b9363301 + Microsoft.AspNet.Html.Abstractions.Test + ..\..\artifacts\obj\$(MSBuildProjectName) + ..\..\artifacts\bin\$(MSBuildProjectName)\ + + + 2.0 + + + + + + \ No newline at end of file diff --git a/test/Microsoft.AspNet.Html.Test/project.json b/test/Microsoft.AspNet.Html.Test/project.json new file mode 100644 index 0000000000..f5ea4ca7e6 --- /dev/null +++ b/test/Microsoft.AspNet.Html.Test/project.json @@ -0,0 +1,19 @@ +{ + "compilationOptions": { + "warningsAsErrors": true, + "keyFile": "../../tools/Key.snk" + }, + "dependencies": { + "Microsoft.AspNet.Html": "1.0.0-*", + "Microsoft.AspNet.Testing": "1.0.0-*", + "Microsoft.Extensions.WebEncoders": "1.0.0-*", + "xunit.runner.aspnet": "2.0.0-aspnet-*" + }, + "commands": { + "test": "xunit.runner.aspnet" + }, + "frameworks": { + "dnx451": { }, + "dnxcore50": { } + } +} diff --git a/tools/Key.snk b/tools/Key.snk new file mode 100644 index 0000000000000000000000000000000000000000..e10e4889c125d3120cd9e81582243d70f7cbb806 GIT binary patch literal 596 zcmV-a0;~N80ssI2Bme+XQ$aES1ONa50098=Iw=HCsnz~#iVhm& zj%TU(_THUee?3yHBjk$37ysB?i5#7WD$={H zV4B!OxRPrb|8)HPg~A}8P>^=#y<)56#=E&NzcjOtPK~<4n6GHt=K$ro*T(lhby_@U zEk(hLzk1H)0yXj{A_5>fk-TgNoP|q6(tP2xo8zt8i%212CWM#AeCd?`hS|4~L({h~Moo(~vy&3Z z1uI}`fd^*>o=rwbAGymj6RM^pZm(*Kfhs+Y1#`-2JPWZMK8@;ZWCk2+9bX4YP);~fj-BU*R zQPvWv$89!{Rl9wM+zR>_TSkn^voYxA?2G iKnV#iZ6Ah`K>b=@=IjYJXrxL124zR(38)nxe+&q_$QXwJ literal 0 HcmV?d00001 From 1b0e2e50e1860ab663233c607662bdcb8a0c28f6 Mon Sep 17 00:00:00 2001 From: Doug Bunting Date: Wed, 2 Dec 2015 09:15:16 -0800 Subject: [PATCH 005/169] Restore previous package name: `Microsoft.AspNet.Html.Abstractions` nit: add a couple of solution items --- HtmlAbstractions.sln | 12 +++++++++--- .../HtmlContentBuilder.cs | 0 .../HtmlContentBuilderExtensions.cs | 0 .../HtmlEncodedString.cs | 0 .../HtmlTextWriter.cs | 0 .../IHtmlContent.cs | 0 .../IHtmlContentBuilder.cs | 0 .../Microsoft.AspNet.Html.Abstractions.xproj} | 0 .../Properties/AssemblyInfo.cs | 10 ++++++++++ .../project.json | 0 src/Microsoft.AspNet.Html/Properties/AssemblyInfo.cs | 10 ---------- .../HtmlContentBuilderExtensionsTest.cs | 0 .../HtmlContentBuilderTest.cs | 0 .../Microsoft.AspNet.Html.Abstractions.Test.xproj} | 0 .../project.json | 2 +- 15 files changed, 20 insertions(+), 14 deletions(-) rename src/{Microsoft.AspNet.Html => Microsoft.AspNet.Html.Abstractions}/HtmlContentBuilder.cs (100%) rename src/{Microsoft.AspNet.Html => Microsoft.AspNet.Html.Abstractions}/HtmlContentBuilderExtensions.cs (100%) rename src/{Microsoft.AspNet.Html => Microsoft.AspNet.Html.Abstractions}/HtmlEncodedString.cs (100%) rename src/{Microsoft.AspNet.Html => Microsoft.AspNet.Html.Abstractions}/HtmlTextWriter.cs (100%) rename src/{Microsoft.AspNet.Html => Microsoft.AspNet.Html.Abstractions}/IHtmlContent.cs (100%) rename src/{Microsoft.AspNet.Html => Microsoft.AspNet.Html.Abstractions}/IHtmlContentBuilder.cs (100%) rename src/{Microsoft.AspNet.Html/Microsoft.AspNet.Html.xproj => Microsoft.AspNet.Html.Abstractions/Microsoft.AspNet.Html.Abstractions.xproj} (100%) create mode 100644 src/Microsoft.AspNet.Html.Abstractions/Properties/AssemblyInfo.cs rename src/{Microsoft.AspNet.Html => Microsoft.AspNet.Html.Abstractions}/project.json (100%) delete mode 100644 src/Microsoft.AspNet.Html/Properties/AssemblyInfo.cs rename test/{Microsoft.AspNet.Html.Test => Microsoft.AspNet.Html.Abstractions.Test}/HtmlContentBuilderExtensionsTest.cs (100%) rename test/{Microsoft.AspNet.Html.Test => Microsoft.AspNet.Html.Abstractions.Test}/HtmlContentBuilderTest.cs (100%) rename test/{Microsoft.AspNet.Html.Test/Microsoft.AspNet.Html.Test.xproj => Microsoft.AspNet.Html.Abstractions.Test/Microsoft.AspNet.Html.Abstractions.Test.xproj} (100%) rename test/{Microsoft.AspNet.Html.Test => Microsoft.AspNet.Html.Abstractions.Test}/project.json (87%) diff --git a/HtmlAbstractions.sln b/HtmlAbstractions.sln index 1d1f5118f3..805c4daa7a 100644 --- a/HtmlAbstractions.sln +++ b/HtmlAbstractions.sln @@ -1,14 +1,20 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 14 -VisualStudioVersion = 14.0.24711.0 +VisualStudioVersion = 14.0.24720.0 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{A5A15F1C-885A-452A-A731-B0173DDBD913}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{F31FF137-390C-49BF-A3BD-7C6ED3597C21}" EndProject -Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNet.Html", "src\Microsoft.AspNet.Html.Abstractions\Microsoft.AspNet.Html.xproj", "{68A28E4A-3ADE-4187-9625-4FF185887CB3}" +Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNet.Html.Abstractions", "src\Microsoft.AspNet.Html.Abstractions\Microsoft.AspNet.Html.Abstractions.xproj", "{68A28E4A-3ADE-4187-9625-4FF185887CB3}" EndProject -Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNet.Html.Test", "test\Microsoft.AspNet.Html.Abstractions.Test\Microsoft.AspNet.Html.Test.xproj", "{2D187B88-94BD-4A39-AC97-F8F8B9363301}" +Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNet.Html.Abstractions.Test", "test\Microsoft.AspNet.Html.Abstractions.Test\Microsoft.AspNet.Html.Abstractions.Test.xproj", "{2D187B88-94BD-4A39-AC97-F8F8B9363301}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{B4962A29-BE69-4A18-9B4F-B803EEE31EAA}" + ProjectSection(SolutionItems) = preProject + global.json = global.json + NuGetPackageVerifier.json = NuGetPackageVerifier.json + EndProjectSection EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/src/Microsoft.AspNet.Html/HtmlContentBuilder.cs b/src/Microsoft.AspNet.Html.Abstractions/HtmlContentBuilder.cs similarity index 100% rename from src/Microsoft.AspNet.Html/HtmlContentBuilder.cs rename to src/Microsoft.AspNet.Html.Abstractions/HtmlContentBuilder.cs diff --git a/src/Microsoft.AspNet.Html/HtmlContentBuilderExtensions.cs b/src/Microsoft.AspNet.Html.Abstractions/HtmlContentBuilderExtensions.cs similarity index 100% rename from src/Microsoft.AspNet.Html/HtmlContentBuilderExtensions.cs rename to src/Microsoft.AspNet.Html.Abstractions/HtmlContentBuilderExtensions.cs diff --git a/src/Microsoft.AspNet.Html/HtmlEncodedString.cs b/src/Microsoft.AspNet.Html.Abstractions/HtmlEncodedString.cs similarity index 100% rename from src/Microsoft.AspNet.Html/HtmlEncodedString.cs rename to src/Microsoft.AspNet.Html.Abstractions/HtmlEncodedString.cs diff --git a/src/Microsoft.AspNet.Html/HtmlTextWriter.cs b/src/Microsoft.AspNet.Html.Abstractions/HtmlTextWriter.cs similarity index 100% rename from src/Microsoft.AspNet.Html/HtmlTextWriter.cs rename to src/Microsoft.AspNet.Html.Abstractions/HtmlTextWriter.cs diff --git a/src/Microsoft.AspNet.Html/IHtmlContent.cs b/src/Microsoft.AspNet.Html.Abstractions/IHtmlContent.cs similarity index 100% rename from src/Microsoft.AspNet.Html/IHtmlContent.cs rename to src/Microsoft.AspNet.Html.Abstractions/IHtmlContent.cs diff --git a/src/Microsoft.AspNet.Html/IHtmlContentBuilder.cs b/src/Microsoft.AspNet.Html.Abstractions/IHtmlContentBuilder.cs similarity index 100% rename from src/Microsoft.AspNet.Html/IHtmlContentBuilder.cs rename to src/Microsoft.AspNet.Html.Abstractions/IHtmlContentBuilder.cs diff --git a/src/Microsoft.AspNet.Html/Microsoft.AspNet.Html.xproj b/src/Microsoft.AspNet.Html.Abstractions/Microsoft.AspNet.Html.Abstractions.xproj similarity index 100% rename from src/Microsoft.AspNet.Html/Microsoft.AspNet.Html.xproj rename to src/Microsoft.AspNet.Html.Abstractions/Microsoft.AspNet.Html.Abstractions.xproj diff --git a/src/Microsoft.AspNet.Html.Abstractions/Properties/AssemblyInfo.cs b/src/Microsoft.AspNet.Html.Abstractions/Properties/AssemblyInfo.cs new file mode 100644 index 0000000000..d310306c25 --- /dev/null +++ b/src/Microsoft.AspNet.Html.Abstractions/Properties/AssemblyInfo.cs @@ -0,0 +1,10 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System.Reflection; +using System.Resources; +using System.Runtime.CompilerServices; + +[assembly: AssemblyMetadata("Serviceable", "True")] +[assembly: NeutralResourcesLanguage("en-us")] +[assembly: InternalsVisibleTo("Microsoft.AspNet.Html.Abstractions.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] \ No newline at end of file diff --git a/src/Microsoft.AspNet.Html/project.json b/src/Microsoft.AspNet.Html.Abstractions/project.json similarity index 100% rename from src/Microsoft.AspNet.Html/project.json rename to src/Microsoft.AspNet.Html.Abstractions/project.json diff --git a/src/Microsoft.AspNet.Html/Properties/AssemblyInfo.cs b/src/Microsoft.AspNet.Html/Properties/AssemblyInfo.cs deleted file mode 100644 index 1951d644af..0000000000 --- a/src/Microsoft.AspNet.Html/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System.Reflection; -using System.Resources; -using System.Runtime.CompilerServices; - -[assembly: AssemblyMetadata("Serviceable", "True")] -[assembly: NeutralResourcesLanguage("en-us")] -[assembly: InternalsVisibleTo("Microsoft.AspNet.Html.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] \ No newline at end of file diff --git a/test/Microsoft.AspNet.Html.Test/HtmlContentBuilderExtensionsTest.cs b/test/Microsoft.AspNet.Html.Abstractions.Test/HtmlContentBuilderExtensionsTest.cs similarity index 100% rename from test/Microsoft.AspNet.Html.Test/HtmlContentBuilderExtensionsTest.cs rename to test/Microsoft.AspNet.Html.Abstractions.Test/HtmlContentBuilderExtensionsTest.cs diff --git a/test/Microsoft.AspNet.Html.Test/HtmlContentBuilderTest.cs b/test/Microsoft.AspNet.Html.Abstractions.Test/HtmlContentBuilderTest.cs similarity index 100% rename from test/Microsoft.AspNet.Html.Test/HtmlContentBuilderTest.cs rename to test/Microsoft.AspNet.Html.Abstractions.Test/HtmlContentBuilderTest.cs diff --git a/test/Microsoft.AspNet.Html.Test/Microsoft.AspNet.Html.Test.xproj b/test/Microsoft.AspNet.Html.Abstractions.Test/Microsoft.AspNet.Html.Abstractions.Test.xproj similarity index 100% rename from test/Microsoft.AspNet.Html.Test/Microsoft.AspNet.Html.Test.xproj rename to test/Microsoft.AspNet.Html.Abstractions.Test/Microsoft.AspNet.Html.Abstractions.Test.xproj diff --git a/test/Microsoft.AspNet.Html.Test/project.json b/test/Microsoft.AspNet.Html.Abstractions.Test/project.json similarity index 87% rename from test/Microsoft.AspNet.Html.Test/project.json rename to test/Microsoft.AspNet.Html.Abstractions.Test/project.json index f5ea4ca7e6..b8e9656f15 100644 --- a/test/Microsoft.AspNet.Html.Test/project.json +++ b/test/Microsoft.AspNet.Html.Abstractions.Test/project.json @@ -4,7 +4,7 @@ "keyFile": "../../tools/Key.snk" }, "dependencies": { - "Microsoft.AspNet.Html": "1.0.0-*", + "Microsoft.AspNet.Html.Abstractions": "1.0.0-*", "Microsoft.AspNet.Testing": "1.0.0-*", "Microsoft.Extensions.WebEncoders": "1.0.0-*", "xunit.runner.aspnet": "2.0.0-aspnet-*" From 6b7cd4ac18a37956de8ad3647800b6066283b146 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Tue, 8 Dec 2015 14:38:35 -0800 Subject: [PATCH 006/169] Adding System.Runtime to resolve build issue --- test/Microsoft.AspNet.Html.Abstractions.Test/project.json | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/Microsoft.AspNet.Html.Abstractions.Test/project.json b/test/Microsoft.AspNet.Html.Abstractions.Test/project.json index b8e9656f15..e3035cbf59 100644 --- a/test/Microsoft.AspNet.Html.Abstractions.Test/project.json +++ b/test/Microsoft.AspNet.Html.Abstractions.Test/project.json @@ -14,6 +14,10 @@ }, "frameworks": { "dnx451": { }, - "dnxcore50": { } + "dnxcore50": { + "dependencies": { + "System.Runtime": "4.0.21-*" + } + } } } From 736f2bcefbd1c1d9bb437bf19d4b0d72593cfb68 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Mon, 14 Dec 2015 16:28:23 -0800 Subject: [PATCH 007/169] Adding Travis and AppVeyor badges --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index add6834eeb..799d29e1dc 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,8 @@ HtmlAbstractions ========== +AppVeyor: [![AppVeyor](https://ci.appveyor.com/api/projects/status/cu9y78vsdp19e5on/branch/dev?svg=true)](https://ci.appveyor.com/project/aspnetci/htmlabstractions/branch/dev) + +Travis: [![Travis](https://travis-ci.org/aspnet/HtmlAbstractions.svg?branch=dev)](https://travis-ci.org/aspnet/HtmlAbstractions) HTML abstractions such as `IHtmlContent` and related APIs. From 234073cf6e4901d68f1b23e7d1127cacff7455e3 Mon Sep 17 00:00:00 2001 From: Doug Bunting Date: Tue, 15 Dec 2015 15:27:40 -0800 Subject: [PATCH 008/169] Make `HtmlEncodedString` a suitable base for MVC's `HtmlString` - #5 - provide `ToString()` implementation - add missing `null` checks in `WriteTo()`; remove extraneous one in the constructor - special-case `HtmlEncodedString` in `IHtmlContentBuilder.AppendFormat()` extension method nits: - ignore more files - add missing `null` checks in `HtmlContentBuilderExtensions` too --- .gitignore | 12 ++++- .../HtmlContentBuilderExtensions.cs | 45 ++++++++++++++++++- .../HtmlEncodedString.cs | 24 +++++----- .../HtmlContentBuilderExtensionsTest.cs | 13 ++++++ 4 files changed, 81 insertions(+), 13 deletions(-) diff --git a/.gitignore b/.gitignore index ac82da7568..329a307cda 100644 --- a/.gitignore +++ b/.gitignore @@ -2,10 +2,17 @@ [Bb]in/ TestResults/ .nuget/ +*.sln.ide/ _ReSharper.*/ packages/ artifacts/ PublishProfiles/ +.vs/ +bower_components/ +node_modules/ +**/wwwroot/lib/ +debugSettings.json +project.lock.json *.user *.suo *.cache @@ -23,5 +30,8 @@ nuget.exe *.ncrunchsolution *.*sdf *.ipch +.settings *.sln.ide -project.lock.json +node_modules +**/[Cc]ompiler/[Rr]esources/**/*.js +*launchSettings.json diff --git a/src/Microsoft.AspNet.Html.Abstractions/HtmlContentBuilderExtensions.cs b/src/Microsoft.AspNet.Html.Abstractions/HtmlContentBuilderExtensions.cs index eabfafbd12..5d0b82dd5e 100644 --- a/src/Microsoft.AspNet.Html.Abstractions/HtmlContentBuilderExtensions.cs +++ b/src/Microsoft.AspNet.Html.Abstractions/HtmlContentBuilderExtensions.cs @@ -99,6 +99,11 @@ namespace Microsoft.AspNet.Html /// The . public static IHtmlContentBuilder AppendLine(this IHtmlContentBuilder builder) { + if (builder == null) + { + throw new ArgumentNullException(nameof(builder)); + } + builder.Append(HtmlEncodedString.NewLine); return builder; } @@ -112,6 +117,11 @@ namespace Microsoft.AspNet.Html /// The . public static IHtmlContentBuilder AppendLine(this IHtmlContentBuilder builder, string unencoded) { + if (builder == null) + { + throw new ArgumentNullException(nameof(builder)); + } + builder.Append(unencoded); builder.Append(HtmlEncodedString.NewLine); return builder; @@ -125,6 +135,11 @@ namespace Microsoft.AspNet.Html /// The . public static IHtmlContentBuilder AppendLine(this IHtmlContentBuilder builder, IHtmlContent content) { + if (builder == null) + { + throw new ArgumentNullException(nameof(builder)); + } + builder.Append(content); builder.Append(HtmlEncodedString.NewLine); return builder; @@ -139,6 +154,11 @@ namespace Microsoft.AspNet.Html /// The . public static IHtmlContentBuilder AppendHtmlLine(this IHtmlContentBuilder builder, string encoded) { + if (builder == null) + { + throw new ArgumentNullException(nameof(builder)); + } + builder.AppendHtml(encoded); builder.Append(HtmlEncodedString.NewLine); return builder; @@ -153,6 +173,11 @@ namespace Microsoft.AspNet.Html /// The . public static IHtmlContentBuilder SetContent(this IHtmlContentBuilder builder, string unencoded) { + if (builder == null) + { + throw new ArgumentNullException(nameof(builder)); + } + builder.Clear(); builder.Append(unencoded); return builder; @@ -166,6 +191,11 @@ namespace Microsoft.AspNet.Html /// The . public static IHtmlContentBuilder SetContent(this IHtmlContentBuilder builder, IHtmlContent content) { + if (builder == null) + { + throw new ArgumentNullException(nameof(builder)); + } + builder.Clear(); builder.Append(content); return builder; @@ -180,6 +210,11 @@ namespace Microsoft.AspNet.Html /// The . public static IHtmlContentBuilder SetHtmlContent(this IHtmlContentBuilder builder, string encoded) { + if (builder == null) + { + throw new ArgumentNullException(nameof(builder)); + } + builder.Clear(); builder.AppendHtml(encoded); return builder; @@ -256,8 +291,14 @@ namespace Microsoft.AspNet.Html public string Format(string format, object arg, IFormatProvider formatProvider) { - // This is the case we need to special case. We trust the IHtmlContent instance to do the - // right thing with encoding. + // These are the cases we need to special case. We trust the HtmlEncodedString or IHtmlContent instance + // to do the right thing with encoding. + var htmlString = arg as HtmlEncodedString; + if (htmlString != null) + { + return htmlString.ToString(); + } + var htmlContent = arg as IHtmlContent; if (htmlContent != null) { diff --git a/src/Microsoft.AspNet.Html.Abstractions/HtmlEncodedString.cs b/src/Microsoft.AspNet.Html.Abstractions/HtmlEncodedString.cs index 348588800f..e5c4ab5003 100644 --- a/src/Microsoft.AspNet.Html.Abstractions/HtmlEncodedString.cs +++ b/src/Microsoft.AspNet.Html.Abstractions/HtmlEncodedString.cs @@ -2,16 +2,14 @@ // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; -using System.Diagnostics; using System.IO; using System.Text.Encodings.Web; namespace Microsoft.AspNet.Html { /// - /// An impelementation that wraps an HTML encoded . + /// An implementation that wraps an HTML encoded . /// - [DebuggerDisplay("{DebuggerToString()}")] public class HtmlEncodedString : IHtmlContent { /// @@ -27,23 +25,29 @@ namespace Microsoft.AspNet.Html /// The HTML encoded value. public HtmlEncodedString(string value) { - if (value == null) - { - throw new ArgumentNullException(nameof(value)); - } - _value = value; } /// public void WriteTo(TextWriter writer, HtmlEncoder encoder) { + if (writer == null) + { + throw new ArgumentNullException(nameof(writer)); + } + + if (encoder == null) + { + throw new ArgumentNullException(nameof(encoder)); + } + writer.Write(_value); } - private string DebuggerToString() + /// + public override string ToString() { - return _value; + return _value ?? string.Empty; } } } diff --git a/test/Microsoft.AspNet.Html.Abstractions.Test/HtmlContentBuilderExtensionsTest.cs b/test/Microsoft.AspNet.Html.Abstractions.Test/HtmlContentBuilderExtensionsTest.cs index 6253bf9be3..9355d507d3 100644 --- a/test/Microsoft.AspNet.Html.Abstractions.Test/HtmlContentBuilderExtensionsTest.cs +++ b/test/Microsoft.AspNet.Html.Abstractions.Test/HtmlContentBuilderExtensionsTest.cs @@ -158,6 +158,19 @@ namespace Microsoft.AspNet.Html.Test HtmlContentToString(builder)); } + [Fact] + public void Builder_AppendFormat_HtmlEncodedString() + { + // Arrange + var builder = new TestHtmlContentBuilder(); + + // Act + builder.AppendFormat("{0}!", new HtmlEncodedString("First")); + + // Assert + Assert.Equal("First!", HtmlContentToString(builder)); + } + [Fact] public void Builder_AppendFormatContent_With1Argument() { From b4239550f3151bcf12211799fdbcbc3dbfec9d1a Mon Sep 17 00:00:00 2001 From: Pranav K Date: Tue, 22 Dec 2015 15:57:35 -0800 Subject: [PATCH 009/169] Move Microsoft.Extensions.WebEncoders to HtmlAbstractions --- HtmlAbstractions.sln | 32 +++++- NuGetPackageVerifier.json | 3 +- .../EncoderServiceCollectionExtensions.cs | 64 +++++++++++ .../EncoderServiceProviderExtensions.cs | 50 +++++++++ .../Microsoft.Extensions.WebEncoders.xproj | 17 +++ .../Properties/AssemblyInfo.cs | 8 ++ .../Testing/HtmlTestEncoder.cs | 104 ++++++++++++++++++ .../Testing/JavaScriptTestEncoder.cs | 104 ++++++++++++++++++ .../Testing/UrlTestEncoder.cs | 104 ++++++++++++++++++ .../WebEncoderOptions.cs | 21 ++++ .../project.json | 27 +++++ ...EncoderServiceCollectionExtensionsTests.cs | 90 +++++++++++++++ .../EncoderServiceProviderExtensionsTests.cs | 103 +++++++++++++++++ .../HtmlTestEncoderTest.cs | 26 +++++ ...crosoft.Extensions.WebEncoders.Tests.xproj | 20 ++++ .../project.json | 24 ++++ 16 files changed, 795 insertions(+), 2 deletions(-) create mode 100644 src/Microsoft.Extensions.WebEncoders/EncoderServiceCollectionExtensions.cs create mode 100644 src/Microsoft.Extensions.WebEncoders/EncoderServiceProviderExtensions.cs create mode 100644 src/Microsoft.Extensions.WebEncoders/Microsoft.Extensions.WebEncoders.xproj create mode 100644 src/Microsoft.Extensions.WebEncoders/Properties/AssemblyInfo.cs create mode 100644 src/Microsoft.Extensions.WebEncoders/Testing/HtmlTestEncoder.cs create mode 100644 src/Microsoft.Extensions.WebEncoders/Testing/JavaScriptTestEncoder.cs create mode 100644 src/Microsoft.Extensions.WebEncoders/Testing/UrlTestEncoder.cs create mode 100644 src/Microsoft.Extensions.WebEncoders/WebEncoderOptions.cs create mode 100644 src/Microsoft.Extensions.WebEncoders/project.json create mode 100644 test/Microsoft.Extensions.WebEncoders.Tests/EncoderServiceCollectionExtensionsTests.cs create mode 100644 test/Microsoft.Extensions.WebEncoders.Tests/EncoderServiceProviderExtensionsTests.cs create mode 100644 test/Microsoft.Extensions.WebEncoders.Tests/HtmlTestEncoderTest.cs create mode 100644 test/Microsoft.Extensions.WebEncoders.Tests/Microsoft.Extensions.WebEncoders.Tests.xproj create mode 100644 test/Microsoft.Extensions.WebEncoders.Tests/project.json diff --git a/HtmlAbstractions.sln b/HtmlAbstractions.sln index 805c4daa7a..a45f34a265 100644 --- a/HtmlAbstractions.sln +++ b/HtmlAbstractions.sln @@ -1,6 +1,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 14 -VisualStudioVersion = 14.0.24720.0 +VisualStudioVersion = 14.0.24711.0 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{A5A15F1C-885A-452A-A731-B0173DDBD913}" EndProject @@ -16,6 +16,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution NuGetPackageVerifier.json = NuGetPackageVerifier.json EndProjectSection EndProject +Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.Extensions.WebEncoders", "src\Microsoft.Extensions.WebEncoders\Microsoft.Extensions.WebEncoders.xproj", "{DD2CE416-765E-4000-A03E-C2FF165DA1B6}" +EndProject +Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.Extensions.WebEncoders.Tests", "test\Microsoft.Extensions.WebEncoders.Tests\Microsoft.Extensions.WebEncoders.Tests.xproj", "{7AE2731D-43CD-4CF8-850A-4914DE2CE930}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -50,6 +54,30 @@ Global {2D187B88-94BD-4A39-AC97-F8F8B9363301}.Release|Mixed Platforms.Build.0 = Release|Any CPU {2D187B88-94BD-4A39-AC97-F8F8B9363301}.Release|x86.ActiveCfg = Release|Any CPU {2D187B88-94BD-4A39-AC97-F8F8B9363301}.Release|x86.Build.0 = Release|Any CPU + {DD2CE416-765E-4000-A03E-C2FF165DA1B6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {DD2CE416-765E-4000-A03E-C2FF165DA1B6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DD2CE416-765E-4000-A03E-C2FF165DA1B6}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {DD2CE416-765E-4000-A03E-C2FF165DA1B6}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {DD2CE416-765E-4000-A03E-C2FF165DA1B6}.Debug|x86.ActiveCfg = Debug|Any CPU + {DD2CE416-765E-4000-A03E-C2FF165DA1B6}.Debug|x86.Build.0 = Debug|Any CPU + {DD2CE416-765E-4000-A03E-C2FF165DA1B6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DD2CE416-765E-4000-A03E-C2FF165DA1B6}.Release|Any CPU.Build.0 = Release|Any CPU + {DD2CE416-765E-4000-A03E-C2FF165DA1B6}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {DD2CE416-765E-4000-A03E-C2FF165DA1B6}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {DD2CE416-765E-4000-A03E-C2FF165DA1B6}.Release|x86.ActiveCfg = Release|Any CPU + {DD2CE416-765E-4000-A03E-C2FF165DA1B6}.Release|x86.Build.0 = Release|Any CPU + {7AE2731D-43CD-4CF8-850A-4914DE2CE930}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7AE2731D-43CD-4CF8-850A-4914DE2CE930}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7AE2731D-43CD-4CF8-850A-4914DE2CE930}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {7AE2731D-43CD-4CF8-850A-4914DE2CE930}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {7AE2731D-43CD-4CF8-850A-4914DE2CE930}.Debug|x86.ActiveCfg = Debug|Any CPU + {7AE2731D-43CD-4CF8-850A-4914DE2CE930}.Debug|x86.Build.0 = Debug|Any CPU + {7AE2731D-43CD-4CF8-850A-4914DE2CE930}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7AE2731D-43CD-4CF8-850A-4914DE2CE930}.Release|Any CPU.Build.0 = Release|Any CPU + {7AE2731D-43CD-4CF8-850A-4914DE2CE930}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {7AE2731D-43CD-4CF8-850A-4914DE2CE930}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {7AE2731D-43CD-4CF8-850A-4914DE2CE930}.Release|x86.ActiveCfg = Release|Any CPU + {7AE2731D-43CD-4CF8-850A-4914DE2CE930}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -57,5 +85,7 @@ Global GlobalSection(NestedProjects) = preSolution {68A28E4A-3ADE-4187-9625-4FF185887CB3} = {A5A15F1C-885A-452A-A731-B0173DDBD913} {2D187B88-94BD-4A39-AC97-F8F8B9363301} = {F31FF137-390C-49BF-A3BD-7C6ED3597C21} + {DD2CE416-765E-4000-A03E-C2FF165DA1B6} = {A5A15F1C-885A-452A-A731-B0173DDBD913} + {7AE2731D-43CD-4CF8-850A-4914DE2CE930} = {F31FF137-390C-49BF-A3BD-7C6ED3597C21} EndGlobalSection EndGlobal diff --git a/NuGetPackageVerifier.json b/NuGetPackageVerifier.json index c57b2afb17..31f9437602 100644 --- a/NuGetPackageVerifier.json +++ b/NuGetPackageVerifier.json @@ -9,7 +9,8 @@ "StrictSemanticVersionValidationRule" ], "packages": { - "Microsoft.AspNet.Html.Abstractions": { } + "Microsoft.AspNet.Html.Abstractions": { }, + "Microsoft.Extensions.WebEncoders": { } } }, "Default": { // Rules to run for packages not listed in any other set. diff --git a/src/Microsoft.Extensions.WebEncoders/EncoderServiceCollectionExtensions.cs b/src/Microsoft.Extensions.WebEncoders/EncoderServiceCollectionExtensions.cs new file mode 100644 index 0000000000..80f1987c17 --- /dev/null +++ b/src/Microsoft.Extensions.WebEncoders/EncoderServiceCollectionExtensions.cs @@ -0,0 +1,64 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System; +using System.Text.Encodings.Web; +using Microsoft.Extensions.DependencyInjection.Extensions; +using Microsoft.Extensions.Options; +using Microsoft.Extensions.WebEncoders; + +namespace Microsoft.Extensions.DependencyInjection +{ + public static class EncoderServiceCollectionExtensions + { + public static IServiceCollection AddWebEncoders(this IServiceCollection services) + { + if (services == null) + { + throw new ArgumentNullException(nameof(services)); + } + + return AddWebEncoders(services, configureOptions: null); + } + + public static IServiceCollection AddWebEncoders(this IServiceCollection services, Action configureOptions) + { + if (services == null) + { + throw new ArgumentNullException(nameof(services)); + } + + services.AddOptions(); + + // Register the default encoders + // We want to call the 'Default' property getters lazily since they perform static caching + services.TryAddSingleton( + CreateFactory(() => HtmlEncoder.Default, settings => HtmlEncoder.Create(settings))); + services.TryAddSingleton( + CreateFactory(() => JavaScriptEncoder.Default, settings => JavaScriptEncoder.Create(settings))); + services.TryAddSingleton( + CreateFactory(() => UrlEncoder.Default, settings => UrlEncoder.Create(settings))); + + if (configureOptions != null) + { + services.Configure(configureOptions); + } + + return services; + } + + private static Func CreateFactory( + Func defaultFactory, + Func customSettingsFactory) + { + return serviceProvider => + { + var settings = serviceProvider + ?.GetService>() + ?.Value + ?.TextEncoderSettings; + return (settings != null) ? customSettingsFactory(settings) : defaultFactory(); + }; + } + } +} diff --git a/src/Microsoft.Extensions.WebEncoders/EncoderServiceProviderExtensions.cs b/src/Microsoft.Extensions.WebEncoders/EncoderServiceProviderExtensions.cs new file mode 100644 index 0000000000..8d9d2da4e8 --- /dev/null +++ b/src/Microsoft.Extensions.WebEncoders/EncoderServiceProviderExtensions.cs @@ -0,0 +1,50 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System; +using System.Text.Encodings.Web; + +namespace Microsoft.Extensions.WebEncoders +{ + /// + /// Contains extension methods for fetching encoders from an . + /// + public static class EncoderServiceProviderExtensions + { + /// + /// Retrieves an from an . + /// + /// + /// This method is guaranteed never to return null. + /// It will return a default encoder instance if does not contain one or is null. + /// + public static HtmlEncoder GetHtmlEncoder(this IServiceProvider serviceProvider) + { + return (HtmlEncoder)serviceProvider?.GetService(typeof(HtmlEncoder)) ?? HtmlEncoder.Default; + } + + /// + /// Retrieves an from an . + /// + /// + /// This method is guaranteed never to return null. + /// It will return a default encoder instance if does not contain one or is null. + /// + public static JavaScriptEncoder GetJavaScriptEncoder(this IServiceProvider serviceProvider) + { + return (JavaScriptEncoder)serviceProvider?.GetService(typeof(JavaScriptEncoder)) ?? JavaScriptEncoder.Default; + } + + /// + /// Retrieves an from an . + /// + /// + /// This method is guaranteed never to return null. + /// It will return a default encoder instance if does not contain one or is null. + /// + public static UrlEncoder GetUrlEncoder(this IServiceProvider serviceProvider) + { + return (UrlEncoder)serviceProvider?.GetService(typeof(UrlEncoder)) ?? UrlEncoder.Default; + } + } +} diff --git a/src/Microsoft.Extensions.WebEncoders/Microsoft.Extensions.WebEncoders.xproj b/src/Microsoft.Extensions.WebEncoders/Microsoft.Extensions.WebEncoders.xproj new file mode 100644 index 0000000000..084e7901ea --- /dev/null +++ b/src/Microsoft.Extensions.WebEncoders/Microsoft.Extensions.WebEncoders.xproj @@ -0,0 +1,17 @@ + + + + 14.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + + dd2ce416-765e-4000-a03e-c2ff165da1b6 + ..\..\artifacts\obj\$(MSBuildProjectName) + ..\..\artifacts\bin\$(MSBuildProjectName)\ + + + 2.0 + + + \ No newline at end of file diff --git a/src/Microsoft.Extensions.WebEncoders/Properties/AssemblyInfo.cs b/src/Microsoft.Extensions.WebEncoders/Properties/AssemblyInfo.cs new file mode 100644 index 0000000000..b2437d9ad6 --- /dev/null +++ b/src/Microsoft.Extensions.WebEncoders/Properties/AssemblyInfo.cs @@ -0,0 +1,8 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System.Reflection; +using System.Resources; + +[assembly: AssemblyMetadata("Serviceable", "True")] +[assembly: NeutralResourcesLanguage("en-us")] \ No newline at end of file diff --git a/src/Microsoft.Extensions.WebEncoders/Testing/HtmlTestEncoder.cs b/src/Microsoft.Extensions.WebEncoders/Testing/HtmlTestEncoder.cs new file mode 100644 index 0000000000..162ce4f6c1 --- /dev/null +++ b/src/Microsoft.Extensions.WebEncoders/Testing/HtmlTestEncoder.cs @@ -0,0 +1,104 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System; +using System.IO; +using System.Text.Encodings.Web; + +namespace Microsoft.Extensions.WebEncoders.Testing +{ + /// + /// Encoder used for unit testing. + /// + public sealed class HtmlTestEncoder : HtmlEncoder + { + public override int MaxOutputCharactersPerInputCharacter + { + get { return 1; } + } + + public override string Encode(string value) + { + if (value == null) + { + throw new ArgumentNullException(nameof(value)); + } + + if (value.Length == 0) + { + return string.Empty; + } + + return $"HtmlEncode[[{value}]]"; + } + + public override void Encode(TextWriter output, char[] value, int startIndex, int characterCount) + { + if (output == null) + { + throw new ArgumentNullException(nameof(output)); + } + + if (value == null) + { + throw new ArgumentNullException(nameof(value)); + } + + if (characterCount == 0) + { + return; + } + + output.Write("HtmlEncode[["); + output.Write(value, startIndex, characterCount); + output.Write("]]"); + } + + public override void Encode(TextWriter output, string value, int startIndex, int characterCount) + { + if (output == null) + { + throw new ArgumentNullException(nameof(output)); + } + + if (value == null) + { + throw new ArgumentNullException(nameof(value)); + } + + if (characterCount == 0) + { + return; + } + + output.Write("HtmlEncode[["); + output.Write(value.Substring(startIndex, characterCount)); + output.Write("]]"); + } + + public override bool WillEncode(int unicodeScalar) + { + return false; + } + + public override unsafe int FindFirstCharacterToEncode(char* text, int textLength) + { + return -1; + } + + public override unsafe bool TryEncodeUnicodeScalar( + int unicodeScalar, + char* buffer, + int bufferLength, + out int numberOfCharactersWritten) + { + if (buffer == null) + { + throw new ArgumentNullException(nameof(buffer)); + } + + numberOfCharactersWritten = 0; + return false; + } + } +} \ No newline at end of file diff --git a/src/Microsoft.Extensions.WebEncoders/Testing/JavaScriptTestEncoder.cs b/src/Microsoft.Extensions.WebEncoders/Testing/JavaScriptTestEncoder.cs new file mode 100644 index 0000000000..bef4461676 --- /dev/null +++ b/src/Microsoft.Extensions.WebEncoders/Testing/JavaScriptTestEncoder.cs @@ -0,0 +1,104 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System; +using System.IO; +using System.Text.Encodings.Web; + +namespace Microsoft.Extensions.WebEncoders.Testing +{ + /// + /// Encoder used for unit testing. + /// + public class JavaScriptTestEncoder : JavaScriptEncoder + { + public override int MaxOutputCharactersPerInputCharacter + { + get { return 1; } + } + + public override string Encode(string value) + { + if (value == null) + { + throw new ArgumentNullException(nameof(value)); + } + + if (value.Length == 0) + { + return string.Empty; + } + + return $"JavaScriptEncode[[{value}]]"; + } + + public override void Encode(TextWriter output, char[] value, int startIndex, int characterCount) + { + if (output == null) + { + throw new ArgumentNullException(nameof(output)); + } + + if (value == null) + { + throw new ArgumentNullException(nameof(value)); + } + + if (characterCount == 0) + { + return; + } + + output.Write("JavaScriptEncode[["); + output.Write(value, startIndex, characterCount); + output.Write("]]"); + } + + public override void Encode(TextWriter output, string value, int startIndex, int characterCount) + { + if (output == null) + { + throw new ArgumentNullException(nameof(output)); + } + + if (value == null) + { + throw new ArgumentNullException(nameof(value)); + } + + if (characterCount == 0) + { + return; + } + + output.Write("JavaScriptEncode[["); + output.Write(value.Substring(startIndex, characterCount)); + output.Write("]]"); + } + + public override bool WillEncode(int unicodeScalar) + { + return false; + } + + public override unsafe int FindFirstCharacterToEncode(char* text, int textLength) + { + return -1; + } + + public override unsafe bool TryEncodeUnicodeScalar( + int unicodeScalar, + char* buffer, + int bufferLength, + out int numberOfCharactersWritten) + { + if (buffer == null) + { + throw new ArgumentNullException(nameof(buffer)); + } + + numberOfCharactersWritten = 0; + return false; + } + } +} \ No newline at end of file diff --git a/src/Microsoft.Extensions.WebEncoders/Testing/UrlTestEncoder.cs b/src/Microsoft.Extensions.WebEncoders/Testing/UrlTestEncoder.cs new file mode 100644 index 0000000000..295bda63e8 --- /dev/null +++ b/src/Microsoft.Extensions.WebEncoders/Testing/UrlTestEncoder.cs @@ -0,0 +1,104 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System; +using System.IO; +using System.Text.Encodings.Web; + +namespace Microsoft.Extensions.WebEncoders.Testing +{ + /// + /// Encoder used for unit testing. + /// + public class UrlTestEncoder : UrlEncoder + { + public override int MaxOutputCharactersPerInputCharacter + { + get { return 1; } + } + + public override string Encode(string value) + { + if (value == null) + { + throw new ArgumentNullException(nameof(value)); + } + + if (value.Length == 0) + { + return string.Empty; + } + + return $"UrlEncode[[{value}]]"; + } + + public override void Encode(TextWriter output, char[] value, int startIndex, int characterCount) + { + if (output == null) + { + throw new ArgumentNullException(nameof(output)); + } + + if (value == null) + { + throw new ArgumentNullException(nameof(value)); + } + + if (characterCount == 0) + { + return; + } + + output.Write("UrlEncode[["); + output.Write(value, startIndex, characterCount); + output.Write("]]"); + } + + public override void Encode(TextWriter output, string value, int startIndex, int characterCount) + { + if (output == null) + { + throw new ArgumentNullException(nameof(output)); + } + + if (value == null) + { + throw new ArgumentNullException(nameof(value)); + } + + if (characterCount == 0) + { + return; + } + + output.Write("UrlEncode[["); + output.Write(value.Substring(startIndex, characterCount)); + output.Write("]]"); + } + + public override bool WillEncode(int unicodeScalar) + { + return false; + } + + public override unsafe int FindFirstCharacterToEncode(char* text, int textLength) + { + return -1; + } + + public override unsafe bool TryEncodeUnicodeScalar( + int unicodeScalar, + char* buffer, + int bufferLength, + out int numberOfCharactersWritten) + { + if (buffer == null) + { + throw new ArgumentNullException(nameof(buffer)); + } + + numberOfCharactersWritten = 0; + return false; + } + } +} \ No newline at end of file diff --git a/src/Microsoft.Extensions.WebEncoders/WebEncoderOptions.cs b/src/Microsoft.Extensions.WebEncoders/WebEncoderOptions.cs new file mode 100644 index 0000000000..2f5e770a0c --- /dev/null +++ b/src/Microsoft.Extensions.WebEncoders/WebEncoderOptions.cs @@ -0,0 +1,21 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System.Text.Encodings.Web; + +namespace Microsoft.Extensions.WebEncoders +{ + /// + /// Specifies options common to all three encoders (HtmlEncode, JavaScriptEncode, UrlEncode). + /// + public sealed class WebEncoderOptions + { + /// + /// Specifies which code points are allowed to be represented unescaped by the encoders. + /// + /// + /// If this property is null, then the encoders will use their default allow lists. + /// + public TextEncoderSettings TextEncoderSettings { get; set; } + } +} diff --git a/src/Microsoft.Extensions.WebEncoders/project.json b/src/Microsoft.Extensions.WebEncoders/project.json new file mode 100644 index 0000000000..0facfeeb8c --- /dev/null +++ b/src/Microsoft.Extensions.WebEncoders/project.json @@ -0,0 +1,27 @@ +{ + "version": "1.0.0-*", + "description": "Contains registration and configuration APIs for the core framework encoders.", + "repository": { + "type": "git", + "url": "git://github.com/aspnet/httpabstractions" + }, + "compilationOptions": { + "warningsAsErrors": true, + "allowUnsafe": true, + "keyFile": "../../tools/Key.snk" + }, + "dependencies": { + "Microsoft.Extensions.DependencyInjection.Abstractions": "1.0.0-*", + "Microsoft.Extensions.Options": "1.0.0-*", + "System.Text.Encodings.Web": "4.0.0-*" + }, + "frameworks": { + "net451": { + "frameworkAssemblies": { + "System.IO": "", + "System.Runtime": "" + } + }, + "dotnet5.4": {} + } +} diff --git a/test/Microsoft.Extensions.WebEncoders.Tests/EncoderServiceCollectionExtensionsTests.cs b/test/Microsoft.Extensions.WebEncoders.Tests/EncoderServiceCollectionExtensionsTests.cs new file mode 100644 index 0000000000..8e060102bb --- /dev/null +++ b/test/Microsoft.Extensions.WebEncoders.Tests/EncoderServiceCollectionExtensionsTests.cs @@ -0,0 +1,90 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System.Text.Encodings.Web; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.WebEncoders.Testing; +using Xunit; + +namespace Microsoft.Extensions.WebEncoders +{ + public class EncoderServiceCollectionExtensionsTests + { + [Fact] + public void AddWebEncoders_WithoutOptions_RegistersDefaultEncoders() + { + // Arrange + var serviceCollection = new ServiceCollection(); + + // Act + serviceCollection.AddWebEncoders(); + + // Assert + var serviceProvider = serviceCollection.BuildServiceProvider(); + Assert.Same(HtmlEncoder.Default, serviceProvider.GetRequiredService()); // default encoder + Assert.Same(HtmlEncoder.Default, serviceProvider.GetRequiredService()); // as singleton instance + Assert.Same(JavaScriptEncoder.Default, serviceProvider.GetRequiredService()); // default encoder + Assert.Same(JavaScriptEncoder.Default, serviceProvider.GetRequiredService()); // as singleton instance + Assert.Same(UrlEncoder.Default, serviceProvider.GetRequiredService()); // default encoder + Assert.Same(UrlEncoder.Default, serviceProvider.GetRequiredService()); // as singleton instance + } + + [Fact] + public void AddWebEncoders_WithOptions_RegistersEncodersWithCustomCodeFilter() + { + // Arrange + var serviceCollection = new ServiceCollection(); + + // Act + serviceCollection.AddWebEncoders(options => + { + options.TextEncoderSettings = new TextEncoderSettings(); + options.TextEncoderSettings.AllowCharacters("ace".ToCharArray()); // only these three chars are allowed + }); + + // Assert + var serviceProvider = serviceCollection.BuildServiceProvider(); + + var htmlEncoder = serviceProvider.GetRequiredService(); + Assert.Equal("abcde", htmlEncoder.Encode("abcde")); + Assert.Same(htmlEncoder, serviceProvider.GetRequiredService()); // as singleton instance + + var javaScriptEncoder = serviceProvider.GetRequiredService(); + Assert.Equal(@"a\u0062c\u0064e", javaScriptEncoder.Encode("abcde")); + Assert.Same(javaScriptEncoder, serviceProvider.GetRequiredService()); // as singleton instance + + var urlEncoder = serviceProvider.GetRequiredService(); + Assert.Equal("a%62c%64e", urlEncoder.Encode("abcde")); + Assert.Same(urlEncoder, serviceProvider.GetRequiredService()); // as singleton instance + } + + [Fact] + public void AddWebEncoders_DoesNotOverrideExistingRegisteredEncoders() + { + // Arrange + var serviceCollection = new ServiceCollection(); + + // Act + serviceCollection.AddSingleton(); + serviceCollection.AddSingleton(); + // we don't register an existing URL encoder + serviceCollection.AddWebEncoders(options => + { + options.TextEncoderSettings = new TextEncoderSettings(); + options.TextEncoderSettings.AllowCharacters("ace".ToCharArray()); // only these three chars are allowed + }); + + // Assert + var serviceProvider = serviceCollection.BuildServiceProvider(); + + var htmlEncoder = serviceProvider.GetHtmlEncoder(); + Assert.Equal("HtmlEncode[[abcde]]", htmlEncoder.Encode("abcde")); + + var javaScriptEncoder = serviceProvider.GetJavaScriptEncoder(); + Assert.Equal("JavaScriptEncode[[abcde]]", javaScriptEncoder.Encode("abcde")); + + var urlEncoder = serviceProvider.GetUrlEncoder(); + Assert.Equal("a%62c%64e", urlEncoder.Encode("abcde")); + } + } +} diff --git a/test/Microsoft.Extensions.WebEncoders.Tests/EncoderServiceProviderExtensionsTests.cs b/test/Microsoft.Extensions.WebEncoders.Tests/EncoderServiceProviderExtensionsTests.cs new file mode 100644 index 0000000000..01492e759e --- /dev/null +++ b/test/Microsoft.Extensions.WebEncoders.Tests/EncoderServiceProviderExtensionsTests.cs @@ -0,0 +1,103 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System; +using System.Text.Encodings.Web; +using Xunit; + +namespace Microsoft.Extensions.WebEncoders +{ + public class EncoderServiceProviderExtensionsTests + { + [Fact] + public void GetHtmlEncoder_ServiceProviderDoesNotHaveEncoder_UsesDefault() + { + // Arrange + var serviceProvider = new TestServiceProvider(); + + // Act + var retVal = serviceProvider.GetHtmlEncoder(); + + // Assert + Assert.Same(HtmlEncoder.Default, retVal); + } + + [Fact] + public void GetHtmlEncoder_ServiceProviderHasEncoder_ReturnsRegisteredInstance() + { + // Arrange + var expectedEncoder = HtmlEncoder.Default; + var serviceProvider = new TestServiceProvider() { Service = expectedEncoder }; + + // Act + var retVal = serviceProvider.GetHtmlEncoder(); + + // Assert + Assert.Same(expectedEncoder, retVal); + } + + [Fact] + public void GetJavaScriptEncoder_ServiceProviderDoesNotHaveEncoder_UsesDefault() + { + // Arrange + var serviceProvider = new TestServiceProvider(); + + // Act + var retVal = serviceProvider.GetJavaScriptEncoder(); + + // Assert + Assert.Same(JavaScriptEncoder.Default, retVal); + } + + [Fact] + public void GetJavaScriptEncoder_ServiceProviderHasEncoder_ReturnsRegisteredInstance() + { + // Arrange + var expectedEncoder = JavaScriptEncoder.Default; + var serviceProvider = new TestServiceProvider() { Service = expectedEncoder }; + + // Act + var retVal = serviceProvider.GetJavaScriptEncoder(); + + // Assert + Assert.Same(expectedEncoder, retVal); + } + + [Fact] + public void GetUrlEncoder_ServiceProviderDoesNotHaveEncoder_UsesDefault() + { + // Arrange + var serviceProvider = new TestServiceProvider(); + + // Act + var retVal = serviceProvider.GetUrlEncoder(); + + // Assert + Assert.Same(UrlEncoder.Default, retVal); + } + + [Fact] + public void GetUrlEncoder_ServiceProviderHasEncoder_ReturnsRegisteredInstance() + { + // Arrange + var expectedEncoder = UrlEncoder.Default; + var serviceProvider = new TestServiceProvider() { Service = expectedEncoder }; + + // Act + var retVal = serviceProvider.GetUrlEncoder(); + + // Assert + Assert.Same(expectedEncoder, retVal); + } + + private class TestServiceProvider : IServiceProvider + { + public object Service { get; set; } + + public object GetService(Type serviceType) + { + return Service; + } + } + } +} diff --git a/test/Microsoft.Extensions.WebEncoders.Tests/HtmlTestEncoderTest.cs b/test/Microsoft.Extensions.WebEncoders.Tests/HtmlTestEncoderTest.cs new file mode 100644 index 0000000000..baafedc4de --- /dev/null +++ b/test/Microsoft.Extensions.WebEncoders.Tests/HtmlTestEncoderTest.cs @@ -0,0 +1,26 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using Xunit; + +namespace Microsoft.Extensions.WebEncoders.Testing +{ + public class HtmlTestEncoderTest + { + [Theory] + [InlineData("", "")] + [InlineData("abcd", "HtmlEncode[[abcd]]")] + [InlineData("<<''\"\">>", "HtmlEncode[[<<''\"\">>]]")] + public void StringEncode_EncodesAsExpected(string input, string expectedOutput) + { + // Arrange + var encoder = new HtmlTestEncoder(); + + // Act + var output = encoder.Encode(input); + + // Assert + Assert.Equal(expectedOutput, output); + } + } +} diff --git a/test/Microsoft.Extensions.WebEncoders.Tests/Microsoft.Extensions.WebEncoders.Tests.xproj b/test/Microsoft.Extensions.WebEncoders.Tests/Microsoft.Extensions.WebEncoders.Tests.xproj new file mode 100644 index 0000000000..9b0698e3cc --- /dev/null +++ b/test/Microsoft.Extensions.WebEncoders.Tests/Microsoft.Extensions.WebEncoders.Tests.xproj @@ -0,0 +1,20 @@ + + + + 14.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + + 7ae2731d-43cd-4cf8-850a-4914de2ce930 + ..\..\artifacts\obj\$(MSBuildProjectName) + ..\..\artifacts\bin\$(MSBuildProjectName)\ + + + 2.0 + + + + + + \ No newline at end of file diff --git a/test/Microsoft.Extensions.WebEncoders.Tests/project.json b/test/Microsoft.Extensions.WebEncoders.Tests/project.json new file mode 100644 index 0000000000..4d81779a7c --- /dev/null +++ b/test/Microsoft.Extensions.WebEncoders.Tests/project.json @@ -0,0 +1,24 @@ +{ + "dependencies": { + "Microsoft.Extensions.DependencyInjection": "1.0.0-*", + "Microsoft.Extensions.WebEncoders": "1.0.0-*", + "Newtonsoft.Json": "6.0.6", + "xunit.runner.aspnet": "2.0.0-aspnet-*" + }, + "commands": { + "test": "xunit.runner.aspnet" + }, + "compilationOptions": { + "allowUnsafe": true, + "warningsAsErrors": true, + "keyFile": "../../tools/Key.snk" + }, + "frameworks": { + "dnx451": { }, + "dnxcore50": { + "dependencies": { + "System.Text.Encoding.Extensions": "4.0.11-*" + } + } + } +} From 46f64dfa208ae29d4e4608343352286f54a6c4a8 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Tue, 29 Dec 2015 18:21:07 -0800 Subject: [PATCH 010/169] * Remove EncoderServiceProviderExtensions --- .../EncoderServiceCollectionExtensions.cs | 13 +++ .../EncoderServiceProviderExtensions.cs | 50 --------- ...EncoderServiceCollectionExtensionsTests.cs | 6 +- .../EncoderServiceProviderExtensionsTests.cs | 103 ------------------ .../project.json | 7 +- 5 files changed, 17 insertions(+), 162 deletions(-) delete mode 100644 src/Microsoft.Extensions.WebEncoders/EncoderServiceProviderExtensions.cs delete mode 100644 test/Microsoft.Extensions.WebEncoders.Tests/EncoderServiceProviderExtensionsTests.cs diff --git a/src/Microsoft.Extensions.WebEncoders/EncoderServiceCollectionExtensions.cs b/src/Microsoft.Extensions.WebEncoders/EncoderServiceCollectionExtensions.cs index 80f1987c17..df3946099c 100644 --- a/src/Microsoft.Extensions.WebEncoders/EncoderServiceCollectionExtensions.cs +++ b/src/Microsoft.Extensions.WebEncoders/EncoderServiceCollectionExtensions.cs @@ -11,6 +11,12 @@ namespace Microsoft.Extensions.DependencyInjection { public static class EncoderServiceCollectionExtensions { + /// + /// Adds , and + /// to the specified . + /// + /// The . + /// The instance after the encoders have been added. public static IServiceCollection AddWebEncoders(this IServiceCollection services) { if (services == null) @@ -21,6 +27,13 @@ namespace Microsoft.Extensions.DependencyInjection return AddWebEncoders(services, configureOptions: null); } + /// + /// Adds , and + /// to the specified . + /// + /// The . + /// A callback to configure . + /// The instance after the encoders have been added. public static IServiceCollection AddWebEncoders(this IServiceCollection services, Action configureOptions) { if (services == null) diff --git a/src/Microsoft.Extensions.WebEncoders/EncoderServiceProviderExtensions.cs b/src/Microsoft.Extensions.WebEncoders/EncoderServiceProviderExtensions.cs deleted file mode 100644 index 8d9d2da4e8..0000000000 --- a/src/Microsoft.Extensions.WebEncoders/EncoderServiceProviderExtensions.cs +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using System.Text.Encodings.Web; - -namespace Microsoft.Extensions.WebEncoders -{ - /// - /// Contains extension methods for fetching encoders from an . - /// - public static class EncoderServiceProviderExtensions - { - /// - /// Retrieves an from an . - /// - /// - /// This method is guaranteed never to return null. - /// It will return a default encoder instance if does not contain one or is null. - /// - public static HtmlEncoder GetHtmlEncoder(this IServiceProvider serviceProvider) - { - return (HtmlEncoder)serviceProvider?.GetService(typeof(HtmlEncoder)) ?? HtmlEncoder.Default; - } - - /// - /// Retrieves an from an . - /// - /// - /// This method is guaranteed never to return null. - /// It will return a default encoder instance if does not contain one or is null. - /// - public static JavaScriptEncoder GetJavaScriptEncoder(this IServiceProvider serviceProvider) - { - return (JavaScriptEncoder)serviceProvider?.GetService(typeof(JavaScriptEncoder)) ?? JavaScriptEncoder.Default; - } - - /// - /// Retrieves an from an . - /// - /// - /// This method is guaranteed never to return null. - /// It will return a default encoder instance if does not contain one or is null. - /// - public static UrlEncoder GetUrlEncoder(this IServiceProvider serviceProvider) - { - return (UrlEncoder)serviceProvider?.GetService(typeof(UrlEncoder)) ?? UrlEncoder.Default; - } - } -} diff --git a/test/Microsoft.Extensions.WebEncoders.Tests/EncoderServiceCollectionExtensionsTests.cs b/test/Microsoft.Extensions.WebEncoders.Tests/EncoderServiceCollectionExtensionsTests.cs index 8e060102bb..0178bba2d5 100644 --- a/test/Microsoft.Extensions.WebEncoders.Tests/EncoderServiceCollectionExtensionsTests.cs +++ b/test/Microsoft.Extensions.WebEncoders.Tests/EncoderServiceCollectionExtensionsTests.cs @@ -77,13 +77,13 @@ namespace Microsoft.Extensions.WebEncoders // Assert var serviceProvider = serviceCollection.BuildServiceProvider(); - var htmlEncoder = serviceProvider.GetHtmlEncoder(); + var htmlEncoder = serviceProvider.GetRequiredService(); Assert.Equal("HtmlEncode[[abcde]]", htmlEncoder.Encode("abcde")); - var javaScriptEncoder = serviceProvider.GetJavaScriptEncoder(); + var javaScriptEncoder = serviceProvider.GetRequiredService(); Assert.Equal("JavaScriptEncode[[abcde]]", javaScriptEncoder.Encode("abcde")); - var urlEncoder = serviceProvider.GetUrlEncoder(); + var urlEncoder = serviceProvider.GetRequiredService(); Assert.Equal("a%62c%64e", urlEncoder.Encode("abcde")); } } diff --git a/test/Microsoft.Extensions.WebEncoders.Tests/EncoderServiceProviderExtensionsTests.cs b/test/Microsoft.Extensions.WebEncoders.Tests/EncoderServiceProviderExtensionsTests.cs deleted file mode 100644 index 01492e759e..0000000000 --- a/test/Microsoft.Extensions.WebEncoders.Tests/EncoderServiceProviderExtensionsTests.cs +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using System.Text.Encodings.Web; -using Xunit; - -namespace Microsoft.Extensions.WebEncoders -{ - public class EncoderServiceProviderExtensionsTests - { - [Fact] - public void GetHtmlEncoder_ServiceProviderDoesNotHaveEncoder_UsesDefault() - { - // Arrange - var serviceProvider = new TestServiceProvider(); - - // Act - var retVal = serviceProvider.GetHtmlEncoder(); - - // Assert - Assert.Same(HtmlEncoder.Default, retVal); - } - - [Fact] - public void GetHtmlEncoder_ServiceProviderHasEncoder_ReturnsRegisteredInstance() - { - // Arrange - var expectedEncoder = HtmlEncoder.Default; - var serviceProvider = new TestServiceProvider() { Service = expectedEncoder }; - - // Act - var retVal = serviceProvider.GetHtmlEncoder(); - - // Assert - Assert.Same(expectedEncoder, retVal); - } - - [Fact] - public void GetJavaScriptEncoder_ServiceProviderDoesNotHaveEncoder_UsesDefault() - { - // Arrange - var serviceProvider = new TestServiceProvider(); - - // Act - var retVal = serviceProvider.GetJavaScriptEncoder(); - - // Assert - Assert.Same(JavaScriptEncoder.Default, retVal); - } - - [Fact] - public void GetJavaScriptEncoder_ServiceProviderHasEncoder_ReturnsRegisteredInstance() - { - // Arrange - var expectedEncoder = JavaScriptEncoder.Default; - var serviceProvider = new TestServiceProvider() { Service = expectedEncoder }; - - // Act - var retVal = serviceProvider.GetJavaScriptEncoder(); - - // Assert - Assert.Same(expectedEncoder, retVal); - } - - [Fact] - public void GetUrlEncoder_ServiceProviderDoesNotHaveEncoder_UsesDefault() - { - // Arrange - var serviceProvider = new TestServiceProvider(); - - // Act - var retVal = serviceProvider.GetUrlEncoder(); - - // Assert - Assert.Same(UrlEncoder.Default, retVal); - } - - [Fact] - public void GetUrlEncoder_ServiceProviderHasEncoder_ReturnsRegisteredInstance() - { - // Arrange - var expectedEncoder = UrlEncoder.Default; - var serviceProvider = new TestServiceProvider() { Service = expectedEncoder }; - - // Act - var retVal = serviceProvider.GetUrlEncoder(); - - // Assert - Assert.Same(expectedEncoder, retVal); - } - - private class TestServiceProvider : IServiceProvider - { - public object Service { get; set; } - - public object GetService(Type serviceType) - { - return Service; - } - } - } -} diff --git a/test/Microsoft.Extensions.WebEncoders.Tests/project.json b/test/Microsoft.Extensions.WebEncoders.Tests/project.json index 4d81779a7c..62fb30b458 100644 --- a/test/Microsoft.Extensions.WebEncoders.Tests/project.json +++ b/test/Microsoft.Extensions.WebEncoders.Tests/project.json @@ -2,7 +2,6 @@ "dependencies": { "Microsoft.Extensions.DependencyInjection": "1.0.0-*", "Microsoft.Extensions.WebEncoders": "1.0.0-*", - "Newtonsoft.Json": "6.0.6", "xunit.runner.aspnet": "2.0.0-aspnet-*" }, "commands": { @@ -15,10 +14,6 @@ }, "frameworks": { "dnx451": { }, - "dnxcore50": { - "dependencies": { - "System.Text.Encoding.Extensions": "4.0.11-*" - } - } + "dnxcore50": { } } } From 984fe02eb8a32c3e67592becd024acb527010930 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Thu, 31 Dec 2015 10:53:48 -0800 Subject: [PATCH 011/169] Rename IHtmlContentBuilder.Append(IHtmlContent) to IHtmlContentBuilder.AppendHtml(IHtmlContent) Fixes #4 --- .../HtmlContentBuilder.cs | 2 +- .../HtmlContentBuilderExtensions.cs | 16 ++++++++-------- .../IHtmlContentBuilder.cs | 2 +- .../HtmlContentBuilderExtensionsTest.cs | 2 +- .../HtmlContentBuilderTest.cs | 8 ++++---- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/Microsoft.AspNet.Html.Abstractions/HtmlContentBuilder.cs b/src/Microsoft.AspNet.Html.Abstractions/HtmlContentBuilder.cs index 34e59d3318..10a50cb34d 100644 --- a/src/Microsoft.AspNet.Html.Abstractions/HtmlContentBuilder.cs +++ b/src/Microsoft.AspNet.Html.Abstractions/HtmlContentBuilder.cs @@ -67,7 +67,7 @@ namespace Microsoft.AspNet.Html } /// - public IHtmlContentBuilder Append(IHtmlContent htmlContent) + public IHtmlContentBuilder AppendHtml(IHtmlContent htmlContent) { if (htmlContent == null) { diff --git a/src/Microsoft.AspNet.Html.Abstractions/HtmlContentBuilderExtensions.cs b/src/Microsoft.AspNet.Html.Abstractions/HtmlContentBuilderExtensions.cs index 5d0b82dd5e..2ff745cdf3 100644 --- a/src/Microsoft.AspNet.Html.Abstractions/HtmlContentBuilderExtensions.cs +++ b/src/Microsoft.AspNet.Html.Abstractions/HtmlContentBuilderExtensions.cs @@ -48,7 +48,7 @@ namespace Microsoft.AspNet.Html throw new ArgumentNullException(nameof(args)); } - builder.Append(new HtmlFormatString(format, args)); + builder.AppendHtml(new HtmlFormatString(format, args)); return builder; } @@ -88,7 +88,7 @@ namespace Microsoft.AspNet.Html throw new ArgumentNullException(nameof(args)); } - builder.Append(new HtmlFormatString(formatProvider, format, args)); + builder.AppendHtml(new HtmlFormatString(formatProvider, format, args)); return builder; } @@ -104,7 +104,7 @@ namespace Microsoft.AspNet.Html throw new ArgumentNullException(nameof(builder)); } - builder.Append(HtmlEncodedString.NewLine); + builder.AppendHtml(HtmlEncodedString.NewLine); return builder; } @@ -123,7 +123,7 @@ namespace Microsoft.AspNet.Html } builder.Append(unencoded); - builder.Append(HtmlEncodedString.NewLine); + builder.AppendHtml(HtmlEncodedString.NewLine); return builder; } @@ -140,8 +140,8 @@ namespace Microsoft.AspNet.Html throw new ArgumentNullException(nameof(builder)); } - builder.Append(content); - builder.Append(HtmlEncodedString.NewLine); + builder.AppendHtml(content); + builder.AppendHtml(HtmlEncodedString.NewLine); return builder; } @@ -160,7 +160,7 @@ namespace Microsoft.AspNet.Html } builder.AppendHtml(encoded); - builder.Append(HtmlEncodedString.NewLine); + builder.AppendHtml(HtmlEncodedString.NewLine); return builder; } @@ -197,7 +197,7 @@ namespace Microsoft.AspNet.Html } builder.Clear(); - builder.Append(content); + builder.AppendHtml(content); return builder; } diff --git a/src/Microsoft.AspNet.Html.Abstractions/IHtmlContentBuilder.cs b/src/Microsoft.AspNet.Html.Abstractions/IHtmlContentBuilder.cs index de4b9ebd90..6b0a6d6571 100644 --- a/src/Microsoft.AspNet.Html.Abstractions/IHtmlContentBuilder.cs +++ b/src/Microsoft.AspNet.Html.Abstractions/IHtmlContentBuilder.cs @@ -13,7 +13,7 @@ namespace Microsoft.AspNet.Html /// /// The to append. /// The . - IHtmlContentBuilder Append(IHtmlContent content); + IHtmlContentBuilder AppendHtml(IHtmlContent content); /// /// Appends a value. The value is treated as unencoded as-provided, and will be HTML diff --git a/test/Microsoft.AspNet.Html.Abstractions.Test/HtmlContentBuilderExtensionsTest.cs b/test/Microsoft.AspNet.Html.Abstractions.Test/HtmlContentBuilderExtensionsTest.cs index 9355d507d3..ff201b494c 100644 --- a/test/Microsoft.AspNet.Html.Abstractions.Test/HtmlContentBuilderExtensionsTest.cs +++ b/test/Microsoft.AspNet.Html.Abstractions.Test/HtmlContentBuilderExtensionsTest.cs @@ -374,7 +374,7 @@ namespace Microsoft.AspNet.Html.Test return this; } - public IHtmlContentBuilder Append(IHtmlContent content) + public IHtmlContentBuilder AppendHtml(IHtmlContent content) { Entries.Add(content); return this; diff --git a/test/Microsoft.AspNet.Html.Abstractions.Test/HtmlContentBuilderTest.cs b/test/Microsoft.AspNet.Html.Abstractions.Test/HtmlContentBuilderTest.cs index 4eee28e219..c9eda50adc 100644 --- a/test/Microsoft.AspNet.Html.Abstractions.Test/HtmlContentBuilderTest.cs +++ b/test/Microsoft.AspNet.Html.Abstractions.Test/HtmlContentBuilderTest.cs @@ -65,7 +65,7 @@ namespace Microsoft.Extensions.Internal var writer = new StringWriter(); // Act - content.Append(new TestHtmlContent("Hello")); + content.AppendHtml(new TestHtmlContent("Hello")); // Assert var result = Assert.Single(content.Entries); @@ -81,7 +81,7 @@ namespace Microsoft.Extensions.Internal var content = new HtmlContentBuilder(); // Act - content.Append(new TestHtmlContent("hello")); + content.AppendHtml(new TestHtmlContent("hello")); content.Append("Test"); // Assert @@ -95,7 +95,7 @@ namespace Microsoft.Extensions.Internal { // Arrange var content = new HtmlContentBuilder(); - content.Append(new TestHtmlContent("hello")); + content.AppendHtml(new TestHtmlContent("hello")); content.Append("Test"); // Act @@ -111,7 +111,7 @@ namespace Microsoft.Extensions.Internal // Arrange var content = new HtmlContentBuilder(); var writer = new StringWriter(); - content.Append(new TestHtmlContent("Hello")); + content.AppendHtml(new TestHtmlContent("Hello")); content.Append("Test"); // Act From d113f7edc97a23993c1f8324da7bf2577f709100 Mon Sep 17 00:00:00 2001 From: Victor Hurdugaci Date: Wed, 6 Jan 2016 14:49:54 -0800 Subject: [PATCH 012/169] Build with dotnet --- .gitattributes | 1 + .gitignore | 2 + .travis.yml | 8 ++- build.cmd | 68 +++++++++---------- build.sh | 47 +++++++------ .../project.json | 12 +++- .../project.json | 13 +++- 7 files changed, 88 insertions(+), 63 deletions(-) diff --git a/.gitattributes b/.gitattributes index bdaa5ba982..66abdf279e 100644 --- a/.gitattributes +++ b/.gitattributes @@ -48,3 +48,4 @@ *.fsproj text=auto *.dbproj text=auto *.sln text=auto eol=crlf +*.sh eol=lf \ No newline at end of file diff --git a/.gitignore b/.gitignore index 329a307cda..980ee002d9 100644 --- a/.gitignore +++ b/.gitignore @@ -35,3 +35,5 @@ nuget.exe node_modules **/[Cc]ompiler/[Rr]esources/**/*.js *launchSettings.json +.build/ +.testPublish/ \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index c0befaffcf..e8f77f0f14 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,9 +10,11 @@ addons: - libssl-dev - libunwind8 - zlib1g -env: - - KOREBUILD_DNU_RESTORE_CORECLR=true KOREBUILD_TEST_DNXCORE=true mono: - 4.0.5 +os: + - linux + - osx +osx_image: xcode7.1 script: - - ./build.sh --quiet verify + - ./build.sh --quiet verify \ No newline at end of file diff --git a/build.cmd b/build.cmd index 553e3929a0..65fb3e3353 100644 --- a/build.cmd +++ b/build.cmd @@ -1,40 +1,40 @@ -@echo off -cd %~dp0 - +@ECHO off SETLOCAL + +SET REPO_FOLDER=%~dp0 +CD "%REPO_FOLDER%" + +SET BUILD_FOLDER=.build +SET KOREBUILD_FOLDER=%BUILD_FOLDER%\KoreBuild-dotnet +SET KOREBUILD_VERSION= + +SET NUGET_PATH=%BUILD_FOLDER%\NuGet.exe SET NUGET_VERSION=latest SET CACHED_NUGET=%LocalAppData%\NuGet\nuget.%NUGET_VERSION%.exe -SET BUILDCMD_KOREBUILD_VERSION= -SET BUILDCMD_DNX_VERSION= -IF EXIST %CACHED_NUGET% goto copynuget -echo Downloading latest version of NuGet.exe... -IF NOT EXIST %LocalAppData%\NuGet md %LocalAppData%\NuGet -@powershell -NoProfile -ExecutionPolicy unrestricted -Command "$ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest 'https://dist.nuget.org/win-x86-commandline/%NUGET_VERSION%/nuget.exe' -OutFile '%CACHED_NUGET%'" - -:copynuget -IF EXIST .nuget\nuget.exe goto restore -md .nuget -copy %CACHED_NUGET% .nuget\nuget.exe > nul - -:restore -IF EXIST packages\Sake goto getdnx -IF "%BUILDCMD_KOREBUILD_VERSION%"=="" ( - .nuget\nuget.exe install KoreBuild -ExcludeVersion -o packages -nocache -pre -) ELSE ( - .nuget\nuget.exe install KoreBuild -version %BUILDCMD_KOREBUILD_VERSION% -ExcludeVersion -o packages -nocache -pre -) -.nuget\NuGet.exe install Sake -ExcludeVersion -Source https://www.nuget.org/api/v2/ -Out packages - -:getdnx -IF "%BUILDCMD_DNX_VERSION%"=="" ( - SET BUILDCMD_DNX_VERSION=latest -) -IF "%SKIP_DNX_INSTALL%"=="" ( - CALL packages\KoreBuild\build\dnvm install %BUILDCMD_DNX_VERSION% -runtime CoreCLR -arch x86 -alias default - CALL packages\KoreBuild\build\dnvm install default -runtime CLR -arch x86 -alias default -) ELSE ( - CALL packages\KoreBuild\build\dnvm use default -runtime CLR -arch x86 +IF NOT EXIST %BUILD_FOLDER% ( + md %BUILD_FOLDER% ) -packages\Sake\tools\Sake.exe -I packages\KoreBuild\build -f makefile.shade %* +IF NOT EXIST %NUGET_PATH% ( + IF NOT EXIST %CACHED_NUGET% ( + echo Downloading latest version of NuGet.exe... + IF NOT EXIST %LocalAppData%\NuGet ( + md %LocalAppData%\NuGet + ) + @powershell -NoProfile -ExecutionPolicy unrestricted -Command "$ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest 'https://dist.nuget.org/win-x86-commandline/%NUGET_VERSION%/nuget.exe' -OutFile '%CACHED_NUGET%'" + ) + + copy %CACHED_NUGET% %NUGET_PATH% > nul +) + +IF NOT EXIST %KOREBUILD_FOLDER% ( + SET KOREBUILD_DOWNLOAD_ARGS= + IF NOT "%KOREBUILD_VERSION%"=="" ( + SET KOREBUILD_DOWNLOAD_ARGS=-version %KOREBUILD_VERSION% + ) + + %BUILD_FOLDER%\nuget.exe install KoreBuild-dotnet -ExcludeVersion -o %BUILD_FOLDER% -nocache -pre %KOREBUILD_DOWNLOAD_ARGS% +) + +"%KOREBUILD_FOLDER%\build\KoreBuild.cmd" %* diff --git a/build.sh b/build.sh index da4e3fcd1c..7b5e25e3a8 100755 --- a/build.sh +++ b/build.sh @@ -1,5 +1,18 @@ #!/usr/bin/env bash +SOURCE="${BASH_SOURCE[0]}" +while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink + DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" + SOURCE="$(readlink "$SOURCE")" + [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located +done +repoFolder="$( cd -P "$( dirname "$SOURCE" )" && pwd )" + +buildFolder=.build +koreBuildFolder=$buildFolder/KoreBuild-dotnet + +nugetPath=$buildFolder/nuget.exe + if test `uname` = Darwin; then cachedir=~/Library/Caches/KBuild else @@ -11,33 +24,25 @@ else fi mkdir -p $cachedir nugetVersion=latest -cachePath=$cachedir/nuget.$nugetVersion.exe +cacheNuget=$cachedir/nuget.$nugetVersion.exe -url=https://dist.nuget.org/win-x86-commandline/$nugetVersion/nuget.exe +nugetUrl=https://dist.nuget.org/win-x86-commandline/$nugetVersion/nuget.exe -if test ! -f $cachePath; then - wget -O $cachePath $url 2>/dev/null || curl -o $cachePath --location $url /dev/null +if test ! -d $buildFolder; then + mkdir $buildFolder fi -if test ! -e .nuget; then - mkdir .nuget - cp $cachePath .nuget/nuget.exe +if test ! -f $nugetPath; then + if test ! -f $cacheNuget; then + wget -O $cacheNuget $nugetUrl 2>/dev/null || curl -o $cacheNuget --location $nugetUrl /dev/null + fi + + cp $cacheNuget $nugetPath fi -if test ! -d packages/Sake; then - mono .nuget/nuget.exe install KoreBuild -ExcludeVersion -o packages -nocache -pre - mono .nuget/nuget.exe install Sake -ExcludeVersion -Source https://www.nuget.org/api/v2/ -Out packages +if test ! -d $koreBuildFolder; then + mono $nugetPath install KoreBuild-dotnet -ExcludeVersion -o $buildFolder -nocache -pre fi -if ! type dnvm > /dev/null 2>&1; then - source packages/KoreBuild/build/dnvm.sh -fi +source $koreBuildFolder/build/KoreBuild.sh -if ! type dnx > /dev/null 2>&1 || [ -z "$SKIP_DNX_INSTALL" ]; then - dnvm install latest -runtime coreclr -alias default - dnvm install default -runtime mono -alias default -else - dnvm use default -runtime mono -fi - -mono packages/Sake/tools/Sake.exe -I packages/KoreBuild/build -f makefile.shade "$@" diff --git a/test/Microsoft.AspNet.Html.Abstractions.Test/project.json b/test/Microsoft.AspNet.Html.Abstractions.Test/project.json index e3035cbf59..8adc45cf51 100644 --- a/test/Microsoft.AspNet.Html.Abstractions.Test/project.json +++ b/test/Microsoft.AspNet.Html.Abstractions.Test/project.json @@ -7,16 +7,22 @@ "Microsoft.AspNet.Html.Abstractions": "1.0.0-*", "Microsoft.AspNet.Testing": "1.0.0-*", "Microsoft.Extensions.WebEncoders": "1.0.0-*", - "xunit.runner.aspnet": "2.0.0-aspnet-*" + "xunit": "2.1.0" }, + "testRunner": "xunit", "commands": { "test": "xunit.runner.aspnet" }, "frameworks": { - "dnx451": { }, + "dnx451": { + "dependencies": { + "xunit.runner.console": "2.1.0" + } + }, "dnxcore50": { "dependencies": { - "System.Runtime": "4.0.21-*" + "System.Runtime": "4.0.21-*", + "xunit.runner.aspnet": "2.0.0-aspnet-*" } } } diff --git a/test/Microsoft.Extensions.WebEncoders.Tests/project.json b/test/Microsoft.Extensions.WebEncoders.Tests/project.json index 62fb30b458..c588c7a29e 100644 --- a/test/Microsoft.Extensions.WebEncoders.Tests/project.json +++ b/test/Microsoft.Extensions.WebEncoders.Tests/project.json @@ -4,6 +4,7 @@ "Microsoft.Extensions.WebEncoders": "1.0.0-*", "xunit.runner.aspnet": "2.0.0-aspnet-*" }, + "testRunner": "xunit", "commands": { "test": "xunit.runner.aspnet" }, @@ -13,7 +14,15 @@ "keyFile": "../../tools/Key.snk" }, "frameworks": { - "dnx451": { }, - "dnxcore50": { } + "dnx451": { + "dependencies": { + "xunit.runner.console": "2.1.0" + } + }, + "dnxcore50": { + "dependencies": { + "xunit.runner.aspnet": "2.0.0-aspnet-*" + } + } } } From c564dfd20241e5f4eb81367ac5cc8ad494028773 Mon Sep 17 00:00:00 2001 From: "N. Taylor Mullen" Date: Fri, 22 Jan 2016 12:19:22 -0800 Subject: [PATCH 013/169] Rename AspNet 5 folders and files. See https://github.com/aspnet/Announcements/issues/144 for more information. --- .../HtmlContentBuilder.cs | 0 .../HtmlContentBuilderExtensions.cs | 0 .../HtmlEncodedString.cs | 0 .../HtmlTextWriter.cs | 0 .../IHtmlContent.cs | 0 .../IHtmlContentBuilder.cs | 0 .../Microsoft.AspNetCore.Html.Abstractions.xproj} | 0 .../Properties/AssemblyInfo.cs | 0 .../project.json | 0 .../HtmlContentBuilderExtensionsTest.cs | 0 .../HtmlContentBuilderTest.cs | 0 .../Microsoft.AspNetCore.Html.Abstractions.Test.xproj} | 0 .../project.json | 0 13 files changed, 0 insertions(+), 0 deletions(-) rename src/{Microsoft.AspNet.Html.Abstractions => Microsoft.AspNetCore.Html.Abstractions}/HtmlContentBuilder.cs (100%) rename src/{Microsoft.AspNet.Html.Abstractions => Microsoft.AspNetCore.Html.Abstractions}/HtmlContentBuilderExtensions.cs (100%) rename src/{Microsoft.AspNet.Html.Abstractions => Microsoft.AspNetCore.Html.Abstractions}/HtmlEncodedString.cs (100%) rename src/{Microsoft.AspNet.Html.Abstractions => Microsoft.AspNetCore.Html.Abstractions}/HtmlTextWriter.cs (100%) rename src/{Microsoft.AspNet.Html.Abstractions => Microsoft.AspNetCore.Html.Abstractions}/IHtmlContent.cs (100%) rename src/{Microsoft.AspNet.Html.Abstractions => Microsoft.AspNetCore.Html.Abstractions}/IHtmlContentBuilder.cs (100%) rename src/{Microsoft.AspNet.Html.Abstractions/Microsoft.AspNet.Html.Abstractions.xproj => Microsoft.AspNetCore.Html.Abstractions/Microsoft.AspNetCore.Html.Abstractions.xproj} (100%) rename src/{Microsoft.AspNet.Html.Abstractions => Microsoft.AspNetCore.Html.Abstractions}/Properties/AssemblyInfo.cs (100%) rename src/{Microsoft.AspNet.Html.Abstractions => Microsoft.AspNetCore.Html.Abstractions}/project.json (100%) rename test/{Microsoft.AspNet.Html.Abstractions.Test => Microsoft.AspNetCore.Html.Abstractions.Test}/HtmlContentBuilderExtensionsTest.cs (100%) rename test/{Microsoft.AspNet.Html.Abstractions.Test => Microsoft.AspNetCore.Html.Abstractions.Test}/HtmlContentBuilderTest.cs (100%) rename test/{Microsoft.AspNet.Html.Abstractions.Test/Microsoft.AspNet.Html.Abstractions.Test.xproj => Microsoft.AspNetCore.Html.Abstractions.Test/Microsoft.AspNetCore.Html.Abstractions.Test.xproj} (100%) rename test/{Microsoft.AspNet.Html.Abstractions.Test => Microsoft.AspNetCore.Html.Abstractions.Test}/project.json (100%) diff --git a/src/Microsoft.AspNet.Html.Abstractions/HtmlContentBuilder.cs b/src/Microsoft.AspNetCore.Html.Abstractions/HtmlContentBuilder.cs similarity index 100% rename from src/Microsoft.AspNet.Html.Abstractions/HtmlContentBuilder.cs rename to src/Microsoft.AspNetCore.Html.Abstractions/HtmlContentBuilder.cs diff --git a/src/Microsoft.AspNet.Html.Abstractions/HtmlContentBuilderExtensions.cs b/src/Microsoft.AspNetCore.Html.Abstractions/HtmlContentBuilderExtensions.cs similarity index 100% rename from src/Microsoft.AspNet.Html.Abstractions/HtmlContentBuilderExtensions.cs rename to src/Microsoft.AspNetCore.Html.Abstractions/HtmlContentBuilderExtensions.cs diff --git a/src/Microsoft.AspNet.Html.Abstractions/HtmlEncodedString.cs b/src/Microsoft.AspNetCore.Html.Abstractions/HtmlEncodedString.cs similarity index 100% rename from src/Microsoft.AspNet.Html.Abstractions/HtmlEncodedString.cs rename to src/Microsoft.AspNetCore.Html.Abstractions/HtmlEncodedString.cs diff --git a/src/Microsoft.AspNet.Html.Abstractions/HtmlTextWriter.cs b/src/Microsoft.AspNetCore.Html.Abstractions/HtmlTextWriter.cs similarity index 100% rename from src/Microsoft.AspNet.Html.Abstractions/HtmlTextWriter.cs rename to src/Microsoft.AspNetCore.Html.Abstractions/HtmlTextWriter.cs diff --git a/src/Microsoft.AspNet.Html.Abstractions/IHtmlContent.cs b/src/Microsoft.AspNetCore.Html.Abstractions/IHtmlContent.cs similarity index 100% rename from src/Microsoft.AspNet.Html.Abstractions/IHtmlContent.cs rename to src/Microsoft.AspNetCore.Html.Abstractions/IHtmlContent.cs diff --git a/src/Microsoft.AspNet.Html.Abstractions/IHtmlContentBuilder.cs b/src/Microsoft.AspNetCore.Html.Abstractions/IHtmlContentBuilder.cs similarity index 100% rename from src/Microsoft.AspNet.Html.Abstractions/IHtmlContentBuilder.cs rename to src/Microsoft.AspNetCore.Html.Abstractions/IHtmlContentBuilder.cs diff --git a/src/Microsoft.AspNet.Html.Abstractions/Microsoft.AspNet.Html.Abstractions.xproj b/src/Microsoft.AspNetCore.Html.Abstractions/Microsoft.AspNetCore.Html.Abstractions.xproj similarity index 100% rename from src/Microsoft.AspNet.Html.Abstractions/Microsoft.AspNet.Html.Abstractions.xproj rename to src/Microsoft.AspNetCore.Html.Abstractions/Microsoft.AspNetCore.Html.Abstractions.xproj diff --git a/src/Microsoft.AspNet.Html.Abstractions/Properties/AssemblyInfo.cs b/src/Microsoft.AspNetCore.Html.Abstractions/Properties/AssemblyInfo.cs similarity index 100% rename from src/Microsoft.AspNet.Html.Abstractions/Properties/AssemblyInfo.cs rename to src/Microsoft.AspNetCore.Html.Abstractions/Properties/AssemblyInfo.cs diff --git a/src/Microsoft.AspNet.Html.Abstractions/project.json b/src/Microsoft.AspNetCore.Html.Abstractions/project.json similarity index 100% rename from src/Microsoft.AspNet.Html.Abstractions/project.json rename to src/Microsoft.AspNetCore.Html.Abstractions/project.json diff --git a/test/Microsoft.AspNet.Html.Abstractions.Test/HtmlContentBuilderExtensionsTest.cs b/test/Microsoft.AspNetCore.Html.Abstractions.Test/HtmlContentBuilderExtensionsTest.cs similarity index 100% rename from test/Microsoft.AspNet.Html.Abstractions.Test/HtmlContentBuilderExtensionsTest.cs rename to test/Microsoft.AspNetCore.Html.Abstractions.Test/HtmlContentBuilderExtensionsTest.cs diff --git a/test/Microsoft.AspNet.Html.Abstractions.Test/HtmlContentBuilderTest.cs b/test/Microsoft.AspNetCore.Html.Abstractions.Test/HtmlContentBuilderTest.cs similarity index 100% rename from test/Microsoft.AspNet.Html.Abstractions.Test/HtmlContentBuilderTest.cs rename to test/Microsoft.AspNetCore.Html.Abstractions.Test/HtmlContentBuilderTest.cs diff --git a/test/Microsoft.AspNet.Html.Abstractions.Test/Microsoft.AspNet.Html.Abstractions.Test.xproj b/test/Microsoft.AspNetCore.Html.Abstractions.Test/Microsoft.AspNetCore.Html.Abstractions.Test.xproj similarity index 100% rename from test/Microsoft.AspNet.Html.Abstractions.Test/Microsoft.AspNet.Html.Abstractions.Test.xproj rename to test/Microsoft.AspNetCore.Html.Abstractions.Test/Microsoft.AspNetCore.Html.Abstractions.Test.xproj diff --git a/test/Microsoft.AspNet.Html.Abstractions.Test/project.json b/test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json similarity index 100% rename from test/Microsoft.AspNet.Html.Abstractions.Test/project.json rename to test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json From 79558ae8d3633f1fd9045239bf21286e50159fe4 Mon Sep 17 00:00:00 2001 From: "N. Taylor Mullen" Date: Fri, 22 Jan 2016 12:19:23 -0800 Subject: [PATCH 014/169] Rename AspNet 5 file contents. See https://github.com/aspnet/Announcements/issues/144 for more information. --- HtmlAbstractions.sln | 4 ++-- NuGetPackageVerifier.json | 2 +- .../HtmlContentBuilder.cs | 4 ++-- .../HtmlContentBuilderExtensions.cs | 2 +- .../HtmlEncodedString.cs | 4 ++-- src/Microsoft.AspNetCore.Html.Abstractions/HtmlTextWriter.cs | 4 ++-- src/Microsoft.AspNetCore.Html.Abstractions/IHtmlContent.cs | 2 +- .../IHtmlContentBuilder.cs | 4 ++-- .../Microsoft.AspNetCore.Html.Abstractions.xproj | 4 ++-- .../Properties/AssemblyInfo.cs | 2 +- .../HtmlContentBuilderExtensionsTest.cs | 4 ++-- .../HtmlContentBuilderTest.cs | 2 +- .../Microsoft.AspNetCore.Html.Abstractions.Test.xproj | 4 ++-- test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json | 4 ++-- 14 files changed, 23 insertions(+), 23 deletions(-) diff --git a/HtmlAbstractions.sln b/HtmlAbstractions.sln index a45f34a265..81189bb447 100644 --- a/HtmlAbstractions.sln +++ b/HtmlAbstractions.sln @@ -6,9 +6,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{A5A15F1C-885 EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{F31FF137-390C-49BF-A3BD-7C6ED3597C21}" EndProject -Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNet.Html.Abstractions", "src\Microsoft.AspNet.Html.Abstractions\Microsoft.AspNet.Html.Abstractions.xproj", "{68A28E4A-3ADE-4187-9625-4FF185887CB3}" +Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNetCore.Html.Abstractions", "src\Microsoft.AspNetCore.Html.Abstractions\Microsoft.AspNetCore.Html.Abstractions.xproj", "{68A28E4A-3ADE-4187-9625-4FF185887CB3}" EndProject -Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNet.Html.Abstractions.Test", "test\Microsoft.AspNet.Html.Abstractions.Test\Microsoft.AspNet.Html.Abstractions.Test.xproj", "{2D187B88-94BD-4A39-AC97-F8F8B9363301}" +Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNetCore.Html.Abstractions.Test", "test\Microsoft.AspNetCore.Html.Abstractions.Test\Microsoft.AspNetCore.Html.Abstractions.Test.xproj", "{2D187B88-94BD-4A39-AC97-F8F8B9363301}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{B4962A29-BE69-4A18-9B4F-B803EEE31EAA}" ProjectSection(SolutionItems) = preProject diff --git a/NuGetPackageVerifier.json b/NuGetPackageVerifier.json index 31f9437602..d9dea7c8ac 100644 --- a/NuGetPackageVerifier.json +++ b/NuGetPackageVerifier.json @@ -9,7 +9,7 @@ "StrictSemanticVersionValidationRule" ], "packages": { - "Microsoft.AspNet.Html.Abstractions": { }, + "Microsoft.AspNetCore.Html.Abstractions": { }, "Microsoft.Extensions.WebEncoders": { } } }, diff --git a/src/Microsoft.AspNetCore.Html.Abstractions/HtmlContentBuilder.cs b/src/Microsoft.AspNetCore.Html.Abstractions/HtmlContentBuilder.cs index 10a50cb34d..b79e400375 100644 --- a/src/Microsoft.AspNetCore.Html.Abstractions/HtmlContentBuilder.cs +++ b/src/Microsoft.AspNetCore.Html.Abstractions/HtmlContentBuilder.cs @@ -1,4 +1,4 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; @@ -6,7 +6,7 @@ using System.Collections.Generic; using System.IO; using System.Text.Encodings.Web; -namespace Microsoft.AspNet.Html +namespace Microsoft.AspNetCore.Html { /// /// An implementation using an in memory list. diff --git a/src/Microsoft.AspNetCore.Html.Abstractions/HtmlContentBuilderExtensions.cs b/src/Microsoft.AspNetCore.Html.Abstractions/HtmlContentBuilderExtensions.cs index 2ff745cdf3..aaba4faefb 100644 --- a/src/Microsoft.AspNetCore.Html.Abstractions/HtmlContentBuilderExtensions.cs +++ b/src/Microsoft.AspNetCore.Html.Abstractions/HtmlContentBuilderExtensions.cs @@ -7,7 +7,7 @@ using System.Globalization; using System.IO; using System.Text.Encodings.Web; -namespace Microsoft.AspNet.Html +namespace Microsoft.AspNetCore.Html { /// /// Extension methods for . diff --git a/src/Microsoft.AspNetCore.Html.Abstractions/HtmlEncodedString.cs b/src/Microsoft.AspNetCore.Html.Abstractions/HtmlEncodedString.cs index e5c4ab5003..c50fba890c 100644 --- a/src/Microsoft.AspNetCore.Html.Abstractions/HtmlEncodedString.cs +++ b/src/Microsoft.AspNetCore.Html.Abstractions/HtmlEncodedString.cs @@ -1,11 +1,11 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.IO; using System.Text.Encodings.Web; -namespace Microsoft.AspNet.Html +namespace Microsoft.AspNetCore.Html { /// /// An implementation that wraps an HTML encoded . diff --git a/src/Microsoft.AspNetCore.Html.Abstractions/HtmlTextWriter.cs b/src/Microsoft.AspNetCore.Html.Abstractions/HtmlTextWriter.cs index 56633f527d..c9158b49b6 100644 --- a/src/Microsoft.AspNetCore.Html.Abstractions/HtmlTextWriter.cs +++ b/src/Microsoft.AspNetCore.Html.Abstractions/HtmlTextWriter.cs @@ -1,9 +1,9 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.IO; -namespace Microsoft.AspNet.Html +namespace Microsoft.AspNetCore.Html { /// /// A which supports special processing of . diff --git a/src/Microsoft.AspNetCore.Html.Abstractions/IHtmlContent.cs b/src/Microsoft.AspNetCore.Html.Abstractions/IHtmlContent.cs index 0e21889d54..2e9a0f19e2 100644 --- a/src/Microsoft.AspNetCore.Html.Abstractions/IHtmlContent.cs +++ b/src/Microsoft.AspNetCore.Html.Abstractions/IHtmlContent.cs @@ -4,7 +4,7 @@ using System.IO; using System.Text.Encodings.Web; -namespace Microsoft.AspNet.Html +namespace Microsoft.AspNetCore.Html { /// /// HTML content which can be written to a TextWriter. diff --git a/src/Microsoft.AspNetCore.Html.Abstractions/IHtmlContentBuilder.cs b/src/Microsoft.AspNetCore.Html.Abstractions/IHtmlContentBuilder.cs index 6b0a6d6571..978fedc03f 100644 --- a/src/Microsoft.AspNetCore.Html.Abstractions/IHtmlContentBuilder.cs +++ b/src/Microsoft.AspNetCore.Html.Abstractions/IHtmlContentBuilder.cs @@ -1,7 +1,7 @@ -// Copyright (c) .NET Foundation. All rights reserved. +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -namespace Microsoft.AspNet.Html +namespace Microsoft.AspNetCore.Html { /// /// A builder for HTML content. diff --git a/src/Microsoft.AspNetCore.Html.Abstractions/Microsoft.AspNetCore.Html.Abstractions.xproj b/src/Microsoft.AspNetCore.Html.Abstractions/Microsoft.AspNetCore.Html.Abstractions.xproj index 564c800504..df229c75eb 100644 --- a/src/Microsoft.AspNetCore.Html.Abstractions/Microsoft.AspNetCore.Html.Abstractions.xproj +++ b/src/Microsoft.AspNetCore.Html.Abstractions/Microsoft.AspNetCore.Html.Abstractions.xproj @@ -1,4 +1,4 @@ - + 14.0 @@ -7,7 +7,7 @@ 68a28e4a-3ade-4187-9625-4ff185887cb3 - Microsoft.AspNet.Html.Abstractions + Microsoft.AspNetCore.Html.Abstractions ..\..\artifacts\obj\$(MSBuildProjectName) ..\..\artifacts\bin\$(MSBuildProjectName)\ diff --git a/src/Microsoft.AspNetCore.Html.Abstractions/Properties/AssemblyInfo.cs b/src/Microsoft.AspNetCore.Html.Abstractions/Properties/AssemblyInfo.cs index d310306c25..72210dd611 100644 --- a/src/Microsoft.AspNetCore.Html.Abstractions/Properties/AssemblyInfo.cs +++ b/src/Microsoft.AspNetCore.Html.Abstractions/Properties/AssemblyInfo.cs @@ -7,4 +7,4 @@ using System.Runtime.CompilerServices; [assembly: AssemblyMetadata("Serviceable", "True")] [assembly: NeutralResourcesLanguage("en-us")] -[assembly: InternalsVisibleTo("Microsoft.AspNet.Html.Abstractions.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] \ No newline at end of file +[assembly: InternalsVisibleTo("Microsoft.AspNetCore.Html.Abstractions.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] \ No newline at end of file diff --git a/test/Microsoft.AspNetCore.Html.Abstractions.Test/HtmlContentBuilderExtensionsTest.cs b/test/Microsoft.AspNetCore.Html.Abstractions.Test/HtmlContentBuilderExtensionsTest.cs index ff201b494c..6b4307f690 100644 --- a/test/Microsoft.AspNetCore.Html.Abstractions.Test/HtmlContentBuilderExtensionsTest.cs +++ b/test/Microsoft.AspNetCore.Html.Abstractions.Test/HtmlContentBuilderExtensionsTest.cs @@ -6,11 +6,11 @@ using System.Collections.Generic; using System.Globalization; using System.IO; using System.Text.Encodings.Web; -using Microsoft.AspNet.Testing; +using Microsoft.AspNetCore.Testing; using Microsoft.Extensions.WebEncoders.Testing; using Xunit; -namespace Microsoft.AspNet.Html.Test +namespace Microsoft.AspNetCore.Html.Test { public class HtmlContentBuilderExtensionsTest { diff --git a/test/Microsoft.AspNetCore.Html.Abstractions.Test/HtmlContentBuilderTest.cs b/test/Microsoft.AspNetCore.Html.Abstractions.Test/HtmlContentBuilderTest.cs index c9eda50adc..901512fdad 100644 --- a/test/Microsoft.AspNetCore.Html.Abstractions.Test/HtmlContentBuilderTest.cs +++ b/test/Microsoft.AspNetCore.Html.Abstractions.Test/HtmlContentBuilderTest.cs @@ -3,7 +3,7 @@ using System.IO; using System.Text.Encodings.Web; -using Microsoft.AspNet.Html; +using Microsoft.AspNetCore.Html; using Microsoft.Extensions.WebEncoders.Testing; using Xunit; diff --git a/test/Microsoft.AspNetCore.Html.Abstractions.Test/Microsoft.AspNetCore.Html.Abstractions.Test.xproj b/test/Microsoft.AspNetCore.Html.Abstractions.Test/Microsoft.AspNetCore.Html.Abstractions.Test.xproj index 4a03567677..f699a1c4dc 100644 --- a/test/Microsoft.AspNetCore.Html.Abstractions.Test/Microsoft.AspNetCore.Html.Abstractions.Test.xproj +++ b/test/Microsoft.AspNetCore.Html.Abstractions.Test/Microsoft.AspNetCore.Html.Abstractions.Test.xproj @@ -1,4 +1,4 @@ - + 14.0 @@ -7,7 +7,7 @@ 2d187b88-94bd-4a39-ac97-f8f8b9363301 - Microsoft.AspNet.Html.Abstractions.Test + Microsoft.AspNetCore.Html.Abstractions.Test ..\..\artifacts\obj\$(MSBuildProjectName) ..\..\artifacts\bin\$(MSBuildProjectName)\ diff --git a/test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json b/test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json index 8adc45cf51..d796493c0a 100644 --- a/test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json +++ b/test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json @@ -4,8 +4,8 @@ "keyFile": "../../tools/Key.snk" }, "dependencies": { - "Microsoft.AspNet.Html.Abstractions": "1.0.0-*", - "Microsoft.AspNet.Testing": "1.0.0-*", + "Microsoft.AspNetCore.Html.Abstractions": "1.0.0-*", + "Microsoft.AspNetCore.Testing": "1.0.0-*", "Microsoft.Extensions.WebEncoders": "1.0.0-*", "xunit": "2.1.0" }, From 33629c5fc07604227d251e5ddcae55f49ae14219 Mon Sep 17 00:00:00 2001 From: John Luo Date: Mon, 1 Feb 2016 17:04:37 -0800 Subject: [PATCH 015/169] Updating to new CLI --- src/Microsoft.AspNetCore.Html.Abstractions/project.json | 6 ++++-- src/Microsoft.Extensions.WebEncoders/project.json | 5 ++++- .../project.json | 3 ++- test/Microsoft.Extensions.WebEncoders.Tests/project.json | 3 ++- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/Microsoft.AspNetCore.Html.Abstractions/project.json b/src/Microsoft.AspNetCore.Html.Abstractions/project.json index 55cc30d9b1..03334e45aa 100644 --- a/src/Microsoft.AspNetCore.Html.Abstractions/project.json +++ b/src/Microsoft.AspNetCore.Html.Abstractions/project.json @@ -10,7 +10,8 @@ "keyFile": "../../tools/Key.snk" }, "dependencies": { - "System.Text.Encodings.Web": "4.0.0-*" + "System.Text.Encodings.Web": "4.0.0-*", + "Microsoft.NETCore.Platforms": "1.0.1-*" }, "frameworks": { "net451": { @@ -23,7 +24,8 @@ "dependencies": { "System.Collections": "4.0.11-*", "System.Resources.ResourceManager": "4.0.1-*" - } + }, + "imports": "portable-net451+win8" } } } diff --git a/src/Microsoft.Extensions.WebEncoders/project.json b/src/Microsoft.Extensions.WebEncoders/project.json index 0facfeeb8c..f56cd3d4b6 100644 --- a/src/Microsoft.Extensions.WebEncoders/project.json +++ b/src/Microsoft.Extensions.WebEncoders/project.json @@ -13,6 +13,7 @@ "dependencies": { "Microsoft.Extensions.DependencyInjection.Abstractions": "1.0.0-*", "Microsoft.Extensions.Options": "1.0.0-*", + "Microsoft.NETCore.Platforms": "1.0.1-*", "System.Text.Encodings.Web": "4.0.0-*" }, "frameworks": { @@ -22,6 +23,8 @@ "System.Runtime": "" } }, - "dotnet5.4": {} + "dotnet5.4": { + "imports": "portable-net451+win8" + } } } diff --git a/test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json b/test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json index d796493c0a..7e104bae8d 100644 --- a/test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json +++ b/test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json @@ -23,7 +23,8 @@ "dependencies": { "System.Runtime": "4.0.21-*", "xunit.runner.aspnet": "2.0.0-aspnet-*" - } + }, + "imports": "portable-net451+win8" } } } diff --git a/test/Microsoft.Extensions.WebEncoders.Tests/project.json b/test/Microsoft.Extensions.WebEncoders.Tests/project.json index c588c7a29e..ebfb18cf96 100644 --- a/test/Microsoft.Extensions.WebEncoders.Tests/project.json +++ b/test/Microsoft.Extensions.WebEncoders.Tests/project.json @@ -22,7 +22,8 @@ "dnxcore50": { "dependencies": { "xunit.runner.aspnet": "2.0.0-aspnet-*" - } + }, + "imports": "portable-net451+win8" } } } From 2fd1490c4acb6017e0811bad655e601782575d57 Mon Sep 17 00:00:00 2001 From: John Luo Date: Mon, 1 Feb 2016 18:33:21 -0800 Subject: [PATCH 016/169] Relocating dependencies --- src/Microsoft.AspNetCore.Html.Abstractions/project.json | 6 ++---- src/Microsoft.Extensions.WebEncoders/project.json | 5 +---- .../project.json | 1 + test/Microsoft.Extensions.WebEncoders.Tests/project.json | 1 + 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/Microsoft.AspNetCore.Html.Abstractions/project.json b/src/Microsoft.AspNetCore.Html.Abstractions/project.json index 03334e45aa..55cc30d9b1 100644 --- a/src/Microsoft.AspNetCore.Html.Abstractions/project.json +++ b/src/Microsoft.AspNetCore.Html.Abstractions/project.json @@ -10,8 +10,7 @@ "keyFile": "../../tools/Key.snk" }, "dependencies": { - "System.Text.Encodings.Web": "4.0.0-*", - "Microsoft.NETCore.Platforms": "1.0.1-*" + "System.Text.Encodings.Web": "4.0.0-*" }, "frameworks": { "net451": { @@ -24,8 +23,7 @@ "dependencies": { "System.Collections": "4.0.11-*", "System.Resources.ResourceManager": "4.0.1-*" - }, - "imports": "portable-net451+win8" + } } } } diff --git a/src/Microsoft.Extensions.WebEncoders/project.json b/src/Microsoft.Extensions.WebEncoders/project.json index f56cd3d4b6..0facfeeb8c 100644 --- a/src/Microsoft.Extensions.WebEncoders/project.json +++ b/src/Microsoft.Extensions.WebEncoders/project.json @@ -13,7 +13,6 @@ "dependencies": { "Microsoft.Extensions.DependencyInjection.Abstractions": "1.0.0-*", "Microsoft.Extensions.Options": "1.0.0-*", - "Microsoft.NETCore.Platforms": "1.0.1-*", "System.Text.Encodings.Web": "4.0.0-*" }, "frameworks": { @@ -23,8 +22,6 @@ "System.Runtime": "" } }, - "dotnet5.4": { - "imports": "portable-net451+win8" - } + "dotnet5.4": {} } } diff --git a/test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json b/test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json index 7e104bae8d..2d2e1345d4 100644 --- a/test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json +++ b/test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json @@ -7,6 +7,7 @@ "Microsoft.AspNetCore.Html.Abstractions": "1.0.0-*", "Microsoft.AspNetCore.Testing": "1.0.0-*", "Microsoft.Extensions.WebEncoders": "1.0.0-*", + "Microsoft.NETCore.Platforms": "1.0.1-*", "xunit": "2.1.0" }, "testRunner": "xunit", diff --git a/test/Microsoft.Extensions.WebEncoders.Tests/project.json b/test/Microsoft.Extensions.WebEncoders.Tests/project.json index ebfb18cf96..62a6a59ec0 100644 --- a/test/Microsoft.Extensions.WebEncoders.Tests/project.json +++ b/test/Microsoft.Extensions.WebEncoders.Tests/project.json @@ -2,6 +2,7 @@ "dependencies": { "Microsoft.Extensions.DependencyInjection": "1.0.0-*", "Microsoft.Extensions.WebEncoders": "1.0.0-*", + "Microsoft.NETCore.Platforms": "1.0.1-*", "xunit.runner.aspnet": "2.0.0-aspnet-*" }, "testRunner": "xunit", From 9959601c4b07bd5e170975b900293bd3beb13e2a Mon Sep 17 00:00:00 2001 From: "N. Taylor Mullen" Date: Fri, 5 Feb 2016 17:20:53 -0800 Subject: [PATCH 017/169] Update project.json to remove redundant System.Runtime dependency. - This package is pulled in transitively. --- test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json | 1 - 1 file changed, 1 deletion(-) diff --git a/test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json b/test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json index 2d2e1345d4..f27a4cd094 100644 --- a/test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json +++ b/test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json @@ -22,7 +22,6 @@ }, "dnxcore50": { "dependencies": { - "System.Runtime": "4.0.21-*", "xunit.runner.aspnet": "2.0.0-aspnet-*" }, "imports": "portable-net451+win8" From 3fa76b26c89190d818974b6112b914dd8aae2477 Mon Sep 17 00:00:00 2001 From: Kiran Challa Date: Tue, 9 Feb 2016 22:23:47 -0800 Subject: [PATCH 018/169] Enable tests to run using dotnet xunit runner --- .../project.json | 15 ++++++--------- .../project.json | 17 +++++++---------- 2 files changed, 13 insertions(+), 19 deletions(-) diff --git a/test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json b/test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json index f27a4cd094..ff91514fd4 100644 --- a/test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json +++ b/test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json @@ -11,20 +11,17 @@ "xunit": "2.1.0" }, "testRunner": "xunit", - "commands": { - "test": "xunit.runner.aspnet" - }, "frameworks": { - "dnx451": { - "dependencies": { - "xunit.runner.console": "2.1.0" - } - }, "dnxcore50": { "dependencies": { - "xunit.runner.aspnet": "2.0.0-aspnet-*" + "dotnet-test-xunit": "1.0.0-dev-*" }, "imports": "portable-net451+win8" + }, + "dnx451": { + "dependencies": { + "xunit.runner.console": "2.1.0" } } } +} \ No newline at end of file diff --git a/test/Microsoft.Extensions.WebEncoders.Tests/project.json b/test/Microsoft.Extensions.WebEncoders.Tests/project.json index 62a6a59ec0..bcd52ff6ee 100644 --- a/test/Microsoft.Extensions.WebEncoders.Tests/project.json +++ b/test/Microsoft.Extensions.WebEncoders.Tests/project.json @@ -6,25 +6,22 @@ "xunit.runner.aspnet": "2.0.0-aspnet-*" }, "testRunner": "xunit", - "commands": { - "test": "xunit.runner.aspnet" - }, "compilationOptions": { "allowUnsafe": true, "warningsAsErrors": true, "keyFile": "../../tools/Key.snk" }, "frameworks": { + "dnxcore50": { + "dependencies": { + "dotnet-test-xunit": "1.0.0-dev-*" + }, + "imports": "portable-net451+win8" + }, "dnx451": { "dependencies": { "xunit.runner.console": "2.1.0" } - }, - "dnxcore50": { - "dependencies": { - "xunit.runner.aspnet": "2.0.0-aspnet-*" - }, - "imports": "portable-net451+win8" } } -} +} \ No newline at end of file From f1e696d865a5b7478b1fe9f6604276fcdfa40f01 Mon Sep 17 00:00:00 2001 From: Ajay Bhargav Baaskaran Date: Thu, 18 Feb 2016 12:39:01 -0800 Subject: [PATCH 019/169] Enabled xml doc generation --- NuGetPackageVerifier.json | 14 ++------------ .../project.json | 4 +++- src/Microsoft.Extensions.WebEncoders/project.json | 4 +++- 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/NuGetPackageVerifier.json b/NuGetPackageVerifier.json index d9dea7c8ac..8df495e3e0 100644 --- a/NuGetPackageVerifier.json +++ b/NuGetPackageVerifier.json @@ -1,12 +1,7 @@ { "adx": { // Packages written by the ADX team and that ship on NuGet.org "rules": [ - "AssemblyHasDocumentFileRule", - "AssemblyHasVersionAttributesRule", - "AssemblyHasServicingAttributeRule", - "AssemblyHasNeutralResourcesLanguageAttributeRule", - "SatellitePackageRule", - "StrictSemanticVersionValidationRule" + "AdxVerificationCompositeRule" ], "packages": { "Microsoft.AspNetCore.Html.Abstractions": { }, @@ -15,12 +10,7 @@ }, "Default": { // Rules to run for packages not listed in any other set. "rules": [ - "AssemblyHasDocumentFileRule", - "AssemblyHasVersionAttributesRule", - "AssemblyHasServicingAttributeRule", - "AssemblyHasNeutralResourcesLanguageAttributeRule", - "SatellitePackageRule", - "StrictSemanticVersionValidationRule" + "DefaultCompositeRule" ] } } \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.Html.Abstractions/project.json b/src/Microsoft.AspNetCore.Html.Abstractions/project.json index 55cc30d9b1..7b5fcb40a1 100644 --- a/src/Microsoft.AspNetCore.Html.Abstractions/project.json +++ b/src/Microsoft.AspNetCore.Html.Abstractions/project.json @@ -7,7 +7,9 @@ }, "compilationOptions": { "warningsAsErrors": true, - "keyFile": "../../tools/Key.snk" + "keyFile": "../../tools/Key.snk", + "nowarn": [ "CS1591" ], + "xmlDoc": true }, "dependencies": { "System.Text.Encodings.Web": "4.0.0-*" diff --git a/src/Microsoft.Extensions.WebEncoders/project.json b/src/Microsoft.Extensions.WebEncoders/project.json index 0facfeeb8c..a777ff4d9b 100644 --- a/src/Microsoft.Extensions.WebEncoders/project.json +++ b/src/Microsoft.Extensions.WebEncoders/project.json @@ -8,7 +8,9 @@ "compilationOptions": { "warningsAsErrors": true, "allowUnsafe": true, - "keyFile": "../../tools/Key.snk" + "keyFile": "../../tools/Key.snk", + "nowarn": [ "CS1591" ], + "xmlDoc": true }, "dependencies": { "Microsoft.Extensions.DependencyInjection.Abstractions": "1.0.0-*", From 397cda382b24fc1f3ded028dd368a6f091618ed2 Mon Sep 17 00:00:00 2001 From: John Luo Date: Thu, 18 Feb 2016 17:08:28 -0800 Subject: [PATCH 020/169] Updating test TFMs for custom test discovery --- test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json | 4 ++-- test/Microsoft.Extensions.WebEncoders.Tests/project.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json b/test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json index ff91514fd4..35c576a3c2 100644 --- a/test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json +++ b/test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json @@ -18,10 +18,10 @@ }, "imports": "portable-net451+win8" }, - "dnx451": { + "net451": { "dependencies": { "xunit.runner.console": "2.1.0" + } } } -} } \ No newline at end of file diff --git a/test/Microsoft.Extensions.WebEncoders.Tests/project.json b/test/Microsoft.Extensions.WebEncoders.Tests/project.json index bcd52ff6ee..074b939a6d 100644 --- a/test/Microsoft.Extensions.WebEncoders.Tests/project.json +++ b/test/Microsoft.Extensions.WebEncoders.Tests/project.json @@ -3,7 +3,7 @@ "Microsoft.Extensions.DependencyInjection": "1.0.0-*", "Microsoft.Extensions.WebEncoders": "1.0.0-*", "Microsoft.NETCore.Platforms": "1.0.1-*", - "xunit.runner.aspnet": "2.0.0-aspnet-*" + "xunit": "2.1.0" }, "testRunner": "xunit", "compilationOptions": { @@ -18,7 +18,7 @@ }, "imports": "portable-net451+win8" }, - "dnx451": { + "net451": { "dependencies": { "xunit.runner.console": "2.1.0" } From 5de08352fa103ba937c85bdc7c0c3155ae9d2817 Mon Sep 17 00:00:00 2001 From: Doug Bunting Date: Wed, 24 Feb 2016 09:37:41 -0800 Subject: [PATCH 021/169] Update `build.sh` to match other repos - currently attempts to `source KoreBuild.sh` --- build.sh | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/build.sh b/build.sh index 7b5e25e3a8..263fb667a8 100755 --- a/build.sh +++ b/build.sh @@ -1,13 +1,5 @@ #!/usr/bin/env bash -SOURCE="${BASH_SOURCE[0]}" -while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink - DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" - SOURCE="$(readlink "$SOURCE")" - [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located -done -repoFolder="$( cd -P "$( dirname "$SOURCE" )" && pwd )" - buildFolder=.build koreBuildFolder=$buildFolder/KoreBuild-dotnet @@ -42,7 +34,12 @@ fi if test ! -d $koreBuildFolder; then mono $nugetPath install KoreBuild-dotnet -ExcludeVersion -o $buildFolder -nocache -pre + chmod +x $koreBuildFolder/build/KoreBuild.sh fi -source $koreBuildFolder/build/KoreBuild.sh +makeFile=makefile.shade +if [ ! -e $makeFile ]; then + makeFile=$koreBuildFolder/build/makefile.shade +fi +./$koreBuildFolder/build/KoreBuild.sh -n $nugetPath -m $makeFile "$@" From 05b2b8e7d84a2cf7cd77f070f9aa4091e6a60aaf Mon Sep 17 00:00:00 2001 From: Doug Bunting Date: Wed, 24 Feb 2016 12:44:10 -0800 Subject: [PATCH 022/169] Update `build.cmd` to match latest template - aspnet/Universe#347 - `%KOREBUILD_VERSION%` doesn't work without this fix --- build.cmd | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/build.cmd b/build.cmd index 65fb3e3353..95b049cf63 100644 --- a/build.cmd +++ b/build.cmd @@ -28,12 +28,11 @@ IF NOT EXIST %NUGET_PATH% ( copy %CACHED_NUGET% %NUGET_PATH% > nul ) +SET KOREBUILD_DOWNLOAD_ARGS= +IF NOT "%KOREBUILD_VERSION%"=="" ( + SET KOREBUILD_DOWNLOAD_ARGS=-version %KOREBUILD_VERSION% +) IF NOT EXIST %KOREBUILD_FOLDER% ( - SET KOREBUILD_DOWNLOAD_ARGS= - IF NOT "%KOREBUILD_VERSION%"=="" ( - SET KOREBUILD_DOWNLOAD_ARGS=-version %KOREBUILD_VERSION% - ) - %BUILD_FOLDER%\nuget.exe install KoreBuild-dotnet -ExcludeVersion -o %BUILD_FOLDER% -nocache -pre %KOREBUILD_DOWNLOAD_ARGS% ) From 2e84cc5aac4d40a24cf56c49e837598271c48da5 Mon Sep 17 00:00:00 2001 From: Victor Hurdugaci Date: Sat, 27 Feb 2016 12:51:06 -0800 Subject: [PATCH 023/169] Update the build scripts --- build.cmd | 41 ++----------------------------------- build.ps1 | 36 +++++++++++++++++++++++++++++++++ build.sh | 60 +++++++++++++++++++++++-------------------------------- 3 files changed, 63 insertions(+), 74 deletions(-) create mode 100644 build.ps1 diff --git a/build.cmd b/build.cmd index 95b049cf63..2fa024b15e 100644 --- a/build.cmd +++ b/build.cmd @@ -1,39 +1,2 @@ -@ECHO off -SETLOCAL - -SET REPO_FOLDER=%~dp0 -CD "%REPO_FOLDER%" - -SET BUILD_FOLDER=.build -SET KOREBUILD_FOLDER=%BUILD_FOLDER%\KoreBuild-dotnet -SET KOREBUILD_VERSION= - -SET NUGET_PATH=%BUILD_FOLDER%\NuGet.exe -SET NUGET_VERSION=latest -SET CACHED_NUGET=%LocalAppData%\NuGet\nuget.%NUGET_VERSION%.exe - -IF NOT EXIST %BUILD_FOLDER% ( - md %BUILD_FOLDER% -) - -IF NOT EXIST %NUGET_PATH% ( - IF NOT EXIST %CACHED_NUGET% ( - echo Downloading latest version of NuGet.exe... - IF NOT EXIST %LocalAppData%\NuGet ( - md %LocalAppData%\NuGet - ) - @powershell -NoProfile -ExecutionPolicy unrestricted -Command "$ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest 'https://dist.nuget.org/win-x86-commandline/%NUGET_VERSION%/nuget.exe' -OutFile '%CACHED_NUGET%'" - ) - - copy %CACHED_NUGET% %NUGET_PATH% > nul -) - -SET KOREBUILD_DOWNLOAD_ARGS= -IF NOT "%KOREBUILD_VERSION%"=="" ( - SET KOREBUILD_DOWNLOAD_ARGS=-version %KOREBUILD_VERSION% -) -IF NOT EXIST %KOREBUILD_FOLDER% ( - %BUILD_FOLDER%\nuget.exe install KoreBuild-dotnet -ExcludeVersion -o %BUILD_FOLDER% -nocache -pre %KOREBUILD_DOWNLOAD_ARGS% -) - -"%KOREBUILD_FOLDER%\build\KoreBuild.cmd" %* +@ECHO OFF +PowerShell -NoProfile -NoLogo -ExecutionPolicy unrestricted -Command "[System.Threading.Thread]::CurrentThread.CurrentCulture = ''; [System.Threading.Thread]::CurrentThread.CurrentUICulture = '';& '%~dp0build.ps1' %*" \ No newline at end of file diff --git a/build.ps1 b/build.ps1 new file mode 100644 index 0000000000..4fd24a30d5 --- /dev/null +++ b/build.ps1 @@ -0,0 +1,36 @@ +cd $PSScriptRoot + +$repoFolder = $PSScriptRoot +$env:REPO_FOLDER = $repoFolder + +$koreBuildZip="https://github.com/aspnet/KoreBuild/archive/dev.zip" +if ($env:KOREBUILD_ZIP) +{ + $koreBuildZip=$env:KOREBUILD_ZIP +} + +$buildFolder = ".build" +$buildFile="$buildFolder\KoreBuild.ps1" + +if (!(Test-Path $buildFolder)) { + Write-Host "Downloading KoreBuild from $koreBuildZip" + + $tempFolder=$env:TEMP + "\KoreBuild-" + [guid]::NewGuid() + New-Item -Path "$tempFolder" -Type directory | Out-Null + + $localZipFile="$tempFolder\korebuild.zip" + + Invoke-WebRequest $koreBuildZip -OutFile $localZipFile + Add-Type -AssemblyName System.IO.Compression.FileSystem + [System.IO.Compression.ZipFile]::ExtractToDirectory($localZipFile, $tempFolder) + + New-Item -Path "$buildFolder" -Type directory | Out-Null + copy-item "$tempFolder\**\build\*" $buildFolder -Recurse + + # Cleanup + if (Test-Path $tempFolder) { + Remove-Item -Recurse -Force $tempFolder + } +} + +&"$buildFile" $args \ No newline at end of file diff --git a/build.sh b/build.sh index 263fb667a8..79638d06b6 100755 --- a/build.sh +++ b/build.sh @@ -1,45 +1,35 @@ #!/usr/bin/env bash +repoFolder="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +cd $repoFolder -buildFolder=.build -koreBuildFolder=$buildFolder/KoreBuild-dotnet - -nugetPath=$buildFolder/nuget.exe - -if test `uname` = Darwin; then - cachedir=~/Library/Caches/KBuild -else - if [ -z $XDG_DATA_HOME ]; then - cachedir=$HOME/.local/share - else - cachedir=$XDG_DATA_HOME; - fi +koreBuildZip="https://github.com/aspnet/KoreBuild/archive/dev.zip" +if [ ! -z $KOREBUILD_ZIP ]; then + koreBuildZip=$KOREBUILD_ZIP fi -mkdir -p $cachedir -nugetVersion=latest -cacheNuget=$cachedir/nuget.$nugetVersion.exe -nugetUrl=https://dist.nuget.org/win-x86-commandline/$nugetVersion/nuget.exe +buildFolder=".build" +buildFile="$buildFolder/KoreBuild.sh" if test ! -d $buildFolder; then + echo "Downloading KoreBuild from $koreBuildZip" + + tempFolder="/tmp/KoreBuild-$(uuidgen)" + mkdir $tempFolder + + localZipFile="$tempFolder/korebuild.zip" + + wget -O $localZipFile $koreBuildZip 2>/dev/null || curl -o $localZipFile --location $koreBuildZip /dev/null + unzip -q -d $tempFolder $localZipFile + mkdir $buildFolder -fi - -if test ! -f $nugetPath; then - if test ! -f $cacheNuget; then - wget -O $cacheNuget $nugetUrl 2>/dev/null || curl -o $cacheNuget --location $nugetUrl /dev/null + cp -r $tempFolder/**/build/** $buildFolder + + chmod +x $buildFile + + # Cleanup + if test ! -d $tempFolder; then + rm -rf $tempFolder fi - - cp $cacheNuget $nugetPath fi -if test ! -d $koreBuildFolder; then - mono $nugetPath install KoreBuild-dotnet -ExcludeVersion -o $buildFolder -nocache -pre - chmod +x $koreBuildFolder/build/KoreBuild.sh -fi - -makeFile=makefile.shade -if [ ! -e $makeFile ]; then - makeFile=$koreBuildFolder/build/makefile.shade -fi - -./$koreBuildFolder/build/KoreBuild.sh -n $nugetPath -m $makeFile "$@" +$buildFile -r $repoFolder "$@" From ed2529edced330be83302b97eb70b75aa6068850 Mon Sep 17 00:00:00 2001 From: Victor Hurdugaci Date: Sun, 28 Feb 2016 10:12:09 -0800 Subject: [PATCH 024/169] Return the error code from build.cmd --- build.cmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.cmd b/build.cmd index 2fa024b15e..7d4894cb4a 100644 --- a/build.cmd +++ b/build.cmd @@ -1,2 +1,2 @@ @ECHO OFF -PowerShell -NoProfile -NoLogo -ExecutionPolicy unrestricted -Command "[System.Threading.Thread]::CurrentThread.CurrentCulture = ''; [System.Threading.Thread]::CurrentThread.CurrentUICulture = '';& '%~dp0build.ps1' %*" \ No newline at end of file +PowerShell -NoProfile -NoLogo -ExecutionPolicy unrestricted -Command "[System.Threading.Thread]::CurrentThread.CurrentCulture = ''; [System.Threading.Thread]::CurrentThread.CurrentUICulture = '';& '%~dp0build.ps1' %*; exit $LASTEXITCODE" \ No newline at end of file From e8f642df19281a3a3059c0ddd51e9eb865519a02 Mon Sep 17 00:00:00 2001 From: "N. Taylor Mullen" Date: Tue, 1 Mar 2016 13:29:45 -0800 Subject: [PATCH 025/169] Transition to netstandard. - dotnet5.X => netstandard1.y (where y = x-1). - DNXCore50 => netstandardapp1.5. - Applied the same changes to ifdefs. --- .../project.json | 13 +++++++++---- src/Microsoft.Extensions.WebEncoders/project.json | 12 +++++++++--- .../project.json | 7 +++++-- .../project.json | 7 +++++-- 4 files changed, 28 insertions(+), 11 deletions(-) diff --git a/src/Microsoft.AspNetCore.Html.Abstractions/project.json b/src/Microsoft.AspNetCore.Html.Abstractions/project.json index 7b5fcb40a1..921349d93f 100644 --- a/src/Microsoft.AspNetCore.Html.Abstractions/project.json +++ b/src/Microsoft.AspNetCore.Html.Abstractions/project.json @@ -8,7 +8,9 @@ "compilationOptions": { "warningsAsErrors": true, "keyFile": "../../tools/Key.snk", - "nowarn": [ "CS1591" ], + "nowarn": [ + "CS1591" + ], "xmlDoc": true }, "dependencies": { @@ -21,11 +23,14 @@ "System.Runtime": "" } }, - "dotnet5.4": { + "netstandard1.3": { "dependencies": { "System.Collections": "4.0.11-*", "System.Resources.ResourceManager": "4.0.1-*" - } + }, + "imports": [ + "dotnet5.4" + ] } } -} +} \ No newline at end of file diff --git a/src/Microsoft.Extensions.WebEncoders/project.json b/src/Microsoft.Extensions.WebEncoders/project.json index a777ff4d9b..1c0e609f4c 100644 --- a/src/Microsoft.Extensions.WebEncoders/project.json +++ b/src/Microsoft.Extensions.WebEncoders/project.json @@ -9,7 +9,9 @@ "warningsAsErrors": true, "allowUnsafe": true, "keyFile": "../../tools/Key.snk", - "nowarn": [ "CS1591" ], + "nowarn": [ + "CS1591" + ], "xmlDoc": true }, "dependencies": { @@ -24,6 +26,10 @@ "System.Runtime": "" } }, - "dotnet5.4": {} + "netstandard1.3": { + "imports": [ + "dotnet5.4" + ] + } } -} +} \ No newline at end of file diff --git a/test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json b/test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json index 35c576a3c2..a2b85b5cfe 100644 --- a/test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json +++ b/test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json @@ -12,11 +12,14 @@ }, "testRunner": "xunit", "frameworks": { - "dnxcore50": { + "netstandardapp1.5": { "dependencies": { "dotnet-test-xunit": "1.0.0-dev-*" }, - "imports": "portable-net451+win8" + "imports": [ + "dnxcore50", + "portable-net451+win8" + ] }, "net451": { "dependencies": { diff --git a/test/Microsoft.Extensions.WebEncoders.Tests/project.json b/test/Microsoft.Extensions.WebEncoders.Tests/project.json index 074b939a6d..0e0c77023b 100644 --- a/test/Microsoft.Extensions.WebEncoders.Tests/project.json +++ b/test/Microsoft.Extensions.WebEncoders.Tests/project.json @@ -12,11 +12,14 @@ "keyFile": "../../tools/Key.snk" }, "frameworks": { - "dnxcore50": { + "netstandardapp1.5": { "dependencies": { "dotnet-test-xunit": "1.0.0-dev-*" }, - "imports": "portable-net451+win8" + "imports": [ + "dnxcore50", + "portable-net451+win8" + ] }, "net451": { "dependencies": { From b2b623816b6c6dabf535e7d924b191e69c091009 Mon Sep 17 00:00:00 2001 From: jacalvar Date: Wed, 24 Feb 2016 23:20:35 -0800 Subject: [PATCH 026/169] Make ServiceCollectionExtensions consistent --- .../EncoderServiceCollectionExtensions.cs | 43 ++++++++++--------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/src/Microsoft.Extensions.WebEncoders/EncoderServiceCollectionExtensions.cs b/src/Microsoft.Extensions.WebEncoders/EncoderServiceCollectionExtensions.cs index df3946099c..317d88f99d 100644 --- a/src/Microsoft.Extensions.WebEncoders/EncoderServiceCollectionExtensions.cs +++ b/src/Microsoft.Extensions.WebEncoders/EncoderServiceCollectionExtensions.cs @@ -9,6 +9,9 @@ using Microsoft.Extensions.WebEncoders; namespace Microsoft.Extensions.DependencyInjection { + /// + /// Extension methods for setting up web encoding services in an . + /// public static class EncoderServiceCollectionExtensions { /// @@ -17,24 +20,7 @@ namespace Microsoft.Extensions.DependencyInjection /// /// The . /// The instance after the encoders have been added. - public static IServiceCollection AddWebEncoders(this IServiceCollection services) - { - if (services == null) - { - throw new ArgumentNullException(nameof(services)); - } - - return AddWebEncoders(services, configureOptions: null); - } - - /// - /// Adds , and - /// to the specified . - /// - /// The . - /// A callback to configure . - /// The instance after the encoders have been added. - public static IServiceCollection AddWebEncoders(this IServiceCollection services, Action configureOptions) + public static void AddWebEncoders(this IServiceCollection services) { if (services == null) { @@ -51,13 +37,28 @@ namespace Microsoft.Extensions.DependencyInjection CreateFactory(() => JavaScriptEncoder.Default, settings => JavaScriptEncoder.Create(settings))); services.TryAddSingleton( CreateFactory(() => UrlEncoder.Default, settings => UrlEncoder.Create(settings))); + } - if (configureOptions != null) + /// + /// Adds , and + /// to the specified . + /// + /// The . + /// An to configure the provided . + public static void AddWebEncoders(this IServiceCollection services, Action setupAction) + { + if (services == null) { - services.Configure(configureOptions); + throw new ArgumentNullException(nameof(services)); } - return services; + if (setupAction == null) + { + throw new ArgumentNullException(nameof(setupAction)); + } + + services.AddWebEncoders(); + services.Configure(setupAction); } private static Func CreateFactory( From 67c1dfc43d14109906d3c2e236d5cdb4d2332b32 Mon Sep 17 00:00:00 2001 From: Doug Bunting Date: Wed, 2 Mar 2016 18:50:26 -0800 Subject: [PATCH 027/169] Remove project name from output path - aspnet/Coherence-Signed#187 - remove `` settings but maintain other unique aspects e.g. `` - in a few cases, standardize on VS version `14.0` and not something more specific --- .../Microsoft.AspNetCore.Html.Abstractions.xproj | 6 ++---- .../Microsoft.Extensions.WebEncoders.xproj | 2 +- .../Microsoft.AspNetCore.Html.Abstractions.Test.xproj | 5 ++--- .../Microsoft.Extensions.WebEncoders.Tests.xproj | 2 +- 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/Microsoft.AspNetCore.Html.Abstractions/Microsoft.AspNetCore.Html.Abstractions.xproj b/src/Microsoft.AspNetCore.Html.Abstractions/Microsoft.AspNetCore.Html.Abstractions.xproj index df229c75eb..7a3801b2b1 100644 --- a/src/Microsoft.AspNetCore.Html.Abstractions/Microsoft.AspNetCore.Html.Abstractions.xproj +++ b/src/Microsoft.AspNetCore.Html.Abstractions/Microsoft.AspNetCore.Html.Abstractions.xproj @@ -1,4 +1,4 @@ - + 14.0 @@ -7,11 +7,9 @@ 68a28e4a-3ade-4187-9625-4ff185887cb3 - Microsoft.AspNetCore.Html.Abstractions ..\..\artifacts\obj\$(MSBuildProjectName) - ..\..\artifacts\bin\$(MSBuildProjectName)\ + ..\..\artifacts\bin\ - 2.0 diff --git a/src/Microsoft.Extensions.WebEncoders/Microsoft.Extensions.WebEncoders.xproj b/src/Microsoft.Extensions.WebEncoders/Microsoft.Extensions.WebEncoders.xproj index 084e7901ea..0f278d6c98 100644 --- a/src/Microsoft.Extensions.WebEncoders/Microsoft.Extensions.WebEncoders.xproj +++ b/src/Microsoft.Extensions.WebEncoders/Microsoft.Extensions.WebEncoders.xproj @@ -8,7 +8,7 @@ dd2ce416-765e-4000-a03e-c2ff165da1b6 ..\..\artifacts\obj\$(MSBuildProjectName) - ..\..\artifacts\bin\$(MSBuildProjectName)\ + ..\..\artifacts\bin\ 2.0 diff --git a/test/Microsoft.AspNetCore.Html.Abstractions.Test/Microsoft.AspNetCore.Html.Abstractions.Test.xproj b/test/Microsoft.AspNetCore.Html.Abstractions.Test/Microsoft.AspNetCore.Html.Abstractions.Test.xproj index f699a1c4dc..20389ad4bf 100644 --- a/test/Microsoft.AspNetCore.Html.Abstractions.Test/Microsoft.AspNetCore.Html.Abstractions.Test.xproj +++ b/test/Microsoft.AspNetCore.Html.Abstractions.Test/Microsoft.AspNetCore.Html.Abstractions.Test.xproj @@ -1,4 +1,4 @@ - + 14.0 @@ -7,9 +7,8 @@ 2d187b88-94bd-4a39-ac97-f8f8b9363301 - Microsoft.AspNetCore.Html.Abstractions.Test ..\..\artifacts\obj\$(MSBuildProjectName) - ..\..\artifacts\bin\$(MSBuildProjectName)\ + ..\..\artifacts\bin\ 2.0 diff --git a/test/Microsoft.Extensions.WebEncoders.Tests/Microsoft.Extensions.WebEncoders.Tests.xproj b/test/Microsoft.Extensions.WebEncoders.Tests/Microsoft.Extensions.WebEncoders.Tests.xproj index 9b0698e3cc..9ad3cb3d4f 100644 --- a/test/Microsoft.Extensions.WebEncoders.Tests/Microsoft.Extensions.WebEncoders.Tests.xproj +++ b/test/Microsoft.Extensions.WebEncoders.Tests/Microsoft.Extensions.WebEncoders.Tests.xproj @@ -8,7 +8,7 @@ 7ae2731d-43cd-4cf8-850a-4914de2ce930 ..\..\artifacts\obj\$(MSBuildProjectName) - ..\..\artifacts\bin\$(MSBuildProjectName)\ + ..\..\artifacts\bin\ 2.0 From b9d2dc89aae71e648b2d19721730d4f023a2f1f5 Mon Sep 17 00:00:00 2001 From: Ajay Bhargav Baaskaran Date: Thu, 3 Mar 2016 17:31:53 -0800 Subject: [PATCH 028/169] Added Company, Copyright and Product attributes to AssemblyInfo --- .../Properties/AssemblyInfo.cs | 5 ++++- .../Properties/AssemblyInfo.cs | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Microsoft.AspNetCore.Html.Abstractions/Properties/AssemblyInfo.cs b/src/Microsoft.AspNetCore.Html.Abstractions/Properties/AssemblyInfo.cs index 72210dd611..403f0e3c52 100644 --- a/src/Microsoft.AspNetCore.Html.Abstractions/Properties/AssemblyInfo.cs +++ b/src/Microsoft.AspNetCore.Html.Abstractions/Properties/AssemblyInfo.cs @@ -7,4 +7,7 @@ using System.Runtime.CompilerServices; [assembly: AssemblyMetadata("Serviceable", "True")] [assembly: NeutralResourcesLanguage("en-us")] -[assembly: InternalsVisibleTo("Microsoft.AspNetCore.Html.Abstractions.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] \ No newline at end of file +[assembly: InternalsVisibleTo("Microsoft.AspNetCore.Html.Abstractions.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] +[assembly: AssemblyCompany("Microsoft Corporation.")] +[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")] +[assembly: AssemblyProduct("Microsoft ASP.NET Core")] diff --git a/src/Microsoft.Extensions.WebEncoders/Properties/AssemblyInfo.cs b/src/Microsoft.Extensions.WebEncoders/Properties/AssemblyInfo.cs index b2437d9ad6..8d8d88195c 100644 --- a/src/Microsoft.Extensions.WebEncoders/Properties/AssemblyInfo.cs +++ b/src/Microsoft.Extensions.WebEncoders/Properties/AssemblyInfo.cs @@ -5,4 +5,7 @@ using System.Reflection; using System.Resources; [assembly: AssemblyMetadata("Serviceable", "True")] -[assembly: NeutralResourcesLanguage("en-us")] \ No newline at end of file +[assembly: NeutralResourcesLanguage("en-us")] +[assembly: AssemblyCompany("Microsoft Corporation.")] +[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")] +[assembly: AssemblyProduct("Microsoft .NET Extensions")] From 2705510508b08f6c50007c87e35fd32951208811 Mon Sep 17 00:00:00 2001 From: Ryan Nowak Date: Fri, 12 Feb 2016 18:11:48 -0800 Subject: [PATCH 029/169] Add Copy/Move for content - Remove HtmlTextWriter Currently we overload the definition of WriteTo on IHtmlContent implementation classes to either represent a "real" write or a "flatten" by checking if the writer inherits HtmlText writer. This overloading is a bit of an odd fit and hides the real semantic we want for flattening. Additionally, we want to gradually make the concept of a pooled backing-buffer for IHtmlContent first-class - using pooled buffers dictates that we support move-semantics to some degree. This change makes the work that we do for flattening into pooled buffers explicit rather than hidden. --- .../HtmlContentBuilder.cs | 64 +++++++++ .../HtmlEncodedString.cs | 13 +- .../HtmlTextWriter.cs | 49 ------- .../IHtmlContentBuilder.cs | 2 +- .../IHtmlContentContainer.cs | 30 +++++ .../HtmlContentBuilderExtensionsTest.cs | 14 ++ .../HtmlContentBuilderTest.cs | 124 +++++++++++++++++- 7 files changed, 240 insertions(+), 56 deletions(-) delete mode 100644 src/Microsoft.AspNetCore.Html.Abstractions/HtmlTextWriter.cs create mode 100644 src/Microsoft.AspNetCore.Html.Abstractions/IHtmlContentContainer.cs diff --git a/src/Microsoft.AspNetCore.Html.Abstractions/HtmlContentBuilder.cs b/src/Microsoft.AspNetCore.Html.Abstractions/HtmlContentBuilder.cs index b79e400375..be218244b0 100644 --- a/src/Microsoft.AspNetCore.Html.Abstractions/HtmlContentBuilder.cs +++ b/src/Microsoft.AspNetCore.Html.Abstractions/HtmlContentBuilder.cs @@ -96,6 +96,70 @@ namespace Microsoft.AspNetCore.Html return this; } + /// + public void CopyTo(IHtmlContentBuilder destination) + { + if (destination == null) + { + throw new ArgumentNullException(nameof(destination)); + } + + for (var i = 0; i < Entries.Count; i++) + { + var entry = Entries[i]; + + string entryAsString; + IHtmlContentContainer entryAsContainer; + if ((entryAsString = entry as string) != null) + { + destination.Append(entryAsString); + } + else if ((entryAsContainer = entry as IHtmlContentContainer) != null) + { + // Since we're copying, do a deep flatten. + entryAsContainer.CopyTo(destination); + } + else + { + // Only string, IHtmlContent values can be added to the buffer. + destination.AppendHtml((IHtmlContent)entry); + } + } + } + + /// + public void MoveTo(IHtmlContentBuilder destination) + { + if (destination == null) + { + throw new ArgumentNullException(nameof(destination)); + } + + for (var i = 0; i < Entries.Count; i++) + { + var entry = Entries[i]; + + string entryAsString; + IHtmlContentContainer entryAsContainer; + if ((entryAsString = entry as string) != null) + { + destination.Append(entryAsString); + } + else if ((entryAsContainer = entry as IHtmlContentContainer) != null) + { + // Since we're moving, do a deep flatten. + entryAsContainer.MoveTo(destination); + } + else + { + // Only string, IHtmlContent values can be added to the buffer. + destination.AppendHtml((IHtmlContent)entry); + } + } + + Entries.Clear(); + } + /// public void WriteTo(TextWriter writer, HtmlEncoder encoder) { diff --git a/src/Microsoft.AspNetCore.Html.Abstractions/HtmlEncodedString.cs b/src/Microsoft.AspNetCore.Html.Abstractions/HtmlEncodedString.cs index c50fba890c..bf38ac3682 100644 --- a/src/Microsoft.AspNetCore.Html.Abstractions/HtmlEncodedString.cs +++ b/src/Microsoft.AspNetCore.Html.Abstractions/HtmlEncodedString.cs @@ -17,17 +17,20 @@ namespace Microsoft.AspNetCore.Html /// public static readonly IHtmlContent NewLine = new HtmlEncodedString(Environment.NewLine); - private readonly string _value; - /// /// Creates a new . /// /// The HTML encoded value. public HtmlEncodedString(string value) { - _value = value; + Value = value; } + /// + /// Gets the HTML encoded value. + /// + public string Value { get; } + /// public void WriteTo(TextWriter writer, HtmlEncoder encoder) { @@ -41,13 +44,13 @@ namespace Microsoft.AspNetCore.Html throw new ArgumentNullException(nameof(encoder)); } - writer.Write(_value); + writer.Write(Value); } /// public override string ToString() { - return _value ?? string.Empty; + return Value ?? string.Empty; } } } diff --git a/src/Microsoft.AspNetCore.Html.Abstractions/HtmlTextWriter.cs b/src/Microsoft.AspNetCore.Html.Abstractions/HtmlTextWriter.cs deleted file mode 100644 index c9158b49b6..0000000000 --- a/src/Microsoft.AspNetCore.Html.Abstractions/HtmlTextWriter.cs +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System.IO; - -namespace Microsoft.AspNetCore.Html -{ - /// - /// A which supports special processing of . - /// - public abstract class HtmlTextWriter : TextWriter - { - /// - /// Writes an value. - /// - /// The value. - public abstract void Write(IHtmlContent value); - - /// - public override void Write(object value) - { - var htmlContent = value as IHtmlContent; - if (htmlContent == null) - { - base.Write(value); - } - else - { - Write(htmlContent); - } - } - - /// - public override void WriteLine(object value) - { - var htmlContent = value as IHtmlContent; - if (htmlContent == null) - { - base.Write(value); - } - else - { - Write(htmlContent); - } - - base.WriteLine(); - } - } -} diff --git a/src/Microsoft.AspNetCore.Html.Abstractions/IHtmlContentBuilder.cs b/src/Microsoft.AspNetCore.Html.Abstractions/IHtmlContentBuilder.cs index 978fedc03f..912fe442aa 100644 --- a/src/Microsoft.AspNetCore.Html.Abstractions/IHtmlContentBuilder.cs +++ b/src/Microsoft.AspNetCore.Html.Abstractions/IHtmlContentBuilder.cs @@ -6,7 +6,7 @@ namespace Microsoft.AspNetCore.Html /// /// A builder for HTML content. /// - public interface IHtmlContentBuilder : IHtmlContent + public interface IHtmlContentBuilder : IHtmlContentContainer { /// /// Appends an instance. diff --git a/src/Microsoft.AspNetCore.Html.Abstractions/IHtmlContentContainer.cs b/src/Microsoft.AspNetCore.Html.Abstractions/IHtmlContentContainer.cs new file mode 100644 index 0000000000..f17811433c --- /dev/null +++ b/src/Microsoft.AspNetCore.Html.Abstractions/IHtmlContentContainer.cs @@ -0,0 +1,30 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +namespace Microsoft.AspNetCore.Html +{ + /// + /// Defines a contract for instances made up of several components which + /// can be copied into an . + /// + public interface IHtmlContentContainer : IHtmlContent + { + /// + /// Copies the contained content of this into . + /// + /// The . + void CopyTo(IHtmlContentBuilder builder); + + /// + /// + /// Moves the contained content of this into . + /// + /// + /// After is called, this instance should be left + /// in an empty state. + /// + /// + /// The . + void MoveTo(IHtmlContentBuilder builder); + } +} diff --git a/test/Microsoft.AspNetCore.Html.Abstractions.Test/HtmlContentBuilderExtensionsTest.cs b/test/Microsoft.AspNetCore.Html.Abstractions.Test/HtmlContentBuilderExtensionsTest.cs index 6b4307f690..08151b3675 100644 --- a/test/Microsoft.AspNetCore.Html.Abstractions.Test/HtmlContentBuilderExtensionsTest.cs +++ b/test/Microsoft.AspNetCore.Html.Abstractions.Test/HtmlContentBuilderExtensionsTest.cs @@ -392,6 +392,20 @@ namespace Microsoft.AspNetCore.Html.Test return this; } + public void CopyTo(IHtmlContentBuilder destination) + { + foreach (var entry in Entries) + { + destination.AppendHtml(entry); + } + } + + public void MoveTo(IHtmlContentBuilder destination) + { + CopyTo(destination); + Clear(); + } + public void WriteTo(TextWriter writer, HtmlEncoder encoder) { foreach (var entry in Entries) diff --git a/test/Microsoft.AspNetCore.Html.Abstractions.Test/HtmlContentBuilderTest.cs b/test/Microsoft.AspNetCore.Html.Abstractions.Test/HtmlContentBuilderTest.cs index 901512fdad..40219b19f7 100644 --- a/test/Microsoft.AspNetCore.Html.Abstractions.Test/HtmlContentBuilderTest.cs +++ b/test/Microsoft.AspNetCore.Html.Abstractions.Test/HtmlContentBuilderTest.cs @@ -1,6 +1,7 @@ // Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +using System; using System.IO; using System.Text.Encodings.Web; using Microsoft.AspNetCore.Html; @@ -105,6 +106,106 @@ namespace Microsoft.Extensions.Internal Assert.Equal(0, content.Entries.Count); } + [Fact] + public void CopyTo_CopiesAllItems() + { + // Arrange + var source = new HtmlContentBuilder(); + source.AppendHtml(new TestHtmlContent("hello")); + source.Append("Test"); + + var destination = new HtmlContentBuilder(); + destination.Append("some-content"); + + // Act + source.CopyTo(destination); + + // Assert + Assert.Equal(2, source.Entries.Count); + Assert.Equal(3, destination.Entries.Count); + + Assert.Equal("some-content", Assert.IsType(destination.Entries[0])); + Assert.Equal(new TestHtmlContent("hello"), Assert.IsType(destination.Entries[1])); + Assert.Equal("Test", Assert.IsType(destination.Entries[2])); + } + + [Fact] + public void CopyTo_DoesDeepCopy() + { + // Arrange + var source = new HtmlContentBuilder(); + + var nested = new HtmlContentBuilder(); + source.AppendHtml(nested); + nested.AppendHtml(new TestHtmlContent("hello")); + source.Append("Test"); + + var destination = new HtmlContentBuilder(); + destination.Append("some-content"); + + // Act + source.CopyTo(destination); + + // Assert + Assert.Equal(2, source.Entries.Count); + Assert.Equal(1, nested.Entries.Count); + Assert.Equal(3, destination.Entries.Count); + + Assert.Equal("some-content", Assert.IsType(destination.Entries[0])); + Assert.Equal(new TestHtmlContent("hello"), Assert.IsType(destination.Entries[1])); + Assert.Equal("Test", Assert.IsType(destination.Entries[2])); + } + + [Fact] + public void MoveTo_CopiesAllItems_AndClears() + { + // Arrange + var source = new HtmlContentBuilder(); + source.AppendHtml(new TestHtmlContent("hello")); + source.Append("Test"); + + var destination = new HtmlContentBuilder(); + destination.Append("some-content"); + + // Act + source.MoveTo(destination); + + // Assert + Assert.Equal(0, source.Entries.Count); + Assert.Equal(3, destination.Entries.Count); + + Assert.Equal("some-content", Assert.IsType(destination.Entries[0])); + Assert.Equal(new TestHtmlContent("hello"), Assert.IsType(destination.Entries[1])); + Assert.Equal("Test", Assert.IsType(destination.Entries[2])); + } + + [Fact] + public void MoveTo_DoesDeepMove() + { + // Arrange + var source = new HtmlContentBuilder(); + + var nested = new HtmlContentBuilder(); + source.AppendHtml(nested); + nested.AppendHtml(new TestHtmlContent("hello")); + source.Append("Test"); + + var destination = new HtmlContentBuilder(); + destination.Append("some-content"); + + // Act + source.MoveTo(destination); + + // Assert + Assert.Equal(0, source.Entries.Count); + Assert.Equal(0, nested.Entries.Count); + Assert.Equal(3, destination.Entries.Count); + + Assert.Equal("some-content", Assert.IsType(destination.Entries[0])); + Assert.Equal(new TestHtmlContent("hello"), Assert.IsType(destination.Entries[1])); + Assert.Equal("Test", Assert.IsType(destination.Entries[2])); + } + [Fact] public void WriteTo_WritesAllItems() { @@ -122,7 +223,7 @@ namespace Microsoft.Extensions.Internal Assert.Equal("Written from TestHtmlContent: HelloHtmlEncode[[Test]]", writer.ToString()); } - private class TestHtmlContent : IHtmlContent + private class TestHtmlContent : IHtmlContent, IEquatable { private string _content; @@ -140,6 +241,27 @@ namespace Microsoft.Extensions.Internal { return "Written from TestHtmlContent: " + _content; } + + public override int GetHashCode() + { + return _content.GetHashCode(); + } + + public override bool Equals(object obj) + { + var other = obj as TestHtmlContent; + if (other != null) + { + return Equals(other); + } + + return base.Equals(obj); + } + + public bool Equals(TestHtmlContent other) + { + return string.Equals(_content, other._content); + } } } } From 8f959b04b18e0b09e01bcd09e48b9524171f5aa8 Mon Sep 17 00:00:00 2001 From: Victor Hurdugaci Date: Mon, 7 Mar 2016 20:54:54 -0800 Subject: [PATCH 030/169] Update the build scripts to the latest version --- build.ps1 | 33 ++++++++++++++++++++++++++++++++- build.sh | 15 +++++++++++++-- 2 files changed, 45 insertions(+), 3 deletions(-) diff --git a/build.ps1 b/build.ps1 index 4fd24a30d5..8f2f99691a 100644 --- a/build.ps1 +++ b/build.ps1 @@ -1,3 +1,33 @@ +$ErrorActionPreference = "Stop" + +function DownloadWithRetry([string] $url, [string] $downloadLocation, [int] $retries) +{ + while($true) + { + try + { + Invoke-WebRequest $url -OutFile $downloadLocation + break + } + catch + { + $exceptionMessage = $_.Exception.Message + Write-Host "Failed to download '$url': $exceptionMessage" + if ($retries -gt 0) { + $retries-- + Write-Host "Waiting 10 seconds before retrying. Retries left: $retries" + Start-Sleep -Seconds 10 + + } + else + { + $exception = $_.Exception + throw $exception + } + } + } +} + cd $PSScriptRoot $repoFolder = $PSScriptRoot @@ -20,7 +50,8 @@ if (!(Test-Path $buildFolder)) { $localZipFile="$tempFolder\korebuild.zip" - Invoke-WebRequest $koreBuildZip -OutFile $localZipFile + DownloadWithRetry -url $koreBuildZip -downloadLocation $localZipFile -retries 6 + Add-Type -AssemblyName System.IO.Compression.FileSystem [System.IO.Compression.ZipFile]::ExtractToDirectory($localZipFile, $tempFolder) diff --git a/build.sh b/build.sh index 79638d06b6..f4208100eb 100755 --- a/build.sh +++ b/build.sh @@ -18,7 +18,18 @@ if test ! -d $buildFolder; then localZipFile="$tempFolder/korebuild.zip" - wget -O $localZipFile $koreBuildZip 2>/dev/null || curl -o $localZipFile --location $koreBuildZip /dev/null + retries=6 + until (wget -O $localZipFile $koreBuildZip 2>/dev/null || curl -o $localZipFile --location $koreBuildZip 2>/dev/null) + do + echo "Failed to download '$koreBuildZip'" + if [ "$retries" -le 0 ]; then + exit 1 + fi + retries=$((retries - 1)) + echo "Waiting 10 seconds before retrying. Retries left: $retries" + sleep 10s + done + unzip -q -d $tempFolder $localZipFile mkdir $buildFolder @@ -32,4 +43,4 @@ if test ! -d $buildFolder; then fi fi -$buildFile -r $repoFolder "$@" +$buildFile -r $repoFolder "$@" \ No newline at end of file From e341d1b1e2bebe4f374542a309fb81f949326ac7 Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Wed, 9 Mar 2016 16:35:10 -0800 Subject: [PATCH 031/169] Limit the branches that build on our public CI. [ci skip] --- .travis.yml | 6 ++++++ appveyor.yml | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/.travis.yml b/.travis.yml index e8f77f0f14..e63d71127a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,5 +16,11 @@ os: - linux - osx osx_image: xcode7.1 +branches: + only: + - master + - release + - dev + - /^(.*\\/)?ci-.*$/ script: - ./build.sh --quiet verify \ No newline at end of file diff --git a/appveyor.yml b/appveyor.yml index 636a7618d3..15ffe737a5 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,5 +1,11 @@ init: - git config --global core.autocrlf true +branches: + only: + - master + - release + - dev + - /^(.*\\/)?ci-.*$/ build_script: - build.cmd --quiet verify clone_depth: 1 From bc560b000353f0e7bf414d3ff812c3691ce0ceb7 Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Wed, 9 Mar 2016 17:44:48 -0800 Subject: [PATCH 032/169] Fix backslashes in yml config. [ci skip] --- .travis.yml | 2 +- appveyor.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index e63d71127a..304e307169 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,6 +21,6 @@ branches: - master - release - dev - - /^(.*\\/)?ci-.*$/ + - /^(.*\/)?ci-.*$/ script: - ./build.sh --quiet verify \ No newline at end of file diff --git a/appveyor.yml b/appveyor.yml index 15ffe737a5..be95b88d6f 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -5,7 +5,7 @@ branches: - master - release - dev - - /^(.*\\/)?ci-.*$/ + - /^(.*\/)?ci-.*$/ build_script: - build.cmd --quiet verify clone_depth: 1 From 06c818c9e5d5c3b5225a8dfc5771f43a02ae6727 Mon Sep 17 00:00:00 2001 From: Brice Lambson Date: Thu, 10 Mar 2016 10:29:41 -0800 Subject: [PATCH 033/169] Don't reference facades in NuSpec These can be removed entirely after dotnet/cli#164 --- src/Microsoft.AspNetCore.Html.Abstractions/project.json | 4 ++-- src/Microsoft.Extensions.WebEncoders/project.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Microsoft.AspNetCore.Html.Abstractions/project.json b/src/Microsoft.AspNetCore.Html.Abstractions/project.json index 921349d93f..6d2220cabe 100644 --- a/src/Microsoft.AspNetCore.Html.Abstractions/project.json +++ b/src/Microsoft.AspNetCore.Html.Abstractions/project.json @@ -19,8 +19,8 @@ "frameworks": { "net451": { "frameworkAssemblies": { - "System.IO": "", - "System.Runtime": "" + "System.IO": { "type": "build" }, + "System.Runtime": { "type": "build" } } }, "netstandard1.3": { diff --git a/src/Microsoft.Extensions.WebEncoders/project.json b/src/Microsoft.Extensions.WebEncoders/project.json index 1c0e609f4c..1e24e36926 100644 --- a/src/Microsoft.Extensions.WebEncoders/project.json +++ b/src/Microsoft.Extensions.WebEncoders/project.json @@ -22,8 +22,8 @@ "frameworks": { "net451": { "frameworkAssemblies": { - "System.IO": "", - "System.Runtime": "" + "System.IO": { "type": "build" }, + "System.Runtime": { "type": "build" } } }, "netstandard1.3": { From 0e95ce9a8eda8e8ced4f2af169790b09b703f2a8 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Sat, 12 Mar 2016 08:22:32 -0800 Subject: [PATCH 034/169] Target minimal TFMs --- .../project.json | 10 ++-------- src/Microsoft.Extensions.WebEncoders/project.json | 10 ++-------- .../project.json | 5 +++-- .../project.json | 4 ++-- 4 files changed, 9 insertions(+), 20 deletions(-) diff --git a/src/Microsoft.AspNetCore.Html.Abstractions/project.json b/src/Microsoft.AspNetCore.Html.Abstractions/project.json index 6d2220cabe..fc92b6e725 100644 --- a/src/Microsoft.AspNetCore.Html.Abstractions/project.json +++ b/src/Microsoft.AspNetCore.Html.Abstractions/project.json @@ -17,19 +17,13 @@ "System.Text.Encodings.Web": "4.0.0-*" }, "frameworks": { - "net451": { - "frameworkAssemblies": { - "System.IO": { "type": "build" }, - "System.Runtime": { "type": "build" } - } - }, - "netstandard1.3": { + "netstandard1.0": { "dependencies": { "System.Collections": "4.0.11-*", "System.Resources.ResourceManager": "4.0.1-*" }, "imports": [ - "dotnet5.4" + "dotnet5.1" ] } } diff --git a/src/Microsoft.Extensions.WebEncoders/project.json b/src/Microsoft.Extensions.WebEncoders/project.json index 1e24e36926..5b12e9999c 100644 --- a/src/Microsoft.Extensions.WebEncoders/project.json +++ b/src/Microsoft.Extensions.WebEncoders/project.json @@ -20,15 +20,9 @@ "System.Text.Encodings.Web": "4.0.0-*" }, "frameworks": { - "net451": { - "frameworkAssemblies": { - "System.IO": { "type": "build" }, - "System.Runtime": { "type": "build" } - } - }, - "netstandard1.3": { + "netstandard1.0": { "imports": [ - "dotnet5.4" + "dotnet5.1" ] } } diff --git a/test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json b/test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json index a2b85b5cfe..5115e2741a 100644 --- a/test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json +++ b/test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json @@ -22,8 +22,9 @@ ] }, "net451": { - "dependencies": { - "xunit.runner.console": "2.1.0" + "frameworkAssemblies": { + "System.IO": { "type": "build" }, + "System.Runtime": { "type": "build" } } } } diff --git a/test/Microsoft.Extensions.WebEncoders.Tests/project.json b/test/Microsoft.Extensions.WebEncoders.Tests/project.json index 0e0c77023b..24fe63d6b1 100644 --- a/test/Microsoft.Extensions.WebEncoders.Tests/project.json +++ b/test/Microsoft.Extensions.WebEncoders.Tests/project.json @@ -22,8 +22,8 @@ ] }, "net451": { - "dependencies": { - "xunit.runner.console": "2.1.0" + "frameworkAssemblies": { + "System.Runtime": { "type": "build" } } } } From 66dccd14eab13387b6b0477f6b0184531dbe7149 Mon Sep 17 00:00:00 2001 From: Cesar Blum Silveira Date: Mon, 14 Mar 2016 21:43:50 -0700 Subject: [PATCH 035/169] ASP.NET 5 -> ASP.NET Core --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 799d29e1dc..c86577af48 100644 --- a/README.md +++ b/README.md @@ -6,4 +6,4 @@ Travis: [![Travis](https://travis-ci.org/aspnet/HtmlAbstractions.svg?branch=de HTML abstractions such as `IHtmlContent` and related APIs. -This project is part of ASP.NET 5. You can find samples, documentation and getting started instructions for ASP.NET 5 at the [Home](https://github.com/aspnet/home) repo. +This project is part of ASP.NET Core. You can find samples, documentation and getting started instructions for ASP.NET Core at the [Home](https://github.com/aspnet/home) repo. From 7c1c4df3109b5df1583c8cb5ef98750aac9b95c6 Mon Sep 17 00:00:00 2001 From: Victor Hurdugaci Date: Thu, 17 Mar 2016 14:31:32 -0700 Subject: [PATCH 036/169] Remove the makefile --- makefile.shade | 10 ---------- 1 file changed, 10 deletions(-) delete mode 100644 makefile.shade diff --git a/makefile.shade b/makefile.shade deleted file mode 100644 index d5e473d558..0000000000 --- a/makefile.shade +++ /dev/null @@ -1,10 +0,0 @@ - -var VERSION='0.1' -var FULL_VERSION='0.1' -var AUTHORS='Microsoft Open Technologies, Inc.' - -use-standard-lifecycle -k-standard-goals - -#xml-docs-test .clean .build-compile description='Check generated XML documentation files for errors' target='package' - k-xml-docs-test From 70c0254dc26ec7659b51cf7244324a79f311922f Mon Sep 17 00:00:00 2001 From: David Fowler Date: Fri, 25 Mar 2016 01:48:01 -0700 Subject: [PATCH 037/169] Fixed build --- .../Microsoft.AspNetCore.Html.Abstractions.Test/project.json | 5 +++-- test/Microsoft.Extensions.WebEncoders.Tests/project.json | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json b/test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json index 5115e2741a..0b423932f0 100644 --- a/test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json +++ b/test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json @@ -7,14 +7,15 @@ "Microsoft.AspNetCore.Html.Abstractions": "1.0.0-*", "Microsoft.AspNetCore.Testing": "1.0.0-*", "Microsoft.Extensions.WebEncoders": "1.0.0-*", - "Microsoft.NETCore.Platforms": "1.0.1-*", "xunit": "2.1.0" }, "testRunner": "xunit", "frameworks": { "netstandardapp1.5": { "dependencies": { - "dotnet-test-xunit": "1.0.0-dev-*" + "dotnet-test-xunit": "1.0.0-dev-*", + "NETStandard.Library": "1.5.0-*", + "System.Diagnostics.Process": "4.1.0-*" }, "imports": [ "dnxcore50", diff --git a/test/Microsoft.Extensions.WebEncoders.Tests/project.json b/test/Microsoft.Extensions.WebEncoders.Tests/project.json index 24fe63d6b1..ab7264c378 100644 --- a/test/Microsoft.Extensions.WebEncoders.Tests/project.json +++ b/test/Microsoft.Extensions.WebEncoders.Tests/project.json @@ -2,7 +2,6 @@ "dependencies": { "Microsoft.Extensions.DependencyInjection": "1.0.0-*", "Microsoft.Extensions.WebEncoders": "1.0.0-*", - "Microsoft.NETCore.Platforms": "1.0.1-*", "xunit": "2.1.0" }, "testRunner": "xunit", @@ -14,7 +13,9 @@ "frameworks": { "netstandardapp1.5": { "dependencies": { - "dotnet-test-xunit": "1.0.0-dev-*" + "dotnet-test-xunit": "1.0.0-dev-*", + "NETStandard.Library": "1.5.0-*", + "System.Diagnostics.Process": "4.1.0-*" }, "imports": [ "dnxcore50", From fd10621c1a3e03ae1770a4f381395b452d5c0a24 Mon Sep 17 00:00:00 2001 From: ryanbrandenburg Date: Fri, 25 Mar 2016 11:07:12 -0700 Subject: [PATCH 038/169] SetContent->SetHtmlContent --- .../HtmlContentBuilderExtensions.cs | 2 +- .../HtmlContentBuilderExtensionsTest.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Microsoft.AspNetCore.Html.Abstractions/HtmlContentBuilderExtensions.cs b/src/Microsoft.AspNetCore.Html.Abstractions/HtmlContentBuilderExtensions.cs index aaba4faefb..439b746a55 100644 --- a/src/Microsoft.AspNetCore.Html.Abstractions/HtmlContentBuilderExtensions.cs +++ b/src/Microsoft.AspNetCore.Html.Abstractions/HtmlContentBuilderExtensions.cs @@ -189,7 +189,7 @@ namespace Microsoft.AspNetCore.Html /// The . /// The value that replaces the content. /// The . - public static IHtmlContentBuilder SetContent(this IHtmlContentBuilder builder, IHtmlContent content) + public static IHtmlContentBuilder SetHtmlContent(this IHtmlContentBuilder builder, IHtmlContent content) { if (builder == null) { diff --git a/test/Microsoft.AspNetCore.Html.Abstractions.Test/HtmlContentBuilderExtensionsTest.cs b/test/Microsoft.AspNetCore.Html.Abstractions.Test/HtmlContentBuilderExtensionsTest.cs index 08151b3675..b985c51890 100644 --- a/test/Microsoft.AspNetCore.Html.Abstractions.Test/HtmlContentBuilderExtensionsTest.cs +++ b/test/Microsoft.AspNetCore.Html.Abstractions.Test/HtmlContentBuilderExtensionsTest.cs @@ -104,7 +104,7 @@ namespace Microsoft.AspNetCore.Html.Test var content = new OtherHtmlContent("Hi"); // Act - builder.SetContent(content); + builder.SetHtmlContent(content); // Assert Assert.Collection( From c5d5ef6788a895627ef25e46129c0b2783d97722 Mon Sep 17 00:00:00 2001 From: Eilon Lipton Date: Sat, 26 Mar 2016 15:00:56 -0700 Subject: [PATCH 039/169] Fix package metadata --- README.md | 2 +- src/Microsoft.AspNetCore.Html.Abstractions/project.json | 5 ++++- src/Microsoft.Extensions.WebEncoders/project.json | 5 ++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index c86577af48..9939efe5b9 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,6 @@ AppVeyor: [![AppVeyor](https://ci.appveyor.com/api/projects/status/cu9y78vsdp19e Travis: [![Travis](https://travis-ci.org/aspnet/HtmlAbstractions.svg?branch=dev)](https://travis-ci.org/aspnet/HtmlAbstractions) -HTML abstractions such as `IHtmlContent` and related APIs. +HTML abstractions used for building HTML content, including types such as `HtmlEncodedString` and `IHtmlContent`. This project is part of ASP.NET Core. You can find samples, documentation and getting started instructions for ASP.NET Core at the [Home](https://github.com/aspnet/home) repo. diff --git a/src/Microsoft.AspNetCore.Html.Abstractions/project.json b/src/Microsoft.AspNetCore.Html.Abstractions/project.json index fc92b6e725..500041c2ed 100644 --- a/src/Microsoft.AspNetCore.Html.Abstractions/project.json +++ b/src/Microsoft.AspNetCore.Html.Abstractions/project.json @@ -1,6 +1,9 @@ { "version": "1.0.0-*", - "description": "ASP.NET 5 HTML content interface.", + "description": "ASP.NET Core HTML abstractions used for building HTML content.\r\nCommonly used types:\r\nMicrosoft.AspNetCore.Html.HtmlEncodedString\r\nMicrosoft.AspNetCore.Html.IHtmlContent", + "tags": [ + "aspnetcore" + ], "repository": { "type": "git", "url": "git://github.com/aspnet/htmlabstractions" diff --git a/src/Microsoft.Extensions.WebEncoders/project.json b/src/Microsoft.Extensions.WebEncoders/project.json index 5b12e9999c..70be4220b9 100644 --- a/src/Microsoft.Extensions.WebEncoders/project.json +++ b/src/Microsoft.Extensions.WebEncoders/project.json @@ -1,6 +1,9 @@ { "version": "1.0.0-*", - "description": "Contains registration and configuration APIs for the core framework encoders.", + "description": "Contains registration and configuration APIs to add the core framework encoders to a dependency injection container.", + "tags": [ + "aspnetcore" + ], "repository": { "type": "git", "url": "git://github.com/aspnet/httpabstractions" From 794d0892ae6975014d3bfb393c9d7646511d81bc Mon Sep 17 00:00:00 2001 From: jacalvar Date: Mon, 28 Mar 2016 15:26:49 -0700 Subject: [PATCH 040/169] Return IServiceCollection from AddWebEncoders extension methods --- .../EncoderServiceCollectionExtensions.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/Microsoft.Extensions.WebEncoders/EncoderServiceCollectionExtensions.cs b/src/Microsoft.Extensions.WebEncoders/EncoderServiceCollectionExtensions.cs index 317d88f99d..72f5e369a1 100644 --- a/src/Microsoft.Extensions.WebEncoders/EncoderServiceCollectionExtensions.cs +++ b/src/Microsoft.Extensions.WebEncoders/EncoderServiceCollectionExtensions.cs @@ -19,8 +19,8 @@ namespace Microsoft.Extensions.DependencyInjection /// to the specified . /// /// The . - /// The instance after the encoders have been added. - public static void AddWebEncoders(this IServiceCollection services) + /// The so that additional calls can be chained. + public static IServiceCollection AddWebEncoders(this IServiceCollection services) { if (services == null) { @@ -37,6 +37,8 @@ namespace Microsoft.Extensions.DependencyInjection CreateFactory(() => JavaScriptEncoder.Default, settings => JavaScriptEncoder.Create(settings))); services.TryAddSingleton( CreateFactory(() => UrlEncoder.Default, settings => UrlEncoder.Create(settings))); + + return services; } /// @@ -45,7 +47,8 @@ namespace Microsoft.Extensions.DependencyInjection /// /// The . /// An to configure the provided . - public static void AddWebEncoders(this IServiceCollection services, Action setupAction) + /// The so that additional calls can be chained. + public static IServiceCollection AddWebEncoders(this IServiceCollection services, Action setupAction) { if (services == null) { @@ -59,6 +62,8 @@ namespace Microsoft.Extensions.DependencyInjection services.AddWebEncoders(); services.Configure(setupAction); + + return services; } private static Func CreateFactory( From 5e2ef6051955e73e2c86c4436e581bc650123d68 Mon Sep 17 00:00:00 2001 From: Victor Hurdugaci Date: Wed, 30 Mar 2016 15:40:25 -0700 Subject: [PATCH 041/169] Webhooks notification --- .travis.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 304e307169..dae036065b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,4 +23,10 @@ branches: - dev - /^(.*\/)?ci-.*$/ script: - - ./build.sh --quiet verify \ No newline at end of file + - ./build.sh --quiet verify +notifications: + webhooks: + secure: "d87o+y2WUx204s8TfSaEuekYudnSyyPaFEXkuzgs3uAyzkKAm/Hx0xcMSuKDqWhYmKaxL7VtgEd2z7mltr2cHZ4oyCrsf6V5v4iI48ojaGykqFXfv8ld6khmLwtdkC32lF2YyuDNL8kUvKNdP9jkrWlpoO/WC6QEqAUxdOuuLo/wLyfrPLbzIvbojwveXbmcwvsfDizLdZdVd88FZSV41h+yBKLnyhpeqRvHG85BTgT/GmVB7Vyjs3yChiS639Aq5DoOP8jBaRdB8Bqs09KibFXzJwDBlKvALIqiwzog3hpd5SVxrgOTCkWbOwqq4TSkahDE425W3vFbmLDANgdfsyAkqgt8daE2BkFTojEHQED+u9CEd8oJVX6FoGnYpuDzge4FVh9iG3HSuKwoVdlONzzew4oJ75iQ+0f67ZNV9oDuScdva/SGb2gYgVUkeJIjDoMxKuaZyhbBT9jRXRBI+LsIjziEhLU/649FjTSmQx0HLpcT7+kaeSmhqT9JffVLidMdvZwhPZsLxPSG9UVBH9G8rdyHXP2e0ZlicHNjjNV6kbDqfDPhHx2/MfZGugsJXjOONKu/5LZduQzmAOysqdLKqkBVkMq2xl7aGV+yVZAtTmZB3nqOWGyKlFC9kLGO+qlJ4tBac26lHCZWTK+4VOAtN5Dag0DkDikgGdZaq78=" + on_success: always + on_failure: always + on_start: always \ No newline at end of file From ffaf2c8b23aa22708c28b58916a179db16883df1 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Wed, 6 Apr 2016 09:46:06 -0700 Subject: [PATCH 042/169] Updating to release. --- NuGet.config | 4 ++-- build.ps1 | 2 +- build.sh | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/NuGet.config b/NuGet.config index 03704957e8..9db87a421e 100644 --- a/NuGet.config +++ b/NuGet.config @@ -1,7 +1,7 @@ - + - + \ No newline at end of file diff --git a/build.ps1 b/build.ps1 index 8f2f99691a..cf8bff13bb 100644 --- a/build.ps1 +++ b/build.ps1 @@ -33,7 +33,7 @@ cd $PSScriptRoot $repoFolder = $PSScriptRoot $env:REPO_FOLDER = $repoFolder -$koreBuildZip="https://github.com/aspnet/KoreBuild/archive/dev.zip" +$koreBuildZip="https://github.com/aspnet/KoreBuild/archive/release.zip" if ($env:KOREBUILD_ZIP) { $koreBuildZip=$env:KOREBUILD_ZIP diff --git a/build.sh b/build.sh index f4208100eb..f88fe4052e 100755 --- a/build.sh +++ b/build.sh @@ -2,7 +2,7 @@ repoFolder="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" cd $repoFolder -koreBuildZip="https://github.com/aspnet/KoreBuild/archive/dev.zip" +koreBuildZip="https://github.com/aspnet/KoreBuild/archive/release.zip" if [ ! -z $KOREBUILD_ZIP ]; then koreBuildZip=$KOREBUILD_ZIP fi From 89c9c3260b2cbc8fe40c5cceb63a411a7c62b3b8 Mon Sep 17 00:00:00 2001 From: Ryan Nowak Date: Wed, 6 Apr 2016 13:46:26 -0700 Subject: [PATCH 043/169] Make HtmlFormattableString public We've had this class for a while backing the implementation of the AppendFormat extension method. Making this public so we can use it in MVC in localization. Some updates to the API surface and name to be aligned with System.FormattableString --- .../HtmlContentBuilderExtensions.cs | 146 +----------- .../HtmlFormattableString.cs | 184 +++++++++++++++ .../HtmlFormattableStringTest.cs | 217 ++++++++++++++++++ 3 files changed, 403 insertions(+), 144 deletions(-) create mode 100644 src/Microsoft.AspNetCore.Html.Abstractions/HtmlFormattableString.cs create mode 100644 test/Microsoft.AspNetCore.Html.Abstractions.Test/HtmlFormattableStringTest.cs diff --git a/src/Microsoft.AspNetCore.Html.Abstractions/HtmlContentBuilderExtensions.cs b/src/Microsoft.AspNetCore.Html.Abstractions/HtmlContentBuilderExtensions.cs index 439b746a55..f7474ca3f2 100644 --- a/src/Microsoft.AspNetCore.Html.Abstractions/HtmlContentBuilderExtensions.cs +++ b/src/Microsoft.AspNetCore.Html.Abstractions/HtmlContentBuilderExtensions.cs @@ -48,7 +48,7 @@ namespace Microsoft.AspNetCore.Html throw new ArgumentNullException(nameof(args)); } - builder.AppendHtml(new HtmlFormatString(format, args)); + builder.AppendHtml(new HtmlFormattableString(format, args)); return builder; } @@ -88,7 +88,7 @@ namespace Microsoft.AspNetCore.Html throw new ArgumentNullException(nameof(args)); } - builder.AppendHtml(new HtmlFormatString(formatProvider, format, args)); + builder.AppendHtml(new HtmlFormattableString(formatProvider, format, args)); return builder; } @@ -219,147 +219,5 @@ namespace Microsoft.AspNetCore.Html builder.AppendHtml(encoded); return builder; } - - [DebuggerDisplay("{DebuggerToString()}")] - private class HtmlFormatString : IHtmlContent - { - private readonly IFormatProvider _formatProvider; - private readonly string _format; - private readonly object[] _args; - - public HtmlFormatString(string format, object[] args) - : this(null, format, args) - { - } - - public HtmlFormatString(IFormatProvider formatProvider, string format, object[] args) - { - Debug.Assert(format != null); - Debug.Assert(args != null); - - _formatProvider = formatProvider ?? CultureInfo.CurrentCulture; - _format = format; - _args = args; - } - - public void WriteTo(TextWriter writer, HtmlEncoder encoder) - { - if (writer == null) - { - throw new ArgumentNullException(nameof(writer)); - } - - if (encoder == null) - { - throw new ArgumentNullException(nameof(encoder)); - } - - var formatProvider = new EncodingFormatProvider(_formatProvider, encoder); - writer.Write(string.Format(formatProvider, _format, _args)); - } - - private string DebuggerToString() - { - using (var writer = new StringWriter()) - { - WriteTo(writer, HtmlEncoder.Default); - return writer.ToString(); - } - } - } - - // This class implements Html encoding via an ICustomFormatter. Passing an instance of this - // class into a string.Format method or anything similar will evaluate arguments implementing - // IHtmlContent without HTML encoding them, and will give other arguments the standard - // composite format string treatment, and then HTML encode the result. - // - // Plenty of examples of ICustomFormatter and the interactions with string.Format here: - // https://msdn.microsoft.com/en-us/library/system.string.format(v=vs.110).aspx#Format6_Example - private class EncodingFormatProvider : IFormatProvider, ICustomFormatter - { - private readonly HtmlEncoder _encoder; - private readonly IFormatProvider _formatProvider; - - public EncodingFormatProvider(IFormatProvider formatProvider, HtmlEncoder encoder) - { - Debug.Assert(formatProvider != null); - Debug.Assert(encoder != null); - - _formatProvider = formatProvider; - _encoder = encoder; - } - - public string Format(string format, object arg, IFormatProvider formatProvider) - { - // These are the cases we need to special case. We trust the HtmlEncodedString or IHtmlContent instance - // to do the right thing with encoding. - var htmlString = arg as HtmlEncodedString; - if (htmlString != null) - { - return htmlString.ToString(); - } - - var htmlContent = arg as IHtmlContent; - if (htmlContent != null) - { - using (var writer = new StringWriter()) - { - htmlContent.WriteTo(writer, _encoder); - return writer.ToString(); - } - } - - // If we get here then 'arg' is not an IHtmlContent, and we want to handle it the way a normal - // string.Format would work, but then HTML encode the result. - // - // First check for an ICustomFormatter - if the IFormatProvider is a CultureInfo, then it's likely - // that ICustomFormatter will be null. - var customFormatter = (ICustomFormatter)_formatProvider.GetFormat(typeof(ICustomFormatter)); - if (customFormatter != null) - { - var result = customFormatter.Format(format, arg, _formatProvider); - if (result != null) - { - return _encoder.Encode(result); - } - } - - // Next check if 'arg' is an IFormattable (DateTime is an example). - // - // An IFormattable will likely call back into the IFormatterProvider and ask for more information - // about how to format itself. This is the typical case when IFormatterProvider is a CultureInfo. - var formattable = arg as IFormattable; - if (formattable != null) - { - var result = formattable.ToString(format, _formatProvider); - if (result != null) - { - return _encoder.Encode(result); - } - } - - // If we get here then there's nothing really smart left to try. - if (arg != null) - { - var result = arg.ToString(); - if (result != null) - { - return _encoder.Encode(result); - } - } - - return string.Empty; - } - - public object GetFormat(Type formatType) - { - if (formatType == typeof(ICustomFormatter)) - { - return this; - } - - return null; - } - } } } diff --git a/src/Microsoft.AspNetCore.Html.Abstractions/HtmlFormattableString.cs b/src/Microsoft.AspNetCore.Html.Abstractions/HtmlFormattableString.cs new file mode 100644 index 0000000000..82e9b69d98 --- /dev/null +++ b/src/Microsoft.AspNetCore.Html.Abstractions/HtmlFormattableString.cs @@ -0,0 +1,184 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System; +using System.Diagnostics; +using System.Globalization; +using System.IO; +using System.Text.Encodings.Web; + +namespace Microsoft.AspNetCore.Html +{ + /// + /// An implementation of composite string formatting + /// (see https://msdn.microsoft.com/en-us/library/txafckwd(v=vs.110).aspx) which HTML encodes + /// formatted arguments. + /// + [DebuggerDisplay("{DebuggerToString()}")] + public class HtmlFormattableString : IHtmlContent + { + private readonly IFormatProvider _formatProvider; + private readonly string _format; + private readonly object[] _args; + + /// + /// Creates a new with the given and + /// . + /// + /// A composite format string. + /// An array that contains objects to format. + public HtmlFormattableString(string format, params object[] args) + : this(formatProvider: null, format: format, args: args) + { + } + + /// + /// Creates a new with the given , + /// and . + /// + /// An object that provides culture-specific formatting information. + /// A composite format string. + /// An array that contains objects to format. + public HtmlFormattableString(IFormatProvider formatProvider, string format, params object[] args) + { + if (format == null) + { + throw new ArgumentNullException(nameof(format)); + } + + if (args == null) + { + throw new ArgumentNullException(nameof(args)); + } + + _formatProvider = formatProvider ?? CultureInfo.CurrentCulture; + _format = format; + _args = args; + } + + /// + public void WriteTo(TextWriter writer, HtmlEncoder encoder) + { + if (writer == null) + { + throw new ArgumentNullException(nameof(writer)); + } + + if (encoder == null) + { + throw new ArgumentNullException(nameof(encoder)); + } + + var formatProvider = new EncodingFormatProvider(_formatProvider, encoder); + writer.Write(string.Format(formatProvider, _format, _args)); + } + + private string DebuggerToString() + { + using (var writer = new StringWriter()) + { + WriteTo(writer, HtmlEncoder.Default); + return writer.ToString(); + } + } + + // This class implements Html encoding via an ICustomFormatter. Passing an instance of this + // class into a string.Format method or anything similar will evaluate arguments implementing + // IHtmlContent without HTML encoding them, and will give other arguments the standard + // composite format string treatment, and then HTML encode the result. + // + // Plenty of examples of ICustomFormatter and the interactions with string.Format here: + // https://msdn.microsoft.com/en-us/library/system.string.format(v=vs.110).aspx#Format6_Example + private class EncodingFormatProvider : IFormatProvider, ICustomFormatter + { + private readonly HtmlEncoder _encoder; + private readonly IFormatProvider _formatProvider; + + private StringWriter _writer; + + public EncodingFormatProvider(IFormatProvider formatProvider, HtmlEncoder encoder) + { + Debug.Assert(formatProvider != null); + Debug.Assert(encoder != null); + + _formatProvider = formatProvider; + _encoder = encoder; + } + + public string Format(string format, object arg, IFormatProvider formatProvider) + { + // These are the cases we need to special case. We trust the HtmlEncodedString or IHtmlContent instance + // to do the right thing with encoding. + var htmlString = arg as HtmlEncodedString; + if (htmlString != null) + { + return htmlString.ToString(); + } + + var htmlContent = arg as IHtmlContent; + if (htmlContent != null) + { + _writer = _writer ?? new StringWriter(); + + htmlContent.WriteTo(_writer, _encoder); + + var result = _writer.ToString(); + _writer.GetStringBuilder().Clear(); + + return result; + } + + // If we get here then 'arg' is not an IHtmlContent, and we want to handle it the way a normal + // string.Format would work, but then HTML encode the result. + // + // First check for an ICustomFormatter - if the IFormatProvider is a CultureInfo, then it's likely + // that ICustomFormatter will be null. + var customFormatter = (ICustomFormatter)_formatProvider.GetFormat(typeof(ICustomFormatter)); + if (customFormatter != null) + { + var result = customFormatter.Format(format, arg, _formatProvider); + if (result != null) + { + return _encoder.Encode(result); + } + } + + // Next check if 'arg' is an IFormattable (DateTime is an example). + // + // An IFormattable will likely call back into the IFormatterProvider and ask for more information + // about how to format itself. This is the typical case when IFormatterProvider is a CultureInfo. + var formattable = arg as IFormattable; + if (formattable != null) + { + var result = formattable.ToString(format, _formatProvider); + if (result != null) + { + return _encoder.Encode(result); + } + } + + // If we get here then there's nothing really smart left to try. + if (arg != null) + { + var result = arg.ToString(); + if (result != null) + { + return _encoder.Encode(result); + } + } + + return string.Empty; + } + + public object GetFormat(Type formatType) + { + if (formatType == typeof(ICustomFormatter)) + { + return this; + } + + return null; + } + } + } +} diff --git a/test/Microsoft.AspNetCore.Html.Abstractions.Test/HtmlFormattableStringTest.cs b/test/Microsoft.AspNetCore.Html.Abstractions.Test/HtmlFormattableStringTest.cs new file mode 100644 index 0000000000..6f466e6046 --- /dev/null +++ b/test/Microsoft.AspNetCore.Html.Abstractions.Test/HtmlFormattableStringTest.cs @@ -0,0 +1,217 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System; +using System.Globalization; +using System.IO; +using Microsoft.AspNetCore.Testing; +using Microsoft.Extensions.WebEncoders.Testing; +using Xunit; + +namespace Microsoft.AspNetCore.Html +{ + public class HtmlFormattableStringTest + { + [Fact] + public void HtmlFormattableString_EmptyArgs() + { + // Arrange + var formattableString = new HtmlFormattableString("Hello, World!"); + + // Act + var result = HtmlContentToString(formattableString); + + // Assert + Assert.Equal("Hello, World!", result); + } + + [Fact] + public void HtmlFormattableString_EmptyArgsAndCulture() + { + // Arrange + var formattableString = new HtmlFormattableString(CultureInfo.CurrentCulture, "Hello, World!"); + + // Act + var result = HtmlContentToString(formattableString); + + // Assert + Assert.Equal("Hello, World!", result); + } + + [Fact] + public void HtmlFormattableString_MultipleArguments() + { + // Arrange + var formattableString = new HtmlFormattableString("{0} {1} {2} {3}!", "First", "Second", "Third", "Fourth"); + + // Act + var result = HtmlContentToString(formattableString); + + // Assert + Assert.Equal( + "HtmlEncode[[First]] HtmlEncode[[Second]] HtmlEncode[[Third]] HtmlEncode[[Fourth]]!", + result); + } + + [Fact] + public void HtmlFormattableString_WithHtmlEncodedString() + { + // Arrange + var formattableString = new HtmlFormattableString("{0}!", new HtmlEncodedString("First")); + + // Act + var result = HtmlContentToString(formattableString); + + // Assert + Assert.Equal("First!", result); + } + + [Fact] + public void HtmlFormattableString_WithOtherIHtmlContent() + { + // Arrange + var builder = new HtmlContentBuilder(); + builder.Append("First"); + + var formattableString = new HtmlFormattableString("{0}!", builder); + + // Act + var result = HtmlContentToString(formattableString); + + // Assert + Assert.Equal("HtmlEncode[[First]]!", result); + } + + // This test is needed to ensure the shared StringWriter gets cleared. + [Fact] + public void HtmlFormattableString_WithMultipleHtmlContentArguments() + { + // Arrange + var formattableString = new HtmlFormattableString( + "Happy {0}, {1}!", + new HtmlEncodedString("Birthday"), + new HtmlContentBuilder().Append("Billy")); + + // Act + var result = HtmlContentToString(formattableString); + + // Assert + Assert.Equal("Happy Birthday, HtmlEncode[[Billy]]!", result); + } + + [Fact] + public void HtmlFormattableString_WithHtmlEncodedString_AndOffset() + { + // Arrange + var formattableString = new HtmlFormattableString("{0, 20}!", new HtmlEncodedString("First")); + + // Act + var result = HtmlContentToString(formattableString); + + // Assert + Assert.Equal(" First!", result); + } + + [Fact] + public void HtmlFormattableString_With3Arguments() + { + // Arrange + var formattableString = new HtmlFormattableString("0x{0:X} - {1} equivalent for {2}.", 50, "hex", 50); + + // Act + var result = HtmlContentToString(formattableString); + + // Assert + Assert.Equal( + "0xHtmlEncode[[32]] - HtmlEncode[[hex]] equivalent for HtmlEncode[[50]].", + result); + } + + [Fact] + public void HtmlFormattableString_WithAlignmentComponent() + { + // Arrange + var formattableString = new HtmlFormattableString("{0, -25} World!", "Hello"); + + // Act + var result = HtmlContentToString(formattableString); + + // Assert + Assert.Equal( + "HtmlEncode[[Hello]] World!", result); + } + + [Fact] + public void HtmlFormattableString_WithFormatStringComponent() + { + // Arrange + var formattableString = new HtmlFormattableString("0x{0:X}", 50); + + // Act + var result = HtmlContentToString(formattableString); + + // Assert + Assert.Equal("0xHtmlEncode[[32]]", result); + } + + [Fact] + public void HtmlFormattableString_WithCulture() + { + // Arrange + var formattableString = new HtmlFormattableString( + CultureInfo.InvariantCulture, + "Numbers in InvariantCulture - {0, -5:N} {1} {2} {3}!", + 1.1, + 2.98, + 145.82, + 32.86); + + // Act + var result = HtmlContentToString(formattableString); + + // Assert + Assert.Equal( + "Numbers in InvariantCulture - HtmlEncode[[1.10]] HtmlEncode[[2.98]] " + + "HtmlEncode[[145.82]] HtmlEncode[[32.86]]!", + result); + } + + [Fact] + [ReplaceCulture("en-US", "en-US")] + public void HtmlFormattableString_UsesPassedInCulture() + { + // Arrange + var culture = new CultureInfo("fr-FR"); + var formattableString = new HtmlFormattableString(culture, "{0} in french!", 1.21); + + // Act + var result = HtmlContentToString(formattableString); + + // Assert + Assert.Equal("HtmlEncode[[1,21]] in french!", result); + } + + [Fact] + [ReplaceCulture("de-DE", "de-DE")] + public void HtmlFormattableString_UsesCurrentCulture() + { + // Arrange + var formattableString = new HtmlFormattableString("{0:D}", DateTime.Parse("01/02/2015")); + + // Act + var result = HtmlContentToString(formattableString); + + // Assert + Assert.Equal("HtmlEncode[[Sonntag, 1. Februar 2015]]", result); + } + + private static string HtmlContentToString(IHtmlContent content) + { + using (var writer = new StringWriter()) + { + content.WriteTo(writer, new HtmlTestEncoder()); + return writer.ToString(); + } + } + } +} From 4d9d196b4a4bbe23e68174c5eac03a88d68a91c9 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Thu, 7 Apr 2016 15:27:11 -0700 Subject: [PATCH 044/169] Removing imports from src projects --- src/Microsoft.AspNetCore.Html.Abstractions/project.json | 5 +---- src/Microsoft.Extensions.WebEncoders/project.json | 6 +----- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/src/Microsoft.AspNetCore.Html.Abstractions/project.json b/src/Microsoft.AspNetCore.Html.Abstractions/project.json index 500041c2ed..69b0215834 100644 --- a/src/Microsoft.AspNetCore.Html.Abstractions/project.json +++ b/src/Microsoft.AspNetCore.Html.Abstractions/project.json @@ -24,10 +24,7 @@ "dependencies": { "System.Collections": "4.0.11-*", "System.Resources.ResourceManager": "4.0.1-*" - }, - "imports": [ - "dotnet5.1" - ] + } } } } \ No newline at end of file diff --git a/src/Microsoft.Extensions.WebEncoders/project.json b/src/Microsoft.Extensions.WebEncoders/project.json index 70be4220b9..beeac94efe 100644 --- a/src/Microsoft.Extensions.WebEncoders/project.json +++ b/src/Microsoft.Extensions.WebEncoders/project.json @@ -23,10 +23,6 @@ "System.Text.Encodings.Web": "4.0.0-*" }, "frameworks": { - "netstandard1.0": { - "imports": [ - "dotnet5.1" - ] - } + "netstandard1.0": {} } } \ No newline at end of file From 98b73cbec5f845cddf1dcffc03ed4cb1d204a7b9 Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Thu, 14 Apr 2016 14:01:34 -0700 Subject: [PATCH 045/169] Migrate tests, tools and samples to portable --- .../project.json | 15 +++++++++++---- .../project.json | 11 ++++++++--- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json b/test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json index 0b423932f0..f05677f95c 100644 --- a/test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json +++ b/test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json @@ -11,10 +11,13 @@ }, "testRunner": "xunit", "frameworks": { - "netstandardapp1.5": { + "netcoreapp1.0": { "dependencies": { + "Microsoft.NETCore.App": { + "version": "1.0.0-*", + "type": "platform" + }, "dotnet-test-xunit": "1.0.0-dev-*", - "NETStandard.Library": "1.5.0-*", "System.Diagnostics.Process": "4.1.0-*" }, "imports": [ @@ -24,8 +27,12 @@ }, "net451": { "frameworkAssemblies": { - "System.IO": { "type": "build" }, - "System.Runtime": { "type": "build" } + "System.IO": { + "type": "build" + }, + "System.Runtime": { + "type": "build" + } } } } diff --git a/test/Microsoft.Extensions.WebEncoders.Tests/project.json b/test/Microsoft.Extensions.WebEncoders.Tests/project.json index ab7264c378..63433fa2c6 100644 --- a/test/Microsoft.Extensions.WebEncoders.Tests/project.json +++ b/test/Microsoft.Extensions.WebEncoders.Tests/project.json @@ -11,10 +11,13 @@ "keyFile": "../../tools/Key.snk" }, "frameworks": { - "netstandardapp1.5": { + "netcoreapp1.0": { "dependencies": { + "Microsoft.NETCore.App": { + "version": "1.0.0-*", + "type": "platform" + }, "dotnet-test-xunit": "1.0.0-dev-*", - "NETStandard.Library": "1.5.0-*", "System.Diagnostics.Process": "4.1.0-*" }, "imports": [ @@ -24,7 +27,9 @@ }, "net451": { "frameworkAssemblies": { - "System.Runtime": { "type": "build" } + "System.Runtime": { + "type": "build" + } } } } From f94faf427623012a3f760ccffb3aba59f004e00e Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Mon, 18 Apr 2016 16:36:54 -0700 Subject: [PATCH 046/169] Bring Microsoft.NETCore.Platforms dependency back --- test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json | 1 + test/Microsoft.Extensions.WebEncoders.Tests/project.json | 1 + 2 files changed, 2 insertions(+) diff --git a/test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json b/test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json index f05677f95c..6a1156028f 100644 --- a/test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json +++ b/test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json @@ -4,6 +4,7 @@ "keyFile": "../../tools/Key.snk" }, "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1-*", "Microsoft.AspNetCore.Html.Abstractions": "1.0.0-*", "Microsoft.AspNetCore.Testing": "1.0.0-*", "Microsoft.Extensions.WebEncoders": "1.0.0-*", diff --git a/test/Microsoft.Extensions.WebEncoders.Tests/project.json b/test/Microsoft.Extensions.WebEncoders.Tests/project.json index 63433fa2c6..69cdc308b0 100644 --- a/test/Microsoft.Extensions.WebEncoders.Tests/project.json +++ b/test/Microsoft.Extensions.WebEncoders.Tests/project.json @@ -1,5 +1,6 @@ { "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.1-*", "Microsoft.Extensions.DependencyInjection": "1.0.0-*", "Microsoft.Extensions.WebEncoders": "1.0.0-*", "xunit": "2.1.0" From cfc071071b00f51d0fc8f1d8e2f3033b145d7af7 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Tue, 19 Apr 2016 14:54:02 -0700 Subject: [PATCH 047/169] Use latest build of dotnet-test-xunit --- test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json | 2 +- test/Microsoft.Extensions.WebEncoders.Tests/project.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json b/test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json index 6a1156028f..15b3e92d51 100644 --- a/test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json +++ b/test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json @@ -18,7 +18,7 @@ "version": "1.0.0-*", "type": "platform" }, - "dotnet-test-xunit": "1.0.0-dev-*", + "dotnet-test-xunit": "1.0.0-*", "System.Diagnostics.Process": "4.1.0-*" }, "imports": [ diff --git a/test/Microsoft.Extensions.WebEncoders.Tests/project.json b/test/Microsoft.Extensions.WebEncoders.Tests/project.json index 69cdc308b0..43836130e5 100644 --- a/test/Microsoft.Extensions.WebEncoders.Tests/project.json +++ b/test/Microsoft.Extensions.WebEncoders.Tests/project.json @@ -18,7 +18,7 @@ "version": "1.0.0-*", "type": "platform" }, - "dotnet-test-xunit": "1.0.0-dev-*", + "dotnet-test-xunit": "1.0.0-*", "System.Diagnostics.Process": "4.1.0-*" }, "imports": [ From a97ac1b23bbbe6e77042f874cc7b79d827632a97 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Mon, 2 May 2016 11:27:16 -0700 Subject: [PATCH 048/169] Fix build warnings --- .../project.json | 16 +++++++++------- .../project.json | 16 +++++++++------- .../project.json | 4 ++-- .../project.json | 4 ++-- 4 files changed, 22 insertions(+), 18 deletions(-) diff --git a/src/Microsoft.AspNetCore.Html.Abstractions/project.json b/src/Microsoft.AspNetCore.Html.Abstractions/project.json index 69b0215834..d117f96abe 100644 --- a/src/Microsoft.AspNetCore.Html.Abstractions/project.json +++ b/src/Microsoft.AspNetCore.Html.Abstractions/project.json @@ -1,14 +1,16 @@ { "version": "1.0.0-*", "description": "ASP.NET Core HTML abstractions used for building HTML content.\r\nCommonly used types:\r\nMicrosoft.AspNetCore.Html.HtmlEncodedString\r\nMicrosoft.AspNetCore.Html.IHtmlContent", - "tags": [ - "aspnetcore" - ], - "repository": { - "type": "git", - "url": "git://github.com/aspnet/htmlabstractions" + "packOptions": { + "repository": { + "type": "git", + "url": "git://github.com/aspnet/htmlabstractions" + }, + "tags": [ + "aspnetcore" + ] }, - "compilationOptions": { + "buildOptions": { "warningsAsErrors": true, "keyFile": "../../tools/Key.snk", "nowarn": [ diff --git a/src/Microsoft.Extensions.WebEncoders/project.json b/src/Microsoft.Extensions.WebEncoders/project.json index beeac94efe..857361e4e4 100644 --- a/src/Microsoft.Extensions.WebEncoders/project.json +++ b/src/Microsoft.Extensions.WebEncoders/project.json @@ -1,14 +1,16 @@ { "version": "1.0.0-*", "description": "Contains registration and configuration APIs to add the core framework encoders to a dependency injection container.", - "tags": [ - "aspnetcore" - ], - "repository": { - "type": "git", - "url": "git://github.com/aspnet/httpabstractions" + "packOptions": { + "repository": { + "type": "git", + "url": "git://github.com/aspnet/httpabstractions" + }, + "tags": [ + "aspnetcore" + ] }, - "compilationOptions": { + "buildOptions": { "warningsAsErrors": true, "allowUnsafe": true, "keyFile": "../../tools/Key.snk", diff --git a/test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json b/test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json index 15b3e92d51..2efabff127 100644 --- a/test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json +++ b/test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json @@ -1,9 +1,10 @@ { - "compilationOptions": { + "buildOptions": { "warningsAsErrors": true, "keyFile": "../../tools/Key.snk" }, "dependencies": { + "dotnet-test-xunit": "1.0.0-*", "Microsoft.NETCore.Platforms": "1.0.1-*", "Microsoft.AspNetCore.Html.Abstractions": "1.0.0-*", "Microsoft.AspNetCore.Testing": "1.0.0-*", @@ -18,7 +19,6 @@ "version": "1.0.0-*", "type": "platform" }, - "dotnet-test-xunit": "1.0.0-*", "System.Diagnostics.Process": "4.1.0-*" }, "imports": [ diff --git a/test/Microsoft.Extensions.WebEncoders.Tests/project.json b/test/Microsoft.Extensions.WebEncoders.Tests/project.json index 43836130e5..2cb866fcc3 100644 --- a/test/Microsoft.Extensions.WebEncoders.Tests/project.json +++ b/test/Microsoft.Extensions.WebEncoders.Tests/project.json @@ -1,12 +1,13 @@ { "dependencies": { + "dotnet-test-xunit": "1.0.0-*", "Microsoft.NETCore.Platforms": "1.0.1-*", "Microsoft.Extensions.DependencyInjection": "1.0.0-*", "Microsoft.Extensions.WebEncoders": "1.0.0-*", "xunit": "2.1.0" }, "testRunner": "xunit", - "compilationOptions": { + "buildOptions": { "allowUnsafe": true, "warningsAsErrors": true, "keyFile": "../../tools/Key.snk" @@ -18,7 +19,6 @@ "version": "1.0.0-*", "type": "platform" }, - "dotnet-test-xunit": "1.0.0-*", "System.Diagnostics.Process": "4.1.0-*" }, "imports": [ From fe563b1459e9c913b9fb2a0fadf212fb64adf036 Mon Sep 17 00:00:00 2001 From: "N. Taylor Mullen" Date: Mon, 16 May 2016 16:06:01 -0700 Subject: [PATCH 049/169] Rename `HtmlEncodedString` => `HtmlString`. - This rename makes the type more consistent with its `HtmlContentBuilder` counterparts (`AppendHtml`). #25 --- README.md | 2 +- .../HtmlContentBuilder.cs | 2 +- .../HtmlContentBuilderExtensions.cs | 8 ++++---- .../HtmlFormattableString.cs | 6 +++--- .../{HtmlEncodedString.cs => HtmlString.cs} | 15 ++++++++++----- .../project.json | 2 +- .../HtmlContentBuilderExtensionsTest.cs | 4 ++-- .../HtmlFormattableStringTest.cs | 10 +++++----- 8 files changed, 27 insertions(+), 22 deletions(-) rename src/Microsoft.AspNetCore.Html.Abstractions/{HtmlEncodedString.cs => HtmlString.cs} (71%) diff --git a/README.md b/README.md index 9939efe5b9..a1e3579e7a 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,6 @@ AppVeyor: [![AppVeyor](https://ci.appveyor.com/api/projects/status/cu9y78vsdp19e Travis: [![Travis](https://travis-ci.org/aspnet/HtmlAbstractions.svg?branch=dev)](https://travis-ci.org/aspnet/HtmlAbstractions) -HTML abstractions used for building HTML content, including types such as `HtmlEncodedString` and `IHtmlContent`. +HTML abstractions used for building HTML content, including types such as `HtmlString` and `IHtmlContent`. This project is part of ASP.NET Core. You can find samples, documentation and getting started instructions for ASP.NET Core at the [Home](https://github.com/aspnet/home) repo. diff --git a/src/Microsoft.AspNetCore.Html.Abstractions/HtmlContentBuilder.cs b/src/Microsoft.AspNetCore.Html.Abstractions/HtmlContentBuilder.cs index be218244b0..864f3c8a65 100644 --- a/src/Microsoft.AspNetCore.Html.Abstractions/HtmlContentBuilder.cs +++ b/src/Microsoft.AspNetCore.Html.Abstractions/HtmlContentBuilder.cs @@ -83,7 +83,7 @@ namespace Microsoft.AspNetCore.Html { if (!string.IsNullOrEmpty(encoded)) { - Entries.Add(new HtmlEncodedString(encoded)); + Entries.Add(new HtmlString(encoded)); } return this; diff --git a/src/Microsoft.AspNetCore.Html.Abstractions/HtmlContentBuilderExtensions.cs b/src/Microsoft.AspNetCore.Html.Abstractions/HtmlContentBuilderExtensions.cs index f7474ca3f2..a5a83fdbb3 100644 --- a/src/Microsoft.AspNetCore.Html.Abstractions/HtmlContentBuilderExtensions.cs +++ b/src/Microsoft.AspNetCore.Html.Abstractions/HtmlContentBuilderExtensions.cs @@ -104,7 +104,7 @@ namespace Microsoft.AspNetCore.Html throw new ArgumentNullException(nameof(builder)); } - builder.AppendHtml(HtmlEncodedString.NewLine); + builder.AppendHtml(HtmlString.NewLine); return builder; } @@ -123,7 +123,7 @@ namespace Microsoft.AspNetCore.Html } builder.Append(unencoded); - builder.AppendHtml(HtmlEncodedString.NewLine); + builder.AppendHtml(HtmlString.NewLine); return builder; } @@ -141,7 +141,7 @@ namespace Microsoft.AspNetCore.Html } builder.AppendHtml(content); - builder.AppendHtml(HtmlEncodedString.NewLine); + builder.AppendHtml(HtmlString.NewLine); return builder; } @@ -160,7 +160,7 @@ namespace Microsoft.AspNetCore.Html } builder.AppendHtml(encoded); - builder.AppendHtml(HtmlEncodedString.NewLine); + builder.AppendHtml(HtmlString.NewLine); return builder; } diff --git a/src/Microsoft.AspNetCore.Html.Abstractions/HtmlFormattableString.cs b/src/Microsoft.AspNetCore.Html.Abstractions/HtmlFormattableString.cs index 82e9b69d98..24bc7c5e2f 100644 --- a/src/Microsoft.AspNetCore.Html.Abstractions/HtmlFormattableString.cs +++ b/src/Microsoft.AspNetCore.Html.Abstractions/HtmlFormattableString.cs @@ -10,7 +10,7 @@ using System.Text.Encodings.Web; namespace Microsoft.AspNetCore.Html { /// - /// An implementation of composite string formatting + /// An implementation of composite string formatting /// (see https://msdn.microsoft.com/en-us/library/txafckwd(v=vs.110).aspx) which HTML encodes /// formatted arguments. /// @@ -107,9 +107,9 @@ namespace Microsoft.AspNetCore.Html public string Format(string format, object arg, IFormatProvider formatProvider) { - // These are the cases we need to special case. We trust the HtmlEncodedString or IHtmlContent instance + // These are the cases we need to special case. We trust the HtmlString or IHtmlContent instance // to do the right thing with encoding. - var htmlString = arg as HtmlEncodedString; + var htmlString = arg as HtmlString; if (htmlString != null) { return htmlString.ToString(); diff --git a/src/Microsoft.AspNetCore.Html.Abstractions/HtmlEncodedString.cs b/src/Microsoft.AspNetCore.Html.Abstractions/HtmlString.cs similarity index 71% rename from src/Microsoft.AspNetCore.Html.Abstractions/HtmlEncodedString.cs rename to src/Microsoft.AspNetCore.Html.Abstractions/HtmlString.cs index bf38ac3682..e7a516bd04 100644 --- a/src/Microsoft.AspNetCore.Html.Abstractions/HtmlEncodedString.cs +++ b/src/Microsoft.AspNetCore.Html.Abstractions/HtmlString.cs @@ -10,18 +10,23 @@ namespace Microsoft.AspNetCore.Html /// /// An implementation that wraps an HTML encoded . /// - public class HtmlEncodedString : IHtmlContent + public class HtmlString : IHtmlContent { /// - /// An instance for . + /// An instance for . /// - public static readonly IHtmlContent NewLine = new HtmlEncodedString(Environment.NewLine); + public static readonly HtmlString NewLine = new HtmlString(Environment.NewLine); /// - /// Creates a new . + /// An instance for . + /// + public static readonly HtmlString Empty = new HtmlString(string.Empty); + + /// + /// Creates a new . /// /// The HTML encoded value. - public HtmlEncodedString(string value) + public HtmlString(string value) { Value = value; } diff --git a/src/Microsoft.AspNetCore.Html.Abstractions/project.json b/src/Microsoft.AspNetCore.Html.Abstractions/project.json index d117f96abe..72763e5b05 100644 --- a/src/Microsoft.AspNetCore.Html.Abstractions/project.json +++ b/src/Microsoft.AspNetCore.Html.Abstractions/project.json @@ -1,6 +1,6 @@ { "version": "1.0.0-*", - "description": "ASP.NET Core HTML abstractions used for building HTML content.\r\nCommonly used types:\r\nMicrosoft.AspNetCore.Html.HtmlEncodedString\r\nMicrosoft.AspNetCore.Html.IHtmlContent", + "description": "ASP.NET Core HTML abstractions used for building HTML content.\r\nCommonly used types:\r\nMicrosoft.AspNetCore.Html.HtmlString\r\nMicrosoft.AspNetCore.Html.IHtmlContent", "packOptions": { "repository": { "type": "git", diff --git a/test/Microsoft.AspNetCore.Html.Abstractions.Test/HtmlContentBuilderExtensionsTest.cs b/test/Microsoft.AspNetCore.Html.Abstractions.Test/HtmlContentBuilderExtensionsTest.cs index b985c51890..c14daeeebb 100644 --- a/test/Microsoft.AspNetCore.Html.Abstractions.Test/HtmlContentBuilderExtensionsTest.cs +++ b/test/Microsoft.AspNetCore.Html.Abstractions.Test/HtmlContentBuilderExtensionsTest.cs @@ -159,13 +159,13 @@ namespace Microsoft.AspNetCore.Html.Test } [Fact] - public void Builder_AppendFormat_HtmlEncodedString() + public void Builder_AppendFormat_HtmlString() { // Arrange var builder = new TestHtmlContentBuilder(); // Act - builder.AppendFormat("{0}!", new HtmlEncodedString("First")); + builder.AppendFormat("{0}!", new HtmlString("First")); // Assert Assert.Equal("First!", HtmlContentToString(builder)); diff --git a/test/Microsoft.AspNetCore.Html.Abstractions.Test/HtmlFormattableStringTest.cs b/test/Microsoft.AspNetCore.Html.Abstractions.Test/HtmlFormattableStringTest.cs index 6f466e6046..64e000751e 100644 --- a/test/Microsoft.AspNetCore.Html.Abstractions.Test/HtmlFormattableStringTest.cs +++ b/test/Microsoft.AspNetCore.Html.Abstractions.Test/HtmlFormattableStringTest.cs @@ -54,10 +54,10 @@ namespace Microsoft.AspNetCore.Html } [Fact] - public void HtmlFormattableString_WithHtmlEncodedString() + public void HtmlFormattableString_WithHtmlString() { // Arrange - var formattableString = new HtmlFormattableString("{0}!", new HtmlEncodedString("First")); + var formattableString = new HtmlFormattableString("{0}!", new HtmlString("First")); // Act var result = HtmlContentToString(formattableString); @@ -89,7 +89,7 @@ namespace Microsoft.AspNetCore.Html // Arrange var formattableString = new HtmlFormattableString( "Happy {0}, {1}!", - new HtmlEncodedString("Birthday"), + new HtmlString("Birthday"), new HtmlContentBuilder().Append("Billy")); // Act @@ -100,10 +100,10 @@ namespace Microsoft.AspNetCore.Html } [Fact] - public void HtmlFormattableString_WithHtmlEncodedString_AndOffset() + public void HtmlFormattableString_WithHtmlString_AndOffset() { // Arrange - var formattableString = new HtmlFormattableString("{0, 20}!", new HtmlEncodedString("First")); + var formattableString = new HtmlFormattableString("{0, 20}!", new HtmlString("First")); // Act var result = HtmlContentToString(formattableString); From 45b4960e265ddfc3c4e8d06dc4a22157b0512ea6 Mon Sep 17 00:00:00 2001 From: Cesar Blum Silveira Date: Fri, 27 May 2016 11:53:04 -0700 Subject: [PATCH 050/169] Fix OSX build on Travis. --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index dae036065b..59d308953d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,6 +22,8 @@ branches: - release - dev - /^(.*\/)?ci-.*$/ +before_install: + - if test "$TRAVIS_OS_NAME" == "osx"; then brew update; brew install openssl; brew link --force openssl; fi script: - ./build.sh --quiet verify notifications: From 0aab6898131d9848728705e146799864bb185be4 Mon Sep 17 00:00:00 2001 From: "N. Taylor Mullen" Date: Mon, 13 Jun 2016 15:28:17 -0700 Subject: [PATCH 051/169] Remove direct Microsoft.NETCore.Platforms dependency. - Microsoft.NETCore.App now pulls this package in. aspnet/Coherence-Signed#344 --- test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json | 1 - test/Microsoft.Extensions.WebEncoders.Tests/project.json | 1 - 2 files changed, 2 deletions(-) diff --git a/test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json b/test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json index 2efabff127..7519592e34 100644 --- a/test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json +++ b/test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json @@ -5,7 +5,6 @@ }, "dependencies": { "dotnet-test-xunit": "1.0.0-*", - "Microsoft.NETCore.Platforms": "1.0.1-*", "Microsoft.AspNetCore.Html.Abstractions": "1.0.0-*", "Microsoft.AspNetCore.Testing": "1.0.0-*", "Microsoft.Extensions.WebEncoders": "1.0.0-*", diff --git a/test/Microsoft.Extensions.WebEncoders.Tests/project.json b/test/Microsoft.Extensions.WebEncoders.Tests/project.json index 2cb866fcc3..7e1a202424 100644 --- a/test/Microsoft.Extensions.WebEncoders.Tests/project.json +++ b/test/Microsoft.Extensions.WebEncoders.Tests/project.json @@ -1,7 +1,6 @@ { "dependencies": { "dotnet-test-xunit": "1.0.0-*", - "Microsoft.NETCore.Platforms": "1.0.1-*", "Microsoft.Extensions.DependencyInjection": "1.0.0-*", "Microsoft.Extensions.WebEncoders": "1.0.0-*", "xunit": "2.1.0" From 2fffcb9da7639401f5a197d96bce401175a86c9b Mon Sep 17 00:00:00 2001 From: Pranav K Date: Tue, 14 Jun 2016 16:22:16 -0700 Subject: [PATCH 052/169] Updating to release. --- NuGet.config | 4 ++-- build.ps1 | 2 +- build.sh | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/NuGet.config b/NuGet.config index 03704957e8..9db87a421e 100644 --- a/NuGet.config +++ b/NuGet.config @@ -1,7 +1,7 @@ - + - + \ No newline at end of file diff --git a/build.ps1 b/build.ps1 index 8f2f99691a..cf8bff13bb 100644 --- a/build.ps1 +++ b/build.ps1 @@ -33,7 +33,7 @@ cd $PSScriptRoot $repoFolder = $PSScriptRoot $env:REPO_FOLDER = $repoFolder -$koreBuildZip="https://github.com/aspnet/KoreBuild/archive/dev.zip" +$koreBuildZip="https://github.com/aspnet/KoreBuild/archive/release.zip" if ($env:KOREBUILD_ZIP) { $koreBuildZip=$env:KOREBUILD_ZIP diff --git a/build.sh b/build.sh index f4208100eb..f88fe4052e 100755 --- a/build.sh +++ b/build.sh @@ -2,7 +2,7 @@ repoFolder="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" cd $repoFolder -koreBuildZip="https://github.com/aspnet/KoreBuild/archive/dev.zip" +koreBuildZip="https://github.com/aspnet/KoreBuild/archive/release.zip" if [ ! -z $KOREBUILD_ZIP ]; then koreBuildZip=$KOREBUILD_ZIP fi From 66518476aff65545f85a3796788f18bf40cfa7e5 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Thu, 16 Jun 2016 10:17:56 -0700 Subject: [PATCH 053/169] Updating to dev versions --- src/Microsoft.AspNetCore.Html.Abstractions/project.json | 2 +- src/Microsoft.Extensions.WebEncoders/project.json | 6 +++--- .../project.json | 6 +++--- test/Microsoft.Extensions.WebEncoders.Tests/project.json | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Microsoft.AspNetCore.Html.Abstractions/project.json b/src/Microsoft.AspNetCore.Html.Abstractions/project.json index 72763e5b05..7d42a7746d 100644 --- a/src/Microsoft.AspNetCore.Html.Abstractions/project.json +++ b/src/Microsoft.AspNetCore.Html.Abstractions/project.json @@ -1,5 +1,5 @@ { - "version": "1.0.0-*", + "version": "1.1.0-*", "description": "ASP.NET Core HTML abstractions used for building HTML content.\r\nCommonly used types:\r\nMicrosoft.AspNetCore.Html.HtmlString\r\nMicrosoft.AspNetCore.Html.IHtmlContent", "packOptions": { "repository": { diff --git a/src/Microsoft.Extensions.WebEncoders/project.json b/src/Microsoft.Extensions.WebEncoders/project.json index 857361e4e4..1e765f8b80 100644 --- a/src/Microsoft.Extensions.WebEncoders/project.json +++ b/src/Microsoft.Extensions.WebEncoders/project.json @@ -1,5 +1,5 @@ { - "version": "1.0.0-*", + "version": "1.1.0-*", "description": "Contains registration and configuration APIs to add the core framework encoders to a dependency injection container.", "packOptions": { "repository": { @@ -20,8 +20,8 @@ "xmlDoc": true }, "dependencies": { - "Microsoft.Extensions.DependencyInjection.Abstractions": "1.0.0-*", - "Microsoft.Extensions.Options": "1.0.0-*", + "Microsoft.Extensions.DependencyInjection.Abstractions": "1.1.0-*", + "Microsoft.Extensions.Options": "1.1.0-*", "System.Text.Encodings.Web": "4.0.0-*" }, "frameworks": { diff --git a/test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json b/test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json index 7519592e34..cbcb78bf6e 100644 --- a/test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json +++ b/test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json @@ -5,9 +5,9 @@ }, "dependencies": { "dotnet-test-xunit": "1.0.0-*", - "Microsoft.AspNetCore.Html.Abstractions": "1.0.0-*", - "Microsoft.AspNetCore.Testing": "1.0.0-*", - "Microsoft.Extensions.WebEncoders": "1.0.0-*", + "Microsoft.AspNetCore.Html.Abstractions": "1.1.0-*", + "Microsoft.AspNetCore.Testing": "1.1.0-*", + "Microsoft.Extensions.WebEncoders": "1.1.0-*", "xunit": "2.1.0" }, "testRunner": "xunit", diff --git a/test/Microsoft.Extensions.WebEncoders.Tests/project.json b/test/Microsoft.Extensions.WebEncoders.Tests/project.json index 7e1a202424..65a29bd9c1 100644 --- a/test/Microsoft.Extensions.WebEncoders.Tests/project.json +++ b/test/Microsoft.Extensions.WebEncoders.Tests/project.json @@ -1,8 +1,8 @@ { "dependencies": { "dotnet-test-xunit": "1.0.0-*", - "Microsoft.Extensions.DependencyInjection": "1.0.0-*", - "Microsoft.Extensions.WebEncoders": "1.0.0-*", + "Microsoft.Extensions.DependencyInjection": "1.1.0-*", + "Microsoft.Extensions.WebEncoders": "1.1.0-*", "xunit": "2.1.0" }, "testRunner": "xunit", From 60a66aaa6db5f7d79fab80d84936fb58a443083a Mon Sep 17 00:00:00 2001 From: Pranav K Date: Thu, 30 Jun 2016 14:52:36 -0700 Subject: [PATCH 054/169] Updating to RTM builds of xunit --- .../project.json | 22 ++++--------------- .../project.json | 16 ++++---------- 2 files changed, 8 insertions(+), 30 deletions(-) diff --git a/test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json b/test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json index cbcb78bf6e..8c2d135d8a 100644 --- a/test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json +++ b/test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json @@ -4,11 +4,11 @@ "keyFile": "../../tools/Key.snk" }, "dependencies": { - "dotnet-test-xunit": "1.0.0-*", + "dotnet-test-xunit": "2.2.0-*", "Microsoft.AspNetCore.Html.Abstractions": "1.1.0-*", "Microsoft.AspNetCore.Testing": "1.1.0-*", "Microsoft.Extensions.WebEncoders": "1.1.0-*", - "xunit": "2.1.0" + "xunit": "2.2.0-*" }, "testRunner": "xunit", "frameworks": { @@ -17,23 +17,9 @@ "Microsoft.NETCore.App": { "version": "1.0.0-*", "type": "platform" - }, - "System.Diagnostics.Process": "4.1.0-*" - }, - "imports": [ - "dnxcore50", - "portable-net451+win8" - ] - }, - "net451": { - "frameworkAssemblies": { - "System.IO": { - "type": "build" - }, - "System.Runtime": { - "type": "build" } } - } + }, + "net451": {} } } \ No newline at end of file diff --git a/test/Microsoft.Extensions.WebEncoders.Tests/project.json b/test/Microsoft.Extensions.WebEncoders.Tests/project.json index 65a29bd9c1..6ed331d6ec 100644 --- a/test/Microsoft.Extensions.WebEncoders.Tests/project.json +++ b/test/Microsoft.Extensions.WebEncoders.Tests/project.json @@ -1,13 +1,12 @@ { "dependencies": { - "dotnet-test-xunit": "1.0.0-*", + "dotnet-test-xunit": "2.2.0-*", "Microsoft.Extensions.DependencyInjection": "1.1.0-*", "Microsoft.Extensions.WebEncoders": "1.1.0-*", - "xunit": "2.1.0" + "xunit": "2.2.0-*" }, "testRunner": "xunit", "buildOptions": { - "allowUnsafe": true, "warningsAsErrors": true, "keyFile": "../../tools/Key.snk" }, @@ -17,20 +16,13 @@ "Microsoft.NETCore.App": { "version": "1.0.0-*", "type": "platform" - }, - "System.Diagnostics.Process": "4.1.0-*" + } }, "imports": [ "dnxcore50", "portable-net451+win8" ] }, - "net451": { - "frameworkAssemblies": { - "System.Runtime": { - "type": "build" - } - } - } + "net451": {} } } \ No newline at end of file From 717e4fe083aee435536ead22c2993278f63f1487 Mon Sep 17 00:00:00 2001 From: Doug Bunting Date: Thu, 7 Jul 2016 12:00:26 -0700 Subject: [PATCH 055/169] One build to rule them all - well, at least VS and command-line builds will share output - part of aspnet/Coherence-Signed#277 --- .../Microsoft.AspNetCore.Html.Abstractions.xproj | 4 ++-- .../Microsoft.Extensions.WebEncoders.xproj | 4 ++-- .../Microsoft.AspNetCore.Html.Abstractions.Test.xproj | 4 ++-- .../Microsoft.Extensions.WebEncoders.Tests.xproj | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/Microsoft.AspNetCore.Html.Abstractions/Microsoft.AspNetCore.Html.Abstractions.xproj b/src/Microsoft.AspNetCore.Html.Abstractions/Microsoft.AspNetCore.Html.Abstractions.xproj index 7a3801b2b1..25d87d97bb 100644 --- a/src/Microsoft.AspNetCore.Html.Abstractions/Microsoft.AspNetCore.Html.Abstractions.xproj +++ b/src/Microsoft.AspNetCore.Html.Abstractions/Microsoft.AspNetCore.Html.Abstractions.xproj @@ -7,8 +7,8 @@ 68a28e4a-3ade-4187-9625-4ff185887cb3 - ..\..\artifacts\obj\$(MSBuildProjectName) - ..\..\artifacts\bin\ + .\obj + .\bin\ 2.0 diff --git a/src/Microsoft.Extensions.WebEncoders/Microsoft.Extensions.WebEncoders.xproj b/src/Microsoft.Extensions.WebEncoders/Microsoft.Extensions.WebEncoders.xproj index 0f278d6c98..f458d42cf1 100644 --- a/src/Microsoft.Extensions.WebEncoders/Microsoft.Extensions.WebEncoders.xproj +++ b/src/Microsoft.Extensions.WebEncoders/Microsoft.Extensions.WebEncoders.xproj @@ -7,8 +7,8 @@ dd2ce416-765e-4000-a03e-c2ff165da1b6 - ..\..\artifacts\obj\$(MSBuildProjectName) - ..\..\artifacts\bin\ + .\obj + .\bin\ 2.0 diff --git a/test/Microsoft.AspNetCore.Html.Abstractions.Test/Microsoft.AspNetCore.Html.Abstractions.Test.xproj b/test/Microsoft.AspNetCore.Html.Abstractions.Test/Microsoft.AspNetCore.Html.Abstractions.Test.xproj index 20389ad4bf..3d3d10b2ac 100644 --- a/test/Microsoft.AspNetCore.Html.Abstractions.Test/Microsoft.AspNetCore.Html.Abstractions.Test.xproj +++ b/test/Microsoft.AspNetCore.Html.Abstractions.Test/Microsoft.AspNetCore.Html.Abstractions.Test.xproj @@ -7,8 +7,8 @@ 2d187b88-94bd-4a39-ac97-f8f8b9363301 - ..\..\artifacts\obj\$(MSBuildProjectName) - ..\..\artifacts\bin\ + .\obj + .\bin\ 2.0 diff --git a/test/Microsoft.Extensions.WebEncoders.Tests/Microsoft.Extensions.WebEncoders.Tests.xproj b/test/Microsoft.Extensions.WebEncoders.Tests/Microsoft.Extensions.WebEncoders.Tests.xproj index 9ad3cb3d4f..a7810a9e17 100644 --- a/test/Microsoft.Extensions.WebEncoders.Tests/Microsoft.Extensions.WebEncoders.Tests.xproj +++ b/test/Microsoft.Extensions.WebEncoders.Tests/Microsoft.Extensions.WebEncoders.Tests.xproj @@ -7,8 +7,8 @@ 7ae2731d-43cd-4cf8-850a-4914de2ce930 - ..\..\artifacts\obj\$(MSBuildProjectName) - ..\..\artifacts\bin\ + .\obj + .\bin\ 2.0 From cbe53312d4b3a41122e334ae38810191363a0486 Mon Sep 17 00:00:00 2001 From: BrennanConroy Date: Tue, 2 Aug 2016 13:15:00 -0700 Subject: [PATCH 056/169] Update .travis.yml --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 59d308953d..1ba51470ba 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,7 +23,7 @@ branches: - dev - /^(.*\/)?ci-.*$/ before_install: - - if test "$TRAVIS_OS_NAME" == "osx"; then brew update; brew install openssl; brew link --force openssl; fi + - if test "$TRAVIS_OS_NAME" == "osx"; then brew update; brew install openssl; ln -s /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib /usr/local/lib/; ln -s /usr/local/opt/openssl/lib/libssl.1.0.0.dylib /usr/local/lib/; fi script: - ./build.sh --quiet verify notifications: @@ -31,4 +31,4 @@ notifications: secure: "d87o+y2WUx204s8TfSaEuekYudnSyyPaFEXkuzgs3uAyzkKAm/Hx0xcMSuKDqWhYmKaxL7VtgEd2z7mltr2cHZ4oyCrsf6V5v4iI48ojaGykqFXfv8ld6khmLwtdkC32lF2YyuDNL8kUvKNdP9jkrWlpoO/WC6QEqAUxdOuuLo/wLyfrPLbzIvbojwveXbmcwvsfDizLdZdVd88FZSV41h+yBKLnyhpeqRvHG85BTgT/GmVB7Vyjs3yChiS639Aq5DoOP8jBaRdB8Bqs09KibFXzJwDBlKvALIqiwzog3hpd5SVxrgOTCkWbOwqq4TSkahDE425W3vFbmLDANgdfsyAkqgt8daE2BkFTojEHQED+u9CEd8oJVX6FoGnYpuDzge4FVh9iG3HSuKwoVdlONzzew4oJ75iQ+0f67ZNV9oDuScdva/SGb2gYgVUkeJIjDoMxKuaZyhbBT9jRXRBI+LsIjziEhLU/649FjTSmQx0HLpcT7+kaeSmhqT9JffVLidMdvZwhPZsLxPSG9UVBH9G8rdyHXP2e0ZlicHNjjNV6kbDqfDPhHx2/MfZGugsJXjOONKu/5LZduQzmAOysqdLKqkBVkMq2xl7aGV+yVZAtTmZB3nqOWGyKlFC9kLGO+qlJ4tBac26lHCZWTK+4VOAtN5Dag0DkDikgGdZaq78=" on_success: always on_failure: always - on_start: always \ No newline at end of file + on_start: always From acab75a1bb3c897f9343ae32c5e460bffad786e1 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Tue, 9 Aug 2016 15:03:00 -0700 Subject: [PATCH 057/169] Switching to dotnet.myget.org feed --- NuGet.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NuGet.config b/NuGet.config index 03704957e8..826a1f9035 100644 --- a/NuGet.config +++ b/NuGet.config @@ -1,7 +1,7 @@  - + \ No newline at end of file From c2690023d8f14f8deb64b9571212ad2da5ff6541 Mon Sep 17 00:00:00 2001 From: Doug Bunting Date: Sun, 4 Sep 2016 12:44:17 -0700 Subject: [PATCH 058/169] Increase .travis.yml consistency between repos - aspnet/Universe#349 - minimize `dotnet` setup time; no need for caching --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.travis.yml b/.travis.yml index 1ba51470ba..e2abeda7d4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,6 +10,10 @@ addons: - libssl-dev - libunwind8 - zlib1g +env: + global: + - DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true + - DOTNET_CLI_TELEMETRY_OPTOUT: 1 mono: - 4.0.5 os: From c13a8affc0662e32edd3914c290c5c9631dbad96 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Wed, 28 Sep 2016 11:50:43 -0700 Subject: [PATCH 059/169] Updating partner package versions --- .../project.json | 10 +++------- src/Microsoft.Extensions.WebEncoders/project.json | 3 ++- .../project.json | 2 +- .../project.json | 2 +- 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/Microsoft.AspNetCore.Html.Abstractions/project.json b/src/Microsoft.AspNetCore.Html.Abstractions/project.json index 7d42a7746d..da6f399828 100644 --- a/src/Microsoft.AspNetCore.Html.Abstractions/project.json +++ b/src/Microsoft.AspNetCore.Html.Abstractions/project.json @@ -19,14 +19,10 @@ "xmlDoc": true }, "dependencies": { - "System.Text.Encodings.Web": "4.0.0-*" + "NETStandard.Library": "1.6.1-*", + "System.Text.Encodings.Web": "4.3.0-*" }, "frameworks": { - "netstandard1.0": { - "dependencies": { - "System.Collections": "4.0.11-*", - "System.Resources.ResourceManager": "4.0.1-*" - } - } + "netstandard1.0": {} } } \ No newline at end of file diff --git a/src/Microsoft.Extensions.WebEncoders/project.json b/src/Microsoft.Extensions.WebEncoders/project.json index 1e765f8b80..852787db64 100644 --- a/src/Microsoft.Extensions.WebEncoders/project.json +++ b/src/Microsoft.Extensions.WebEncoders/project.json @@ -22,7 +22,8 @@ "dependencies": { "Microsoft.Extensions.DependencyInjection.Abstractions": "1.1.0-*", "Microsoft.Extensions.Options": "1.1.0-*", - "System.Text.Encodings.Web": "4.0.0-*" + "NETStandard.Library": "1.6.1-*", + "System.Text.Encodings.Web": "4.3.0-*" }, "frameworks": { "netstandard1.0": {} diff --git a/test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json b/test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json index 8c2d135d8a..8e5e79eeb2 100644 --- a/test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json +++ b/test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json @@ -15,7 +15,7 @@ "netcoreapp1.0": { "dependencies": { "Microsoft.NETCore.App": { - "version": "1.0.0-*", + "version": "1.1.0-*", "type": "platform" } } diff --git a/test/Microsoft.Extensions.WebEncoders.Tests/project.json b/test/Microsoft.Extensions.WebEncoders.Tests/project.json index 6ed331d6ec..4c9ee42471 100644 --- a/test/Microsoft.Extensions.WebEncoders.Tests/project.json +++ b/test/Microsoft.Extensions.WebEncoders.Tests/project.json @@ -14,7 +14,7 @@ "netcoreapp1.0": { "dependencies": { "Microsoft.NETCore.App": { - "version": "1.0.0-*", + "version": "1.1.0-*", "type": "platform" } }, From 08332a96b718ce5b0a192385a196dbcb62f77e21 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Wed, 12 Oct 2016 13:45:26 -0700 Subject: [PATCH 060/169] Updating to netcoreapp1.1 --- test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json | 2 +- test/Microsoft.Extensions.WebEncoders.Tests/project.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json b/test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json index 8e5e79eeb2..754cf25670 100644 --- a/test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json +++ b/test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json @@ -12,7 +12,7 @@ }, "testRunner": "xunit", "frameworks": { - "netcoreapp1.0": { + "netcoreapp1.1": { "dependencies": { "Microsoft.NETCore.App": { "version": "1.1.0-*", diff --git a/test/Microsoft.Extensions.WebEncoders.Tests/project.json b/test/Microsoft.Extensions.WebEncoders.Tests/project.json index 4c9ee42471..9171910c7c 100644 --- a/test/Microsoft.Extensions.WebEncoders.Tests/project.json +++ b/test/Microsoft.Extensions.WebEncoders.Tests/project.json @@ -11,7 +11,7 @@ "keyFile": "../../tools/Key.snk" }, "frameworks": { - "netcoreapp1.0": { + "netcoreapp1.1": { "dependencies": { "Microsoft.NETCore.App": { "version": "1.1.0-*", From 2b86005a855d724873ec02b2434b1872c5646b79 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Wed, 12 Oct 2016 16:08:44 -0700 Subject: [PATCH 061/169] Revert "Updating to netcoreapp1.1" This reverts commit 08332a96b718ce5b0a192385a196dbcb62f77e21. --- test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json | 2 +- test/Microsoft.Extensions.WebEncoders.Tests/project.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json b/test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json index 754cf25670..8e5e79eeb2 100644 --- a/test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json +++ b/test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json @@ -12,7 +12,7 @@ }, "testRunner": "xunit", "frameworks": { - "netcoreapp1.1": { + "netcoreapp1.0": { "dependencies": { "Microsoft.NETCore.App": { "version": "1.1.0-*", diff --git a/test/Microsoft.Extensions.WebEncoders.Tests/project.json b/test/Microsoft.Extensions.WebEncoders.Tests/project.json index 9171910c7c..4c9ee42471 100644 --- a/test/Microsoft.Extensions.WebEncoders.Tests/project.json +++ b/test/Microsoft.Extensions.WebEncoders.Tests/project.json @@ -11,7 +11,7 @@ "keyFile": "../../tools/Key.snk" }, "frameworks": { - "netcoreapp1.1": { + "netcoreapp1.0": { "dependencies": { "Microsoft.NETCore.App": { "version": "1.1.0-*", From 58d5c2f7d4420b095faeece77c580acfbc4f78ca Mon Sep 17 00:00:00 2001 From: Pranav K Date: Thu, 13 Oct 2016 11:17:57 -0700 Subject: [PATCH 062/169] Updating to netcoreapp1.1 --- test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json | 2 +- test/Microsoft.Extensions.WebEncoders.Tests/project.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json b/test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json index 8e5e79eeb2..754cf25670 100644 --- a/test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json +++ b/test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json @@ -12,7 +12,7 @@ }, "testRunner": "xunit", "frameworks": { - "netcoreapp1.0": { + "netcoreapp1.1": { "dependencies": { "Microsoft.NETCore.App": { "version": "1.1.0-*", diff --git a/test/Microsoft.Extensions.WebEncoders.Tests/project.json b/test/Microsoft.Extensions.WebEncoders.Tests/project.json index 4c9ee42471..9171910c7c 100644 --- a/test/Microsoft.Extensions.WebEncoders.Tests/project.json +++ b/test/Microsoft.Extensions.WebEncoders.Tests/project.json @@ -11,7 +11,7 @@ "keyFile": "../../tools/Key.snk" }, "frameworks": { - "netcoreapp1.0": { + "netcoreapp1.1": { "dependencies": { "Microsoft.NETCore.App": { "version": "1.1.0-*", From f280d5ff434257ca679ab9b135f9a7d4235c047b Mon Sep 17 00:00:00 2001 From: Pranav K Date: Mon, 17 Oct 2016 09:49:10 -0700 Subject: [PATCH 063/169] Branching for 1.1.0-preview1 --- NuGet.config | 4 ++-- build.ps1 | 2 +- build.sh | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/NuGet.config b/NuGet.config index 826a1f9035..6197c93176 100644 --- a/NuGet.config +++ b/NuGet.config @@ -1,7 +1,7 @@ - + - + \ No newline at end of file diff --git a/build.ps1 b/build.ps1 index 8f2f99691a..787f63ac02 100644 --- a/build.ps1 +++ b/build.ps1 @@ -33,7 +33,7 @@ cd $PSScriptRoot $repoFolder = $PSScriptRoot $env:REPO_FOLDER = $repoFolder -$koreBuildZip="https://github.com/aspnet/KoreBuild/archive/dev.zip" +$koreBuildZip="https://github.com/aspnet/KoreBuild/archive/rel/1.1.0-preview1.zip" if ($env:KOREBUILD_ZIP) { $koreBuildZip=$env:KOREBUILD_ZIP diff --git a/build.sh b/build.sh index f4208100eb..355c682856 100755 --- a/build.sh +++ b/build.sh @@ -2,7 +2,7 @@ repoFolder="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" cd $repoFolder -koreBuildZip="https://github.com/aspnet/KoreBuild/archive/dev.zip" +koreBuildZip="https://github.com/aspnet/KoreBuild/archive/rel/1.1.0-preview1.zip" if [ ! -z $KOREBUILD_ZIP ]; then koreBuildZip=$KOREBUILD_ZIP fi From 0781b5a87cb9eb8b48044b74cb8e6602650a3b63 Mon Sep 17 00:00:00 2001 From: Doug Bunting Date: Mon, 10 Oct 2016 21:42:33 -0700 Subject: [PATCH 064/169] Add `HtmlContentBuilder.Count` - precursor to PR aspnet/Mvc#5378 for issue aspnet/Mvc#3918 --- .../HtmlContentBuilder.cs | 5 ++ .../HtmlContentBuilderTest.cs | 71 +++++++++++-------- 2 files changed, 45 insertions(+), 31 deletions(-) diff --git a/src/Microsoft.AspNetCore.Html.Abstractions/HtmlContentBuilder.cs b/src/Microsoft.AspNetCore.Html.Abstractions/HtmlContentBuilder.cs index 864f3c8a65..e61d9f7dc8 100644 --- a/src/Microsoft.AspNetCore.Html.Abstractions/HtmlContentBuilder.cs +++ b/src/Microsoft.AspNetCore.Html.Abstractions/HtmlContentBuilder.cs @@ -30,6 +30,11 @@ namespace Microsoft.AspNetCore.Html { } + /// + /// Gets the number of elements in the . + /// + public int Count => Entries.Count; + /// /// Creates a new with the given list of entries. /// diff --git a/test/Microsoft.AspNetCore.Html.Abstractions.Test/HtmlContentBuilderTest.cs b/test/Microsoft.AspNetCore.Html.Abstractions.Test/HtmlContentBuilderTest.cs index 40219b19f7..c3cb7d1954 100644 --- a/test/Microsoft.AspNetCore.Html.Abstractions.Test/HtmlContentBuilderTest.cs +++ b/test/Microsoft.AspNetCore.Html.Abstractions.Test/HtmlContentBuilderTest.cs @@ -22,6 +22,7 @@ namespace Microsoft.Extensions.Internal content.Append("Hello"); // Assert + Assert.Equal(1, content.Count); var result = Assert.Single(content.Entries); Assert.IsType(result); } @@ -69,6 +70,7 @@ namespace Microsoft.Extensions.Internal content.AppendHtml(new TestHtmlContent("Hello")); // Assert + Assert.Equal(1, content.Count); var result = Assert.Single(content.Entries); var testHtmlContent = Assert.IsType(result); testHtmlContent.WriteTo(writer, new HtmlTestEncoder()); @@ -86,9 +88,11 @@ namespace Microsoft.Extensions.Internal content.Append("Test"); // Assert - Assert.Equal(2, content.Entries.Count); - Assert.Equal("Written from TestHtmlContent: hello", content.Entries[0].ToString()); - Assert.Equal("Test", content.Entries[1]); + Assert.Equal(2, content.Count); + Assert.Collection( + content.Entries, + entry => Assert.Equal("Written from TestHtmlContent: hello", entry.ToString()), + entry => Assert.Equal("Test", entry)); } [Fact] @@ -103,7 +107,8 @@ namespace Microsoft.Extensions.Internal content.Clear(); // Assert - Assert.Equal(0, content.Entries.Count); + Assert.Equal(0, content.Count); + Assert.Empty(content.Entries); } [Fact] @@ -121,12 +126,13 @@ namespace Microsoft.Extensions.Internal source.CopyTo(destination); // Assert - Assert.Equal(2, source.Entries.Count); - Assert.Equal(3, destination.Entries.Count); - - Assert.Equal("some-content", Assert.IsType(destination.Entries[0])); - Assert.Equal(new TestHtmlContent("hello"), Assert.IsType(destination.Entries[1])); - Assert.Equal("Test", Assert.IsType(destination.Entries[2])); + Assert.Equal(2, source.Count); + Assert.Equal(3, destination.Count); + Assert.Collection( + destination.Entries, + entry => Assert.Equal("some-content", Assert.IsType(entry)), + entry => Assert.Equal(new TestHtmlContent("hello"), Assert.IsType(entry)), + entry => Assert.Equal("Test", Assert.IsType(entry))); } [Fact] @@ -147,13 +153,14 @@ namespace Microsoft.Extensions.Internal source.CopyTo(destination); // Assert - Assert.Equal(2, source.Entries.Count); - Assert.Equal(1, nested.Entries.Count); - Assert.Equal(3, destination.Entries.Count); - - Assert.Equal("some-content", Assert.IsType(destination.Entries[0])); - Assert.Equal(new TestHtmlContent("hello"), Assert.IsType(destination.Entries[1])); - Assert.Equal("Test", Assert.IsType(destination.Entries[2])); + Assert.Equal(2, source.Count); + Assert.Equal(1, nested.Count); + Assert.Equal(3, destination.Count); + Assert.Collection( + destination.Entries, + entry => Assert.Equal("some-content", Assert.IsType(entry)), + entry => Assert.Equal(new TestHtmlContent("hello"), Assert.IsType(entry)), + entry => Assert.Equal("Test", Assert.IsType(entry))); } [Fact] @@ -171,12 +178,13 @@ namespace Microsoft.Extensions.Internal source.MoveTo(destination); // Assert - Assert.Equal(0, source.Entries.Count); - Assert.Equal(3, destination.Entries.Count); - - Assert.Equal("some-content", Assert.IsType(destination.Entries[0])); - Assert.Equal(new TestHtmlContent("hello"), Assert.IsType(destination.Entries[1])); - Assert.Equal("Test", Assert.IsType(destination.Entries[2])); + Assert.Equal(0, source.Count); + Assert.Equal(3, destination.Count); + Assert.Collection( + destination.Entries, + entry => Assert.Equal("some-content", Assert.IsType(entry)), + entry => Assert.Equal(new TestHtmlContent("hello"), Assert.IsType(entry)), + entry => Assert.Equal("Test", Assert.IsType(entry))); } [Fact] @@ -197,13 +205,14 @@ namespace Microsoft.Extensions.Internal source.MoveTo(destination); // Assert - Assert.Equal(0, source.Entries.Count); - Assert.Equal(0, nested.Entries.Count); - Assert.Equal(3, destination.Entries.Count); - - Assert.Equal("some-content", Assert.IsType(destination.Entries[0])); - Assert.Equal(new TestHtmlContent("hello"), Assert.IsType(destination.Entries[1])); - Assert.Equal("Test", Assert.IsType(destination.Entries[2])); + Assert.Equal(0, source.Count); + Assert.Equal(0, nested.Count); + Assert.Equal(3, destination.Count); + Assert.Collection( + destination.Entries, + entry => Assert.Equal("some-content", Assert.IsType(entry)), + entry => Assert.Equal(new TestHtmlContent("hello"), Assert.IsType(entry)), + entry => Assert.Equal("Test", Assert.IsType(entry))); } [Fact] @@ -219,7 +228,7 @@ namespace Microsoft.Extensions.Internal content.WriteTo(writer, new HtmlTestEncoder()); // Assert - Assert.Equal(2, content.Entries.Count); + Assert.Equal(2, content.Count); Assert.Equal("Written from TestHtmlContent: HelloHtmlEncode[[Test]]", writer.ToString()); } From 80cdeceb0b7127ec9be2da2bfbfbba4824978751 Mon Sep 17 00:00:00 2001 From: jacalvar Date: Fri, 4 Nov 2016 15:28:07 -0700 Subject: [PATCH 065/169] Created public API baselines --- .../baseline.netcore.json | 618 ++++++++++++++++++ .../baseline.netcore.json | 564 ++++++++++++++++ 2 files changed, 1182 insertions(+) create mode 100644 src/Microsoft.AspNetCore.Html.Abstractions/baseline.netcore.json create mode 100644 src/Microsoft.Extensions.WebEncoders/baseline.netcore.json diff --git a/src/Microsoft.AspNetCore.Html.Abstractions/baseline.netcore.json b/src/Microsoft.AspNetCore.Html.Abstractions/baseline.netcore.json new file mode 100644 index 0000000000..7e3a4d0d00 --- /dev/null +++ b/src/Microsoft.AspNetCore.Html.Abstractions/baseline.netcore.json @@ -0,0 +1,618 @@ +{ + "AssemblyIdentity": "Microsoft.AspNetCore.Html.Abstractions, Version=1.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60", + "Types": [ + { + "Name": "Microsoft.AspNetCore.Html.HtmlContentBuilder", + "Visibility": "Public", + "Kind": "Class", + "ImplementedInterfaces": [ + "Microsoft.AspNetCore.Html.IHtmlContentBuilder" + ], + "Members": [ + { + "Kind": "Method", + "Name": "Append", + "Parameters": [ + { + "Name": "unencoded", + "Type": "System.String" + } + ], + "ReturnType": "Microsoft.AspNetCore.Html.IHtmlContentBuilder", + "Sealed": true, + "Virtual": true, + "ImplementedInterface": "Microsoft.AspNetCore.Html.IHtmlContentBuilder", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "AppendHtml", + "Parameters": [ + { + "Name": "htmlContent", + "Type": "Microsoft.AspNetCore.Html.IHtmlContent" + } + ], + "ReturnType": "Microsoft.AspNetCore.Html.IHtmlContentBuilder", + "Sealed": true, + "Virtual": true, + "ImplementedInterface": "Microsoft.AspNetCore.Html.IHtmlContentBuilder", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "AppendHtml", + "Parameters": [ + { + "Name": "encoded", + "Type": "System.String" + } + ], + "ReturnType": "Microsoft.AspNetCore.Html.IHtmlContentBuilder", + "Sealed": true, + "Virtual": true, + "ImplementedInterface": "Microsoft.AspNetCore.Html.IHtmlContentBuilder", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "Clear", + "Parameters": [], + "ReturnType": "Microsoft.AspNetCore.Html.IHtmlContentBuilder", + "Sealed": true, + "Virtual": true, + "ImplementedInterface": "Microsoft.AspNetCore.Html.IHtmlContentBuilder", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "CopyTo", + "Parameters": [ + { + "Name": "destination", + "Type": "Microsoft.AspNetCore.Html.IHtmlContentBuilder" + } + ], + "ReturnType": "System.Void", + "Sealed": true, + "Virtual": true, + "ImplementedInterface": "Microsoft.AspNetCore.Html.IHtmlContentContainer", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "MoveTo", + "Parameters": [ + { + "Name": "destination", + "Type": "Microsoft.AspNetCore.Html.IHtmlContentBuilder" + } + ], + "ReturnType": "System.Void", + "Sealed": true, + "Virtual": true, + "ImplementedInterface": "Microsoft.AspNetCore.Html.IHtmlContentContainer", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "WriteTo", + "Parameters": [ + { + "Name": "writer", + "Type": "System.IO.TextWriter" + }, + { + "Name": "encoder", + "Type": "System.Text.Encodings.Web.HtmlEncoder" + } + ], + "ReturnType": "System.Void", + "Sealed": true, + "Virtual": true, + "ImplementedInterface": "Microsoft.AspNetCore.Html.IHtmlContent", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Constructor", + "Name": ".ctor", + "Parameters": [], + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Constructor", + "Name": ".ctor", + "Parameters": [ + { + "Name": "capacity", + "Type": "System.Int32" + } + ], + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Constructor", + "Name": ".ctor", + "Parameters": [ + { + "Name": "entries", + "Type": "System.Collections.Generic.IList" + } + ], + "Visibility": "Public", + "GenericParameter": [] + } + ], + "GenericParameters": [] + }, + { + "Name": "Microsoft.AspNetCore.Html.HtmlContentBuilderExtensions", + "Visibility": "Public", + "Kind": "Class", + "Abstract": true, + "Static": true, + "Sealed": true, + "ImplementedInterfaces": [], + "Members": [ + { + "Kind": "Method", + "Name": "AppendFormat", + "Parameters": [ + { + "Name": "builder", + "Type": "Microsoft.AspNetCore.Html.IHtmlContentBuilder" + }, + { + "Name": "format", + "Type": "System.String" + }, + { + "Name": "args", + "Type": "System.Object[]", + "IsParams": true + } + ], + "ReturnType": "Microsoft.AspNetCore.Html.IHtmlContentBuilder", + "Static": true, + "Extension": true, + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "AppendFormat", + "Parameters": [ + { + "Name": "builder", + "Type": "Microsoft.AspNetCore.Html.IHtmlContentBuilder" + }, + { + "Name": "formatProvider", + "Type": "System.IFormatProvider" + }, + { + "Name": "format", + "Type": "System.String" + }, + { + "Name": "args", + "Type": "System.Object[]", + "IsParams": true + } + ], + "ReturnType": "Microsoft.AspNetCore.Html.IHtmlContentBuilder", + "Static": true, + "Extension": true, + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "AppendLine", + "Parameters": [ + { + "Name": "builder", + "Type": "Microsoft.AspNetCore.Html.IHtmlContentBuilder" + } + ], + "ReturnType": "Microsoft.AspNetCore.Html.IHtmlContentBuilder", + "Static": true, + "Extension": true, + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "AppendLine", + "Parameters": [ + { + "Name": "builder", + "Type": "Microsoft.AspNetCore.Html.IHtmlContentBuilder" + }, + { + "Name": "unencoded", + "Type": "System.String" + } + ], + "ReturnType": "Microsoft.AspNetCore.Html.IHtmlContentBuilder", + "Static": true, + "Extension": true, + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "AppendLine", + "Parameters": [ + { + "Name": "builder", + "Type": "Microsoft.AspNetCore.Html.IHtmlContentBuilder" + }, + { + "Name": "content", + "Type": "Microsoft.AspNetCore.Html.IHtmlContent" + } + ], + "ReturnType": "Microsoft.AspNetCore.Html.IHtmlContentBuilder", + "Static": true, + "Extension": true, + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "AppendHtmlLine", + "Parameters": [ + { + "Name": "builder", + "Type": "Microsoft.AspNetCore.Html.IHtmlContentBuilder" + }, + { + "Name": "encoded", + "Type": "System.String" + } + ], + "ReturnType": "Microsoft.AspNetCore.Html.IHtmlContentBuilder", + "Static": true, + "Extension": true, + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "SetContent", + "Parameters": [ + { + "Name": "builder", + "Type": "Microsoft.AspNetCore.Html.IHtmlContentBuilder" + }, + { + "Name": "unencoded", + "Type": "System.String" + } + ], + "ReturnType": "Microsoft.AspNetCore.Html.IHtmlContentBuilder", + "Static": true, + "Extension": true, + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "SetHtmlContent", + "Parameters": [ + { + "Name": "builder", + "Type": "Microsoft.AspNetCore.Html.IHtmlContentBuilder" + }, + { + "Name": "content", + "Type": "Microsoft.AspNetCore.Html.IHtmlContent" + } + ], + "ReturnType": "Microsoft.AspNetCore.Html.IHtmlContentBuilder", + "Static": true, + "Extension": true, + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "SetHtmlContent", + "Parameters": [ + { + "Name": "builder", + "Type": "Microsoft.AspNetCore.Html.IHtmlContentBuilder" + }, + { + "Name": "encoded", + "Type": "System.String" + } + ], + "ReturnType": "Microsoft.AspNetCore.Html.IHtmlContentBuilder", + "Static": true, + "Extension": true, + "Visibility": "Public", + "GenericParameter": [] + } + ], + "GenericParameters": [] + }, + { + "Name": "Microsoft.AspNetCore.Html.HtmlFormattableString", + "Visibility": "Public", + "Kind": "Class", + "ImplementedInterfaces": [ + "Microsoft.AspNetCore.Html.IHtmlContent" + ], + "Members": [ + { + "Kind": "Method", + "Name": "WriteTo", + "Parameters": [ + { + "Name": "writer", + "Type": "System.IO.TextWriter" + }, + { + "Name": "encoder", + "Type": "System.Text.Encodings.Web.HtmlEncoder" + } + ], + "ReturnType": "System.Void", + "Sealed": true, + "Virtual": true, + "ImplementedInterface": "Microsoft.AspNetCore.Html.IHtmlContent", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Constructor", + "Name": ".ctor", + "Parameters": [ + { + "Name": "format", + "Type": "System.String" + }, + { + "Name": "args", + "Type": "System.Object[]", + "IsParams": true + } + ], + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Constructor", + "Name": ".ctor", + "Parameters": [ + { + "Name": "formatProvider", + "Type": "System.IFormatProvider" + }, + { + "Name": "format", + "Type": "System.String" + }, + { + "Name": "args", + "Type": "System.Object[]", + "IsParams": true + } + ], + "Visibility": "Public", + "GenericParameter": [] + } + ], + "GenericParameters": [] + }, + { + "Name": "Microsoft.AspNetCore.Html.HtmlString", + "Visibility": "Public", + "Kind": "Class", + "ImplementedInterfaces": [ + "Microsoft.AspNetCore.Html.IHtmlContent" + ], + "Members": [ + { + "Kind": "Method", + "Name": "get_Value", + "Parameters": [], + "ReturnType": "System.String", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "WriteTo", + "Parameters": [ + { + "Name": "writer", + "Type": "System.IO.TextWriter" + }, + { + "Name": "encoder", + "Type": "System.Text.Encodings.Web.HtmlEncoder" + } + ], + "ReturnType": "System.Void", + "Sealed": true, + "Virtual": true, + "ImplementedInterface": "Microsoft.AspNetCore.Html.IHtmlContent", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "ToString", + "Parameters": [], + "ReturnType": "System.String", + "Virtual": true, + "Override": true, + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Constructor", + "Name": ".ctor", + "Parameters": [ + { + "Name": "value", + "Type": "System.String" + } + ], + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Field", + "Name": "NewLine", + "Parameters": [], + "ReturnType": "Microsoft.AspNetCore.Html.HtmlString", + "Static": true, + "ReadOnly": true, + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Field", + "Name": "Empty", + "Parameters": [], + "ReturnType": "Microsoft.AspNetCore.Html.HtmlString", + "Static": true, + "ReadOnly": true, + "Visibility": "Public", + "GenericParameter": [] + } + ], + "GenericParameters": [] + }, + { + "Name": "Microsoft.AspNetCore.Html.IHtmlContent", + "Visibility": "Public", + "Kind": "Interface", + "Abstract": true, + "ImplementedInterfaces": [], + "Members": [ + { + "Kind": "Method", + "Name": "WriteTo", + "Parameters": [ + { + "Name": "writer", + "Type": "System.IO.TextWriter" + }, + { + "Name": "encoder", + "Type": "System.Text.Encodings.Web.HtmlEncoder" + } + ], + "ReturnType": "System.Void", + "GenericParameter": [] + } + ], + "GenericParameters": [] + }, + { + "Name": "Microsoft.AspNetCore.Html.IHtmlContentBuilder", + "Visibility": "Public", + "Kind": "Interface", + "Abstract": true, + "ImplementedInterfaces": [ + "Microsoft.AspNetCore.Html.IHtmlContentContainer" + ], + "Members": [ + { + "Kind": "Method", + "Name": "AppendHtml", + "Parameters": [ + { + "Name": "content", + "Type": "Microsoft.AspNetCore.Html.IHtmlContent" + } + ], + "ReturnType": "Microsoft.AspNetCore.Html.IHtmlContentBuilder", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "Append", + "Parameters": [ + { + "Name": "unencoded", + "Type": "System.String" + } + ], + "ReturnType": "Microsoft.AspNetCore.Html.IHtmlContentBuilder", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "AppendHtml", + "Parameters": [ + { + "Name": "encoded", + "Type": "System.String" + } + ], + "ReturnType": "Microsoft.AspNetCore.Html.IHtmlContentBuilder", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "Clear", + "Parameters": [], + "ReturnType": "Microsoft.AspNetCore.Html.IHtmlContentBuilder", + "GenericParameter": [] + } + ], + "GenericParameters": [] + }, + { + "Name": "Microsoft.AspNetCore.Html.IHtmlContentContainer", + "Visibility": "Public", + "Kind": "Interface", + "Abstract": true, + "ImplementedInterfaces": [ + "Microsoft.AspNetCore.Html.IHtmlContent" + ], + "Members": [ + { + "Kind": "Method", + "Name": "CopyTo", + "Parameters": [ + { + "Name": "builder", + "Type": "Microsoft.AspNetCore.Html.IHtmlContentBuilder" + } + ], + "ReturnType": "System.Void", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "MoveTo", + "Parameters": [ + { + "Name": "builder", + "Type": "Microsoft.AspNetCore.Html.IHtmlContentBuilder" + } + ], + "ReturnType": "System.Void", + "GenericParameter": [] + } + ], + "GenericParameters": [] + } + ] +} \ No newline at end of file diff --git a/src/Microsoft.Extensions.WebEncoders/baseline.netcore.json b/src/Microsoft.Extensions.WebEncoders/baseline.netcore.json new file mode 100644 index 0000000000..db16203ed1 --- /dev/null +++ b/src/Microsoft.Extensions.WebEncoders/baseline.netcore.json @@ -0,0 +1,564 @@ +{ + "AssemblyIdentity": "Microsoft.Extensions.WebEncoders, Version=1.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60", + "Types": [ + { + "Name": "Microsoft.Extensions.WebEncoders.WebEncoderOptions", + "Visibility": "Public", + "Kind": "Class", + "Sealed": true, + "ImplementedInterfaces": [], + "Members": [ + { + "Kind": "Method", + "Name": "get_TextEncoderSettings", + "Parameters": [], + "ReturnType": "System.Text.Encodings.Web.TextEncoderSettings", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "set_TextEncoderSettings", + "Parameters": [ + { + "Name": "value", + "Type": "System.Text.Encodings.Web.TextEncoderSettings" + } + ], + "ReturnType": "System.Void", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Constructor", + "Name": ".ctor", + "Parameters": [], + "Visibility": "Public", + "GenericParameter": [] + } + ], + "GenericParameters": [] + }, + { + "Name": "Microsoft.Extensions.WebEncoders.Testing.HtmlTestEncoder", + "Visibility": "Public", + "Kind": "Class", + "Sealed": true, + "BaseType": "System.Text.Encodings.Web.HtmlEncoder", + "ImplementedInterfaces": [], + "Members": [ + { + "Kind": "Method", + "Name": "get_MaxOutputCharactersPerInputCharacter", + "Parameters": [], + "ReturnType": "System.Int32", + "Virtual": true, + "Override": true, + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "Encode", + "Parameters": [ + { + "Name": "value", + "Type": "System.String" + } + ], + "ReturnType": "System.String", + "Virtual": true, + "Override": true, + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "Encode", + "Parameters": [ + { + "Name": "output", + "Type": "System.IO.TextWriter" + }, + { + "Name": "value", + "Type": "System.Char[]" + }, + { + "Name": "startIndex", + "Type": "System.Int32" + }, + { + "Name": "characterCount", + "Type": "System.Int32" + } + ], + "ReturnType": "System.Void", + "Virtual": true, + "Override": true, + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "Encode", + "Parameters": [ + { + "Name": "output", + "Type": "System.IO.TextWriter" + }, + { + "Name": "value", + "Type": "System.String" + }, + { + "Name": "startIndex", + "Type": "System.Int32" + }, + { + "Name": "characterCount", + "Type": "System.Int32" + } + ], + "ReturnType": "System.Void", + "Virtual": true, + "Override": true, + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "WillEncode", + "Parameters": [ + { + "Name": "unicodeScalar", + "Type": "System.Int32" + } + ], + "ReturnType": "System.Boolean", + "Virtual": true, + "Override": true, + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "FindFirstCharacterToEncode", + "Parameters": [ + { + "Name": "text", + "Type": "System.Char*" + }, + { + "Name": "textLength", + "Type": "System.Int32" + } + ], + "ReturnType": "System.Int32", + "Virtual": true, + "Override": true, + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "TryEncodeUnicodeScalar", + "Parameters": [ + { + "Name": "unicodeScalar", + "Type": "System.Int32" + }, + { + "Name": "buffer", + "Type": "System.Char*" + }, + { + "Name": "bufferLength", + "Type": "System.Int32" + }, + { + "Name": "numberOfCharactersWritten", + "Type": "System.Int32", + "Direction": "Out" + } + ], + "ReturnType": "System.Boolean", + "Virtual": true, + "Override": true, + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Constructor", + "Name": ".ctor", + "Parameters": [], + "Visibility": "Public", + "GenericParameter": [] + } + ], + "GenericParameters": [] + }, + { + "Name": "Microsoft.Extensions.WebEncoders.Testing.JavaScriptTestEncoder", + "Visibility": "Public", + "Kind": "Class", + "BaseType": "System.Text.Encodings.Web.JavaScriptEncoder", + "ImplementedInterfaces": [], + "Members": [ + { + "Kind": "Method", + "Name": "get_MaxOutputCharactersPerInputCharacter", + "Parameters": [], + "ReturnType": "System.Int32", + "Virtual": true, + "Override": true, + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "Encode", + "Parameters": [ + { + "Name": "value", + "Type": "System.String" + } + ], + "ReturnType": "System.String", + "Virtual": true, + "Override": true, + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "Encode", + "Parameters": [ + { + "Name": "output", + "Type": "System.IO.TextWriter" + }, + { + "Name": "value", + "Type": "System.Char[]" + }, + { + "Name": "startIndex", + "Type": "System.Int32" + }, + { + "Name": "characterCount", + "Type": "System.Int32" + } + ], + "ReturnType": "System.Void", + "Virtual": true, + "Override": true, + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "Encode", + "Parameters": [ + { + "Name": "output", + "Type": "System.IO.TextWriter" + }, + { + "Name": "value", + "Type": "System.String" + }, + { + "Name": "startIndex", + "Type": "System.Int32" + }, + { + "Name": "characterCount", + "Type": "System.Int32" + } + ], + "ReturnType": "System.Void", + "Virtual": true, + "Override": true, + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "WillEncode", + "Parameters": [ + { + "Name": "unicodeScalar", + "Type": "System.Int32" + } + ], + "ReturnType": "System.Boolean", + "Virtual": true, + "Override": true, + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "FindFirstCharacterToEncode", + "Parameters": [ + { + "Name": "text", + "Type": "System.Char*" + }, + { + "Name": "textLength", + "Type": "System.Int32" + } + ], + "ReturnType": "System.Int32", + "Virtual": true, + "Override": true, + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "TryEncodeUnicodeScalar", + "Parameters": [ + { + "Name": "unicodeScalar", + "Type": "System.Int32" + }, + { + "Name": "buffer", + "Type": "System.Char*" + }, + { + "Name": "bufferLength", + "Type": "System.Int32" + }, + { + "Name": "numberOfCharactersWritten", + "Type": "System.Int32", + "Direction": "Out" + } + ], + "ReturnType": "System.Boolean", + "Virtual": true, + "Override": true, + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Constructor", + "Name": ".ctor", + "Parameters": [], + "Visibility": "Public", + "GenericParameter": [] + } + ], + "GenericParameters": [] + }, + { + "Name": "Microsoft.Extensions.WebEncoders.Testing.UrlTestEncoder", + "Visibility": "Public", + "Kind": "Class", + "BaseType": "System.Text.Encodings.Web.UrlEncoder", + "ImplementedInterfaces": [], + "Members": [ + { + "Kind": "Method", + "Name": "get_MaxOutputCharactersPerInputCharacter", + "Parameters": [], + "ReturnType": "System.Int32", + "Virtual": true, + "Override": true, + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "Encode", + "Parameters": [ + { + "Name": "value", + "Type": "System.String" + } + ], + "ReturnType": "System.String", + "Virtual": true, + "Override": true, + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "Encode", + "Parameters": [ + { + "Name": "output", + "Type": "System.IO.TextWriter" + }, + { + "Name": "value", + "Type": "System.Char[]" + }, + { + "Name": "startIndex", + "Type": "System.Int32" + }, + { + "Name": "characterCount", + "Type": "System.Int32" + } + ], + "ReturnType": "System.Void", + "Virtual": true, + "Override": true, + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "Encode", + "Parameters": [ + { + "Name": "output", + "Type": "System.IO.TextWriter" + }, + { + "Name": "value", + "Type": "System.String" + }, + { + "Name": "startIndex", + "Type": "System.Int32" + }, + { + "Name": "characterCount", + "Type": "System.Int32" + } + ], + "ReturnType": "System.Void", + "Virtual": true, + "Override": true, + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "WillEncode", + "Parameters": [ + { + "Name": "unicodeScalar", + "Type": "System.Int32" + } + ], + "ReturnType": "System.Boolean", + "Virtual": true, + "Override": true, + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "FindFirstCharacterToEncode", + "Parameters": [ + { + "Name": "text", + "Type": "System.Char*" + }, + { + "Name": "textLength", + "Type": "System.Int32" + } + ], + "ReturnType": "System.Int32", + "Virtual": true, + "Override": true, + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "TryEncodeUnicodeScalar", + "Parameters": [ + { + "Name": "unicodeScalar", + "Type": "System.Int32" + }, + { + "Name": "buffer", + "Type": "System.Char*" + }, + { + "Name": "bufferLength", + "Type": "System.Int32" + }, + { + "Name": "numberOfCharactersWritten", + "Type": "System.Int32", + "Direction": "Out" + } + ], + "ReturnType": "System.Boolean", + "Virtual": true, + "Override": true, + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Constructor", + "Name": ".ctor", + "Parameters": [], + "Visibility": "Public", + "GenericParameter": [] + } + ], + "GenericParameters": [] + }, + { + "Name": "Microsoft.Extensions.DependencyInjection.EncoderServiceCollectionExtensions", + "Visibility": "Public", + "Kind": "Class", + "Abstract": true, + "Static": true, + "Sealed": true, + "ImplementedInterfaces": [], + "Members": [ + { + "Kind": "Method", + "Name": "AddWebEncoders", + "Parameters": [ + { + "Name": "services", + "Type": "Microsoft.Extensions.DependencyInjection.IServiceCollection" + } + ], + "ReturnType": "Microsoft.Extensions.DependencyInjection.IServiceCollection", + "Static": true, + "Extension": true, + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "AddWebEncoders", + "Parameters": [ + { + "Name": "services", + "Type": "Microsoft.Extensions.DependencyInjection.IServiceCollection" + }, + { + "Name": "setupAction", + "Type": "System.Action" + } + ], + "ReturnType": "Microsoft.Extensions.DependencyInjection.IServiceCollection", + "Static": true, + "Extension": true, + "Visibility": "Public", + "GenericParameter": [] + } + ], + "GenericParameters": [] + } + ] +} \ No newline at end of file From 86508f3c44468326384c90b139b1bd4e7328e832 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Wed, 9 Nov 2016 11:31:01 -0800 Subject: [PATCH 066/169] Branching for 1.1.0 --- NuGet.config | 4 ++-- build.ps1 | 2 +- build.sh | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/NuGet.config b/NuGet.config index 826a1f9035..6197c93176 100644 --- a/NuGet.config +++ b/NuGet.config @@ -1,7 +1,7 @@ - + - + \ No newline at end of file diff --git a/build.ps1 b/build.ps1 index 8f2f99691a..24ca167cf6 100644 --- a/build.ps1 +++ b/build.ps1 @@ -33,7 +33,7 @@ cd $PSScriptRoot $repoFolder = $PSScriptRoot $env:REPO_FOLDER = $repoFolder -$koreBuildZip="https://github.com/aspnet/KoreBuild/archive/dev.zip" +$koreBuildZip="https://github.com/aspnet/KoreBuild/archive/rel/1.1.0.zip" if ($env:KOREBUILD_ZIP) { $koreBuildZip=$env:KOREBUILD_ZIP diff --git a/build.sh b/build.sh index f4208100eb..fea9ac64ad 100755 --- a/build.sh +++ b/build.sh @@ -2,7 +2,7 @@ repoFolder="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" cd $repoFolder -koreBuildZip="https://github.com/aspnet/KoreBuild/archive/dev.zip" +koreBuildZip="https://github.com/aspnet/KoreBuild/archive/rel/1.1.0.zip" if [ ! -z $KOREBUILD_ZIP ]; then koreBuildZip=$KOREBUILD_ZIP fi From 9cdb55b59cee496d3b65913c42fff4724ac2e52f Mon Sep 17 00:00:00 2001 From: Pranav K Date: Wed, 9 Nov 2016 14:17:51 -0800 Subject: [PATCH 067/169] Updating versions to 1.2.0-* --- src/Microsoft.AspNetCore.Html.Abstractions/project.json | 2 +- src/Microsoft.Extensions.WebEncoders/project.json | 6 +++--- .../project.json | 6 +++--- test/Microsoft.Extensions.WebEncoders.Tests/project.json | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Microsoft.AspNetCore.Html.Abstractions/project.json b/src/Microsoft.AspNetCore.Html.Abstractions/project.json index da6f399828..8c64893f22 100644 --- a/src/Microsoft.AspNetCore.Html.Abstractions/project.json +++ b/src/Microsoft.AspNetCore.Html.Abstractions/project.json @@ -1,5 +1,5 @@ { - "version": "1.1.0-*", + "version": "1.2.0-*", "description": "ASP.NET Core HTML abstractions used for building HTML content.\r\nCommonly used types:\r\nMicrosoft.AspNetCore.Html.HtmlString\r\nMicrosoft.AspNetCore.Html.IHtmlContent", "packOptions": { "repository": { diff --git a/src/Microsoft.Extensions.WebEncoders/project.json b/src/Microsoft.Extensions.WebEncoders/project.json index 852787db64..f7ded704b5 100644 --- a/src/Microsoft.Extensions.WebEncoders/project.json +++ b/src/Microsoft.Extensions.WebEncoders/project.json @@ -1,5 +1,5 @@ { - "version": "1.1.0-*", + "version": "1.2.0-*", "description": "Contains registration and configuration APIs to add the core framework encoders to a dependency injection container.", "packOptions": { "repository": { @@ -20,8 +20,8 @@ "xmlDoc": true }, "dependencies": { - "Microsoft.Extensions.DependencyInjection.Abstractions": "1.1.0-*", - "Microsoft.Extensions.Options": "1.1.0-*", + "Microsoft.Extensions.DependencyInjection.Abstractions": "1.2.0-*", + "Microsoft.Extensions.Options": "1.2.0-*", "NETStandard.Library": "1.6.1-*", "System.Text.Encodings.Web": "4.3.0-*" }, diff --git a/test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json b/test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json index 754cf25670..a1e50970d0 100644 --- a/test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json +++ b/test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json @@ -5,9 +5,9 @@ }, "dependencies": { "dotnet-test-xunit": "2.2.0-*", - "Microsoft.AspNetCore.Html.Abstractions": "1.1.0-*", - "Microsoft.AspNetCore.Testing": "1.1.0-*", - "Microsoft.Extensions.WebEncoders": "1.1.0-*", + "Microsoft.AspNetCore.Html.Abstractions": "1.2.0-*", + "Microsoft.AspNetCore.Testing": "1.2.0-*", + "Microsoft.Extensions.WebEncoders": "1.2.0-*", "xunit": "2.2.0-*" }, "testRunner": "xunit", diff --git a/test/Microsoft.Extensions.WebEncoders.Tests/project.json b/test/Microsoft.Extensions.WebEncoders.Tests/project.json index 9171910c7c..462b1cebfd 100644 --- a/test/Microsoft.Extensions.WebEncoders.Tests/project.json +++ b/test/Microsoft.Extensions.WebEncoders.Tests/project.json @@ -1,8 +1,8 @@ { "dependencies": { "dotnet-test-xunit": "2.2.0-*", - "Microsoft.Extensions.DependencyInjection": "1.1.0-*", - "Microsoft.Extensions.WebEncoders": "1.1.0-*", + "Microsoft.Extensions.DependencyInjection": "1.2.0-*", + "Microsoft.Extensions.WebEncoders": "1.2.0-*", "xunit": "2.2.0-*" }, "testRunner": "xunit", From 6259fd3fb37712fb670e33326c68279c8df3c9b0 Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Fri, 18 Nov 2016 10:57:00 -0800 Subject: [PATCH 068/169] Clean tmp folder after unzipping KoreBuild --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index f4208100eb..4fd7ede788 100755 --- a/build.sh +++ b/build.sh @@ -38,7 +38,7 @@ if test ! -d $buildFolder; then chmod +x $buildFile # Cleanup - if test ! -d $tempFolder; then + if test -d $tempFolder; then rm -rf $tempFolder fi fi From fe4527d54399bb98c43e0f75633b6d4ea3d812ab Mon Sep 17 00:00:00 2001 From: "N. Taylor Mullen" Date: Wed, 23 Nov 2016 15:57:55 -0800 Subject: [PATCH 069/169] Pin global.json SDK to 1.0.0-preview2-1-003177. --- global.json | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/global.json b/global.json index 983ba0401e..f45e8cc925 100644 --- a/global.json +++ b/global.json @@ -1,3 +1,8 @@ { - "projects": ["src"] -} + "projects": [ + "src" + ], + "sdk": { + "version": "1.0.0-preview2-1-003177" + } +} \ No newline at end of file From 9c90925f81b59a637b86f015d6fbba930c0d56d0 Mon Sep 17 00:00:00 2001 From: "N. Taylor Mullen" Date: Thu, 8 Dec 2016 10:02:30 -0800 Subject: [PATCH 070/169] Update .travis.yml osx image to xcode7.3. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index e2abeda7d4..67d9a88786 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,7 +19,7 @@ mono: os: - linux - osx -osx_image: xcode7.1 +osx_image: xcode7.3 branches: only: - master From 3a9dff9c1c3884e3919ffa99a64b78485836ede9 Mon Sep 17 00:00:00 2001 From: Ajay Bhargav Baaskaran Date: Mon, 12 Dec 2016 00:42:29 -0800 Subject: [PATCH 071/169] Removed packages list in NuGetPackageVerifier.json --- NuGetPackageVerifier.json | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/NuGetPackageVerifier.json b/NuGetPackageVerifier.json index 8df495e3e0..b153ab1515 100644 --- a/NuGetPackageVerifier.json +++ b/NuGetPackageVerifier.json @@ -1,14 +1,5 @@ { - "adx": { // Packages written by the ADX team and that ship on NuGet.org - "rules": [ - "AdxVerificationCompositeRule" - ], - "packages": { - "Microsoft.AspNetCore.Html.Abstractions": { }, - "Microsoft.Extensions.WebEncoders": { } - } - }, - "Default": { // Rules to run for packages not listed in any other set. + "Default": { "rules": [ "DefaultCompositeRule" ] From f6eb86be7838e030173d2c6e7614bccd18d1dec7 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Mon, 5 Dec 2016 09:02:41 -0800 Subject: [PATCH 072/169] Updating to 4.4 CoreFx packages --- global.json | 2 +- src/Microsoft.AspNetCore.Html.Abstractions/project.json | 4 ++-- src/Microsoft.Extensions.WebEncoders/project.json | 4 ++-- test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json | 2 +- test/Microsoft.Extensions.WebEncoders.Tests/project.json | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/global.json b/global.json index f45e8cc925..0ad1995dd2 100644 --- a/global.json +++ b/global.json @@ -3,6 +3,6 @@ "src" ], "sdk": { - "version": "1.0.0-preview2-1-003177" + "version": "1.0.0-preview2-1-003180" } } \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.Html.Abstractions/project.json b/src/Microsoft.AspNetCore.Html.Abstractions/project.json index 8c64893f22..4e640d584b 100644 --- a/src/Microsoft.AspNetCore.Html.Abstractions/project.json +++ b/src/Microsoft.AspNetCore.Html.Abstractions/project.json @@ -19,8 +19,8 @@ "xmlDoc": true }, "dependencies": { - "NETStandard.Library": "1.6.1-*", - "System.Text.Encodings.Web": "4.3.0-*" + "NETStandard.Library": "1.6.2-*", + "System.Text.Encodings.Web": "4.4.0-*" }, "frameworks": { "netstandard1.0": {} diff --git a/src/Microsoft.Extensions.WebEncoders/project.json b/src/Microsoft.Extensions.WebEncoders/project.json index f7ded704b5..b3fe422893 100644 --- a/src/Microsoft.Extensions.WebEncoders/project.json +++ b/src/Microsoft.Extensions.WebEncoders/project.json @@ -22,8 +22,8 @@ "dependencies": { "Microsoft.Extensions.DependencyInjection.Abstractions": "1.2.0-*", "Microsoft.Extensions.Options": "1.2.0-*", - "NETStandard.Library": "1.6.1-*", - "System.Text.Encodings.Web": "4.3.0-*" + "NETStandard.Library": "1.6.2-*", + "System.Text.Encodings.Web": "4.4.0-*" }, "frameworks": { "netstandard1.0": {} diff --git a/test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json b/test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json index a1e50970d0..0e46d9c52c 100644 --- a/test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json +++ b/test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json @@ -15,7 +15,7 @@ "netcoreapp1.1": { "dependencies": { "Microsoft.NETCore.App": { - "version": "1.1.0-*", + "version": "1.2.0-*", "type": "platform" } } diff --git a/test/Microsoft.Extensions.WebEncoders.Tests/project.json b/test/Microsoft.Extensions.WebEncoders.Tests/project.json index 462b1cebfd..d06fb5b18b 100644 --- a/test/Microsoft.Extensions.WebEncoders.Tests/project.json +++ b/test/Microsoft.Extensions.WebEncoders.Tests/project.json @@ -14,7 +14,7 @@ "netcoreapp1.1": { "dependencies": { "Microsoft.NETCore.App": { - "version": "1.1.0-*", + "version": "1.2.0-*", "type": "platform" } }, From 81acef9238622249c95229ce2d6205a48b85d514 Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Wed, 1 Feb 2017 13:24:34 -0800 Subject: [PATCH 073/169] Upgrade to VS 2017 --- HtmlAbstractions.sln | 13 ++++---- NuGet.config | 5 +-- appveyor.yml | 3 +- build.ps1 | 2 +- build.sh | 2 +- {tools => build}/Key.snk | Bin build/common.props | 19 +++++++++++ global.json | 8 ----- ...rosoft.AspNetCore.Html.Abstractions.csproj | 21 ++++++++++++ ...crosoft.AspNetCore.Html.Abstractions.xproj | 17 ---------- .../Properties/AssemblyInfo.cs | 5 --- .../project.json | 28 ---------------- .../Microsoft.Extensions.WebEncoders.csproj | 21 ++++++++++++ .../Microsoft.Extensions.WebEncoders.xproj | 17 ---------- .../Properties/AssemblyInfo.cs | 11 ------- .../project.json | 31 ------------------ ...t.AspNetCore.Html.Abstractions.Test.csproj | 18 ++++++++++ ...ft.AspNetCore.Html.Abstractions.Test.xproj | 20 ----------- .../project.json | 25 -------------- ...rosoft.Extensions.WebEncoders.Tests.csproj | 18 ++++++++++ ...crosoft.Extensions.WebEncoders.Tests.xproj | 20 ----------- .../project.json | 28 ---------------- version.props | 7 ++++ 23 files changed, 117 insertions(+), 222 deletions(-) rename {tools => build}/Key.snk (100%) create mode 100644 build/common.props delete mode 100644 global.json create mode 100755 src/Microsoft.AspNetCore.Html.Abstractions/Microsoft.AspNetCore.Html.Abstractions.csproj delete mode 100644 src/Microsoft.AspNetCore.Html.Abstractions/Microsoft.AspNetCore.Html.Abstractions.xproj delete mode 100644 src/Microsoft.AspNetCore.Html.Abstractions/project.json create mode 100755 src/Microsoft.Extensions.WebEncoders/Microsoft.Extensions.WebEncoders.csproj delete mode 100644 src/Microsoft.Extensions.WebEncoders/Microsoft.Extensions.WebEncoders.xproj delete mode 100644 src/Microsoft.Extensions.WebEncoders/Properties/AssemblyInfo.cs delete mode 100644 src/Microsoft.Extensions.WebEncoders/project.json create mode 100755 test/Microsoft.AspNetCore.Html.Abstractions.Test/Microsoft.AspNetCore.Html.Abstractions.Test.csproj delete mode 100644 test/Microsoft.AspNetCore.Html.Abstractions.Test/Microsoft.AspNetCore.Html.Abstractions.Test.xproj delete mode 100644 test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json create mode 100755 test/Microsoft.Extensions.WebEncoders.Tests/Microsoft.Extensions.WebEncoders.Tests.csproj delete mode 100644 test/Microsoft.Extensions.WebEncoders.Tests/Microsoft.Extensions.WebEncoders.Tests.xproj delete mode 100644 test/Microsoft.Extensions.WebEncoders.Tests/project.json create mode 100644 version.props diff --git a/HtmlAbstractions.sln b/HtmlAbstractions.sln index 81189bb447..5b6b09416f 100644 --- a/HtmlAbstractions.sln +++ b/HtmlAbstractions.sln @@ -1,24 +1,23 @@ Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 14 -VisualStudioVersion = 14.0.24711.0 +# Visual Studio 15 +VisualStudioVersion = 15.0.26127.0 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{A5A15F1C-885A-452A-A731-B0173DDBD913}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{F31FF137-390C-49BF-A3BD-7C6ED3597C21}" EndProject -Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNetCore.Html.Abstractions", "src\Microsoft.AspNetCore.Html.Abstractions\Microsoft.AspNetCore.Html.Abstractions.xproj", "{68A28E4A-3ADE-4187-9625-4FF185887CB3}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.AspNetCore.Html.Abstractions", "src\Microsoft.AspNetCore.Html.Abstractions\Microsoft.AspNetCore.Html.Abstractions.csproj", "{68A28E4A-3ADE-4187-9625-4FF185887CB3}" EndProject -Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNetCore.Html.Abstractions.Test", "test\Microsoft.AspNetCore.Html.Abstractions.Test\Microsoft.AspNetCore.Html.Abstractions.Test.xproj", "{2D187B88-94BD-4A39-AC97-F8F8B9363301}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.AspNetCore.Html.Abstractions.Test", "test\Microsoft.AspNetCore.Html.Abstractions.Test\Microsoft.AspNetCore.Html.Abstractions.Test.csproj", "{2D187B88-94BD-4A39-AC97-F8F8B9363301}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{B4962A29-BE69-4A18-9B4F-B803EEE31EAA}" ProjectSection(SolutionItems) = preProject - global.json = global.json NuGetPackageVerifier.json = NuGetPackageVerifier.json EndProjectSection EndProject -Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.Extensions.WebEncoders", "src\Microsoft.Extensions.WebEncoders\Microsoft.Extensions.WebEncoders.xproj", "{DD2CE416-765E-4000-A03E-C2FF165DA1B6}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Extensions.WebEncoders", "src\Microsoft.Extensions.WebEncoders\Microsoft.Extensions.WebEncoders.csproj", "{DD2CE416-765E-4000-A03E-C2FF165DA1B6}" EndProject -Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.Extensions.WebEncoders.Tests", "test\Microsoft.Extensions.WebEncoders.Tests\Microsoft.Extensions.WebEncoders.Tests.xproj", "{7AE2731D-43CD-4CF8-850A-4914DE2CE930}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Extensions.WebEncoders.Tests", "test\Microsoft.Extensions.WebEncoders.Tests\Microsoft.Extensions.WebEncoders.Tests.csproj", "{7AE2731D-43CD-4CF8-850A-4914DE2CE930}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/NuGet.config b/NuGet.config index 826a1f9035..8e65695611 100644 --- a/NuGet.config +++ b/NuGet.config @@ -1,7 +1,8 @@ - + + - \ No newline at end of file + diff --git a/appveyor.yml b/appveyor.yml index be95b88d6f..13c0650228 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -10,4 +10,5 @@ build_script: - build.cmd --quiet verify clone_depth: 1 test: off -deploy: off \ No newline at end of file +deploy: off +os: Visual Studio 2017 RC diff --git a/build.ps1 b/build.ps1 index 8f2f99691a..0605b59c01 100644 --- a/build.ps1 +++ b/build.ps1 @@ -33,7 +33,7 @@ cd $PSScriptRoot $repoFolder = $PSScriptRoot $env:REPO_FOLDER = $repoFolder -$koreBuildZip="https://github.com/aspnet/KoreBuild/archive/dev.zip" +$koreBuildZip="https://github.com/aspnet/KoreBuild/archive/feature/msbuild.zip" if ($env:KOREBUILD_ZIP) { $koreBuildZip=$env:KOREBUILD_ZIP diff --git a/build.sh b/build.sh index 4fd7ede788..07997d6c83 100755 --- a/build.sh +++ b/build.sh @@ -2,7 +2,7 @@ repoFolder="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" cd $repoFolder -koreBuildZip="https://github.com/aspnet/KoreBuild/archive/dev.zip" +koreBuildZip="https://github.com/aspnet/KoreBuild/archive/feature/msbuild.zip" if [ ! -z $KOREBUILD_ZIP ]; then koreBuildZip=$KOREBUILD_ZIP fi diff --git a/tools/Key.snk b/build/Key.snk similarity index 100% rename from tools/Key.snk rename to build/Key.snk diff --git a/build/common.props b/build/common.props new file mode 100644 index 0000000000..c39a1694c3 --- /dev/null +++ b/build/common.props @@ -0,0 +1,19 @@ + + + + + https://github.com/aspnet/HtmlAbstractions + git + $(MSBuildThisFileDirectory)Key.snk + true + true + 1.2.0-* + 1.6.2-* + $(VersionSuffix)-$(BuildNumber) + + + + + + + diff --git a/global.json b/global.json deleted file mode 100644 index 0ad1995dd2..0000000000 --- a/global.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "projects": [ - "src" - ], - "sdk": { - "version": "1.0.0-preview2-1-003180" - } -} \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.Html.Abstractions/Microsoft.AspNetCore.Html.Abstractions.csproj b/src/Microsoft.AspNetCore.Html.Abstractions/Microsoft.AspNetCore.Html.Abstractions.csproj new file mode 100755 index 0000000000..3baa9641ae --- /dev/null +++ b/src/Microsoft.AspNetCore.Html.Abstractions/Microsoft.AspNetCore.Html.Abstractions.csproj @@ -0,0 +1,21 @@ + + + + + + Microsoft ASP.NET Core + ASP.NET Core HTML abstractions used for building HTML content. +Commonly used types: +Microsoft.AspNetCore.Html.HtmlString +Microsoft.AspNetCore.Html.IHtmlContent + netstandard1.0 + $(NoWarn);CS1591 + true + aspnetcore + + + + + + + diff --git a/src/Microsoft.AspNetCore.Html.Abstractions/Microsoft.AspNetCore.Html.Abstractions.xproj b/src/Microsoft.AspNetCore.Html.Abstractions/Microsoft.AspNetCore.Html.Abstractions.xproj deleted file mode 100644 index 25d87d97bb..0000000000 --- a/src/Microsoft.AspNetCore.Html.Abstractions/Microsoft.AspNetCore.Html.Abstractions.xproj +++ /dev/null @@ -1,17 +0,0 @@ - - - - 14.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - - 68a28e4a-3ade-4187-9625-4ff185887cb3 - .\obj - .\bin\ - - - 2.0 - - - \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.Html.Abstractions/Properties/AssemblyInfo.cs b/src/Microsoft.AspNetCore.Html.Abstractions/Properties/AssemblyInfo.cs index 403f0e3c52..bde0132dbb 100644 --- a/src/Microsoft.AspNetCore.Html.Abstractions/Properties/AssemblyInfo.cs +++ b/src/Microsoft.AspNetCore.Html.Abstractions/Properties/AssemblyInfo.cs @@ -5,9 +5,4 @@ using System.Reflection; using System.Resources; using System.Runtime.CompilerServices; -[assembly: AssemblyMetadata("Serviceable", "True")] -[assembly: NeutralResourcesLanguage("en-us")] [assembly: InternalsVisibleTo("Microsoft.AspNetCore.Html.Abstractions.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] -[assembly: AssemblyCompany("Microsoft Corporation.")] -[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")] -[assembly: AssemblyProduct("Microsoft ASP.NET Core")] diff --git a/src/Microsoft.AspNetCore.Html.Abstractions/project.json b/src/Microsoft.AspNetCore.Html.Abstractions/project.json deleted file mode 100644 index 4e640d584b..0000000000 --- a/src/Microsoft.AspNetCore.Html.Abstractions/project.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "version": "1.2.0-*", - "description": "ASP.NET Core HTML abstractions used for building HTML content.\r\nCommonly used types:\r\nMicrosoft.AspNetCore.Html.HtmlString\r\nMicrosoft.AspNetCore.Html.IHtmlContent", - "packOptions": { - "repository": { - "type": "git", - "url": "git://github.com/aspnet/htmlabstractions" - }, - "tags": [ - "aspnetcore" - ] - }, - "buildOptions": { - "warningsAsErrors": true, - "keyFile": "../../tools/Key.snk", - "nowarn": [ - "CS1591" - ], - "xmlDoc": true - }, - "dependencies": { - "NETStandard.Library": "1.6.2-*", - "System.Text.Encodings.Web": "4.4.0-*" - }, - "frameworks": { - "netstandard1.0": {} - } -} \ No newline at end of file diff --git a/src/Microsoft.Extensions.WebEncoders/Microsoft.Extensions.WebEncoders.csproj b/src/Microsoft.Extensions.WebEncoders/Microsoft.Extensions.WebEncoders.csproj new file mode 100755 index 0000000000..231359c110 --- /dev/null +++ b/src/Microsoft.Extensions.WebEncoders/Microsoft.Extensions.WebEncoders.csproj @@ -0,0 +1,21 @@ + + + + + + Microsoft .NET Extensions + Contains registration and configuration APIs to add the core framework encoders to a dependency injection container. + netstandard1.0 + $(NoWarn);CS1591 + true + true + aspnetcore + + + + + + + + + diff --git a/src/Microsoft.Extensions.WebEncoders/Microsoft.Extensions.WebEncoders.xproj b/src/Microsoft.Extensions.WebEncoders/Microsoft.Extensions.WebEncoders.xproj deleted file mode 100644 index f458d42cf1..0000000000 --- a/src/Microsoft.Extensions.WebEncoders/Microsoft.Extensions.WebEncoders.xproj +++ /dev/null @@ -1,17 +0,0 @@ - - - - 14.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - - dd2ce416-765e-4000-a03e-c2ff165da1b6 - .\obj - .\bin\ - - - 2.0 - - - \ No newline at end of file diff --git a/src/Microsoft.Extensions.WebEncoders/Properties/AssemblyInfo.cs b/src/Microsoft.Extensions.WebEncoders/Properties/AssemblyInfo.cs deleted file mode 100644 index 8d8d88195c..0000000000 --- a/src/Microsoft.Extensions.WebEncoders/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System.Reflection; -using System.Resources; - -[assembly: AssemblyMetadata("Serviceable", "True")] -[assembly: NeutralResourcesLanguage("en-us")] -[assembly: AssemblyCompany("Microsoft Corporation.")] -[assembly: AssemblyCopyright("© Microsoft Corporation. All rights reserved.")] -[assembly: AssemblyProduct("Microsoft .NET Extensions")] diff --git a/src/Microsoft.Extensions.WebEncoders/project.json b/src/Microsoft.Extensions.WebEncoders/project.json deleted file mode 100644 index b3fe422893..0000000000 --- a/src/Microsoft.Extensions.WebEncoders/project.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "version": "1.2.0-*", - "description": "Contains registration and configuration APIs to add the core framework encoders to a dependency injection container.", - "packOptions": { - "repository": { - "type": "git", - "url": "git://github.com/aspnet/httpabstractions" - }, - "tags": [ - "aspnetcore" - ] - }, - "buildOptions": { - "warningsAsErrors": true, - "allowUnsafe": true, - "keyFile": "../../tools/Key.snk", - "nowarn": [ - "CS1591" - ], - "xmlDoc": true - }, - "dependencies": { - "Microsoft.Extensions.DependencyInjection.Abstractions": "1.2.0-*", - "Microsoft.Extensions.Options": "1.2.0-*", - "NETStandard.Library": "1.6.2-*", - "System.Text.Encodings.Web": "4.4.0-*" - }, - "frameworks": { - "netstandard1.0": {} - } -} \ No newline at end of file diff --git a/test/Microsoft.AspNetCore.Html.Abstractions.Test/Microsoft.AspNetCore.Html.Abstractions.Test.csproj b/test/Microsoft.AspNetCore.Html.Abstractions.Test/Microsoft.AspNetCore.Html.Abstractions.Test.csproj new file mode 100755 index 0000000000..160e0ab478 --- /dev/null +++ b/test/Microsoft.AspNetCore.Html.Abstractions.Test/Microsoft.AspNetCore.Html.Abstractions.Test.csproj @@ -0,0 +1,18 @@ + + + + + + netcoreapp1.1;net451 + + + + + + + + + + + + diff --git a/test/Microsoft.AspNetCore.Html.Abstractions.Test/Microsoft.AspNetCore.Html.Abstractions.Test.xproj b/test/Microsoft.AspNetCore.Html.Abstractions.Test/Microsoft.AspNetCore.Html.Abstractions.Test.xproj deleted file mode 100644 index 3d3d10b2ac..0000000000 --- a/test/Microsoft.AspNetCore.Html.Abstractions.Test/Microsoft.AspNetCore.Html.Abstractions.Test.xproj +++ /dev/null @@ -1,20 +0,0 @@ - - - - 14.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - - 2d187b88-94bd-4a39-ac97-f8f8b9363301 - .\obj - .\bin\ - - - 2.0 - - - - - - \ No newline at end of file diff --git a/test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json b/test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json deleted file mode 100644 index 0e46d9c52c..0000000000 --- a/test/Microsoft.AspNetCore.Html.Abstractions.Test/project.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "buildOptions": { - "warningsAsErrors": true, - "keyFile": "../../tools/Key.snk" - }, - "dependencies": { - "dotnet-test-xunit": "2.2.0-*", - "Microsoft.AspNetCore.Html.Abstractions": "1.2.0-*", - "Microsoft.AspNetCore.Testing": "1.2.0-*", - "Microsoft.Extensions.WebEncoders": "1.2.0-*", - "xunit": "2.2.0-*" - }, - "testRunner": "xunit", - "frameworks": { - "netcoreapp1.1": { - "dependencies": { - "Microsoft.NETCore.App": { - "version": "1.2.0-*", - "type": "platform" - } - } - }, - "net451": {} - } -} \ No newline at end of file diff --git a/test/Microsoft.Extensions.WebEncoders.Tests/Microsoft.Extensions.WebEncoders.Tests.csproj b/test/Microsoft.Extensions.WebEncoders.Tests/Microsoft.Extensions.WebEncoders.Tests.csproj new file mode 100755 index 0000000000..9ad4edbc0b --- /dev/null +++ b/test/Microsoft.Extensions.WebEncoders.Tests/Microsoft.Extensions.WebEncoders.Tests.csproj @@ -0,0 +1,18 @@ + + + + + + netcoreapp1.1;net451 + $(PackageTargetFallback);dnxcore50;portable-net451+win8 + + + + + + + + + + + diff --git a/test/Microsoft.Extensions.WebEncoders.Tests/Microsoft.Extensions.WebEncoders.Tests.xproj b/test/Microsoft.Extensions.WebEncoders.Tests/Microsoft.Extensions.WebEncoders.Tests.xproj deleted file mode 100644 index a7810a9e17..0000000000 --- a/test/Microsoft.Extensions.WebEncoders.Tests/Microsoft.Extensions.WebEncoders.Tests.xproj +++ /dev/null @@ -1,20 +0,0 @@ - - - - 14.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - - 7ae2731d-43cd-4cf8-850a-4914de2ce930 - .\obj - .\bin\ - - - 2.0 - - - - - - \ No newline at end of file diff --git a/test/Microsoft.Extensions.WebEncoders.Tests/project.json b/test/Microsoft.Extensions.WebEncoders.Tests/project.json deleted file mode 100644 index d06fb5b18b..0000000000 --- a/test/Microsoft.Extensions.WebEncoders.Tests/project.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "dependencies": { - "dotnet-test-xunit": "2.2.0-*", - "Microsoft.Extensions.DependencyInjection": "1.2.0-*", - "Microsoft.Extensions.WebEncoders": "1.2.0-*", - "xunit": "2.2.0-*" - }, - "testRunner": "xunit", - "buildOptions": { - "warningsAsErrors": true, - "keyFile": "../../tools/Key.snk" - }, - "frameworks": { - "netcoreapp1.1": { - "dependencies": { - "Microsoft.NETCore.App": { - "version": "1.2.0-*", - "type": "platform" - } - }, - "imports": [ - "dnxcore50", - "portable-net451+win8" - ] - }, - "net451": {} - } -} \ No newline at end of file diff --git a/version.props b/version.props new file mode 100644 index 0000000000..17fd5ac36d --- /dev/null +++ b/version.props @@ -0,0 +1,7 @@ + + + + 1.2.0 + preview1 + + From 859aad081e3ce334b7b604bf2175beb1b6a91496 Mon Sep 17 00:00:00 2001 From: Doug Bunting Date: Tue, 14 Feb 2017 08:31:52 -0800 Subject: [PATCH 074/169] Bump test projects up to .NET 4.5.2 - aspnet/Testing#248 - xUnit no longer supports .NET 4.5.1 - build tests for desktop .NET only on Windows --- .../Microsoft.AspNetCore.Html.Abstractions.Test.csproj | 3 ++- .../Microsoft.Extensions.WebEncoders.Tests.csproj | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/test/Microsoft.AspNetCore.Html.Abstractions.Test/Microsoft.AspNetCore.Html.Abstractions.Test.csproj b/test/Microsoft.AspNetCore.Html.Abstractions.Test/Microsoft.AspNetCore.Html.Abstractions.Test.csproj index 160e0ab478..1fe9581c45 100755 --- a/test/Microsoft.AspNetCore.Html.Abstractions.Test/Microsoft.AspNetCore.Html.Abstractions.Test.csproj +++ b/test/Microsoft.AspNetCore.Html.Abstractions.Test/Microsoft.AspNetCore.Html.Abstractions.Test.csproj @@ -3,7 +3,8 @@ - netcoreapp1.1;net451 + netcoreapp1.1;net452 + netcoreapp1.1 diff --git a/test/Microsoft.Extensions.WebEncoders.Tests/Microsoft.Extensions.WebEncoders.Tests.csproj b/test/Microsoft.Extensions.WebEncoders.Tests/Microsoft.Extensions.WebEncoders.Tests.csproj index 9ad4edbc0b..77b807e9dd 100755 --- a/test/Microsoft.Extensions.WebEncoders.Tests/Microsoft.Extensions.WebEncoders.Tests.csproj +++ b/test/Microsoft.Extensions.WebEncoders.Tests/Microsoft.Extensions.WebEncoders.Tests.csproj @@ -3,7 +3,8 @@ - netcoreapp1.1;net451 + netcoreapp1.1;net452 + netcoreapp1.1 $(PackageTargetFallback);dnxcore50;portable-net451+win8 From 0c714cf61b908e5e39c8d06a0109aa2305b7e9b0 Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Tue, 14 Feb 2017 16:03:53 -0800 Subject: [PATCH 075/169] Downgrade to stable packages --- build/common.props | 3 +-- build/dependencies.props | 6 ++++++ .../Microsoft.AspNetCore.Html.Abstractions.csproj | 2 +- .../Microsoft.Extensions.WebEncoders.csproj | 2 +- 4 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 build/dependencies.props diff --git a/build/common.props b/build/common.props index c39a1694c3..de08271afe 100644 --- a/build/common.props +++ b/build/common.props @@ -1,4 +1,5 @@ + @@ -7,8 +8,6 @@ $(MSBuildThisFileDirectory)Key.snk true true - 1.2.0-* - 1.6.2-* $(VersionSuffix)-$(BuildNumber) diff --git a/build/dependencies.props b/build/dependencies.props new file mode 100644 index 0000000000..e704edaec0 --- /dev/null +++ b/build/dependencies.props @@ -0,0 +1,6 @@ + + + 1.6.1 + 4.3.0 + + diff --git a/src/Microsoft.AspNetCore.Html.Abstractions/Microsoft.AspNetCore.Html.Abstractions.csproj b/src/Microsoft.AspNetCore.Html.Abstractions/Microsoft.AspNetCore.Html.Abstractions.csproj index 3baa9641ae..85948d6df7 100755 --- a/src/Microsoft.AspNetCore.Html.Abstractions/Microsoft.AspNetCore.Html.Abstractions.csproj +++ b/src/Microsoft.AspNetCore.Html.Abstractions/Microsoft.AspNetCore.Html.Abstractions.csproj @@ -15,7 +15,7 @@ Microsoft.AspNetCore.Html.IHtmlContent - + diff --git a/src/Microsoft.Extensions.WebEncoders/Microsoft.Extensions.WebEncoders.csproj b/src/Microsoft.Extensions.WebEncoders/Microsoft.Extensions.WebEncoders.csproj index 231359c110..70766d649f 100755 --- a/src/Microsoft.Extensions.WebEncoders/Microsoft.Extensions.WebEncoders.csproj +++ b/src/Microsoft.Extensions.WebEncoders/Microsoft.Extensions.WebEncoders.csproj @@ -15,7 +15,7 @@ - + From fbb2360f872437247a55cb47bfdc4c2bcc7c75d4 Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Wed, 1 Mar 2017 18:14:13 -0800 Subject: [PATCH 076/169] Change korebuild branch and fix argument forwarding in bootstrapper --- build.ps1 | 16 ++++++++-------- build.sh | 22 +++++++++++----------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/build.ps1 b/build.ps1 index 0605b59c01..5bf0e2c113 100644 --- a/build.ps1 +++ b/build.ps1 @@ -1,6 +1,6 @@ $ErrorActionPreference = "Stop" -function DownloadWithRetry([string] $url, [string] $downloadLocation, [int] $retries) +function DownloadWithRetry([string] $url, [string] $downloadLocation, [int] $retries) { while($true) { @@ -19,7 +19,7 @@ function DownloadWithRetry([string] $url, [string] $downloadLocation, [int] $ret Start-Sleep -Seconds 10 } - else + else { $exception = $_.Exception throw $exception @@ -33,7 +33,7 @@ cd $PSScriptRoot $repoFolder = $PSScriptRoot $env:REPO_FOLDER = $repoFolder -$koreBuildZip="https://github.com/aspnet/KoreBuild/archive/feature/msbuild.zip" +$koreBuildZip="https://github.com/aspnet/KoreBuild/archive/dev.zip" if ($env:KOREBUILD_ZIP) { $koreBuildZip=$env:KOREBUILD_ZIP @@ -43,18 +43,18 @@ $buildFolder = ".build" $buildFile="$buildFolder\KoreBuild.ps1" if (!(Test-Path $buildFolder)) { - Write-Host "Downloading KoreBuild from $koreBuildZip" - + Write-Host "Downloading KoreBuild from $koreBuildZip" + $tempFolder=$env:TEMP + "\KoreBuild-" + [guid]::NewGuid() New-Item -Path "$tempFolder" -Type directory | Out-Null $localZipFile="$tempFolder\korebuild.zip" - + DownloadWithRetry -url $koreBuildZip -downloadLocation $localZipFile -retries 6 Add-Type -AssemblyName System.IO.Compression.FileSystem [System.IO.Compression.ZipFile]::ExtractToDirectory($localZipFile, $tempFolder) - + New-Item -Path "$buildFolder" -Type directory | Out-Null copy-item "$tempFolder\**\build\*" $buildFolder -Recurse @@ -64,4 +64,4 @@ if (!(Test-Path $buildFolder)) { } } -&"$buildFile" $args \ No newline at end of file +&"$buildFile" @args diff --git a/build.sh b/build.sh index 07997d6c83..b0bcadb579 100755 --- a/build.sh +++ b/build.sh @@ -2,7 +2,7 @@ repoFolder="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" cd $repoFolder -koreBuildZip="https://github.com/aspnet/KoreBuild/archive/feature/msbuild.zip" +koreBuildZip="https://github.com/aspnet/KoreBuild/archive/dev.zip" if [ ! -z $KOREBUILD_ZIP ]; then koreBuildZip=$KOREBUILD_ZIP fi @@ -12,12 +12,12 @@ buildFile="$buildFolder/KoreBuild.sh" if test ! -d $buildFolder; then echo "Downloading KoreBuild from $koreBuildZip" - - tempFolder="/tmp/KoreBuild-$(uuidgen)" + + tempFolder="/tmp/KoreBuild-$(uuidgen)" mkdir $tempFolder - + localZipFile="$tempFolder/korebuild.zip" - + retries=6 until (wget -O $localZipFile $koreBuildZip 2>/dev/null || curl -o $localZipFile --location $koreBuildZip 2>/dev/null) do @@ -29,18 +29,18 @@ if test ! -d $buildFolder; then echo "Waiting 10 seconds before retrying. Retries left: $retries" sleep 10s done - + unzip -q -d $tempFolder $localZipFile - + mkdir $buildFolder cp -r $tempFolder/**/build/** $buildFolder - + chmod +x $buildFile - + # Cleanup if test -d $tempFolder; then - rm -rf $tempFolder + rm -rf $tempFolder fi fi -$buildFile -r $repoFolder "$@" \ No newline at end of file +$buildFile -r $repoFolder "$@" From 35ab125ba64ae21a581f051d986c75c0f2919391 Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Wed, 1 Mar 2017 18:25:51 -0800 Subject: [PATCH 077/169] Update AppVeyor and Travis settings --- .travis.yml | 2 +- appveyor.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 67d9a88786..d9285f178d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,7 +29,7 @@ branches: before_install: - if test "$TRAVIS_OS_NAME" == "osx"; then brew update; brew install openssl; ln -s /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib /usr/local/lib/; ln -s /usr/local/opt/openssl/lib/libssl.1.0.0.dylib /usr/local/lib/; fi script: - - ./build.sh --quiet verify + - ./build.sh notifications: webhooks: secure: "d87o+y2WUx204s8TfSaEuekYudnSyyPaFEXkuzgs3uAyzkKAm/Hx0xcMSuKDqWhYmKaxL7VtgEd2z7mltr2cHZ4oyCrsf6V5v4iI48ojaGykqFXfv8ld6khmLwtdkC32lF2YyuDNL8kUvKNdP9jkrWlpoO/WC6QEqAUxdOuuLo/wLyfrPLbzIvbojwveXbmcwvsfDizLdZdVd88FZSV41h+yBKLnyhpeqRvHG85BTgT/GmVB7Vyjs3yChiS639Aq5DoOP8jBaRdB8Bqs09KibFXzJwDBlKvALIqiwzog3hpd5SVxrgOTCkWbOwqq4TSkahDE425W3vFbmLDANgdfsyAkqgt8daE2BkFTojEHQED+u9CEd8oJVX6FoGnYpuDzge4FVh9iG3HSuKwoVdlONzzew4oJ75iQ+0f67ZNV9oDuScdva/SGb2gYgVUkeJIjDoMxKuaZyhbBT9jRXRBI+LsIjziEhLU/649FjTSmQx0HLpcT7+kaeSmhqT9JffVLidMdvZwhPZsLxPSG9UVBH9G8rdyHXP2e0ZlicHNjjNV6kbDqfDPhHx2/MfZGugsJXjOONKu/5LZduQzmAOysqdLKqkBVkMq2xl7aGV+yVZAtTmZB3nqOWGyKlFC9kLGO+qlJ4tBac26lHCZWTK+4VOAtN5Dag0DkDikgGdZaq78=" diff --git a/appveyor.yml b/appveyor.yml index 13c0650228..3f828ce38e 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -7,7 +7,7 @@ branches: - dev - /^(.*\/)?ci-.*$/ build_script: - - build.cmd --quiet verify + - ps: .\build.ps1 clone_depth: 1 test: off deploy: off From 533373d6365be73c72ee8fe003dcb09cb6fbc23e Mon Sep 17 00:00:00 2001 From: David Fowler Date: Wed, 8 Mar 2017 20:32:33 -0800 Subject: [PATCH 078/169] Update .travis.yml --- .travis.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index d9285f178d..4f28213da4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,8 +14,7 @@ env: global: - DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true - DOTNET_CLI_TELEMETRY_OPTOUT: 1 -mono: - - 4.0.5 +mono: none os: - linux - osx From ba0926736b86703c64044983f6e74a10c640ead9 Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Tue, 14 Mar 2017 13:40:24 -0700 Subject: [PATCH 079/169] Update appveyor and travis settings --- .travis.yml | 1 - appveyor.yml | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4f28213da4..56f3837d7e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,7 +18,6 @@ mono: none os: - linux - osx -osx_image: xcode7.3 branches: only: - master diff --git a/appveyor.yml b/appveyor.yml index 3f828ce38e..1041615c68 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -11,4 +11,4 @@ build_script: clone_depth: 1 test: off deploy: off -os: Visual Studio 2017 RC +os: Visual Studio 2017 From e3ca1d1a2cd8d1471f5d82103c7bddf95b71a8b8 Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Wed, 15 Mar 2017 13:47:45 -0700 Subject: [PATCH 080/169] Unify dependency versions to one file and remove workarounds --- build/dependencies.props | 5 ++++- .../Microsoft.Extensions.WebEncoders.csproj | 4 ++-- ...icrosoft.AspNetCore.Html.Abstractions.Test.csproj | 11 +++++++---- .../Microsoft.Extensions.WebEncoders.Tests.csproj | 12 +++++++----- 4 files changed, 20 insertions(+), 12 deletions(-) diff --git a/build/dependencies.props b/build/dependencies.props index e704edaec0..5a4c06ce33 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -1,6 +1,9 @@ - 1.6.1 + 1.2.0-* 4.3.0 + 1.6.1 + 15.0.0 + 2.2.0 diff --git a/src/Microsoft.Extensions.WebEncoders/Microsoft.Extensions.WebEncoders.csproj b/src/Microsoft.Extensions.WebEncoders/Microsoft.Extensions.WebEncoders.csproj index 70766d649f..d80a4bbcc6 100755 --- a/src/Microsoft.Extensions.WebEncoders/Microsoft.Extensions.WebEncoders.csproj +++ b/src/Microsoft.Extensions.WebEncoders/Microsoft.Extensions.WebEncoders.csproj @@ -13,8 +13,8 @@ - - + + diff --git a/test/Microsoft.AspNetCore.Html.Abstractions.Test/Microsoft.AspNetCore.Html.Abstractions.Test.csproj b/test/Microsoft.AspNetCore.Html.Abstractions.Test/Microsoft.AspNetCore.Html.Abstractions.Test.csproj index 1fe9581c45..8f5f62fd36 100755 --- a/test/Microsoft.AspNetCore.Html.Abstractions.Test/Microsoft.AspNetCore.Html.Abstractions.Test.csproj +++ b/test/Microsoft.AspNetCore.Html.Abstractions.Test/Microsoft.AspNetCore.Html.Abstractions.Test.csproj @@ -10,10 +10,13 @@ - - - - + + + + + + + diff --git a/test/Microsoft.Extensions.WebEncoders.Tests/Microsoft.Extensions.WebEncoders.Tests.csproj b/test/Microsoft.Extensions.WebEncoders.Tests/Microsoft.Extensions.WebEncoders.Tests.csproj index 77b807e9dd..f090acc59c 100755 --- a/test/Microsoft.Extensions.WebEncoders.Tests/Microsoft.Extensions.WebEncoders.Tests.csproj +++ b/test/Microsoft.Extensions.WebEncoders.Tests/Microsoft.Extensions.WebEncoders.Tests.csproj @@ -5,15 +5,17 @@ netcoreapp1.1;net452 netcoreapp1.1 - $(PackageTargetFallback);dnxcore50;portable-net451+win8 - - - - + + + + + + + From ebd8f61dcbe5909926162d06033a48fae3463123 Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Tue, 21 Mar 2017 12:14:12 -0700 Subject: [PATCH 081/169] Update Travis to macOS Sierra [skip appveyor] --- .travis.yml | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/.travis.yml b/.travis.yml index 56f3837d7e..2a46104677 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,15 +1,6 @@ language: csharp -sudo: required +sudo: false dist: trusty -addons: - apt: - packages: - - gettext - - libcurl4-openssl-dev - - libicu-dev - - libssl-dev - - libunwind8 - - zlib1g env: global: - DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true @@ -18,6 +9,7 @@ mono: none os: - linux - osx +osx_image: xcode8.2 branches: only: - master @@ -28,9 +20,3 @@ before_install: - if test "$TRAVIS_OS_NAME" == "osx"; then brew update; brew install openssl; ln -s /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib /usr/local/lib/; ln -s /usr/local/opt/openssl/lib/libssl.1.0.0.dylib /usr/local/lib/; fi script: - ./build.sh -notifications: - webhooks: - secure: "d87o+y2WUx204s8TfSaEuekYudnSyyPaFEXkuzgs3uAyzkKAm/Hx0xcMSuKDqWhYmKaxL7VtgEd2z7mltr2cHZ4oyCrsf6V5v4iI48ojaGykqFXfv8ld6khmLwtdkC32lF2YyuDNL8kUvKNdP9jkrWlpoO/WC6QEqAUxdOuuLo/wLyfrPLbzIvbojwveXbmcwvsfDizLdZdVd88FZSV41h+yBKLnyhpeqRvHG85BTgT/GmVB7Vyjs3yChiS639Aq5DoOP8jBaRdB8Bqs09KibFXzJwDBlKvALIqiwzog3hpd5SVxrgOTCkWbOwqq4TSkahDE425W3vFbmLDANgdfsyAkqgt8daE2BkFTojEHQED+u9CEd8oJVX6FoGnYpuDzge4FVh9iG3HSuKwoVdlONzzew4oJ75iQ+0f67ZNV9oDuScdva/SGb2gYgVUkeJIjDoMxKuaZyhbBT9jRXRBI+LsIjziEhLU/649FjTSmQx0HLpcT7+kaeSmhqT9JffVLidMdvZwhPZsLxPSG9UVBH9G8rdyHXP2e0ZlicHNjjNV6kbDqfDPhHx2/MfZGugsJXjOONKu/5LZduQzmAOysqdLKqkBVkMq2xl7aGV+yVZAtTmZB3nqOWGyKlFC9kLGO+qlJ4tBac26lHCZWTK+4VOAtN5Dag0DkDikgGdZaq78=" - on_success: always - on_failure: always - on_start: always From bac161fdd6f193c5a63584db5a2a5bc8c4729135 Mon Sep 17 00:00:00 2001 From: Kiran Challa Date: Tue, 21 Mar 2017 15:41:08 -0700 Subject: [PATCH 082/169] Converted test projects to run on netcoreapp2.0 --- build/dependencies.props | 1 + .../Microsoft.AspNetCore.Html.Abstractions.Test.csproj | 4 ++-- .../Microsoft.Extensions.WebEncoders.Tests.csproj | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/build/dependencies.props b/build/dependencies.props index 5a4c06ce33..12a50aa67f 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -3,6 +3,7 @@ 1.2.0-* 4.3.0 1.6.1 + 2.0.0-* 15.0.0 2.2.0 diff --git a/test/Microsoft.AspNetCore.Html.Abstractions.Test/Microsoft.AspNetCore.Html.Abstractions.Test.csproj b/test/Microsoft.AspNetCore.Html.Abstractions.Test/Microsoft.AspNetCore.Html.Abstractions.Test.csproj index 8f5f62fd36..3e6fcd27cb 100755 --- a/test/Microsoft.AspNetCore.Html.Abstractions.Test/Microsoft.AspNetCore.Html.Abstractions.Test.csproj +++ b/test/Microsoft.AspNetCore.Html.Abstractions.Test/Microsoft.AspNetCore.Html.Abstractions.Test.csproj @@ -3,8 +3,8 @@ - netcoreapp1.1;net452 - netcoreapp1.1 + netcoreapp2.0;net452 + netcoreapp2.0 diff --git a/test/Microsoft.Extensions.WebEncoders.Tests/Microsoft.Extensions.WebEncoders.Tests.csproj b/test/Microsoft.Extensions.WebEncoders.Tests/Microsoft.Extensions.WebEncoders.Tests.csproj index f090acc59c..35a8477927 100755 --- a/test/Microsoft.Extensions.WebEncoders.Tests/Microsoft.Extensions.WebEncoders.Tests.csproj +++ b/test/Microsoft.Extensions.WebEncoders.Tests/Microsoft.Extensions.WebEncoders.Tests.csproj @@ -3,8 +3,8 @@ - netcoreapp1.1;net452 - netcoreapp1.1 + netcoreapp2.0;net452 + netcoreapp2.0 From 9a7abcd902358017bdcfafa4cc5371360758551c Mon Sep 17 00:00:00 2001 From: Pranav K Date: Sun, 12 Mar 2017 15:02:51 -0700 Subject: [PATCH 083/169] Remove net451 as a cross-compile target --- .gitignore | 3 ++- .../Microsoft.AspNetCore.Html.Abstractions.Test.csproj | 2 +- .../Microsoft.Extensions.WebEncoders.Tests.csproj | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 980ee002d9..6da3c6a3e9 100644 --- a/.gitignore +++ b/.gitignore @@ -36,4 +36,5 @@ node_modules **/[Cc]ompiler/[Rr]esources/**/*.js *launchSettings.json .build/ -.testPublish/ \ No newline at end of file +.testPublish/ +global.json diff --git a/test/Microsoft.AspNetCore.Html.Abstractions.Test/Microsoft.AspNetCore.Html.Abstractions.Test.csproj b/test/Microsoft.AspNetCore.Html.Abstractions.Test/Microsoft.AspNetCore.Html.Abstractions.Test.csproj index 3e6fcd27cb..ac305ecf01 100755 --- a/test/Microsoft.AspNetCore.Html.Abstractions.Test/Microsoft.AspNetCore.Html.Abstractions.Test.csproj +++ b/test/Microsoft.AspNetCore.Html.Abstractions.Test/Microsoft.AspNetCore.Html.Abstractions.Test.csproj @@ -3,7 +3,7 @@ - netcoreapp2.0;net452 + netcoreapp2.0;net46 netcoreapp2.0 diff --git a/test/Microsoft.Extensions.WebEncoders.Tests/Microsoft.Extensions.WebEncoders.Tests.csproj b/test/Microsoft.Extensions.WebEncoders.Tests/Microsoft.Extensions.WebEncoders.Tests.csproj index 35a8477927..94bc15926e 100755 --- a/test/Microsoft.Extensions.WebEncoders.Tests/Microsoft.Extensions.WebEncoders.Tests.csproj +++ b/test/Microsoft.Extensions.WebEncoders.Tests/Microsoft.Extensions.WebEncoders.Tests.csproj @@ -3,7 +3,7 @@ - netcoreapp2.0;net452 + netcoreapp2.0;net46 netcoreapp2.0 From 2e3c35b863ab242a2c948911225537965483740c Mon Sep 17 00:00:00 2001 From: Pranav K Date: Wed, 29 Mar 2017 11:30:33 -0700 Subject: [PATCH 084/169] Updating to 2.0.0 Internal.AspNetCore.Sdk --- build/common.props | 2 +- build/dependencies.props | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/build/common.props b/build/common.props index de08271afe..647ef2d1e9 100644 --- a/build/common.props +++ b/build/common.props @@ -12,7 +12,7 @@ - + diff --git a/build/dependencies.props b/build/dependencies.props index 12a50aa67f..8c81df7f34 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -2,9 +2,10 @@ 1.2.0-* 4.3.0 + 2.0.0-* 1.6.1 2.0.0-* 15.0.0 2.2.0 - + \ No newline at end of file From 0e6db5af0f82d85273b800660045d2696e6302e1 Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Wed, 29 Mar 2017 14:32:35 -0700 Subject: [PATCH 085/169] Bump to netstandard1.1 for options --- .../Microsoft.Extensions.WebEncoders.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.Extensions.WebEncoders/Microsoft.Extensions.WebEncoders.csproj b/src/Microsoft.Extensions.WebEncoders/Microsoft.Extensions.WebEncoders.csproj index d80a4bbcc6..773011fef5 100755 --- a/src/Microsoft.Extensions.WebEncoders/Microsoft.Extensions.WebEncoders.csproj +++ b/src/Microsoft.Extensions.WebEncoders/Microsoft.Extensions.WebEncoders.csproj @@ -5,7 +5,7 @@ Microsoft .NET Extensions Contains registration and configuration APIs to add the core framework encoders to a dependency injection container. - netstandard1.0 + netstandard1.1 $(NoWarn);CS1591 true true From ebc2c99aaf71e820d3acef6f89986b2e854279d1 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Mon, 3 Apr 2017 21:41:10 -0700 Subject: [PATCH 086/169] Updating versions to 2.0.0-preview1 --- build/dependencies.props | 2 +- version.props | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/dependencies.props b/build/dependencies.props index 8c81df7f34..1973fc186f 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -1,6 +1,6 @@ - 1.2.0-* + 2.0.0-* 4.3.0 2.0.0-* 1.6.1 diff --git a/version.props b/version.props index 17fd5ac36d..c7150e64f4 100644 --- a/version.props +++ b/version.props @@ -1,7 +1,7 @@ - 1.2.0 + 2.0.0 preview1 From 2c2992b465fbd929891086bf1614139e4f5c438e Mon Sep 17 00:00:00 2001 From: Pranav K Date: Tue, 25 Apr 2017 11:04:08 -0700 Subject: [PATCH 087/169] Use Bundled NETStandard.Library \ NETCoreApp versions instead of explicitly specifying one --- build/dependencies.props | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/build/dependencies.props b/build/dependencies.props index 1973fc186f..01387147a4 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -3,9 +3,7 @@ 2.0.0-* 4.3.0 2.0.0-* - 1.6.1 - 2.0.0-* 15.0.0 2.2.0 - \ No newline at end of file + From 755bba2c623035bc9bf1b55ebb05c1756834b5d2 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Tue, 25 Apr 2017 22:02:36 -0700 Subject: [PATCH 088/169] Branching for 2.0.0-preview1 --- NuGet.config | 2 +- build.ps1 | 2 +- build.sh | 2 +- build/dependencies.props | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/NuGet.config b/NuGet.config index 8e65695611..fa4304af9c 100644 --- a/NuGet.config +++ b/NuGet.config @@ -1,7 +1,7 @@ - + diff --git a/build.ps1 b/build.ps1 index 5bf0e2c113..225b1fe450 100644 --- a/build.ps1 +++ b/build.ps1 @@ -33,7 +33,7 @@ cd $PSScriptRoot $repoFolder = $PSScriptRoot $env:REPO_FOLDER = $repoFolder -$koreBuildZip="https://github.com/aspnet/KoreBuild/archive/dev.zip" +$koreBuildZip="https://github.com/aspnet/KoreBuild/archive/rel/2.0.0-preview1.zip" if ($env:KOREBUILD_ZIP) { $koreBuildZip=$env:KOREBUILD_ZIP diff --git a/build.sh b/build.sh index b0bcadb579..702b25c636 100755 --- a/build.sh +++ b/build.sh @@ -2,7 +2,7 @@ repoFolder="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" cd $repoFolder -koreBuildZip="https://github.com/aspnet/KoreBuild/archive/dev.zip" +koreBuildZip="https://github.com/aspnet/KoreBuild/archive/rel/2.0.0-preview1.zip" if [ ! -z $KOREBUILD_ZIP ]; then koreBuildZip=$KOREBUILD_ZIP fi diff --git a/build/dependencies.props b/build/dependencies.props index 01387147a4..c7741b724b 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -1,6 +1,6 @@ - 2.0.0-* + 2.0.0-preview1-* 4.3.0 2.0.0-* 15.0.0 From 36a11404acfa0991ece671128da4cc26a720fe0d Mon Sep 17 00:00:00 2001 From: Pranav K Date: Wed, 26 Apr 2017 07:12:58 -0700 Subject: [PATCH 089/169] Updating package version to preview2 --- version.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.props b/version.props index c7150e64f4..6af4f81de2 100644 --- a/version.props +++ b/version.props @@ -2,6 +2,6 @@ 2.0.0 - preview1 + preview2 From aa4bef0f546c1c8544bd09af1e86e0ad6ea8f0b2 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Mon, 1 May 2017 12:39:26 -0700 Subject: [PATCH 090/169] Use the bundled NETStandard.Library package in netstandard targeting libraries --- build/dependencies.props | 1 + 1 file changed, 1 insertion(+) diff --git a/build/dependencies.props b/build/dependencies.props index c7741b724b..3db1eba0a2 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -3,6 +3,7 @@ 2.0.0-preview1-* 4.3.0 2.0.0-* + $(BundledNETStandardPackageVersion) 15.0.0 2.2.0 From 0eca2200697f16f987788a8f1e3dbae765ac3c84 Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Fri, 5 May 2017 10:22:33 -0700 Subject: [PATCH 091/169] Update InternalAspNetCoreSdkVersion --- build/dependencies.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/dependencies.props b/build/dependencies.props index 3db1eba0a2..f66ecf394c 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -2,7 +2,7 @@ 2.0.0-preview1-* 4.3.0 - 2.0.0-* + 2.1.0-* $(BundledNETStandardPackageVersion) 15.0.0 2.2.0 From 225c482c375fb1ffebcd6ad2d8334d6494c1f56f Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Mon, 15 May 2017 15:39:13 -0700 Subject: [PATCH 092/169] Upgrade test framework versions --- build/dependencies.props | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/dependencies.props b/build/dependencies.props index 09cfb1fe04..ed2c89867f 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -4,7 +4,7 @@ 4.3.0 2.1.0-* $(BundledNETStandardPackageVersion) - 15.0.0 - 2.2.0 + 15.3.0-* + 2.3.0-beta2-* From 46dd25fcac69c32ddce56931ebc082b5dc0a7897 Mon Sep 17 00:00:00 2001 From: Kiran Challa Date: Fri, 26 May 2017 12:40:38 -0700 Subject: [PATCH 093/169] Updated to use the latest shared runtime --- build/dependencies.props | 1 + 1 file changed, 1 insertion(+) diff --git a/build/dependencies.props b/build/dependencies.props index ed2c89867f..e9ed2ba5bf 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -4,6 +4,7 @@ 4.3.0 2.1.0-* $(BundledNETStandardPackageVersion) + 2.0.0-* 15.3.0-* 2.3.0-beta2-* From 3cae8795d4aca9a03d37a41a13f484dd96c79ab4 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Wed, 31 May 2017 19:36:37 -0700 Subject: [PATCH 094/169] Branching for rel/2.0.0-preview2 --- NuGet.config | 7 ++++--- build/dependencies.props | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/NuGet.config b/NuGet.config index 8e65695611..c4bc056c4d 100644 --- a/NuGet.config +++ b/NuGet.config @@ -1,8 +1,9 @@ - + - + + - + \ No newline at end of file diff --git a/build/dependencies.props b/build/dependencies.props index e9ed2ba5bf..fa6f8711f8 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -1,6 +1,6 @@ - 2.0.0-* + 2.0.0-preview2-* 4.3.0 2.1.0-* $(BundledNETStandardPackageVersion) From 7e436ef3ce5e12eedf75b1638509d5629da7325a Mon Sep 17 00:00:00 2001 From: Pranav K Date: Wed, 31 May 2017 19:53:20 -0700 Subject: [PATCH 095/169] Updating build scripts to point to 2.0.0-preview2 KoreBuild --- build.ps1 | 2 +- build.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build.ps1 b/build.ps1 index 5bf0e2c113..3a2476b2b4 100644 --- a/build.ps1 +++ b/build.ps1 @@ -33,7 +33,7 @@ cd $PSScriptRoot $repoFolder = $PSScriptRoot $env:REPO_FOLDER = $repoFolder -$koreBuildZip="https://github.com/aspnet/KoreBuild/archive/dev.zip" +$koreBuildZip="https://github.com/aspnet/KoreBuild/archive/rel/2.0.0-preview2.zip" if ($env:KOREBUILD_ZIP) { $koreBuildZip=$env:KOREBUILD_ZIP diff --git a/build.sh b/build.sh index b0bcadb579..a40bdb87b1 100755 --- a/build.sh +++ b/build.sh @@ -2,7 +2,7 @@ repoFolder="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" cd $repoFolder -koreBuildZip="https://github.com/aspnet/KoreBuild/archive/dev.zip" +koreBuildZip="https://github.com/aspnet/KoreBuild/archive/rel/2.0.0-preview2.zip" if [ ! -z $KOREBUILD_ZIP ]; then koreBuildZip=$KOREBUILD_ZIP fi From b52a081f1998d58791b7efbf874aa46e199db410 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Thu, 1 Jun 2017 10:47:02 -0700 Subject: [PATCH 096/169] Updating versions to preview3 --- NuGet.config | 3 ++- version.props | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/NuGet.config b/NuGet.config index 8e65695611..4e8a1f6de1 100644 --- a/NuGet.config +++ b/NuGet.config @@ -1,6 +1,7 @@ - + + diff --git a/version.props b/version.props index 6af4f81de2..193a5999d8 100644 --- a/version.props +++ b/version.props @@ -2,6 +2,6 @@ 2.0.0 - preview2 + preview3 From ccef6b261b94394aa34a68aa5faf2a8c533ca2fe Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Wed, 7 Jun 2017 09:41:23 -0700 Subject: [PATCH 097/169] Lift Microsoft.Extensions.WebEncoders to target .NET Standard 2.0 --- build/common.props | 4 ++++ build/dependencies.props | 3 ++- .../Microsoft.AspNetCore.Html.Abstractions.csproj | 1 - .../Microsoft.Extensions.WebEncoders.csproj | 2 +- .../Microsoft.AspNetCore.Html.Abstractions.Test.csproj | 2 +- .../Microsoft.Extensions.WebEncoders.Tests.csproj | 2 +- 6 files changed, 9 insertions(+), 5 deletions(-) diff --git a/build/common.props b/build/common.props index 647ef2d1e9..da05c181bb 100644 --- a/build/common.props +++ b/build/common.props @@ -15,4 +15,8 @@ + + + + diff --git a/build/dependencies.props b/build/dependencies.props index e9ed2ba5bf..583adadec1 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -1,9 +1,10 @@ 2.0.0-* - 4.3.0 + 4.4.0-* 2.1.0-* $(BundledNETStandardPackageVersion) + 2.0.0-* 2.0.0-* 15.3.0-* 2.3.0-beta2-* diff --git a/src/Microsoft.AspNetCore.Html.Abstractions/Microsoft.AspNetCore.Html.Abstractions.csproj b/src/Microsoft.AspNetCore.Html.Abstractions/Microsoft.AspNetCore.Html.Abstractions.csproj index 85948d6df7..246b2515a2 100755 --- a/src/Microsoft.AspNetCore.Html.Abstractions/Microsoft.AspNetCore.Html.Abstractions.csproj +++ b/src/Microsoft.AspNetCore.Html.Abstractions/Microsoft.AspNetCore.Html.Abstractions.csproj @@ -9,7 +9,6 @@ Commonly used types: Microsoft.AspNetCore.Html.HtmlString Microsoft.AspNetCore.Html.IHtmlContent netstandard1.0 - $(NoWarn);CS1591 true aspnetcore diff --git a/src/Microsoft.Extensions.WebEncoders/Microsoft.Extensions.WebEncoders.csproj b/src/Microsoft.Extensions.WebEncoders/Microsoft.Extensions.WebEncoders.csproj index 773011fef5..de62d482f9 100755 --- a/src/Microsoft.Extensions.WebEncoders/Microsoft.Extensions.WebEncoders.csproj +++ b/src/Microsoft.Extensions.WebEncoders/Microsoft.Extensions.WebEncoders.csproj @@ -5,7 +5,7 @@ Microsoft .NET Extensions Contains registration and configuration APIs to add the core framework encoders to a dependency injection container. - netstandard1.1 + netstandard2.0 $(NoWarn);CS1591 true true diff --git a/test/Microsoft.AspNetCore.Html.Abstractions.Test/Microsoft.AspNetCore.Html.Abstractions.Test.csproj b/test/Microsoft.AspNetCore.Html.Abstractions.Test/Microsoft.AspNetCore.Html.Abstractions.Test.csproj index ac305ecf01..5030f90ad5 100755 --- a/test/Microsoft.AspNetCore.Html.Abstractions.Test/Microsoft.AspNetCore.Html.Abstractions.Test.csproj +++ b/test/Microsoft.AspNetCore.Html.Abstractions.Test/Microsoft.AspNetCore.Html.Abstractions.Test.csproj @@ -3,7 +3,7 @@ - netcoreapp2.0;net46 + netcoreapp2.0;net461 netcoreapp2.0 diff --git a/test/Microsoft.Extensions.WebEncoders.Tests/Microsoft.Extensions.WebEncoders.Tests.csproj b/test/Microsoft.Extensions.WebEncoders.Tests/Microsoft.Extensions.WebEncoders.Tests.csproj index 94bc15926e..19406979f2 100755 --- a/test/Microsoft.Extensions.WebEncoders.Tests/Microsoft.Extensions.WebEncoders.Tests.csproj +++ b/test/Microsoft.Extensions.WebEncoders.Tests/Microsoft.Extensions.WebEncoders.Tests.csproj @@ -3,7 +3,7 @@ - netcoreapp2.0;net46 + netcoreapp2.0;net461 netcoreapp2.0 From f12054dfa7b38a7cccc7a63ad298f0e00d359365 Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Thu, 8 Jun 2017 12:58:50 -0700 Subject: [PATCH 098/169] Update Microsoft.AspNetCore.HtmlAbstractions to .NET Standard 2.0 --- build/dependencies.props | 2 +- .../Microsoft.AspNetCore.Html.Abstractions.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/dependencies.props b/build/dependencies.props index 583adadec1..c81696f7f4 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -3,7 +3,7 @@ 2.0.0-* 4.4.0-* 2.1.0-* - $(BundledNETStandardPackageVersion) + 2.0.0-* 2.0.0-* 2.0.0-* 15.3.0-* diff --git a/src/Microsoft.AspNetCore.Html.Abstractions/Microsoft.AspNetCore.Html.Abstractions.csproj b/src/Microsoft.AspNetCore.Html.Abstractions/Microsoft.AspNetCore.Html.Abstractions.csproj index 246b2515a2..c26d590912 100755 --- a/src/Microsoft.AspNetCore.Html.Abstractions/Microsoft.AspNetCore.Html.Abstractions.csproj +++ b/src/Microsoft.AspNetCore.Html.Abstractions/Microsoft.AspNetCore.Html.Abstractions.csproj @@ -8,7 +8,7 @@ Commonly used types: Microsoft.AspNetCore.Html.HtmlString Microsoft.AspNetCore.Html.IHtmlContent - netstandard1.0 + netstandard2.0 true aspnetcore From 16b9c59ac364950cb74a9bb49b14d25aa5126fb2 Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Mon, 26 Jun 2017 09:37:33 -0700 Subject: [PATCH 099/169] Adding libunwind8 to .travis.yml [skip appveyor] --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.travis.yml b/.travis.yml index 2a46104677..b10be14215 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,6 +10,10 @@ os: - linux - osx osx_image: xcode8.2 +addons: + apt: + packages: + - libunwind8 branches: only: - master From 0704198e554cb0b4407063a1c4c578b48ba32c71 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Mon, 3 Jul 2017 14:05:58 -0700 Subject: [PATCH 100/169] Update LICENSE.txt text --- LICENSE.txt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/LICENSE.txt b/LICENSE.txt index 0bdc1962b6..7b2956ecee 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,10 +1,12 @@ -Copyright (c) .NET Foundation. All rights reserved. +Copyright (c) .NET Foundation and Contributors + +All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use -these files except in compliance with the License. You may obtain a copy of the +this file except in compliance with the License. You may obtain a copy of the License at -http://www.apache.org/licenses/LICENSE-2.0 + http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR From 6849a49905ce6febe8699f831514e926a88c11d9 Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Thu, 6 Jul 2017 10:37:33 -0700 Subject: [PATCH 101/169] React to aspnet/BuildTools#293 [ci skip] --- build/dependencies.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/dependencies.props b/build/dependencies.props index c81696f7f4..b4bc781894 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -2,7 +2,7 @@ 2.0.0-* 4.4.0-* - 2.1.0-* + 2.0.1-* 2.0.0-* 2.0.0-* 2.0.0-* From bcbfe745f4c649f1a7b3cda62eb0d75dec661ca6 Mon Sep 17 00:00:00 2001 From: Ryan Brandenburg Date: Thu, 6 Jul 2017 12:12:21 -0700 Subject: [PATCH 102/169] Set "TreatWarningsAsErrors" before NuGet restore * Ensures our build stays clean of NuGet warnings --- build/common.props | 1 + 1 file changed, 1 insertion(+) diff --git a/build/common.props b/build/common.props index da05c181bb..7abb374f12 100644 --- a/build/common.props +++ b/build/common.props @@ -9,6 +9,7 @@ true true $(VersionSuffix)-$(BuildNumber) + true From 3d92b581e710b61c2d95c0826eb0f1a0090b1ccf Mon Sep 17 00:00:00 2001 From: Pranav K Date: Thu, 6 Jul 2017 15:08:18 -0700 Subject: [PATCH 103/169] Update version suffix for 2.0.0 RTM release --- version.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.props b/version.props index 193a5999d8..eba6b16756 100644 --- a/version.props +++ b/version.props @@ -2,6 +2,6 @@ 2.0.0 - preview3 + rtm From 615f9d1743db0839ae027047efbcdeef438f0445 Mon Sep 17 00:00:00 2001 From: Ryan Brandenburg Date: Thu, 6 Jul 2017 15:51:42 -0700 Subject: [PATCH 104/169] Remove NETStandard.Library.NETFramework --- build/common.props | 4 ---- 1 file changed, 4 deletions(-) diff --git a/build/common.props b/build/common.props index 7abb374f12..83647293aa 100644 --- a/build/common.props +++ b/build/common.props @@ -16,8 +16,4 @@ - - - - From b4afc95b281d8f2bee775ee58bf4b028e9a0c009 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Mon, 10 Jul 2017 11:42:52 -0700 Subject: [PATCH 105/169] Branching for 2.0.0 rtm --- NuGet.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NuGet.config b/NuGet.config index 4e8a1f6de1..37f0d27ea0 100644 --- a/NuGet.config +++ b/NuGet.config @@ -2,7 +2,7 @@ - + From 1fbbf5e72ff21df8418224b2d4ecd07ff3fcbefd Mon Sep 17 00:00:00 2001 From: Pranav K Date: Mon, 10 Jul 2017 11:57:57 -0700 Subject: [PATCH 106/169] Updating KoreBuild branch --- build.ps1 | 2 +- build.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build.ps1 b/build.ps1 index 5bf0e2c113..1785334385 100644 --- a/build.ps1 +++ b/build.ps1 @@ -33,7 +33,7 @@ cd $PSScriptRoot $repoFolder = $PSScriptRoot $env:REPO_FOLDER = $repoFolder -$koreBuildZip="https://github.com/aspnet/KoreBuild/archive/dev.zip" +$koreBuildZip="https://github.com/aspnet/KoreBuild/archive/rel/2.0.0.zip" if ($env:KOREBUILD_ZIP) { $koreBuildZip=$env:KOREBUILD_ZIP diff --git a/build.sh b/build.sh index b0bcadb579..5e27ed8efb 100755 --- a/build.sh +++ b/build.sh @@ -2,7 +2,7 @@ repoFolder="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" cd $repoFolder -koreBuildZip="https://github.com/aspnet/KoreBuild/archive/dev.zip" +koreBuildZip="https://github.com/aspnet/KoreBuild/archive/rel/2.0.0.zip" if [ ! -z $KOREBUILD_ZIP ]; then koreBuildZip=$KOREBUILD_ZIP fi From e9d7403c6f8f5d1cb3172d5ebcbc0eb498cdae65 Mon Sep 17 00:00:00 2001 From: Ryan Brandenburg Date: Fri, 7 Jul 2017 14:55:40 -0700 Subject: [PATCH 107/169] Skip first time experience on Appveyor --- appveyor.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 1041615c68..31efd8196f 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,4 +1,4 @@ -init: +init: - git config --global core.autocrlf true branches: only: @@ -9,6 +9,10 @@ branches: build_script: - ps: .\build.ps1 clone_depth: 1 +environment: + global: + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true + DOTNET_CLI_TELEMETRY_OPTOUT: 1 test: off deploy: off os: Visual Studio 2017 From de5d7de12469c312992cf2e9867314ee91a2622e Mon Sep 17 00:00:00 2001 From: Ryan Brandenburg Date: Fri, 21 Jul 2017 12:59:18 -0700 Subject: [PATCH 108/169] 2.0.0-rtm to 2.1.0-preview1 --- version.props | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/version.props b/version.props index eba6b16756..1ea46af42a 100644 --- a/version.props +++ b/version.props @@ -1,7 +1,7 @@ - 2.0.0 - rtm + 2.1.0 + preview1 From 2ac5f3617e9bd157e08d701429abb8b5943fe720 Mon Sep 17 00:00:00 2001 From: Ryan Brandenburg Date: Mon, 24 Jul 2017 17:56:12 -0700 Subject: [PATCH 109/169] Set AspNetCoreVersion --- build/dependencies.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/dependencies.props b/build/dependencies.props index b4bc781894..833d909a0d 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -1,6 +1,6 @@ - 2.0.0-* + 2.1.0-* 4.4.0-* 2.0.1-* 2.0.0-* From 7d5f3511d1e837a8760a5916c3ce657964cd9e53 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Tue, 25 Jul 2017 15:13:18 -0700 Subject: [PATCH 110/169] Updating to InternalAspNetCoreSdkVersion 2.1.1-* --- build/dependencies.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/dependencies.props b/build/dependencies.props index 833d909a0d..3c71bd378d 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -2,7 +2,7 @@ 2.1.0-* 4.4.0-* - 2.0.1-* + 2.1.1-* 2.0.0-* 2.0.0-* 2.0.0-* From 4b747a75bded9ef1e8648f98f640d0096b631044 Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Tue, 25 Jul 2017 16:32:07 -0700 Subject: [PATCH 111/169] Update bootstrappers to use the compiled version of KoreBuild [ci skip] --- .gitignore | 1 + build.cmd | 2 +- build.ps1 | 218 +++++++++++++++++++++++++--------- build.sh | 224 +++++++++++++++++++++++++++++------ build/common.props | 2 +- version.props => version.xml | 3 +- 6 files changed, 356 insertions(+), 94 deletions(-) rename version.props => version.xml (55%) diff --git a/.gitignore b/.gitignore index 6da3c6a3e9..a7fdfd773b 100644 --- a/.gitignore +++ b/.gitignore @@ -38,3 +38,4 @@ node_modules .build/ .testPublish/ global.json +korebuild-lock.txt diff --git a/build.cmd b/build.cmd index 7d4894cb4a..b6c8d24864 100644 --- a/build.cmd +++ b/build.cmd @@ -1,2 +1,2 @@ @ECHO OFF -PowerShell -NoProfile -NoLogo -ExecutionPolicy unrestricted -Command "[System.Threading.Thread]::CurrentThread.CurrentCulture = ''; [System.Threading.Thread]::CurrentThread.CurrentUICulture = '';& '%~dp0build.ps1' %*; exit $LASTEXITCODE" \ No newline at end of file +PowerShell -NoProfile -NoLogo -ExecutionPolicy unrestricted -Command "[System.Threading.Thread]::CurrentThread.CurrentCulture = ''; [System.Threading.Thread]::CurrentThread.CurrentUICulture = '';& '%~dp0build.ps1' %*; exit $LASTEXITCODE" diff --git a/build.ps1 b/build.ps1 index 5bf0e2c113..d5eb4d5cf2 100644 --- a/build.ps1 +++ b/build.ps1 @@ -1,67 +1,177 @@ -$ErrorActionPreference = "Stop" +#!/usr/bin/env powershell +#requires -version 4 -function DownloadWithRetry([string] $url, [string] $downloadLocation, [int] $retries) -{ - while($true) - { - try - { - Invoke-WebRequest $url -OutFile $downloadLocation - break - } - catch - { - $exceptionMessage = $_.Exception.Message - Write-Host "Failed to download '$url': $exceptionMessage" - if ($retries -gt 0) { - $retries-- - Write-Host "Waiting 10 seconds before retrying. Retries left: $retries" - Start-Sleep -Seconds 10 +<# +.SYNOPSIS +Build this repository +.DESCRIPTION +Downloads korebuild if required. Then builds the repository. + +.PARAMETER Path +The folder to build. Defaults to the folder containing this script. + +.PARAMETER Channel +The channel of KoreBuild to download. Overrides the value from the config file. + +.PARAMETER DotNetHome +The directory where .NET Core tools will be stored. + +.PARAMETER ToolsSource +The base url where build tools can be downloaded. Overrides the value from the config file. + +.PARAMETER Update +Updates KoreBuild to the latest version even if a lock file is present. + +.PARAMETER ConfigFile +The path to the configuration file that stores values. Defaults to version.xml. + +.PARAMETER MSBuildArgs +Arguments to be passed to MSBuild + +.NOTES +This function will create a file $PSScriptRoot/korebuild-lock.txt. This lock file can be committed to source, but does not have to be. +When the lockfile is not present, KoreBuild will create one using latest available version from $Channel. + +The $ConfigFile is expected to be an XML file. It is optional, and the configuration values in it are optional as well. + +.EXAMPLE +Example config file: +```xml + + + + dev + https://aspnetcore.blob.core.windows.net/buildtools + + +``` +#> +[CmdletBinding(PositionalBinding = $false)] +param( + [string]$Path = $PSScriptRoot, + [Alias('c')] + [string]$Channel, + [Alias('d')] + [string]$DotNetHome, + [Alias('s')] + [string]$ToolsSource, + [Alias('u')] + [switch]$Update, + [string]$ConfigFile = (Join-Path $PSScriptRoot 'version.xml'), + [Parameter(ValueFromRemainingArguments = $true)] + [string[]]$MSBuildArgs +) + +Set-StrictMode -Version 2 +$ErrorActionPreference = 'Stop' + +# +# Functions +# + +function Get-KoreBuild { + + $lockFile = Join-Path $Path 'korebuild-lock.txt' + + if (!(Test-Path $lockFile) -or $Update) { + Get-RemoteFile "$ToolsSource/korebuild/channels/$Channel/latest.txt" $lockFile + } + + $version = Get-Content $lockFile | Where-Object { $_ -like 'version:*' } | Select-Object -first 1 + if (!$version) { + Write-Error "Failed to parse version from $lockFile. Expected a line that begins with 'version:'" + } + $version = $version.TrimStart('version:').Trim() + $korebuildPath = Join-Paths $DotNetHome ('buildtools', 'korebuild', $version) + + if (!(Test-Path $korebuildPath)) { + Write-Host -ForegroundColor Magenta "Downloading KoreBuild $version" + New-Item -ItemType Directory -Path $korebuildPath | Out-Null + $remotePath = "$ToolsSource/korebuild/artifacts/$version/korebuild.$version.zip" + + try { + $tmpfile = Join-Path ([IO.Path]::GetTempPath()) "KoreBuild-$([guid]::NewGuid()).zip" + Get-RemoteFile $remotePath $tmpfile + if (Get-Command -Name 'Expand-Archive' -ErrorAction Ignore) { + # Use built-in commands where possible as they are cross-plat compatible + Expand-Archive -Path $tmpfile -DestinationPath $korebuildPath } - else - { - $exception = $_.Exception - throw $exception + else { + # Fallback to old approach for old installations of PowerShell + Add-Type -AssemblyName System.IO.Compression.FileSystem + [System.IO.Compression.ZipFile]::ExtractToDirectory($tmpfile, $korebuildPath) } } + catch { + Remove-Item -Recurse -Force $korebuildPath -ErrorAction Ignore + throw + } + finally { + Remove-Item $tmpfile -ErrorAction Ignore + } } + + return $korebuildPath } -cd $PSScriptRoot - -$repoFolder = $PSScriptRoot -$env:REPO_FOLDER = $repoFolder - -$koreBuildZip="https://github.com/aspnet/KoreBuild/archive/dev.zip" -if ($env:KOREBUILD_ZIP) -{ - $koreBuildZip=$env:KOREBUILD_ZIP +function Join-Paths([string]$path, [string[]]$childPaths) { + $childPaths | ForEach-Object { $path = Join-Path $path $_ } + return $path } -$buildFolder = ".build" -$buildFile="$buildFolder\KoreBuild.ps1" - -if (!(Test-Path $buildFolder)) { - Write-Host "Downloading KoreBuild from $koreBuildZip" - - $tempFolder=$env:TEMP + "\KoreBuild-" + [guid]::NewGuid() - New-Item -Path "$tempFolder" -Type directory | Out-Null - - $localZipFile="$tempFolder\korebuild.zip" - - DownloadWithRetry -url $koreBuildZip -downloadLocation $localZipFile -retries 6 - - Add-Type -AssemblyName System.IO.Compression.FileSystem - [System.IO.Compression.ZipFile]::ExtractToDirectory($localZipFile, $tempFolder) - - New-Item -Path "$buildFolder" -Type directory | Out-Null - copy-item "$tempFolder\**\build\*" $buildFolder -Recurse - - # Cleanup - if (Test-Path $tempFolder) { - Remove-Item -Recurse -Force $tempFolder +function Get-RemoteFile([string]$RemotePath, [string]$LocalPath) { + if ($RemotePath -notlike 'http*') { + Copy-Item $RemotePath $LocalPath + return } + + $retries = 10 + while ($retries -gt 0) { + $retries -= 1 + try { + Invoke-WebRequest -UseBasicParsing -Uri $RemotePath -OutFile $LocalPath + return + } + catch { + Write-Verbose "Request failed. $retries retries remaining" + } + } + + Write-Error "Download failed: '$RemotePath'." } -&"$buildFile" @args +# +# Main +# + +# Load configuration or set defaults + +if (Test-Path $ConfigFile) { + [xml] $config = Get-Content $ConfigFile + if (!($Channel)) { [string] $Channel = Select-Xml -Xml $config -XPath '/Project/PropertyGroup/KoreBuildChannel' } + if (!($ToolsSource)) { [string] $ToolsSource = Select-Xml -Xml $config -XPath '/Project/PropertyGroup/KoreBuildToolsSource' } +} + +if (!$DotNetHome) { + $DotNetHome = if ($env:DOTNET_HOME) { $env:DOTNET_HOME } ` + elseif ($env:USERPROFILE) { Join-Path $env:USERPROFILE '.dotnet'} ` + elseif ($env:HOME) {Join-Path $env:HOME '.dotnet'}` + else { Join-Path $PSScriptRoot '.dotnet'} +} + +if (!$Channel) { $Channel = 'dev' } +if (!$ToolsSource) { $ToolsSource = 'https://aspnetcore.blob.core.windows.net/buildtools' } + +# Execute + +$korebuildPath = Get-KoreBuild +Import-Module -Force -Scope Local (Join-Path $korebuildPath 'KoreBuild.psd1') + +try { + Install-Tools $ToolsSource $DotNetHome + Invoke-RepositoryBuild $Path @MSBuildArgs +} +finally { + Remove-Module 'KoreBuild' -ErrorAction Ignore +} diff --git a/build.sh b/build.sh index b0bcadb579..ab590e62f1 100755 --- a/build.sh +++ b/build.sh @@ -1,46 +1,196 @@ #!/usr/bin/env bash -repoFolder="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -cd $repoFolder -koreBuildZip="https://github.com/aspnet/KoreBuild/archive/dev.zip" -if [ ! -z $KOREBUILD_ZIP ]; then - koreBuildZip=$KOREBUILD_ZIP -fi +set -euo pipefail -buildFolder=".build" -buildFile="$buildFolder/KoreBuild.sh" +# +# variables +# -if test ! -d $buildFolder; then - echo "Downloading KoreBuild from $koreBuildZip" +RESET="\033[0m" +RED="\033[0;31m" +MAGENTA="\033[0;95m" +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +[ -z "${DOTNET_HOME:-}"] && DOTNET_HOME="$HOME/.dotnet" +config_file="$DIR/version.xml" +verbose=false +update=false +repo_path="$DIR" +channel='' +tools_source='' - tempFolder="/tmp/KoreBuild-$(uuidgen)" - mkdir $tempFolder +# +# Functions +# +__usage() { + echo "Usage: $(basename ${BASH_SOURCE[0]}) [options] [[--] ...]" + echo "" + echo "Arguments:" + echo " ... Arguments passed to MSBuild. Variable number of arguments allowed." + echo "" + echo "Options:" + echo " --verbose Show verbose output." + echo " -c|--channel The channel of KoreBuild to download. Overrides the value from the config file.." + echo " --config-file TThe path to the configuration file that stores values. Defaults to version.xml." + echo " -d|--dotnet-home The directory where .NET Core tools will be stored. Defaults to '\$DOTNET_HOME' or '\$HOME/.dotnet." + echo " --path The directory to build. Defaults to the directory containing the script." + echo " -s|--tools-source The base url where build tools can be downloaded. Overrides the value from the config file." + echo " -u|--update Update to the latest KoreBuild even if the lock file is present." + echo "" + echo "Description:" + echo " This function will create a file \$DIR/korebuild-lock.txt. This lock file can be committed to source, but does not have to be." + echo " When the lockfile is not present, KoreBuild will create one using latest available version from \$channel." - localZipFile="$tempFolder/korebuild.zip" - - retries=6 - until (wget -O $localZipFile $koreBuildZip 2>/dev/null || curl -o $localZipFile --location $koreBuildZip 2>/dev/null) - do - echo "Failed to download '$koreBuildZip'" - if [ "$retries" -le 0 ]; then - exit 1 - fi - retries=$((retries - 1)) - echo "Waiting 10 seconds before retrying. Retries left: $retries" - sleep 10s - done - - unzip -q -d $tempFolder $localZipFile - - mkdir $buildFolder - cp -r $tempFolder/**/build/** $buildFolder - - chmod +x $buildFile - - # Cleanup - if test -d $tempFolder; then - rm -rf $tempFolder + if [[ "${1:-}" != '--no-exit' ]]; then + exit 2 fi +} + +get_korebuild() { + local lock_file="$repo_path/korebuild-lock.txt" + if [ ! -f $lock_file ] || [ "$update" = true ]; then + __get_remote_file "$tools_source/korebuild/channels/$channel/latest.txt" $lock_file + fi + local version="$(grep 'version:*' -m 1 $lock_file)" + if [[ "$version" == '' ]]; then + __error "Failed to parse version from $lock_file. Expected a line that begins with 'version:'" + return 1 + fi + version="$(echo ${version#version:} | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')" + local korebuild_path="$DOTNET_HOME/buildtools/korebuild/$version" + + { + if [ ! -d "$korebuild_path" ]; then + mkdir -p "$korebuild_path" + local remote_path="$tools_source/korebuild/artifacts/$version/korebuild.$version.zip" + tmpfile="$(mktemp)" + echo -e "${MAGENTA}Downloading KoreBuild ${version}${RESET}" + if __get_remote_file $remote_path $tmpfile; then + unzip -q -d "$korebuild_path" $tmpfile + fi + rm $tmpfile || true + fi + + source "$korebuild_path/KoreBuild.sh" + } || { + if [ -d "$korebuild_path" ]; then + echo "Cleaning up after failed installation" + rm -rf "$korebuild_path" || true + fi + return 1 + } +} + +__error() { + echo -e "${RED}$@${RESET}" 1>&2 +} + +__machine_has() { + hash "$1" > /dev/null 2>&1 + return $? +} + +__get_remote_file() { + local remote_path=$1 + local local_path=$2 + + if [[ "$remote_path" != 'http'* ]]; then + cp $remote_path $local_path + return 0 + fi + + failed=false + if __machine_has wget; then + wget --tries 10 --quiet -O $local_path $remote_path || failed=true + fi + + if [ "$failed" = true ] && __machine_has curl; then + failed=false + curl --retry 10 -sSL -f --create-dirs -o $local_path $remote_path || failed=true + fi + + if [ "$failed" = true ]; then + __error "Download failed: $remote_path" 1>&2 + return 1 + fi +} + +__read_dom () { local IFS=\> ; read -d \< ENTITY CONTENT ;} + +# +# main +# + +while [[ $# > 0 ]]; do + case $1 in + -\?|-h|--help) + __usage --no-exit + exit 0 + ;; + -c|--channel|-Channel) + shift + channel=${1:-} + [ -z "$channel" ] && __usage + ;; + --config-file|-ConfigFile) + shift + config_file="${1:-}" + [ -z "$config_file" ] && __usage + ;; + -d|--dotnet-home|-DotNetHome) + shift + DOTNET_HOME=${1:-} + [ -z "$DOTNET_HOME" ] && __usage + ;; + --path|-Path) + shift + repo_path="${1:-}" + [ -z "$repo_path" ] && __usage + ;; + -s|--tools-source|-ToolsSource) + shift + tools_source="${1:-}" + [ -z "$tools_source" ] && __usage + ;; + -u|--update|-Update) + update=true + ;; + --verbose|-Verbose) + verbose=true + ;; + --) + shift + break + ;; + *) + break + ;; + esac + shift +done + +if ! __machine_has unzip; then + __error 'Missing required command: unzip' + exit 1 fi -$buildFile -r $repoFolder "$@" +if ! __machine_has curl && ! __machine_has wget; then + __error 'Missing required command. Either wget or curl is required.' + exit 1 +fi + +if [ -f $config_file ]; then + comment=false + while __read_dom; do + if [ "$comment" = true ]; then [[ $CONTENT == *'-->'* ]] && comment=false ; continue; fi + if [[ $ENTITY == '!--'* ]]; then comment=true; continue; fi + if [ -z "$channel" ] && [[ $ENTITY == "KoreBuildChannel" ]]; then channel=$CONTENT; fi + if [ -z "$tools_source" ] && [[ $ENTITY == "KoreBuildToolsSource" ]]; then tools_source=$CONTENT; fi + done < $config_file +fi + +[ -z "$channel" ] && channel='dev' +[ -z "$tools_source" ] && tools_source='https://aspnetcore.blob.core.windows.net/buildtools' + +get_korebuild +install_tools "$tools_source" "$DOTNET_HOME" +invoke_repository_build "$repo_path" $@ diff --git a/build/common.props b/build/common.props index 83647293aa..c03e5c1314 100644 --- a/build/common.props +++ b/build/common.props @@ -1,6 +1,6 @@ - + https://github.com/aspnet/HtmlAbstractions diff --git a/version.props b/version.xml similarity index 55% rename from version.props rename to version.xml index 1ea46af42a..3c05022b7d 100644 --- a/version.props +++ b/version.xml @@ -1,6 +1,7 @@ - + + dev 2.1.0 preview1 From 9c3d4543f550e9ca985887f72627a2b0d021fe12 Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Wed, 26 Jul 2017 10:27:33 -0700 Subject: [PATCH 112/169] Fix syntax warning when running build.sh on older versions of bash [ci skip] --- build.sh | 41 +++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/build.sh b/build.sh index ab590e62f1..5568c6182a 100755 --- a/build.sh +++ b/build.sh @@ -10,7 +10,7 @@ RESET="\033[0m" RED="\033[0;31m" MAGENTA="\033[0;95m" DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -[ -z "${DOTNET_HOME:-}"] && DOTNET_HOME="$HOME/.dotnet" +[ -z "${DOTNET_HOME:-}" ] && DOTNET_HOME="$HOME/.dotnet" config_file="$DIR/version.xml" verbose=false update=false @@ -22,7 +22,7 @@ tools_source='' # Functions # __usage() { - echo "Usage: $(basename ${BASH_SOURCE[0]}) [options] [[--] ...]" + echo "Usage: $(basename "${BASH_SOURCE[0]}") [options] [[--] ...]" echo "" echo "Arguments:" echo " ... Arguments passed to MSBuild. Variable number of arguments allowed." @@ -46,16 +46,17 @@ __usage() { } get_korebuild() { + local version local lock_file="$repo_path/korebuild-lock.txt" - if [ ! -f $lock_file ] || [ "$update" = true ]; then - __get_remote_file "$tools_source/korebuild/channels/$channel/latest.txt" $lock_file + if [ ! -f "$lock_file" ] || [ "$update" = true ]; then + __get_remote_file "$tools_source/korebuild/channels/$channel/latest.txt" "$lock_file" fi - local version="$(grep 'version:*' -m 1 $lock_file)" + version="$(grep 'version:*' -m 1 "$lock_file")" if [[ "$version" == '' ]]; then __error "Failed to parse version from $lock_file. Expected a line that begins with 'version:'" return 1 fi - version="$(echo ${version#version:} | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')" + version="$(echo "${version#version:}" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')" local korebuild_path="$DOTNET_HOME/buildtools/korebuild/$version" { @@ -64,10 +65,10 @@ get_korebuild() { local remote_path="$tools_source/korebuild/artifacts/$version/korebuild.$version.zip" tmpfile="$(mktemp)" echo -e "${MAGENTA}Downloading KoreBuild ${version}${RESET}" - if __get_remote_file $remote_path $tmpfile; then - unzip -q -d "$korebuild_path" $tmpfile + if __get_remote_file "$remote_path" "$tmpfile"; then + unzip -q -d "$korebuild_path" "$tmpfile" fi - rm $tmpfile || true + rm "$tmpfile" || true fi source "$korebuild_path/KoreBuild.sh" @@ -81,7 +82,7 @@ get_korebuild() { } __error() { - echo -e "${RED}$@${RESET}" 1>&2 + echo -e "${RED}$*${RESET}" 1>&2 } __machine_has() { @@ -94,18 +95,18 @@ __get_remote_file() { local local_path=$2 if [[ "$remote_path" != 'http'* ]]; then - cp $remote_path $local_path + cp "$remote_path" "$local_path" return 0 fi failed=false if __machine_has wget; then - wget --tries 10 --quiet -O $local_path $remote_path || failed=true + wget --tries 10 --quiet -O "$local_path" "$remote_path" || failed=true fi if [ "$failed" = true ] && __machine_has curl; then failed=false - curl --retry 10 -sSL -f --create-dirs -o $local_path $remote_path || failed=true + curl --retry 10 -sSL -f --create-dirs -o "$local_path" "$remote_path" || failed=true fi if [ "$failed" = true ]; then @@ -114,13 +115,13 @@ __get_remote_file() { fi } -__read_dom () { local IFS=\> ; read -d \< ENTITY CONTENT ;} +__read_dom () { local IFS=\> ; read -r -d \< ENTITY CONTENT ;} # # main # -while [[ $# > 0 ]]; do +while [[ $# -gt 0 ]]; do case $1 in -\?|-h|--help) __usage --no-exit @@ -128,7 +129,7 @@ while [[ $# > 0 ]]; do ;; -c|--channel|-Channel) shift - channel=${1:-} + channel="${1:-}" [ -z "$channel" ] && __usage ;; --config-file|-ConfigFile) @@ -138,7 +139,7 @@ while [[ $# > 0 ]]; do ;; -d|--dotnet-home|-DotNetHome) shift - DOTNET_HOME=${1:-} + DOTNET_HOME="${1:-}" [ -z "$DOTNET_HOME" ] && __usage ;; --path|-Path) @@ -178,14 +179,14 @@ if ! __machine_has curl && ! __machine_has wget; then exit 1 fi -if [ -f $config_file ]; then +if [ -f "$config_file" ]; then comment=false while __read_dom; do if [ "$comment" = true ]; then [[ $CONTENT == *'-->'* ]] && comment=false ; continue; fi if [[ $ENTITY == '!--'* ]]; then comment=true; continue; fi if [ -z "$channel" ] && [[ $ENTITY == "KoreBuildChannel" ]]; then channel=$CONTENT; fi if [ -z "$tools_source" ] && [[ $ENTITY == "KoreBuildToolsSource" ]]; then tools_source=$CONTENT; fi - done < $config_file + done < "$config_file" fi [ -z "$channel" ] && channel='dev' @@ -193,4 +194,4 @@ fi get_korebuild install_tools "$tools_source" "$DOTNET_HOME" -invoke_repository_build "$repo_path" $@ +invoke_repository_build "$repo_path" "$@" From dce16d26ecc51fc89912b86eb7c2199679bcb87b Mon Sep 17 00:00:00 2001 From: John Luo Date: Wed, 2 Aug 2017 12:44:45 -0700 Subject: [PATCH 113/169] Update __get_remote_file logic --- build.sh | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/build.sh b/build.sh index 5568c6182a..8eace4c20d 100755 --- a/build.sh +++ b/build.sh @@ -99,17 +99,16 @@ __get_remote_file() { return 0 fi - failed=false + local succeeded=false if __machine_has wget; then - wget --tries 10 --quiet -O "$local_path" "$remote_path" || failed=true + wget --tries 10 --quiet -O "$local_path" "$remote_path" && succeeded=true fi - if [ "$failed" = true ] && __machine_has curl; then - failed=false - curl --retry 10 -sSL -f --create-dirs -o "$local_path" "$remote_path" || failed=true + if [ "$succeeded" = false ] && __machine_has curl; then + curl --retry 10 -sSL -f --create-dirs -o "$local_path" "$remote_path" && succeeded=true fi - if [ "$failed" = true ]; then + if [ "$succeeded" = false ]; then __error "Download failed: $remote_path" 1>&2 return 1 fi From aa2c30688236abf8037b4dd9e47971eddae858e2 Mon Sep 17 00:00:00 2001 From: John Luo Date: Wed, 2 Aug 2017 14:31:53 -0700 Subject: [PATCH 114/169] Ensure fallback to curl after failed wget --- build.sh | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/build.sh b/build.sh index 8eace4c20d..11cdbe5504 100755 --- a/build.sh +++ b/build.sh @@ -99,16 +99,19 @@ __get_remote_file() { return 0 fi - local succeeded=false + local failed=false if __machine_has wget; then - wget --tries 10 --quiet -O "$local_path" "$remote_path" && succeeded=true + wget --tries 10 --quiet -O "$local_path" "$remote_path" || failed=true + else + failed=true fi - if [ "$succeeded" = false ] && __machine_has curl; then - curl --retry 10 -sSL -f --create-dirs -o "$local_path" "$remote_path" && succeeded=true + if [ "$failed" = true ] && __machine_has curl; then + failed=false + curl --retry 10 -sSL -f --create-dirs -o "$local_path" "$remote_path" || failed=true fi - if [ "$succeeded" = false ]; then + if [ "$failed" = true ]; then __error "Download failed: $remote_path" 1>&2 return 1 fi From 68a6e8d367b27d00e00ae00b4bacd764dc6fb503 Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Tue, 22 Aug 2017 15:19:42 -0700 Subject: [PATCH 115/169] Upgrade to xunit 2.3.0-beta4 --- build/dependencies.props | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build/dependencies.props b/build/dependencies.props index 3c71bd378d..1235e00530 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -6,7 +6,7 @@ 2.0.0-* 2.0.0-* 2.0.0-* - 15.3.0-* - 2.3.0-beta2-* + 15.3.0 + 2.3.0-beta4-build3742 From 51781762195bcc463d837d5c8914f218a6d43659 Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Tue, 29 Aug 2017 09:41:12 -0700 Subject: [PATCH 116/169] Use Directory.Build.props/targets --- appveyor.yml => .appveyor.yml | 0 build/common.props => Directory.Build.props | 8 ++++---- Directory.Build.targets | 2 ++ .../Microsoft.AspNetCore.Html.Abstractions.csproj | 2 -- .../Microsoft.Extensions.WebEncoders.csproj | 2 -- test/Directory.Build.props | 10 ++++++++++ .../Microsoft.AspNetCore.Html.Abstractions.Test.csproj | 9 --------- .../Microsoft.Extensions.WebEncoders.Tests.csproj | 5 ----- 8 files changed, 16 insertions(+), 22 deletions(-) rename appveyor.yml => .appveyor.yml (100%) rename build/common.props => Directory.Build.props (75%) create mode 100644 Directory.Build.targets create mode 100644 test/Directory.Build.props diff --git a/appveyor.yml b/.appveyor.yml similarity index 100% rename from appveyor.yml rename to .appveyor.yml diff --git a/build/common.props b/Directory.Build.props similarity index 75% rename from build/common.props rename to Directory.Build.props index c03e5c1314..620aa5b381 100644 --- a/build/common.props +++ b/Directory.Build.props @@ -1,11 +1,11 @@ - - - + + + https://github.com/aspnet/HtmlAbstractions git - $(MSBuildThisFileDirectory)Key.snk + $(MSBuildThisFileDirectory)build\Key.snk true true $(VersionSuffix)-$(BuildNumber) diff --git a/Directory.Build.targets b/Directory.Build.targets new file mode 100644 index 0000000000..f75adf7e4d --- /dev/null +++ b/Directory.Build.targets @@ -0,0 +1,2 @@ + + diff --git a/src/Microsoft.AspNetCore.Html.Abstractions/Microsoft.AspNetCore.Html.Abstractions.csproj b/src/Microsoft.AspNetCore.Html.Abstractions/Microsoft.AspNetCore.Html.Abstractions.csproj index c26d590912..d6d301320f 100755 --- a/src/Microsoft.AspNetCore.Html.Abstractions/Microsoft.AspNetCore.Html.Abstractions.csproj +++ b/src/Microsoft.AspNetCore.Html.Abstractions/Microsoft.AspNetCore.Html.Abstractions.csproj @@ -1,7 +1,5 @@  - - Microsoft ASP.NET Core ASP.NET Core HTML abstractions used for building HTML content. diff --git a/src/Microsoft.Extensions.WebEncoders/Microsoft.Extensions.WebEncoders.csproj b/src/Microsoft.Extensions.WebEncoders/Microsoft.Extensions.WebEncoders.csproj index de62d482f9..04359f96f5 100755 --- a/src/Microsoft.Extensions.WebEncoders/Microsoft.Extensions.WebEncoders.csproj +++ b/src/Microsoft.Extensions.WebEncoders/Microsoft.Extensions.WebEncoders.csproj @@ -1,7 +1,5 @@  - - Microsoft .NET Extensions Contains registration and configuration APIs to add the core framework encoders to a dependency injection container. diff --git a/test/Directory.Build.props b/test/Directory.Build.props new file mode 100644 index 0000000000..98d33955fd --- /dev/null +++ b/test/Directory.Build.props @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/test/Microsoft.AspNetCore.Html.Abstractions.Test/Microsoft.AspNetCore.Html.Abstractions.Test.csproj b/test/Microsoft.AspNetCore.Html.Abstractions.Test/Microsoft.AspNetCore.Html.Abstractions.Test.csproj index 5030f90ad5..f899e1a699 100755 --- a/test/Microsoft.AspNetCore.Html.Abstractions.Test/Microsoft.AspNetCore.Html.Abstractions.Test.csproj +++ b/test/Microsoft.AspNetCore.Html.Abstractions.Test/Microsoft.AspNetCore.Html.Abstractions.Test.csproj @@ -1,7 +1,5 @@  - - netcoreapp2.0;net461 netcoreapp2.0 @@ -12,11 +10,4 @@ - - - - - - - diff --git a/test/Microsoft.Extensions.WebEncoders.Tests/Microsoft.Extensions.WebEncoders.Tests.csproj b/test/Microsoft.Extensions.WebEncoders.Tests/Microsoft.Extensions.WebEncoders.Tests.csproj index 19406979f2..0236c3e9af 100755 --- a/test/Microsoft.Extensions.WebEncoders.Tests/Microsoft.Extensions.WebEncoders.Tests.csproj +++ b/test/Microsoft.Extensions.WebEncoders.Tests/Microsoft.Extensions.WebEncoders.Tests.csproj @@ -1,7 +1,5 @@  - - netcoreapp2.0;net461 netcoreapp2.0 @@ -13,9 +11,6 @@ - - - From 11377e08f6ceff699aa2d64a568bb81bc0d48f20 Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Tue, 29 Aug 2017 09:42:24 -0700 Subject: [PATCH 117/169] Use PackageLineup to manage PackageReference versions --- Directory.Build.props | 3 +-- Directory.Build.targets | 14 +++++++++++++- NuGet.config | 1 - build/dependencies.props | 12 ------------ build/repo.props | 6 ++++++ .../Microsoft.AspNetCore.Html.Abstractions.csproj | 2 +- .../Microsoft.Extensions.WebEncoders.csproj | 6 +++--- test/Directory.Build.props | 8 ++++---- .../Microsoft.Extensions.WebEncoders.Tests.csproj | 2 +- 9 files changed, 29 insertions(+), 25 deletions(-) delete mode 100644 build/dependencies.props create mode 100644 build/repo.props diff --git a/Directory.Build.props b/Directory.Build.props index 620aa5b381..74b2f8246d 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,5 +1,4 @@  - @@ -13,7 +12,7 @@ - + diff --git a/Directory.Build.targets b/Directory.Build.targets index f75adf7e4d..bc118fd907 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -1,2 +1,14 @@ - + + + + <_BootstrapperFile Condition=" $([MSBuild]::IsOSUnixLike()) ">build.sh + <_BootstrapperFile Condition="! $([MSBuild]::IsOSUnixLike()) ">build.cmd + <_BootstrapperError> + Package references have not been pinned. Run './$(_BootstrapperFile) /t:Pin'. + Also, you can run './$(_BootstrapperFile) /t:Restore' which will pin *and* restore packages. '$(_BootstrapperFile)' can be found in '$(MSBuildThisFileDirectory)'. + + + + + diff --git a/NuGet.config b/NuGet.config index 4e8a1f6de1..20060c934e 100644 --- a/NuGet.config +++ b/NuGet.config @@ -3,7 +3,6 @@ - diff --git a/build/dependencies.props b/build/dependencies.props deleted file mode 100644 index 1235e00530..0000000000 --- a/build/dependencies.props +++ /dev/null @@ -1,12 +0,0 @@ - - - 2.1.0-* - 4.4.0-* - 2.1.1-* - 2.0.0-* - 2.0.0-* - 2.0.0-* - 15.3.0 - 2.3.0-beta4-build3742 - - diff --git a/build/repo.props b/build/repo.props new file mode 100644 index 0000000000..13fe1c296a --- /dev/null +++ b/build/repo.props @@ -0,0 +1,6 @@ + + + + + + diff --git a/src/Microsoft.AspNetCore.Html.Abstractions/Microsoft.AspNetCore.Html.Abstractions.csproj b/src/Microsoft.AspNetCore.Html.Abstractions/Microsoft.AspNetCore.Html.Abstractions.csproj index d6d301320f..79e5ea01a5 100755 --- a/src/Microsoft.AspNetCore.Html.Abstractions/Microsoft.AspNetCore.Html.Abstractions.csproj +++ b/src/Microsoft.AspNetCore.Html.Abstractions/Microsoft.AspNetCore.Html.Abstractions.csproj @@ -12,7 +12,7 @@ Microsoft.AspNetCore.Html.IHtmlContent - + diff --git a/src/Microsoft.Extensions.WebEncoders/Microsoft.Extensions.WebEncoders.csproj b/src/Microsoft.Extensions.WebEncoders/Microsoft.Extensions.WebEncoders.csproj index 04359f96f5..cd0c144633 100755 --- a/src/Microsoft.Extensions.WebEncoders/Microsoft.Extensions.WebEncoders.csproj +++ b/src/Microsoft.Extensions.WebEncoders/Microsoft.Extensions.WebEncoders.csproj @@ -11,9 +11,9 @@ - - - + + + diff --git a/test/Directory.Build.props b/test/Directory.Build.props index 98d33955fd..a728ed268e 100644 --- a/test/Directory.Build.props +++ b/test/Directory.Build.props @@ -2,9 +2,9 @@ - - - - + + + + diff --git a/test/Microsoft.Extensions.WebEncoders.Tests/Microsoft.Extensions.WebEncoders.Tests.csproj b/test/Microsoft.Extensions.WebEncoders.Tests/Microsoft.Extensions.WebEncoders.Tests.csproj index 0236c3e9af..c019c8b97e 100755 --- a/test/Microsoft.Extensions.WebEncoders.Tests/Microsoft.Extensions.WebEncoders.Tests.csproj +++ b/test/Microsoft.Extensions.WebEncoders.Tests/Microsoft.Extensions.WebEncoders.Tests.csproj @@ -10,7 +10,7 @@ - + From 148942979220ea964f10191cf676d8865a13d9d3 Mon Sep 17 00:00:00 2001 From: Justin Kotalik Date: Thu, 21 Sep 2017 17:47:46 -0700 Subject: [PATCH 118/169] Increase Minimum Version of Visual Studio to 15.3.0 --- HtmlAbstractions.sln | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/HtmlAbstractions.sln b/HtmlAbstractions.sln index 5b6b09416f..5ee1cb4612 100644 --- a/HtmlAbstractions.sln +++ b/HtmlAbstractions.sln @@ -1,7 +1,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 VisualStudioVersion = 15.0.26127.0 -MinimumVisualStudioVersion = 10.0.40219.1 +MinimumVisualStudioVersion = 15.0.26730.03 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{A5A15F1C-885A-452A-A731-B0173DDBD913}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{F31FF137-390C-49BF-A3BD-7C6ED3597C21}" From f3ae0489befacdbc9d1361f8bedcc45d6dd5b302 Mon Sep 17 00:00:00 2001 From: Ryan Brandenburg Date: Wed, 20 Sep 2017 13:20:26 -0700 Subject: [PATCH 119/169] Update bootstrappers --- .appveyor.yml | 4 +- build.cmd | 2 +- build.sh | 197 +------------------------------------- run.cmd | 2 + build.ps1 => run.ps1 | 56 +++++++---- run.sh | 223 +++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 266 insertions(+), 218 deletions(-) create mode 100644 run.cmd rename build.ps1 => run.ps1 (73%) create mode 100755 run.sh diff --git a/.appveyor.yml b/.appveyor.yml index 31efd8196f..46038786c9 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -1,4 +1,4 @@ -init: +init: - git config --global core.autocrlf true branches: only: @@ -7,7 +7,7 @@ branches: - dev - /^(.*\/)?ci-.*$/ build_script: - - ps: .\build.ps1 + - ps: .\run.ps1 default-build clone_depth: 1 environment: global: diff --git a/build.cmd b/build.cmd index b6c8d24864..c0050bda12 100644 --- a/build.cmd +++ b/build.cmd @@ -1,2 +1,2 @@ @ECHO OFF -PowerShell -NoProfile -NoLogo -ExecutionPolicy unrestricted -Command "[System.Threading.Thread]::CurrentThread.CurrentCulture = ''; [System.Threading.Thread]::CurrentThread.CurrentUICulture = '';& '%~dp0build.ps1' %*; exit $LASTEXITCODE" +PowerShell -NoProfile -NoLogo -ExecutionPolicy unrestricted -Command "[System.Threading.Thread]::CurrentThread.CurrentCulture = ''; [System.Threading.Thread]::CurrentThread.CurrentUICulture = '';& '%~dp0run.ps1' default-build %*; exit $LASTEXITCODE" diff --git a/build.sh b/build.sh index 11cdbe5504..98a4b22765 100755 --- a/build.sh +++ b/build.sh @@ -1,199 +1,8 @@ #!/usr/bin/env bash set -euo pipefail - -# -# variables -# - -RESET="\033[0m" -RED="\033[0;31m" -MAGENTA="\033[0;95m" DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -[ -z "${DOTNET_HOME:-}" ] && DOTNET_HOME="$HOME/.dotnet" -config_file="$DIR/version.xml" -verbose=false -update=false -repo_path="$DIR" -channel='' -tools_source='' -# -# Functions -# -__usage() { - echo "Usage: $(basename "${BASH_SOURCE[0]}") [options] [[--] ...]" - echo "" - echo "Arguments:" - echo " ... Arguments passed to MSBuild. Variable number of arguments allowed." - echo "" - echo "Options:" - echo " --verbose Show verbose output." - echo " -c|--channel The channel of KoreBuild to download. Overrides the value from the config file.." - echo " --config-file TThe path to the configuration file that stores values. Defaults to version.xml." - echo " -d|--dotnet-home The directory where .NET Core tools will be stored. Defaults to '\$DOTNET_HOME' or '\$HOME/.dotnet." - echo " --path The directory to build. Defaults to the directory containing the script." - echo " -s|--tools-source The base url where build tools can be downloaded. Overrides the value from the config file." - echo " -u|--update Update to the latest KoreBuild even if the lock file is present." - echo "" - echo "Description:" - echo " This function will create a file \$DIR/korebuild-lock.txt. This lock file can be committed to source, but does not have to be." - echo " When the lockfile is not present, KoreBuild will create one using latest available version from \$channel." - - if [[ "${1:-}" != '--no-exit' ]]; then - exit 2 - fi -} - -get_korebuild() { - local version - local lock_file="$repo_path/korebuild-lock.txt" - if [ ! -f "$lock_file" ] || [ "$update" = true ]; then - __get_remote_file "$tools_source/korebuild/channels/$channel/latest.txt" "$lock_file" - fi - version="$(grep 'version:*' -m 1 "$lock_file")" - if [[ "$version" == '' ]]; then - __error "Failed to parse version from $lock_file. Expected a line that begins with 'version:'" - return 1 - fi - version="$(echo "${version#version:}" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')" - local korebuild_path="$DOTNET_HOME/buildtools/korebuild/$version" - - { - if [ ! -d "$korebuild_path" ]; then - mkdir -p "$korebuild_path" - local remote_path="$tools_source/korebuild/artifacts/$version/korebuild.$version.zip" - tmpfile="$(mktemp)" - echo -e "${MAGENTA}Downloading KoreBuild ${version}${RESET}" - if __get_remote_file "$remote_path" "$tmpfile"; then - unzip -q -d "$korebuild_path" "$tmpfile" - fi - rm "$tmpfile" || true - fi - - source "$korebuild_path/KoreBuild.sh" - } || { - if [ -d "$korebuild_path" ]; then - echo "Cleaning up after failed installation" - rm -rf "$korebuild_path" || true - fi - return 1 - } -} - -__error() { - echo -e "${RED}$*${RESET}" 1>&2 -} - -__machine_has() { - hash "$1" > /dev/null 2>&1 - return $? -} - -__get_remote_file() { - local remote_path=$1 - local local_path=$2 - - if [[ "$remote_path" != 'http'* ]]; then - cp "$remote_path" "$local_path" - return 0 - fi - - local failed=false - if __machine_has wget; then - wget --tries 10 --quiet -O "$local_path" "$remote_path" || failed=true - else - failed=true - fi - - if [ "$failed" = true ] && __machine_has curl; then - failed=false - curl --retry 10 -sSL -f --create-dirs -o "$local_path" "$remote_path" || failed=true - fi - - if [ "$failed" = true ]; then - __error "Download failed: $remote_path" 1>&2 - return 1 - fi -} - -__read_dom () { local IFS=\> ; read -r -d \< ENTITY CONTENT ;} - -# -# main -# - -while [[ $# -gt 0 ]]; do - case $1 in - -\?|-h|--help) - __usage --no-exit - exit 0 - ;; - -c|--channel|-Channel) - shift - channel="${1:-}" - [ -z "$channel" ] && __usage - ;; - --config-file|-ConfigFile) - shift - config_file="${1:-}" - [ -z "$config_file" ] && __usage - ;; - -d|--dotnet-home|-DotNetHome) - shift - DOTNET_HOME="${1:-}" - [ -z "$DOTNET_HOME" ] && __usage - ;; - --path|-Path) - shift - repo_path="${1:-}" - [ -z "$repo_path" ] && __usage - ;; - -s|--tools-source|-ToolsSource) - shift - tools_source="${1:-}" - [ -z "$tools_source" ] && __usage - ;; - -u|--update|-Update) - update=true - ;; - --verbose|-Verbose) - verbose=true - ;; - --) - shift - break - ;; - *) - break - ;; - esac - shift -done - -if ! __machine_has unzip; then - __error 'Missing required command: unzip' - exit 1 -fi - -if ! __machine_has curl && ! __machine_has wget; then - __error 'Missing required command. Either wget or curl is required.' - exit 1 -fi - -if [ -f "$config_file" ]; then - comment=false - while __read_dom; do - if [ "$comment" = true ]; then [[ $CONTENT == *'-->'* ]] && comment=false ; continue; fi - if [[ $ENTITY == '!--'* ]]; then comment=true; continue; fi - if [ -z "$channel" ] && [[ $ENTITY == "KoreBuildChannel" ]]; then channel=$CONTENT; fi - if [ -z "$tools_source" ] && [[ $ENTITY == "KoreBuildToolsSource" ]]; then tools_source=$CONTENT; fi - done < "$config_file" -fi - -[ -z "$channel" ] && channel='dev' -[ -z "$tools_source" ] && tools_source='https://aspnetcore.blob.core.windows.net/buildtools' - -get_korebuild -install_tools "$tools_source" "$DOTNET_HOME" -invoke_repository_build "$repo_path" "$@" +# Call "sync" between "chmod" and execution to prevent "text file busy" error in Docker (aufs) +chmod +x "$DIR/run.sh"; sync +"$DIR/run.sh" default-build "$@" diff --git a/run.cmd b/run.cmd new file mode 100644 index 0000000000..d52d5c7e68 --- /dev/null +++ b/run.cmd @@ -0,0 +1,2 @@ +@ECHO OFF +PowerShell -NoProfile -NoLogo -ExecutionPolicy unrestricted -Command "[System.Threading.Thread]::CurrentThread.CurrentCulture = ''; [System.Threading.Thread]::CurrentThread.CurrentUICulture = '';& '%~dp0run.ps1' %*; exit $LASTEXITCODE" diff --git a/build.ps1 b/run.ps1 similarity index 73% rename from build.ps1 rename to run.ps1 index d5eb4d5cf2..49c2899856 100644 --- a/build.ps1 +++ b/run.ps1 @@ -3,10 +3,13 @@ <# .SYNOPSIS -Build this repository +Executes KoreBuild commands. .DESCRIPTION -Downloads korebuild if required. Then builds the repository. +Downloads korebuild if required. Then executes the KoreBuild command. To see available commands, execute with `-Command help`. + +.PARAMETER Command +The KoreBuild command to run. .PARAMETER Path The folder to build. Defaults to the folder containing this script. @@ -24,31 +27,32 @@ The base url where build tools can be downloaded. Overrides the value from the c Updates KoreBuild to the latest version even if a lock file is present. .PARAMETER ConfigFile -The path to the configuration file that stores values. Defaults to version.xml. +The path to the configuration file that stores values. Defaults to korebuild.json. -.PARAMETER MSBuildArgs -Arguments to be passed to MSBuild +.PARAMETER Arguments +Arguments to be passed to the command .NOTES This function will create a file $PSScriptRoot/korebuild-lock.txt. This lock file can be committed to source, but does not have to be. When the lockfile is not present, KoreBuild will create one using latest available version from $Channel. -The $ConfigFile is expected to be an XML file. It is optional, and the configuration values in it are optional as well. +The $ConfigFile is expected to be an JSON file. It is optional, and the configuration values in it are optional as well. Any options set +in the file are overridden by command line parameters. .EXAMPLE Example config file: -```xml - - - - dev - https://aspnetcore.blob.core.windows.net/buildtools - - +```json +{ + "$schema": "https://raw.githubusercontent.com/aspnet/BuildTools/dev/tools/korebuild.schema.json", + "channel": "dev", + "toolsSource": "https://aspnetcore.blob.core.windows.net/buildtools" +} ``` #> [CmdletBinding(PositionalBinding = $false)] param( + [Parameter(Mandatory=$true, Position = 0)] + [string]$Command, [string]$Path = $PSScriptRoot, [Alias('c')] [string]$Channel, @@ -58,9 +62,9 @@ param( [string]$ToolsSource, [Alias('u')] [switch]$Update, - [string]$ConfigFile = (Join-Path $PSScriptRoot 'version.xml'), + [string]$ConfigFile, [Parameter(ValueFromRemainingArguments = $true)] - [string[]]$MSBuildArgs + [string[]]$Arguments ) Set-StrictMode -Version 2 @@ -147,10 +151,20 @@ function Get-RemoteFile([string]$RemotePath, [string]$LocalPath) { # Load configuration or set defaults +$Path = Resolve-Path $Path +if (!$ConfigFile) { $ConfigFile = Join-Path $Path 'korebuild.json' } + if (Test-Path $ConfigFile) { - [xml] $config = Get-Content $ConfigFile - if (!($Channel)) { [string] $Channel = Select-Xml -Xml $config -XPath '/Project/PropertyGroup/KoreBuildChannel' } - if (!($ToolsSource)) { [string] $ToolsSource = Select-Xml -Xml $config -XPath '/Project/PropertyGroup/KoreBuildToolsSource' } + try { + $config = Get-Content -Raw -Encoding UTF8 -Path $ConfigFile | ConvertFrom-Json + if ($config) { + if (!($Channel) -and (Get-Member -Name 'channel' -InputObject $config)) { [string] $Channel = $config.channel } + if (!($ToolsSource) -and (Get-Member -Name 'toolsSource' -InputObject $config)) { [string] $ToolsSource = $config.toolsSource} + } + } catch { + Write-Warning "$ConfigFile could not be read. Its settings will be ignored." + Write-Warning $Error[0] + } } if (!$DotNetHome) { @@ -169,8 +183,8 @@ $korebuildPath = Get-KoreBuild Import-Module -Force -Scope Local (Join-Path $korebuildPath 'KoreBuild.psd1') try { - Install-Tools $ToolsSource $DotNetHome - Invoke-RepositoryBuild $Path @MSBuildArgs + Set-KoreBuildSettings -ToolsSource $ToolsSource -DotNetHome $DotNetHome -RepoPath $Path -ConfigFile $ConfigFile + Invoke-KoreBuildCommand $Command @Arguments } finally { Remove-Module 'KoreBuild' -ErrorAction Ignore diff --git a/run.sh b/run.sh new file mode 100755 index 0000000000..c278423acc --- /dev/null +++ b/run.sh @@ -0,0 +1,223 @@ +#!/usr/bin/env bash + +set -euo pipefail + +# +# variables +# + +RESET="\033[0m" +RED="\033[0;31m" +YELLOW="\033[0;33m" +MAGENTA="\033[0;95m" +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +[ -z "${DOTNET_HOME:-}" ] && DOTNET_HOME="$HOME/.dotnet" +verbose=false +update=false +repo_path="$DIR" +channel='' +tools_source='' + +# +# Functions +# +__usage() { + echo "Usage: $(basename "${BASH_SOURCE[0]}") command [options] [[--] ...]" + echo "" + echo "Arguments:" + echo " command The command to be run." + echo " ... Arguments passed to the command. Variable number of arguments allowed." + echo "" + echo "Options:" + echo " --verbose Show verbose output." + echo " -c|--channel The channel of KoreBuild to download. Overrides the value from the config file.." + echo " --config-file The path to the configuration file that stores values. Defaults to korebuild.json." + echo " -d|--dotnet-home The directory where .NET Core tools will be stored. Defaults to '\$DOTNET_HOME' or '\$HOME/.dotnet." + echo " --path The directory to build. Defaults to the directory containing the script." + echo " -s|--tools-source|-ToolsSource The base url where build tools can be downloaded. Overrides the value from the config file." + echo " -u|--update Update to the latest KoreBuild even if the lock file is present." + echo "" + echo "Description:" + echo " This function will create a file \$DIR/korebuild-lock.txt. This lock file can be committed to source, but does not have to be." + echo " When the lockfile is not present, KoreBuild will create one using latest available version from \$channel." + + if [[ "${1:-}" != '--no-exit' ]]; then + exit 2 + fi +} + +get_korebuild() { + local version + local lock_file="$repo_path/korebuild-lock.txt" + if [ ! -f "$lock_file" ] || [ "$update" = true ]; then + __get_remote_file "$tools_source/korebuild/channels/$channel/latest.txt" "$lock_file" + fi + version="$(grep 'version:*' -m 1 "$lock_file")" + if [[ "$version" == '' ]]; then + __error "Failed to parse version from $lock_file. Expected a line that begins with 'version:'" + return 1 + fi + version="$(echo "${version#version:}" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')" + local korebuild_path="$DOTNET_HOME/buildtools/korebuild/$version" + + { + if [ ! -d "$korebuild_path" ]; then + mkdir -p "$korebuild_path" + local remote_path="$tools_source/korebuild/artifacts/$version/korebuild.$version.zip" + tmpfile="$(mktemp)" + echo -e "${MAGENTA}Downloading KoreBuild ${version}${RESET}" + if __get_remote_file "$remote_path" "$tmpfile"; then + unzip -q -d "$korebuild_path" "$tmpfile" + fi + rm "$tmpfile" || true + fi + + source "$korebuild_path/KoreBuild.sh" + } || { + if [ -d "$korebuild_path" ]; then + echo "Cleaning up after failed installation" + rm -rf "$korebuild_path" || true + fi + return 1 + } +} + +__error() { + echo -e "${RED}error: $*${RESET}" 1>&2 +} + +__warn() { + echo -e "${YELLOW}warning: $*${RESET}" +} + +__machine_has() { + hash "$1" > /dev/null 2>&1 + return $? +} + +__get_remote_file() { + local remote_path=$1 + local local_path=$2 + + if [[ "$remote_path" != 'http'* ]]; then + cp "$remote_path" "$local_path" + return 0 + fi + + local failed=false + if __machine_has wget; then + wget --tries 10 --quiet -O "$local_path" "$remote_path" || failed=true + else + failed=true + fi + + if [ "$failed" = true ] && __machine_has curl; then + failed=false + curl --retry 10 -sSL -f --create-dirs -o "$local_path" "$remote_path" || failed=true + fi + + if [ "$failed" = true ]; then + __error "Download failed: $remote_path" 1>&2 + return 1 + fi +} + +# +# main +# + +command="${1:-}" +shift + +while [[ $# -gt 0 ]]; do + case $1 in + -\?|-h|--help) + __usage --no-exit + exit 0 + ;; + -c|--channel|-Channel) + shift + channel="${1:-}" + [ -z "$channel" ] && __usage + ;; + --config-file|-ConfigFile) + shift + config_file="${1:-}" + [ -z "$config_file" ] && __usage + if [ ! -f "$config_file" ]; then + __error "Invalid value for --config-file. $config_file does not exist." + exit 1 + fi + ;; + -d|--dotnet-home|-DotNetHome) + shift + DOTNET_HOME="${1:-}" + [ -z "$DOTNET_HOME" ] && __usage + ;; + --path|-Path) + shift + repo_path="${1:-}" + [ -z "$repo_path" ] && __usage + ;; + -s|--tools-source|-ToolsSource) + shift + tools_source="${1:-}" + [ -z "$tools_source" ] && __usage + ;; + -u|--update|-Update) + update=true + ;; + --verbose|-Verbose) + verbose=true + ;; + --) + shift + break + ;; + *) + break + ;; + esac + shift +done + +if ! __machine_has unzip; then + __error 'Missing required command: unzip' + exit 1 +fi + +if ! __machine_has curl && ! __machine_has wget; then + __error 'Missing required command. Either wget or curl is required.' + exit 1 +fi + +[ -z "${config_file:-}" ] && config_file="$repo_path/korebuild.json" +if [ -f "$config_file" ]; then + if __machine_has jq ; then + if jq '.' "$config_file" >/dev/null ; then + config_channel="$(jq -r 'select(.channel!=null) | .channel' "$config_file")" + config_tools_source="$(jq -r 'select(.toolsSource!=null) | .toolsSource' "$config_file")" + else + __warn "$config_file is invalid JSON. Its settings will be ignored." + fi + elif __machine_has python ; then + if python -c "import json,codecs;obj=json.load(codecs.open('$config_file', 'r', 'utf-8-sig'))" >/dev/null ; then + config_channel="$(python -c "import json,codecs;obj=json.load(codecs.open('$config_file', 'r', 'utf-8-sig'));print(obj['channel'] if 'channel' in obj else '')")" + config_tools_source="$(python -c "import json,codecs;obj=json.load(codecs.open('$config_file', 'r', 'utf-8-sig'));print(obj['toolsSource'] if 'toolsSource' in obj else '')")" + else + __warn "$config_file is invalid JSON. Its settings will be ignored." + fi + else + __warn 'Missing required command: jq or pyton. Could not parse the JSON file. Its settings will be ignored.' + fi + + [ ! -z "${config_channel:-}" ] && channel="$config_channel" + [ ! -z "${config_tools_source:-}" ] && tools_source="$config_tools_source" +fi + +[ -z "$channel" ] && channel='dev' +[ -z "$tools_source" ] && tools_source='https://aspnetcore.blob.core.windows.net/buildtools' + +get_korebuild +set_korebuildsettings "$tools_source" "$DOTNET_HOME" "$repo_path" "$config_file" +invoke_korebuild_command "$command" "$@" From b1ccd606e56843726cbe253736a789c7f9d6fa82 Mon Sep 17 00:00:00 2001 From: Ryan Brandenburg Date: Mon, 16 Oct 2017 12:49:40 -0700 Subject: [PATCH 120/169] Add RepositoryRoot --- Directory.Build.props | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index 74b2f8246d..50b555b540 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,9 +1,10 @@ - + https://github.com/aspnet/HtmlAbstractions git + $(MSBuildThisFileDirectory) $(MSBuildThisFileDirectory)build\Key.snk true true From d687617a356b9a875ea5b09163ef9d443b4256bb Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Wed, 1 Nov 2017 09:29:41 -0700 Subject: [PATCH 121/169] Pin tool and package versions to make builds more repeatable Part of aspnet/Universe#575 --- .gitignore | 1 - Directory.Build.props | 8 ++++---- Directory.Build.targets | 17 ++++------------- NuGet.config | 1 + build/dependencies.props | 18 ++++++++++++++++++ build/repo.props | 9 +++++---- korebuild-lock.txt | 2 ++ korebuild.json | 4 ++++ ...crosoft.AspNetCore.Html.Abstractions.csproj | 2 +- .../Microsoft.Extensions.WebEncoders.csproj | 6 +++--- test/Directory.Build.props | 10 +++++----- ...crosoft.Extensions.WebEncoders.Tests.csproj | 2 +- version.props | 10 ++++++++++ version.xml | 8 -------- 14 files changed, 58 insertions(+), 40 deletions(-) create mode 100644 build/dependencies.props create mode 100644 korebuild-lock.txt create mode 100644 korebuild.json create mode 100644 version.props delete mode 100644 version.xml diff --git a/.gitignore b/.gitignore index a7fdfd773b..6da3c6a3e9 100644 --- a/.gitignore +++ b/.gitignore @@ -38,4 +38,3 @@ node_modules .build/ .testPublish/ global.json -korebuild-lock.txt diff --git a/Directory.Build.props b/Directory.Build.props index 50b555b540..9db4d01587 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,5 +1,6 @@ - - + + + https://github.com/aspnet/HtmlAbstractions @@ -8,12 +9,11 @@ $(MSBuildThisFileDirectory)build\Key.snk true true - $(VersionSuffix)-$(BuildNumber) true - + diff --git a/Directory.Build.targets b/Directory.Build.targets index bc118fd907..e83ff95e39 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -1,14 +1,5 @@ - - - - <_BootstrapperFile Condition=" $([MSBuild]::IsOSUnixLike()) ">build.sh - <_BootstrapperFile Condition="! $([MSBuild]::IsOSUnixLike()) ">build.cmd - <_BootstrapperError> - Package references have not been pinned. Run './$(_BootstrapperFile) /t:Pin'. - Also, you can run './$(_BootstrapperFile) /t:Restore' which will pin *and* restore packages. '$(_BootstrapperFile)' can be found in '$(MSBuildThisFileDirectory)'. - - - - - + + + $(MicrosoftNETCoreApp20PackageVersion) + diff --git a/NuGet.config b/NuGet.config index 20060c934e..4e8a1f6de1 100644 --- a/NuGet.config +++ b/NuGet.config @@ -3,6 +3,7 @@ + diff --git a/build/dependencies.props b/build/dependencies.props new file mode 100644 index 0000000000..410f1c8697 --- /dev/null +++ b/build/dependencies.props @@ -0,0 +1,18 @@ + + + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) + + + 2.1.0-preview1-15549 + 2.1.0-preview1-27488 + 2.1.0-preview1-27488 + 2.1.0-preview1-27488 + 2.1.0-preview1-27488 + 2.0.0 + 15.3.0 + 4.4.0 + 2.3.0 + 2.3.0 + + + diff --git a/build/repo.props b/build/repo.props index 13fe1c296a..b55e651b87 100644 --- a/build/repo.props +++ b/build/repo.props @@ -1,6 +1,7 @@  - - - - + + + Internal.AspNetCore.Universe.Lineup + https://dotnet.myget.org/F/aspnetcore-ci-dev/api/v3/index.json + diff --git a/korebuild-lock.txt b/korebuild-lock.txt new file mode 100644 index 0000000000..45463cc71e --- /dev/null +++ b/korebuild-lock.txt @@ -0,0 +1,2 @@ +version:2.1.0-preview1-15549 +commithash:f570e08585fec510dd60cd4bfe8795388b757a95 diff --git a/korebuild.json b/korebuild.json new file mode 100644 index 0000000000..bd5d51a51b --- /dev/null +++ b/korebuild.json @@ -0,0 +1,4 @@ +{ + "$schema": "https://raw.githubusercontent.com/aspnet/BuildTools/dev/tools/korebuild.schema.json", + "channel": "dev" +} diff --git a/src/Microsoft.AspNetCore.Html.Abstractions/Microsoft.AspNetCore.Html.Abstractions.csproj b/src/Microsoft.AspNetCore.Html.Abstractions/Microsoft.AspNetCore.Html.Abstractions.csproj index 79e5ea01a5..271cc6c7fa 100755 --- a/src/Microsoft.AspNetCore.Html.Abstractions/Microsoft.AspNetCore.Html.Abstractions.csproj +++ b/src/Microsoft.AspNetCore.Html.Abstractions/Microsoft.AspNetCore.Html.Abstractions.csproj @@ -12,7 +12,7 @@ Microsoft.AspNetCore.Html.IHtmlContent - + diff --git a/src/Microsoft.Extensions.WebEncoders/Microsoft.Extensions.WebEncoders.csproj b/src/Microsoft.Extensions.WebEncoders/Microsoft.Extensions.WebEncoders.csproj index cd0c144633..5e6b3392b5 100755 --- a/src/Microsoft.Extensions.WebEncoders/Microsoft.Extensions.WebEncoders.csproj +++ b/src/Microsoft.Extensions.WebEncoders/Microsoft.Extensions.WebEncoders.csproj @@ -11,9 +11,9 @@ - - - + + + diff --git a/test/Directory.Build.props b/test/Directory.Build.props index a728ed268e..80e7258054 100644 --- a/test/Directory.Build.props +++ b/test/Directory.Build.props @@ -1,10 +1,10 @@ - + - - - - + + + + diff --git a/test/Microsoft.Extensions.WebEncoders.Tests/Microsoft.Extensions.WebEncoders.Tests.csproj b/test/Microsoft.Extensions.WebEncoders.Tests/Microsoft.Extensions.WebEncoders.Tests.csproj index c019c8b97e..f016febe5c 100755 --- a/test/Microsoft.Extensions.WebEncoders.Tests/Microsoft.Extensions.WebEncoders.Tests.csproj +++ b/test/Microsoft.Extensions.WebEncoders.Tests/Microsoft.Extensions.WebEncoders.Tests.csproj @@ -10,7 +10,7 @@ - + diff --git a/version.props b/version.props new file mode 100644 index 0000000000..5c4a7c32d1 --- /dev/null +++ b/version.props @@ -0,0 +1,10 @@ + + + 2.1.0 + preview1 + $(VersionPrefix) + $(VersionPrefix)-$(VersionSuffix)-final + t000 + $(VersionSuffix)-$(BuildNumber) + + diff --git a/version.xml b/version.xml deleted file mode 100644 index 3c05022b7d..0000000000 --- a/version.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - dev - 2.1.0 - preview1 - - From 42d3bdb82d0a241259e079aec06c79e3873cd3c1 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Mon, 13 Nov 2017 15:19:26 -0800 Subject: [PATCH 122/169] Update samples and tests to target netcoreapp2.1 --- Directory.Build.props | 4 ++++ korebuild-lock.txt | 4 ++-- test/Directory.Build.props | 7 +++++++ .../Microsoft.AspNetCore.Html.Abstractions.Test.csproj | 3 +-- .../Microsoft.Extensions.WebEncoders.Tests.csproj | 3 +-- 5 files changed, 15 insertions(+), 6 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 9db4d01587..ffc398567e 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,4 +1,8 @@  + + diff --git a/korebuild-lock.txt b/korebuild-lock.txt index 45463cc71e..95f4613014 100644 --- a/korebuild-lock.txt +++ b/korebuild-lock.txt @@ -1,2 +1,2 @@ -version:2.1.0-preview1-15549 -commithash:f570e08585fec510dd60cd4bfe8795388b757a95 +version:2.1.0-preview1-15567 +commithash:903e3104807b1bb8cddd28bdef205b1e2dc021d1 diff --git a/test/Directory.Build.props b/test/Directory.Build.props index 80e7258054..0b706cbca5 100644 --- a/test/Directory.Build.props +++ b/test/Directory.Build.props @@ -1,6 +1,13 @@ + + netcoreapp2.1 + $(DeveloperBuildTestTfms) + netcoreapp2.1;netcoreapp2.0 + $(StandardTestTfms);net461 + + diff --git a/test/Microsoft.AspNetCore.Html.Abstractions.Test/Microsoft.AspNetCore.Html.Abstractions.Test.csproj b/test/Microsoft.AspNetCore.Html.Abstractions.Test/Microsoft.AspNetCore.Html.Abstractions.Test.csproj index f899e1a699..1577693497 100755 --- a/test/Microsoft.AspNetCore.Html.Abstractions.Test/Microsoft.AspNetCore.Html.Abstractions.Test.csproj +++ b/test/Microsoft.AspNetCore.Html.Abstractions.Test/Microsoft.AspNetCore.Html.Abstractions.Test.csproj @@ -1,8 +1,7 @@  - netcoreapp2.0;net461 - netcoreapp2.0 + $(StandardTestTfms) diff --git a/test/Microsoft.Extensions.WebEncoders.Tests/Microsoft.Extensions.WebEncoders.Tests.csproj b/test/Microsoft.Extensions.WebEncoders.Tests/Microsoft.Extensions.WebEncoders.Tests.csproj index f016febe5c..247ccd19b3 100755 --- a/test/Microsoft.Extensions.WebEncoders.Tests/Microsoft.Extensions.WebEncoders.Tests.csproj +++ b/test/Microsoft.Extensions.WebEncoders.Tests/Microsoft.Extensions.WebEncoders.Tests.csproj @@ -1,8 +1,7 @@  - netcoreapp2.0;net461 - netcoreapp2.0 + $(StandardTestTfms) From 330960460cf4c7718f54dedaf4ca63a46a2fec7d Mon Sep 17 00:00:00 2001 From: Pranav K Date: Fri, 17 Nov 2017 13:00:25 -0800 Subject: [PATCH 123/169] Use MicrosoftNETCoreApp21PackageVersion to determine the runtime framework in netcoreapp2.1 --- Directory.Build.targets | 1 + build/dependencies.props | 1 + 2 files changed, 2 insertions(+) diff --git a/Directory.Build.targets b/Directory.Build.targets index e83ff95e39..894b1d0cf8 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -1,5 +1,6 @@  $(MicrosoftNETCoreApp20PackageVersion) + $(MicrosoftNETCoreApp21PackageVersion) diff --git a/build/dependencies.props b/build/dependencies.props index 410f1c8697..fa9a01ce97 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -9,6 +9,7 @@ 2.1.0-preview1-27488 2.1.0-preview1-27488 2.0.0 + 2.1.0-preview1-25907-02 15.3.0 4.4.0 2.3.0 From dc095b1f4d5e2c1a03a2dc1de98f5b0883ef65d4 Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Mon, 20 Nov 2017 12:15:56 -0800 Subject: [PATCH 124/169] Use MSBuild to set NuGet feeds instead of NuGet.config --- Directory.Build.props | 1 + NuGet.config | 4 +--- build/sources.props | 16 ++++++++++++++++ 3 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 build/sources.props diff --git a/Directory.Build.props b/Directory.Build.props index ffc398567e..b7176c688d 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -5,6 +5,7 @@ + https://github.com/aspnet/HtmlAbstractions diff --git a/NuGet.config b/NuGet.config index 4e8a1f6de1..e32bddfd51 100644 --- a/NuGet.config +++ b/NuGet.config @@ -2,8 +2,6 @@ - - - + diff --git a/build/sources.props b/build/sources.props new file mode 100644 index 0000000000..c03f3ddb60 --- /dev/null +++ b/build/sources.props @@ -0,0 +1,16 @@ + + + + + $(DotNetRestoreSources) + + $(RestoreSources); + https://dotnet.myget.org/F/aspnetcore-ci-dev/api/v3/index.json; + https://dotnet.myget.org/F/aspnetcore-tools/api/v3/index.json; + + + $(RestoreSources); + https://api.nuget.org/v3/index.json; + + + From f6341853de7e6f305d3f47756a0d63f01b8cc1e1 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Tue, 21 Nov 2017 15:47:50 -0800 Subject: [PATCH 125/169] Replace aspnetcore-ci-dev feed with aspnetcore-dev --- build/dependencies.props | 12 ++++++------ build/repo.props | 2 +- build/sources.props | 2 +- korebuild-lock.txt | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/build/dependencies.props b/build/dependencies.props index fa9a01ce97..9b84aca3eb 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -1,13 +1,13 @@ - + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - 2.1.0-preview1-15549 - 2.1.0-preview1-27488 - 2.1.0-preview1-27488 - 2.1.0-preview1-27488 - 2.1.0-preview1-27488 + 2.1.0-preview1-15576 + 2.1.0-preview1-27644 + 2.1.0-preview1-27644 + 2.1.0-preview1-27644 + 2.1.0-preview1-27644 2.0.0 2.1.0-preview1-25907-02 15.3.0 diff --git a/build/repo.props b/build/repo.props index b55e651b87..07c5f08325 100644 --- a/build/repo.props +++ b/build/repo.props @@ -2,6 +2,6 @@ Internal.AspNetCore.Universe.Lineup - https://dotnet.myget.org/F/aspnetcore-ci-dev/api/v3/index.json + https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json diff --git a/build/sources.props b/build/sources.props index c03f3ddb60..9feff29d09 100644 --- a/build/sources.props +++ b/build/sources.props @@ -5,7 +5,7 @@ $(DotNetRestoreSources) $(RestoreSources); - https://dotnet.myget.org/F/aspnetcore-ci-dev/api/v3/index.json; + https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json; https://dotnet.myget.org/F/aspnetcore-tools/api/v3/index.json; diff --git a/korebuild-lock.txt b/korebuild-lock.txt index 95f4613014..1a99066b7c 100644 --- a/korebuild-lock.txt +++ b/korebuild-lock.txt @@ -1,2 +1,2 @@ -version:2.1.0-preview1-15567 -commithash:903e3104807b1bb8cddd28bdef205b1e2dc021d1 +version:2.1.0-preview1-15576 +commithash:2f3856d2ba4f659fcb9253215b83946a06794a27 From b9867d21b35cd653730eacb6ebc56c94f618372a Mon Sep 17 00:00:00 2001 From: Pranav K Date: Wed, 29 Nov 2017 14:09:26 -0800 Subject: [PATCH 126/169] Specify runtime versions to install --- build/repo.props | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/build/repo.props b/build/repo.props index 07c5f08325..78b0ce5879 100644 --- a/build/repo.props +++ b/build/repo.props @@ -1,7 +1,14 @@  + + Internal.AspNetCore.Universe.Lineup https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json + + + + + From 62a1d5c1769e0bbb6bc6ac99fd9ee97e165f540b Mon Sep 17 00:00:00 2001 From: Ryan Brandenburg Date: Fri, 1 Dec 2017 10:23:41 -0800 Subject: [PATCH 127/169] Update bootstrappers --- run.ps1 | 17 +++++++++++------ run.sh | 30 +++++++++++++++++++----------- 2 files changed, 30 insertions(+), 17 deletions(-) diff --git a/run.ps1 b/run.ps1 index 49c2899856..27dcf848f8 100644 --- a/run.ps1 +++ b/run.ps1 @@ -29,6 +29,9 @@ Updates KoreBuild to the latest version even if a lock file is present. .PARAMETER ConfigFile The path to the configuration file that stores values. Defaults to korebuild.json. +.PARAMETER ToolsSourceSuffix +The Suffix to append to the end of the ToolsSource. Useful for query strings in blob stores. + .PARAMETER Arguments Arguments to be passed to the command @@ -51,7 +54,7 @@ Example config file: #> [CmdletBinding(PositionalBinding = $false)] param( - [Parameter(Mandatory=$true, Position = 0)] + [Parameter(Mandatory = $true, Position = 0)] [string]$Command, [string]$Path = $PSScriptRoot, [Alias('c')] @@ -63,6 +66,7 @@ param( [Alias('u')] [switch]$Update, [string]$ConfigFile, + [string]$ToolsSourceSuffix, [Parameter(ValueFromRemainingArguments = $true)] [string[]]$Arguments ) @@ -79,7 +83,7 @@ function Get-KoreBuild { $lockFile = Join-Path $Path 'korebuild-lock.txt' if (!(Test-Path $lockFile) -or $Update) { - Get-RemoteFile "$ToolsSource/korebuild/channels/$Channel/latest.txt" $lockFile + Get-RemoteFile "$ToolsSource/korebuild/channels/$Channel/latest.txt" $lockFile $ToolsSourceSuffix } $version = Get-Content $lockFile | Where-Object { $_ -like 'version:*' } | Select-Object -first 1 @@ -96,7 +100,7 @@ function Get-KoreBuild { try { $tmpfile = Join-Path ([IO.Path]::GetTempPath()) "KoreBuild-$([guid]::NewGuid()).zip" - Get-RemoteFile $remotePath $tmpfile + Get-RemoteFile $remotePath $tmpfile $ToolsSourceSuffix if (Get-Command -Name 'Expand-Archive' -ErrorAction Ignore) { # Use built-in commands where possible as they are cross-plat compatible Expand-Archive -Path $tmpfile -DestinationPath $korebuildPath @@ -124,7 +128,7 @@ function Join-Paths([string]$path, [string[]]$childPaths) { return $path } -function Get-RemoteFile([string]$RemotePath, [string]$LocalPath) { +function Get-RemoteFile([string]$RemotePath, [string]$LocalPath, [string]$RemoteSuffix) { if ($RemotePath -notlike 'http*') { Copy-Item $RemotePath $LocalPath return @@ -134,7 +138,7 @@ function Get-RemoteFile([string]$RemotePath, [string]$LocalPath) { while ($retries -gt 0) { $retries -= 1 try { - Invoke-WebRequest -UseBasicParsing -Uri $RemotePath -OutFile $LocalPath + Invoke-WebRequest -UseBasicParsing -Uri $($RemotePath + $RemoteSuffix) -OutFile $LocalPath return } catch { @@ -161,7 +165,8 @@ if (Test-Path $ConfigFile) { if (!($Channel) -and (Get-Member -Name 'channel' -InputObject $config)) { [string] $Channel = $config.channel } if (!($ToolsSource) -and (Get-Member -Name 'toolsSource' -InputObject $config)) { [string] $ToolsSource = $config.toolsSource} } - } catch { + } + catch { Write-Warning "$ConfigFile could not be read. Its settings will be ignored." Write-Warning $Error[0] } diff --git a/run.sh b/run.sh index c278423acc..834961fc3a 100755 --- a/run.sh +++ b/run.sh @@ -17,6 +17,7 @@ update=false repo_path="$DIR" channel='' tools_source='' +tools_source_suffix='' # # Functions @@ -29,13 +30,14 @@ __usage() { echo " ... Arguments passed to the command. Variable number of arguments allowed." echo "" echo "Options:" - echo " --verbose Show verbose output." - echo " -c|--channel The channel of KoreBuild to download. Overrides the value from the config file.." - echo " --config-file The path to the configuration file that stores values. Defaults to korebuild.json." - echo " -d|--dotnet-home The directory where .NET Core tools will be stored. Defaults to '\$DOTNET_HOME' or '\$HOME/.dotnet." - echo " --path The directory to build. Defaults to the directory containing the script." - echo " -s|--tools-source|-ToolsSource The base url where build tools can be downloaded. Overrides the value from the config file." - echo " -u|--update Update to the latest KoreBuild even if the lock file is present." + echo " --verbose Show verbose output." + echo " -c|--channel The channel of KoreBuild to download. Overrides the value from the config file.." + echo " --config-file The path to the configuration file that stores values. Defaults to korebuild.json." + echo " -d|--dotnet-home The directory where .NET Core tools will be stored. Defaults to '\$DOTNET_HOME' or '\$HOME/.dotnet." + echo " --path The directory to build. Defaults to the directory containing the script." + echo " -s|--tools-source|-ToolsSource The base url where build tools can be downloaded. Overrides the value from the config file." + echo " --tools-source-suffix|-ToolsSourceSuffix The suffix to append to tools-source. Useful for query strings." + echo " -u|--update Update to the latest KoreBuild even if the lock file is present." echo "" echo "Description:" echo " This function will create a file \$DIR/korebuild-lock.txt. This lock file can be committed to source, but does not have to be." @@ -50,7 +52,7 @@ get_korebuild() { local version local lock_file="$repo_path/korebuild-lock.txt" if [ ! -f "$lock_file" ] || [ "$update" = true ]; then - __get_remote_file "$tools_source/korebuild/channels/$channel/latest.txt" "$lock_file" + __get_remote_file "$tools_source/korebuild/channels/$channel/latest.txt" "$lock_file" "$tools_source_suffix" fi version="$(grep 'version:*' -m 1 "$lock_file")" if [[ "$version" == '' ]]; then @@ -66,7 +68,7 @@ get_korebuild() { local remote_path="$tools_source/korebuild/artifacts/$version/korebuild.$version.zip" tmpfile="$(mktemp)" echo -e "${MAGENTA}Downloading KoreBuild ${version}${RESET}" - if __get_remote_file "$remote_path" "$tmpfile"; then + if __get_remote_file "$remote_path" "$tmpfile" "$tools_source_suffix"; then unzip -q -d "$korebuild_path" "$tmpfile" fi rm "$tmpfile" || true @@ -98,6 +100,7 @@ __machine_has() { __get_remote_file() { local remote_path=$1 local local_path=$2 + local remote_path_suffix=$3 if [[ "$remote_path" != 'http'* ]]; then cp "$remote_path" "$local_path" @@ -106,14 +109,14 @@ __get_remote_file() { local failed=false if __machine_has wget; then - wget --tries 10 --quiet -O "$local_path" "$remote_path" || failed=true + wget --tries 10 --quiet -O "$local_path" "${remote_path}${remote_path_suffix}" || failed=true else failed=true fi if [ "$failed" = true ] && __machine_has curl; then failed=false - curl --retry 10 -sSL -f --create-dirs -o "$local_path" "$remote_path" || failed=true + curl --retry 10 -sSL -f --create-dirs -o "$local_path" "${remote_path}${remote_path_suffix}" || failed=true fi if [ "$failed" = true ]; then @@ -164,6 +167,11 @@ while [[ $# -gt 0 ]]; do tools_source="${1:-}" [ -z "$tools_source" ] && __usage ;; + --tools-source-suffix|-ToolsSourceSuffix) + shift + tools_source_suffix="${1:-}" + [ -z "$tools_source_suffix" ] && __usage + ;; -u|--update|-Update) update=true ;; From 1760bab38fc7e601b9165f6dc60268b3739b7863 Mon Sep 17 00:00:00 2001 From: "ASP.NET CI" Date: Sun, 10 Dec 2017 12:48:34 -0800 Subject: [PATCH 128/169] Update dependencies.props [auto-updated: dependencies] --- build/dependencies.props | 18 +++++++++--------- korebuild-lock.txt | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/build/dependencies.props b/build/dependencies.props index 9b84aca3eb..00ce6f22db 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -3,17 +3,17 @@ $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - 2.1.0-preview1-15576 - 2.1.0-preview1-27644 - 2.1.0-preview1-27644 - 2.1.0-preview1-27644 - 2.1.0-preview1-27644 + 2.1.0-preview1-15618 + 2.1.0-preview1-27773 + 2.1.0-preview1-27773 + 2.1.0-preview1-27773 + 2.1.0-preview1-27773 2.0.0 - 2.1.0-preview1-25907-02 + 2.1.0-preview1-25915-01 15.3.0 - 4.4.0 - 2.3.0 - 2.3.0 + 4.5.0-preview1-25914-04 + 2.3.1 + 2.3.1 diff --git a/korebuild-lock.txt b/korebuild-lock.txt index 1a99066b7c..e7cce93009 100644 --- a/korebuild-lock.txt +++ b/korebuild-lock.txt @@ -1,2 +1,2 @@ -version:2.1.0-preview1-15576 -commithash:2f3856d2ba4f659fcb9253215b83946a06794a27 +version:2.1.0-preview1-15618 +commithash:00ce1383114015fe89b221146036e59e6bc11219 From d3c71cce948c400c40c26f818b2bec177ba9827c Mon Sep 17 00:00:00 2001 From: "ASP.NET CI" Date: Wed, 13 Dec 2017 20:49:48 +0000 Subject: [PATCH 129/169] Update dependencies.props [auto-updated: dependencies] --- build/dependencies.props | 14 +++++++------- korebuild-lock.txt | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/build/dependencies.props b/build/dependencies.props index 00ce6f22db..9333aa7bd3 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -3,15 +3,15 @@ $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - 2.1.0-preview1-15618 - 2.1.0-preview1-27773 - 2.1.0-preview1-27773 - 2.1.0-preview1-27773 - 2.1.0-preview1-27773 + 2.1.0-preview1-15626 + 2.1.0-preview1-27807 + 2.1.0-preview1-27807 + 2.1.0-preview1-27807 + 2.1.0-preview1-27807 2.0.0 - 2.1.0-preview1-25915-01 + 2.1.0-preview1-26008-01 15.3.0 - 4.5.0-preview1-25914-04 + 4.5.0-preview1-26006-06 2.3.1 2.3.1 diff --git a/korebuild-lock.txt b/korebuild-lock.txt index e7cce93009..8d52a6128c 100644 --- a/korebuild-lock.txt +++ b/korebuild-lock.txt @@ -1,2 +1,2 @@ -version:2.1.0-preview1-15618 -commithash:00ce1383114015fe89b221146036e59e6bc11219 +version:2.1.0-preview1-15626 +commithash:fd6410e9c90c428bc01238372303ad09cb9ec889 From d3fa87c6c5fd0e362d758da44c6423283a9e7145 Mon Sep 17 00:00:00 2001 From: "ASP.NET CI" Date: Mon, 18 Dec 2017 17:04:20 -0800 Subject: [PATCH 130/169] Update dependencies.props [auto-updated: dependencies] --- build/dependencies.props | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/build/dependencies.props b/build/dependencies.props index 9333aa7bd3..766fe3e033 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -4,14 +4,14 @@ 2.1.0-preview1-15626 - 2.1.0-preview1-27807 - 2.1.0-preview1-27807 - 2.1.0-preview1-27807 - 2.1.0-preview1-27807 + 2.1.0-preview1-27849 + 2.1.0-preview1-27849 + 2.1.0-preview1-27849 + 2.1.0-preview1-27849 2.0.0 - 2.1.0-preview1-26008-01 + 2.1.0-preview1-26016-05 15.3.0 - 4.5.0-preview1-26006-06 + 4.5.0-preview1-26016-05 2.3.1 2.3.1 From 48cc16eadc2e58190fdf8100cdec1653da08a6d8 Mon Sep 17 00:00:00 2001 From: "ASP.NET CI" Date: Sun, 31 Dec 2017 21:05:44 +0000 Subject: [PATCH 131/169] Update dependencies.props [auto-updated: dependencies] --- build/dependencies.props | 10 +++++----- korebuild-lock.txt | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/build/dependencies.props b/build/dependencies.props index 766fe3e033..e5e9ff8abf 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -3,11 +3,11 @@ $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - 2.1.0-preview1-15626 - 2.1.0-preview1-27849 - 2.1.0-preview1-27849 - 2.1.0-preview1-27849 - 2.1.0-preview1-27849 + 2.1.0-preview1-15651 + 2.1.0-preview1-27942 + 2.1.0-preview1-27942 + 2.1.0-preview1-27942 + 2.1.0-preview1-27942 2.0.0 2.1.0-preview1-26016-05 15.3.0 diff --git a/korebuild-lock.txt b/korebuild-lock.txt index 8d52a6128c..7c2e97aa79 100644 --- a/korebuild-lock.txt +++ b/korebuild-lock.txt @@ -1,2 +1,2 @@ -version:2.1.0-preview1-15626 -commithash:fd6410e9c90c428bc01238372303ad09cb9ec889 +version:2.1.0-preview1-15651 +commithash:ebf2365121c2c6a6a0fbfa9b0f37bb5effc89323 From 6a1046d3b9bfc53baf74127b21f8310516cf5e32 Mon Sep 17 00:00:00 2001 From: Eilon Lipton Date: Tue, 2 Jan 2018 14:34:07 -0800 Subject: [PATCH 132/169] Create ISSUE_TEMPLATE.md --- .github/ISSUE_TEMPLATE.md | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE.md diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md new file mode 100644 index 0000000000..101a084f0a --- /dev/null +++ b/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,3 @@ +THIS ISSUE TRACKER IS CLOSED - please log new issues here: https://github.com/aspnet/Home/issues + +For information about this change, see https://github.com/aspnet/Announcements/issues/283 From 0f65354175f9cfdcd48c37902a1bd6311d8a278e Mon Sep 17 00:00:00 2001 From: "ASP.NET CI" Date: Thu, 4 Jan 2018 01:12:22 +0000 Subject: [PATCH 133/169] Update dependencies.props [auto-updated: dependencies] --- build/dependencies.props | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/build/dependencies.props b/build/dependencies.props index e5e9ff8abf..c5a5bf4ea0 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -4,10 +4,10 @@ 2.1.0-preview1-15651 - 2.1.0-preview1-27942 - 2.1.0-preview1-27942 - 2.1.0-preview1-27942 - 2.1.0-preview1-27942 + 2.1.0-preview1-27965 + 2.1.0-preview1-27965 + 2.1.0-preview1-27965 + 2.1.0-preview1-27965 2.0.0 2.1.0-preview1-26016-05 15.3.0 From 3746bf4286db95096849e2b064069ef24616d026 Mon Sep 17 00:00:00 2001 From: "ASP.NET CI" Date: Sat, 6 Jan 2018 14:44:10 -0800 Subject: [PATCH 134/169] Update dependencies.props [auto-updated: dependencies] --- korebuild-lock.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/korebuild-lock.txt b/korebuild-lock.txt index 7c2e97aa79..2146d006d7 100644 --- a/korebuild-lock.txt +++ b/korebuild-lock.txt @@ -1,2 +1,2 @@ -version:2.1.0-preview1-15651 -commithash:ebf2365121c2c6a6a0fbfa9b0f37bb5effc89323 +version:2.1.0-preview1-15661 +commithash:c9349d4c8a495d3085d9b879214d80f2f45e2193 From d208eca57fdd0af1e2a638eb2feed891dc8aa146 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Tue, 23 Jan 2018 15:31:08 -0800 Subject: [PATCH 135/169] Branching for 2.1.0-preview1 --- build/dependencies.props | 14 +++++++------- build/repo.props | 4 ++-- build/sources.props | 4 ++-- korebuild-lock.txt | 4 ++-- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/build/dependencies.props b/build/dependencies.props index c5a5bf4ea0..aacad395d0 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -3,15 +3,15 @@ $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - 2.1.0-preview1-15651 - 2.1.0-preview1-27965 - 2.1.0-preview1-27965 - 2.1.0-preview1-27965 - 2.1.0-preview1-27965 + 2.1.0-preview1-15679 + 2.1.0-preview1-28153 + 2.1.0-preview1-28153 + 2.1.0-preview1-28153 + 2.1.0-preview1-28153 2.0.0 - 2.1.0-preview1-26016-05 + 2.1.0-preview1-26115-03 15.3.0 - 4.5.0-preview1-26016-05 + 4.5.0-preview1-26112-01 2.3.1 2.3.1 diff --git a/build/repo.props b/build/repo.props index 78b0ce5879..d94ff7d00d 100644 --- a/build/repo.props +++ b/build/repo.props @@ -1,10 +1,10 @@ - + Internal.AspNetCore.Universe.Lineup - https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json + https://dotnet.myget.org/F/aspnetcore-release/api/v3/index.json diff --git a/build/sources.props b/build/sources.props index 9feff29d09..5d66393335 100644 --- a/build/sources.props +++ b/build/sources.props @@ -1,11 +1,11 @@ - + $(DotNetRestoreSources) $(RestoreSources); - https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json; + https://dotnet.myget.org/F/aspnetcore-release/api/v3/index.json; https://dotnet.myget.org/F/aspnetcore-tools/api/v3/index.json; diff --git a/korebuild-lock.txt b/korebuild-lock.txt index 2146d006d7..a474bc0e35 100644 --- a/korebuild-lock.txt +++ b/korebuild-lock.txt @@ -1,2 +1,2 @@ -version:2.1.0-preview1-15661 -commithash:c9349d4c8a495d3085d9b879214d80f2f45e2193 +version:2.1.0-preview1-15679 +commithash:5347461137cb45a77ddcc0b55b2478092de43338 From 26c76a2f17c590ab21651d32eabe25f968b682eb Mon Sep 17 00:00:00 2001 From: Pranav K Date: Wed, 24 Jan 2018 15:00:27 -0800 Subject: [PATCH 136/169] Updating version to preview2 --- version.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.props b/version.props index 5c4a7c32d1..370d5ababd 100644 --- a/version.props +++ b/version.props @@ -1,7 +1,7 @@ 2.1.0 - preview1 + preview2 $(VersionPrefix) $(VersionPrefix)-$(VersionSuffix)-final t000 From a7219e0c5cdc1de5cf6f5871b3f2b89b9d7e5040 Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Wed, 31 Jan 2018 15:01:11 -0800 Subject: [PATCH 137/169] Update dependencies.props to 2.1.0-preview-28193, build tools to 2.1.0-preview1-1010 [ci skip] Scripted changes: - updated travis and appveyor.yml files to only build dev, ci, and release branches - updated dependencies.props - updated korebuild-lock.txt - updated korebuild.json to release/2.1 channel --- .appveyor.yml | 15 +++++++-------- .travis.yml | 23 ++++++++++++----------- build/dependencies.props | 14 +++++++------- korebuild-lock.txt | 4 ++-- korebuild.json | 4 ++-- 5 files changed, 30 insertions(+), 30 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 46038786c9..4eea96ab69 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -1,18 +1,17 @@ init: - - git config --global core.autocrlf true +- git config --global core.autocrlf true branches: only: - - master - - release - - dev - - /^(.*\/)?ci-.*$/ + - dev + - /^release\/.*$/ + - /^(.*\/)?ci-.*$/ build_script: - - ps: .\run.ps1 default-build +- ps: .\run.ps1 default-build clone_depth: 1 environment: global: DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true DOTNET_CLI_TELEMETRY_OPTOUT: 1 -test: off -deploy: off +test: 'off' +deploy: 'off' os: Visual Studio 2017 diff --git a/.travis.yml b/.travis.yml index b10be14215..64bdbb4441 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,24 +3,25 @@ sudo: false dist: trusty env: global: - - DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true - - DOTNET_CLI_TELEMETRY_OPTOUT: 1 + - DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true + - DOTNET_CLI_TELEMETRY_OPTOUT: 1 mono: none os: - - linux - - osx +- linux +- osx osx_image: xcode8.2 addons: apt: packages: - - libunwind8 + - libunwind8 branches: only: - - master - - release - - dev - - /^(.*\/)?ci-.*$/ + - dev + - /^release\/.*$/ + - /^(.*\/)?ci-.*$/ before_install: - - if test "$TRAVIS_OS_NAME" == "osx"; then brew update; brew install openssl; ln -s /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib /usr/local/lib/; ln -s /usr/local/opt/openssl/lib/libssl.1.0.0.dylib /usr/local/lib/; fi +- if test "$TRAVIS_OS_NAME" == "osx"; then brew update; brew install openssl; ln -s + /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib /usr/local/lib/; ln -s /usr/local/opt/openssl/lib/libssl.1.0.0.dylib + /usr/local/lib/; fi script: - - ./build.sh +- ./build.sh diff --git a/build/dependencies.props b/build/dependencies.props index aacad395d0..a3badf6fc0 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -3,15 +3,15 @@ $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - 2.1.0-preview1-15679 - 2.1.0-preview1-28153 - 2.1.0-preview1-28153 - 2.1.0-preview1-28153 - 2.1.0-preview1-28153 + 2.1.0-preview1-1010 + 2.1.0-preview1-28193 + 2.1.0-preview1-28193 + 2.1.0-preview1-28193 + 2.1.0-preview1-28193 2.0.0 - 2.1.0-preview1-26115-03 + 2.1.0-preview1-26122-01 15.3.0 - 4.5.0-preview1-26112-01 + 4.5.0-preview1-26119-06 2.3.1 2.3.1 diff --git a/korebuild-lock.txt b/korebuild-lock.txt index a474bc0e35..851bfbf203 100644 --- a/korebuild-lock.txt +++ b/korebuild-lock.txt @@ -1,2 +1,2 @@ -version:2.1.0-preview1-15679 -commithash:5347461137cb45a77ddcc0b55b2478092de43338 +version:2.1.0-preview1-1010 +commithash:75ca924dfbd673c38841025b04c4dcd93b84f56d diff --git a/korebuild.json b/korebuild.json index bd5d51a51b..678d8bb948 100644 --- a/korebuild.json +++ b/korebuild.json @@ -1,4 +1,4 @@ { - "$schema": "https://raw.githubusercontent.com/aspnet/BuildTools/dev/tools/korebuild.schema.json", - "channel": "dev" + "$schema": "https://raw.githubusercontent.com/aspnet/BuildTools/release/2.1/tools/korebuild.schema.json", + "channel": "release/2.1" } From 22c2797d84e091221767ccb4cb50cad470695f44 Mon Sep 17 00:00:00 2001 From: "ASP.NET CI" Date: Thu, 1 Feb 2018 03:29:53 +0000 Subject: [PATCH 138/169] Update dependencies.props [auto-updated: dependencies] --- build/dependencies.props | 14 +++++++------- korebuild-lock.txt | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/build/dependencies.props b/build/dependencies.props index c5a5bf4ea0..c1e4d6ef27 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -3,15 +3,15 @@ $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - 2.1.0-preview1-15651 - 2.1.0-preview1-27965 - 2.1.0-preview1-27965 - 2.1.0-preview1-27965 - 2.1.0-preview1-27965 + 2.1.0-preview2-15692 + 2.1.0-preview2-28215 + 2.1.0-preview2-28215 + 2.1.0-preview2-28215 + 2.1.0-preview2-28215 2.0.0 - 2.1.0-preview1-26016-05 + 2.1.0-preview2-26130-04 15.3.0 - 4.5.0-preview1-26016-05 + 4.5.0-preview2-26130-01 2.3.1 2.3.1 diff --git a/korebuild-lock.txt b/korebuild-lock.txt index 2146d006d7..232cb858c2 100644 --- a/korebuild-lock.txt +++ b/korebuild-lock.txt @@ -1,2 +1,2 @@ -version:2.1.0-preview1-15661 -commithash:c9349d4c8a495d3085d9b879214d80f2f45e2193 +version:2.1.0-preview2-15692 +commithash:5d9f445ce3f8492451a6f461df7e739bbed6a7f8 From 0b4285caa28f7ec84ebf02f79036845b0af3509a Mon Sep 17 00:00:00 2001 From: "ASP.NET CI" Date: Sat, 3 Feb 2018 02:46:03 +0000 Subject: [PATCH 139/169] Update dependencies.props [auto-updated: dependencies] --- build/dependencies.props | 10 +++++----- korebuild-lock.txt | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/build/dependencies.props b/build/dependencies.props index c1e4d6ef27..b9e0d540c9 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -3,11 +3,11 @@ $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - 2.1.0-preview2-15692 - 2.1.0-preview2-28215 - 2.1.0-preview2-28215 - 2.1.0-preview2-28215 - 2.1.0-preview2-28215 + 2.1.0-preview2-15694 + 2.1.0-preview2-30020 + 2.1.0-preview2-30020 + 2.1.0-preview2-30020 + 2.1.0-preview2-30020 2.0.0 2.1.0-preview2-26130-04 15.3.0 diff --git a/korebuild-lock.txt b/korebuild-lock.txt index 232cb858c2..6f294ef0e6 100644 --- a/korebuild-lock.txt +++ b/korebuild-lock.txt @@ -1,2 +1,2 @@ -version:2.1.0-preview2-15692 -commithash:5d9f445ce3f8492451a6f461df7e739bbed6a7f8 +version:2.1.0-preview2-15694 +commithash:f61af02b48e89592c9aadb7ebaebe84228666c3b From 52249d6038339a493739c8bc82eebfad7ae2c81b Mon Sep 17 00:00:00 2001 From: "ASP.NET CI" Date: Fri, 9 Feb 2018 11:43:03 -0800 Subject: [PATCH 140/169] Update dependencies.props [auto-updated: dependencies] --- build/dependencies.props | 10 +++++----- korebuild-lock.txt | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/build/dependencies.props b/build/dependencies.props index b9e0d540c9..3636a35d79 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -3,11 +3,11 @@ $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - 2.1.0-preview2-15694 - 2.1.0-preview2-30020 - 2.1.0-preview2-30020 - 2.1.0-preview2-30020 - 2.1.0-preview2-30020 + 2.1.0-preview2-15698 + 2.1.0-preview2-30066 + 2.1.0-preview2-30066 + 2.1.0-preview2-30066 + 2.1.0-preview2-30066 2.0.0 2.1.0-preview2-26130-04 15.3.0 diff --git a/korebuild-lock.txt b/korebuild-lock.txt index 6f294ef0e6..3e2b56b91b 100644 --- a/korebuild-lock.txt +++ b/korebuild-lock.txt @@ -1,2 +1,2 @@ -version:2.1.0-preview2-15694 -commithash:f61af02b48e89592c9aadb7ebaebe84228666c3b +version:2.1.0-preview2-15698 +commithash:7216e5068cb1957e09d45fcbe58a744dd5c2de73 From fbfafa06ce20d5a236c284e5a6bdaecc1fa1cea7 Mon Sep 17 00:00:00 2001 From: "ASP.NET CI" Date: Sun, 11 Feb 2018 12:24:21 -0800 Subject: [PATCH 141/169] Update dependencies.props [auto-updated: dependencies] --- build/dependencies.props | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/build/dependencies.props b/build/dependencies.props index 3636a35d79..e01cfca7d0 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -4,16 +4,16 @@ 2.1.0-preview2-15698 - 2.1.0-preview2-30066 - 2.1.0-preview2-30066 - 2.1.0-preview2-30066 - 2.1.0-preview2-30066 + 2.1.0-preview2-30077 + 2.1.0-preview2-30077 + 2.1.0-preview2-30077 + 2.1.0-preview2-30077 2.0.0 2.1.0-preview2-26130-04 15.3.0 4.5.0-preview2-26130-01 2.3.1 - 2.3.1 + 2.4.0-beta.1.build3945 From bee7ced54f90756c41362bbbb5a7cadac4b1ca3d Mon Sep 17 00:00:00 2001 From: "ASP.NET CI" Date: Sun, 18 Feb 2018 12:17:51 -0800 Subject: [PATCH 142/169] Update dependencies.props [auto-updated: dependencies] --- build/dependencies.props | 10 +++++----- korebuild-lock.txt | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/build/dependencies.props b/build/dependencies.props index e01cfca7d0..9e7f39f805 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -3,11 +3,11 @@ $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - 2.1.0-preview2-15698 - 2.1.0-preview2-30077 - 2.1.0-preview2-30077 - 2.1.0-preview2-30077 - 2.1.0-preview2-30077 + 2.1.0-preview2-15707 + 2.1.0-preview2-30131 + 2.1.0-preview2-30131 + 2.1.0-preview2-30131 + 2.1.0-preview2-30131 2.0.0 2.1.0-preview2-26130-04 15.3.0 diff --git a/korebuild-lock.txt b/korebuild-lock.txt index 3e2b56b91b..89d0ad3d15 100644 --- a/korebuild-lock.txt +++ b/korebuild-lock.txt @@ -1,2 +1,2 @@ -version:2.1.0-preview2-15698 -commithash:7216e5068cb1957e09d45fcbe58a744dd5c2de73 +version:2.1.0-preview2-15707 +commithash:e74e53f129ab34332947fea7ac7b7591b027cb22 From b7873a42496513170360b374a1e5b9dd6203e7b6 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Wed, 21 Feb 2018 18:26:57 -0800 Subject: [PATCH 143/169] Use FeatureBranchVersionSuffix when generating VersionSuffix --- version.props | 1 + 1 file changed, 1 insertion(+) diff --git a/version.props b/version.props index 370d5ababd..65c8a07e37 100644 --- a/version.props +++ b/version.props @@ -5,6 +5,7 @@ $(VersionPrefix) $(VersionPrefix)-$(VersionSuffix)-final t000 + $(VersionSuffix)-$([System.Text.RegularExpressions.Regex]::Replace('$(FeatureBranchVersionSuffix)', '[^\w-]', '-')) $(VersionSuffix)-$(BuildNumber) From a992ce0d7b881dc6cf9fa579c22d5c7b4ecc8d83 Mon Sep 17 00:00:00 2001 From: "ASP.NET CI" Date: Mon, 26 Feb 2018 11:01:44 -0800 Subject: [PATCH 144/169] Update dependencies.props [auto-updated: dependencies] --- build/dependencies.props | 12 ++++++------ korebuild-lock.txt | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/build/dependencies.props b/build/dependencies.props index 9e7f39f805..a4ee848bcc 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -3,14 +3,14 @@ $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - 2.1.0-preview2-15707 - 2.1.0-preview2-30131 - 2.1.0-preview2-30131 - 2.1.0-preview2-30131 - 2.1.0-preview2-30131 + 2.1.0-preview2-15721 + 2.1.0-preview2-30187 + 2.1.0-preview2-30187 + 2.1.0-preview2-30187 + 2.1.0-preview2-30187 2.0.0 2.1.0-preview2-26130-04 - 15.3.0 + 15.6.0 4.5.0-preview2-26130-01 2.3.1 2.4.0-beta.1.build3945 diff --git a/korebuild-lock.txt b/korebuild-lock.txt index 89d0ad3d15..e6c7fddffa 100644 --- a/korebuild-lock.txt +++ b/korebuild-lock.txt @@ -1,2 +1,2 @@ -version:2.1.0-preview2-15707 -commithash:e74e53f129ab34332947fea7ac7b7591b027cb22 +version:2.1.0-preview2-15721 +commithash:f9bb4be59e39938ec59a6975257e26099b0d03c1 From a34a3e319ed1c07562a0dfcd6908485462242a1e Mon Sep 17 00:00:00 2001 From: Pranav K Date: Tue, 6 Mar 2018 10:03:51 -0800 Subject: [PATCH 145/169] Use dotnet-core feed in repos --- build/sources.props | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build/sources.props b/build/sources.props index 9feff29d09..9215df9751 100644 --- a/build/sources.props +++ b/build/sources.props @@ -1,10 +1,11 @@ - + $(DotNetRestoreSources) $(RestoreSources); + https://dotnet.myget.org/F/dotnet-core/api/v3/index.json; https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json; https://dotnet.myget.org/F/aspnetcore-tools/api/v3/index.json; From 2e5964f709aedcff192587bd5ad636392b8c5797 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Tue, 6 Mar 2018 10:03:51 -0800 Subject: [PATCH 146/169] Prepend FeatureBranchVersionPrefix if FeatureBranchVersionSuffix is specified --- version.props | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/version.props b/version.props index 65c8a07e37..a11ea1ed52 100644 --- a/version.props +++ b/version.props @@ -5,7 +5,8 @@ $(VersionPrefix) $(VersionPrefix)-$(VersionSuffix)-final t000 - $(VersionSuffix)-$([System.Text.RegularExpressions.Regex]::Replace('$(FeatureBranchVersionSuffix)', '[^\w-]', '-')) + a- + $(FeatureBranchVersionPrefix)$(VersionSuffix)-$([System.Text.RegularExpressions.Regex]::Replace('$(FeatureBranchVersionSuffix)', '[^\w-]', '-')) $(VersionSuffix)-$(BuildNumber) From d5e6c6a81e857d798a4375e5524262037f49776e Mon Sep 17 00:00:00 2001 From: "ASP.NET CI" Date: Thu, 8 Mar 2018 13:00:13 -0800 Subject: [PATCH 147/169] Update dependencies.props [auto-updated: dependencies] --- build/dependencies.props | 14 +++++++------- korebuild-lock.txt | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/build/dependencies.props b/build/dependencies.props index a4ee848bcc..30d6e336de 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -3,15 +3,15 @@ $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - 2.1.0-preview2-15721 - 2.1.0-preview2-30187 - 2.1.0-preview2-30187 - 2.1.0-preview2-30187 - 2.1.0-preview2-30187 + 2.1.0-preview2-15728 + 2.1.0-preview2-30272 + 2.1.0-preview2-30272 + 2.1.0-preview2-30272 + 2.1.0-preview2-30272 2.0.0 - 2.1.0-preview2-26130-04 + 2.1.0-preview2-26225-03 15.6.0 - 4.5.0-preview2-26130-01 + 4.5.0-preview2-26224-02 2.3.1 2.4.0-beta.1.build3945 diff --git a/korebuild-lock.txt b/korebuild-lock.txt index e6c7fddffa..138d848db1 100644 --- a/korebuild-lock.txt +++ b/korebuild-lock.txt @@ -1,2 +1,2 @@ -version:2.1.0-preview2-15721 -commithash:f9bb4be59e39938ec59a6975257e26099b0d03c1 +version:2.1.0-preview2-15728 +commithash:393377068ddcf51dfee0536536d455f57a828b06 From 7b13960c6d6bf71867a500eb8c1c1f7d89f6aa12 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Fri, 16 Mar 2018 11:14:38 -0700 Subject: [PATCH 148/169] Branching for 2.1.0-preview2 --- build/dependencies.props | 14 +++++++------- build/repo.props | 4 ++-- build/sources.props | 2 +- korebuild-lock.txt | 4 ++-- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/build/dependencies.props b/build/dependencies.props index 30d6e336de..e2ad411a23 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -3,15 +3,15 @@ $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - 2.1.0-preview2-15728 - 2.1.0-preview2-30272 - 2.1.0-preview2-30272 - 2.1.0-preview2-30272 - 2.1.0-preview2-30272 + 2.1.0-preview2-15742 + 2.1.0-preview2-30355 + 2.1.0-preview2-30355 + 2.1.0-preview2-30355 + 2.1.0-preview2-30355 2.0.0 - 2.1.0-preview2-26225-03 + 2.1.0-preview2-26314-02 15.6.0 - 4.5.0-preview2-26224-02 + 4.5.0-preview2-26313-01 2.3.1 2.4.0-beta.1.build3945 diff --git a/build/repo.props b/build/repo.props index 78b0ce5879..d94ff7d00d 100644 --- a/build/repo.props +++ b/build/repo.props @@ -1,10 +1,10 @@ - + Internal.AspNetCore.Universe.Lineup - https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json + https://dotnet.myget.org/F/aspnetcore-release/api/v3/index.json diff --git a/build/sources.props b/build/sources.props index 9215df9751..36045f12b5 100644 --- a/build/sources.props +++ b/build/sources.props @@ -6,7 +6,7 @@ $(RestoreSources); https://dotnet.myget.org/F/dotnet-core/api/v3/index.json; - https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json; + https://dotnet.myget.org/F/aspnetcore-release/api/v3/index.json; https://dotnet.myget.org/F/aspnetcore-tools/api/v3/index.json; diff --git a/korebuild-lock.txt b/korebuild-lock.txt index 138d848db1..e40ef6651b 100644 --- a/korebuild-lock.txt +++ b/korebuild-lock.txt @@ -1,2 +1,2 @@ -version:2.1.0-preview2-15728 -commithash:393377068ddcf51dfee0536536d455f57a828b06 +version:2.1.0-preview2-15742 +commithash:21fbb0f2c3fe4a9216e2d59632b98cfd7d685962 From a12fa391fb7fab32b52abc4a9b002a427ba928a3 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Fri, 16 Mar 2018 11:26:21 -0700 Subject: [PATCH 149/169] Update version prefix to preview3 --- version.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.props b/version.props index a11ea1ed52..24f2b00a0a 100644 --- a/version.props +++ b/version.props @@ -1,7 +1,7 @@ 2.1.0 - preview2 + preview3 $(VersionPrefix) $(VersionPrefix)-$(VersionSuffix)-final t000 From cb9a800b6b424edefe673e3988cd7a3f3759eb7b Mon Sep 17 00:00:00 2001 From: Pranav K Date: Fri, 16 Mar 2018 12:29:47 -0700 Subject: [PATCH 150/169] Update KoreBuild channel --- korebuild.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/korebuild.json b/korebuild.json index bd5d51a51b..678d8bb948 100644 --- a/korebuild.json +++ b/korebuild.json @@ -1,4 +1,4 @@ { - "$schema": "https://raw.githubusercontent.com/aspnet/BuildTools/dev/tools/korebuild.schema.json", - "channel": "dev" + "$schema": "https://raw.githubusercontent.com/aspnet/BuildTools/release/2.1/tools/korebuild.schema.json", + "channel": "release/2.1" } From c8f5b2e3ae543c4ccb705b01a0702e4b89653860 Mon Sep 17 00:00:00 2001 From: Ryan Brandenburg Date: Wed, 14 Mar 2018 15:33:57 -0700 Subject: [PATCH 151/169] Set 2.0 baselines --- build/dependencies.props | 2 +- korebuild-lock.txt | 4 ++-- .../baseline.netcore.json | 10 +++++++++- .../baseline.netcore.json | 2 +- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/build/dependencies.props b/build/dependencies.props index e2ad411a23..dc9945767a 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -3,7 +3,7 @@ $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - 2.1.0-preview2-15742 + 2.1.0-preview2-15744 2.1.0-preview2-30355 2.1.0-preview2-30355 2.1.0-preview2-30355 diff --git a/korebuild-lock.txt b/korebuild-lock.txt index e40ef6651b..f531e7b0f7 100644 --- a/korebuild-lock.txt +++ b/korebuild-lock.txt @@ -1,2 +1,2 @@ -version:2.1.0-preview2-15742 -commithash:21fbb0f2c3fe4a9216e2d59632b98cfd7d685962 +version:2.1.0-preview2-15744 +commithash:9e15cb6062ab5b9790d3fa699e018543a6950713 diff --git a/src/Microsoft.AspNetCore.Html.Abstractions/baseline.netcore.json b/src/Microsoft.AspNetCore.Html.Abstractions/baseline.netcore.json index 7e3a4d0d00..b0b320e216 100644 --- a/src/Microsoft.AspNetCore.Html.Abstractions/baseline.netcore.json +++ b/src/Microsoft.AspNetCore.Html.Abstractions/baseline.netcore.json @@ -1,5 +1,5 @@ { - "AssemblyIdentity": "Microsoft.AspNetCore.Html.Abstractions, Version=1.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60", + "AssemblyIdentity": "Microsoft.AspNetCore.Html.Abstractions, Version=2.0.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60", "Types": [ { "Name": "Microsoft.AspNetCore.Html.HtmlContentBuilder", @@ -9,6 +9,14 @@ "Microsoft.AspNetCore.Html.IHtmlContentBuilder" ], "Members": [ + { + "Kind": "Method", + "Name": "get_Count", + "Parameters": [], + "ReturnType": "System.Int32", + "Visibility": "Public", + "GenericParameter": [] + }, { "Kind": "Method", "Name": "Append", diff --git a/src/Microsoft.Extensions.WebEncoders/baseline.netcore.json b/src/Microsoft.Extensions.WebEncoders/baseline.netcore.json index db16203ed1..cc93cc7458 100644 --- a/src/Microsoft.Extensions.WebEncoders/baseline.netcore.json +++ b/src/Microsoft.Extensions.WebEncoders/baseline.netcore.json @@ -1,5 +1,5 @@ { - "AssemblyIdentity": "Microsoft.Extensions.WebEncoders, Version=1.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60", + "AssemblyIdentity": "Microsoft.Extensions.WebEncoders, Version=2.0.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60", "Types": [ { "Name": "Microsoft.Extensions.WebEncoders.WebEncoderOptions", From ede8417bb1a3da411cc1b2fb3cf77a2926dc59cc Mon Sep 17 00:00:00 2001 From: "ASP.NET CI" Date: Sun, 25 Mar 2018 15:39:25 -0700 Subject: [PATCH 152/169] Update dependencies.props [auto-updated: dependencies] --- build/dependencies.props | 16 ++++++++-------- korebuild-lock.txt | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/build/dependencies.props b/build/dependencies.props index 30d6e336de..7d0d2b0bf2 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -3,15 +3,15 @@ $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - 2.1.0-preview2-15728 - 2.1.0-preview2-30272 - 2.1.0-preview2-30272 - 2.1.0-preview2-30272 - 2.1.0-preview2-30272 + 2.1.0-preview3-17001 + 2.1.0-preview3-32037 + 2.1.0-preview3-32037 + 2.1.0-preview3-32037 + 2.1.0-preview3-32037 2.0.0 - 2.1.0-preview2-26225-03 - 15.6.0 - 4.5.0-preview2-26224-02 + 2.1.0-preview2-26314-02 + 15.6.1 + 4.5.0-preview2-26313-01 2.3.1 2.4.0-beta.1.build3945 diff --git a/korebuild-lock.txt b/korebuild-lock.txt index 138d848db1..3a326c7d58 100644 --- a/korebuild-lock.txt +++ b/korebuild-lock.txt @@ -1,2 +1,2 @@ -version:2.1.0-preview2-15728 -commithash:393377068ddcf51dfee0536536d455f57a828b06 +version:2.1.0-preview3-17001 +commithash:dda68c56abf0d3b911fe6a2315872c446b314585 From 00d595932354b96431e6684b49c3b436bae08e20 Mon Sep 17 00:00:00 2001 From: "Nate McMaster (automated)" Date: Wed, 28 Mar 2018 10:45:08 -0700 Subject: [PATCH 153/169] Update dependencies.props [auto-updated: dependencies] --- build/dependencies.props | 16 ++++++++-------- korebuild-lock.txt | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/build/dependencies.props b/build/dependencies.props index dc9945767a..8776af33dd 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -3,15 +3,15 @@ $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - 2.1.0-preview2-15744 - 2.1.0-preview2-30355 - 2.1.0-preview2-30355 - 2.1.0-preview2-30355 - 2.1.0-preview2-30355 + 2.1.0-preview2-15749 + 2.1.0-preview2-30478 + 2.1.0-preview2-30478 + 2.1.0-preview2-30478 + 2.1.0-preview2-30478 2.0.0 - 2.1.0-preview2-26314-02 - 15.6.0 - 4.5.0-preview2-26313-01 + 2.1.0-preview2-26326-03 + 15.6.1 + 4.5.0-preview2-26326-04 2.3.1 2.4.0-beta.1.build3945 diff --git a/korebuild-lock.txt b/korebuild-lock.txt index f531e7b0f7..b8e036fe2c 100644 --- a/korebuild-lock.txt +++ b/korebuild-lock.txt @@ -1,2 +1,2 @@ -version:2.1.0-preview2-15744 -commithash:9e15cb6062ab5b9790d3fa699e018543a6950713 +version:2.1.0-preview2-15749 +commithash:5544c9ab20fa5e24b9e155d8958a3c3b6f5f9df9 From ac3bce603baa478103f7c3c432ececa6a1744fd9 Mon Sep 17 00:00:00 2001 From: "ASP.NET CI" Date: Tue, 3 Apr 2018 22:26:47 +0000 Subject: [PATCH 154/169] Update dependencies.props [auto-updated: dependencies] --- build/dependencies.props | 14 +++++++------- korebuild-lock.txt | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/build/dependencies.props b/build/dependencies.props index 7d0d2b0bf2..ae5170fa13 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -3,15 +3,15 @@ $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - 2.1.0-preview3-17001 - 2.1.0-preview3-32037 - 2.1.0-preview3-32037 - 2.1.0-preview3-32037 - 2.1.0-preview3-32037 + 2.1.0-preview3-17002 + 2.1.0-preview3-32110 + 2.1.0-preview3-32110 + 2.1.0-preview3-32110 + 2.1.0-preview3-32110 2.0.0 - 2.1.0-preview2-26314-02 + 2.1.0-preview3-26331-01 15.6.1 - 4.5.0-preview2-26313-01 + 4.5.0-preview3-26331-02 2.3.1 2.4.0-beta.1.build3945 diff --git a/korebuild-lock.txt b/korebuild-lock.txt index 3a326c7d58..b3af0b8bce 100644 --- a/korebuild-lock.txt +++ b/korebuild-lock.txt @@ -1,2 +1,2 @@ -version:2.1.0-preview3-17001 -commithash:dda68c56abf0d3b911fe6a2315872c446b314585 +version:2.1.0-preview3-17002 +commithash:b8e4e6ab104adc94c0719bb74229870e9b584a7f From 411d583631e8ef191e8dbcc4eadfff0d99787d6b Mon Sep 17 00:00:00 2001 From: "ASP.NET CI" Date: Sun, 15 Apr 2018 14:09:55 -0700 Subject: [PATCH 155/169] Update dependencies.props [auto-updated: dependencies] --- build/dependencies.props | 14 +++++++------- korebuild-lock.txt | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/build/dependencies.props b/build/dependencies.props index ae5170fa13..d4c70b5608 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -3,15 +3,15 @@ $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - 2.1.0-preview3-17002 - 2.1.0-preview3-32110 - 2.1.0-preview3-32110 - 2.1.0-preview3-32110 - 2.1.0-preview3-32110 + 2.1.0-preview3-17018 + 2.1.0-preview3-32233 + 2.1.0-preview3-32233 + 2.1.0-preview3-32233 + 2.1.0-preview3-32233 2.0.0 - 2.1.0-preview3-26331-01 + 2.1.0-preview3-26413-05 15.6.1 - 4.5.0-preview3-26331-02 + 4.5.0-preview3-26413-02 2.3.1 2.4.0-beta.1.build3945 diff --git a/korebuild-lock.txt b/korebuild-lock.txt index b3af0b8bce..b419d767b9 100644 --- a/korebuild-lock.txt +++ b/korebuild-lock.txt @@ -1,2 +1,2 @@ -version:2.1.0-preview3-17002 -commithash:b8e4e6ab104adc94c0719bb74229870e9b584a7f +version:2.1.0-preview3-17018 +commithash:af264ca131f212b5ba8aafbc5110fc0fc510a2be From 6c2432e5448fc71889e374fee3f6c7472c18628a Mon Sep 17 00:00:00 2001 From: Ryan Brandenburg Date: Mon, 16 Apr 2018 16:57:26 -0700 Subject: [PATCH 156/169] Branching for 2.1.0-rc1 --- build/repo.props | 3 ++- korebuild.json | 4 ++-- version.props | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/build/repo.props b/build/repo.props index 78b0ce5879..dab1601c88 100644 --- a/build/repo.props +++ b/build/repo.props @@ -1,9 +1,10 @@ - + Internal.AspNetCore.Universe.Lineup + 2.1.0-rc1-* https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json diff --git a/korebuild.json b/korebuild.json index bd5d51a51b..678d8bb948 100644 --- a/korebuild.json +++ b/korebuild.json @@ -1,4 +1,4 @@ { - "$schema": "https://raw.githubusercontent.com/aspnet/BuildTools/dev/tools/korebuild.schema.json", - "channel": "dev" + "$schema": "https://raw.githubusercontent.com/aspnet/BuildTools/release/2.1/tools/korebuild.schema.json", + "channel": "release/2.1" } diff --git a/version.props b/version.props index 24f2b00a0a..e27532787e 100644 --- a/version.props +++ b/version.props @@ -1,7 +1,7 @@ 2.1.0 - preview3 + rc1 $(VersionPrefix) $(VersionPrefix)-$(VersionSuffix)-final t000 From b392ef5ed7c1b509ceadfa9261c671bb78f6334e Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Thu, 19 Apr 2018 16:39:10 -0700 Subject: [PATCH 157/169] Set NETStandardImplicitPackageVersion via dependencies.props --- Directory.Build.targets | 1 + build/dependencies.props | 1 + 2 files changed, 2 insertions(+) diff --git a/Directory.Build.targets b/Directory.Build.targets index 894b1d0cf8..53b3f6e1da 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -2,5 +2,6 @@ $(MicrosoftNETCoreApp20PackageVersion) $(MicrosoftNETCoreApp21PackageVersion) + $(NETStandardLibrary20PackageVersion) diff --git a/build/dependencies.props b/build/dependencies.props index d4c70b5608..577926b344 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -11,6 +11,7 @@ 2.0.0 2.1.0-preview3-26413-05 15.6.1 + 2.0.1 4.5.0-preview3-26413-02 2.3.1 2.4.0-beta.1.build3945 From 065f9f9dbcba5cb8d1c37dc70f922a0b6609d934 Mon Sep 17 00:00:00 2001 From: "ASP.NET CI" Date: Thu, 19 Apr 2018 22:21:45 -0700 Subject: [PATCH 158/169] Update dependencies.props [auto-updated: dependencies] --- build/dependencies.props | 14 +++++++------- korebuild-lock.txt | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/build/dependencies.props b/build/dependencies.props index 577926b344..dc2db7956c 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -3,16 +3,16 @@ $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - 2.1.0-preview3-17018 - 2.1.0-preview3-32233 - 2.1.0-preview3-32233 - 2.1.0-preview3-32233 - 2.1.0-preview3-32233 + 2.1.0-rc1-15774 + 2.1.0-rc1-30613 + 2.1.0-rc1-30613 + 2.1.0-rc1-30613 + 2.1.0-rc1-30613 2.0.0 - 2.1.0-preview3-26413-05 + 2.1.0-rc1-26419-02 15.6.1 2.0.1 - 4.5.0-preview3-26413-02 + 4.5.0-rc1-26419-03 2.3.1 2.4.0-beta.1.build3945 diff --git a/korebuild-lock.txt b/korebuild-lock.txt index b419d767b9..9d4ef8c888 100644 --- a/korebuild-lock.txt +++ b/korebuild-lock.txt @@ -1,2 +1,2 @@ -version:2.1.0-preview3-17018 -commithash:af264ca131f212b5ba8aafbc5110fc0fc510a2be +version:2.1.0-rc1-15774 +commithash:ed5ca9de3c652347dbb0158a9a65eff3471d2114 From b8b90e1bed89ed2783b6d85d81828f7ef96d6d46 Mon Sep 17 00:00:00 2001 From: "Nate McMaster (automated)" Date: Mon, 30 Apr 2018 14:51:40 -0700 Subject: [PATCH 159/169] Bump version to 2.1.0-rtm --- version.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.props b/version.props index e27532787e..b9552451d8 100644 --- a/version.props +++ b/version.props @@ -1,7 +1,7 @@ 2.1.0 - rc1 + rtm $(VersionPrefix) $(VersionPrefix)-$(VersionSuffix)-final t000 From dd2eaa1ed3f9e7bebd3c7b001a2f7a95bf4b6c09 Mon Sep 17 00:00:00 2001 From: "ASP.NET CI" Date: Fri, 4 May 2018 07:35:13 -0700 Subject: [PATCH 160/169] Update dependencies.props [auto-updated: dependencies] --- build/dependencies.props | 16 ++++++++-------- korebuild-lock.txt | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/build/dependencies.props b/build/dependencies.props index dc2db7956c..007238eb66 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -3,16 +3,16 @@ $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - 2.1.0-rc1-15774 - 2.1.0-rc1-30613 - 2.1.0-rc1-30613 - 2.1.0-rc1-30613 - 2.1.0-rc1-30613 + 2.1.0-rtm-15783 + 2.1.0-rtm-30721 + 2.1.0-rtm-30721 + 2.1.0-rtm-30721 + 2.1.0-rtm-30721 2.0.0 - 2.1.0-rc1-26419-02 + 2.1.0-rtm-26502-02 15.6.1 - 2.0.1 - 4.5.0-rc1-26419-03 + 2.0.3 + 4.5.0-rtm-26502-02 2.3.1 2.4.0-beta.1.build3945 diff --git a/korebuild-lock.txt b/korebuild-lock.txt index 9d4ef8c888..3673744db9 100644 --- a/korebuild-lock.txt +++ b/korebuild-lock.txt @@ -1,2 +1,2 @@ -version:2.1.0-rc1-15774 -commithash:ed5ca9de3c652347dbb0158a9a65eff3471d2114 +version:2.1.0-rtm-15783 +commithash:5fc2b2f607f542a2ffde11c19825e786fc1a3774 From f4b98641d2ae8f95682bed02802dea5beffc9b46 Mon Sep 17 00:00:00 2001 From: "ASP.NET CI" Date: Tue, 29 May 2018 09:38:05 -0700 Subject: [PATCH 161/169] Update dependencies.props [auto-updated: dependencies] --- build/dependencies.props | 14 +++++++------- korebuild-lock.txt | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/build/dependencies.props b/build/dependencies.props index 007238eb66..a1e264ee96 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -3,16 +3,16 @@ $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - 2.1.0-rtm-15783 - 2.1.0-rtm-30721 - 2.1.0-rtm-30721 - 2.1.0-rtm-30721 - 2.1.0-rtm-30721 + 2.1.1-rtm-15790 + 2.1.0 + 2.1.0 + 2.1.0 + 2.1.0 2.0.0 - 2.1.0-rtm-26502-02 + 2.1.0 15.6.1 2.0.3 - 4.5.0-rtm-26502-02 + 4.5.0 2.3.1 2.4.0-beta.1.build3945 diff --git a/korebuild-lock.txt b/korebuild-lock.txt index 3673744db9..cd5b409a1e 100644 --- a/korebuild-lock.txt +++ b/korebuild-lock.txt @@ -1,2 +1,2 @@ -version:2.1.0-rtm-15783 -commithash:5fc2b2f607f542a2ffde11c19825e786fc1a3774 +version:2.1.1-rtm-15790 +commithash:274c65868e735f29f4078c1884c61c4371ee1fc0 From 4764c44e93d0bb772def90285d16572bc2bc376c Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Tue, 5 Jun 2018 09:11:34 -0700 Subject: [PATCH 162/169] Bumping version from 2.1.0 to 2.1.1 --- version.props | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/version.props b/version.props index b9552451d8..669c874829 100644 --- a/version.props +++ b/version.props @@ -1,6 +1,6 @@ - + - 2.1.0 + 2.1.1 rtm $(VersionPrefix) $(VersionPrefix)-$(VersionSuffix)-final From 256f7755bae10204ba6c3b669d2289b7de33308a Mon Sep 17 00:00:00 2001 From: "ASP.NET CI" Date: Tue, 12 Jun 2018 19:19:58 +0000 Subject: [PATCH 163/169] Update dependencies.props [auto-updated: dependencies] --- build/dependencies.props | 10 +++++----- korebuild-lock.txt | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/build/dependencies.props b/build/dependencies.props index a1e264ee96..dc47d2ca18 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -3,13 +3,13 @@ $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - 2.1.1-rtm-15790 + 2.1.1-rtm-15793 2.1.0 - 2.1.0 - 2.1.0 - 2.1.0 + 2.1.1 + 2.1.1 + 2.1.1 2.0.0 - 2.1.0 + 2.1.1 15.6.1 2.0.3 4.5.0 diff --git a/korebuild-lock.txt b/korebuild-lock.txt index cd5b409a1e..bc84e0cd53 100644 --- a/korebuild-lock.txt +++ b/korebuild-lock.txt @@ -1,2 +1,2 @@ -version:2.1.1-rtm-15790 -commithash:274c65868e735f29f4078c1884c61c4371ee1fc0 +version:2.1.1-rtm-15793 +commithash:988313f4b064d6c69fc6f7b845b6384a6af3447a From b7c722bb68233b28475748c3c6fdabb63b854205 Mon Sep 17 00:00:00 2001 From: Ryan Brandenburg Date: Wed, 13 Jun 2018 10:55:16 -0700 Subject: [PATCH 164/169] Set 2.1 baselines --- .../baseline.netcore.json | 106 +++++++++--------- .../baseline.netcore.json | 2 +- 2 files changed, 54 insertions(+), 54 deletions(-) diff --git a/src/Microsoft.AspNetCore.Html.Abstractions/baseline.netcore.json b/src/Microsoft.AspNetCore.Html.Abstractions/baseline.netcore.json index b0b320e216..29f855f97b 100644 --- a/src/Microsoft.AspNetCore.Html.Abstractions/baseline.netcore.json +++ b/src/Microsoft.AspNetCore.Html.Abstractions/baseline.netcore.json @@ -1,5 +1,5 @@ { - "AssemblyIdentity": "Microsoft.AspNetCore.Html.Abstractions, Version=2.0.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60", + "AssemblyIdentity": "Microsoft.AspNetCore.Html.Abstractions, Version=2.1.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60", "Types": [ { "Name": "Microsoft.AspNetCore.Html.HtmlContentBuilder", @@ -9,6 +9,58 @@ "Microsoft.AspNetCore.Html.IHtmlContentBuilder" ], "Members": [ + { + "Kind": "Method", + "Name": "CopyTo", + "Parameters": [ + { + "Name": "destination", + "Type": "Microsoft.AspNetCore.Html.IHtmlContentBuilder" + } + ], + "ReturnType": "System.Void", + "Sealed": true, + "Virtual": true, + "ImplementedInterface": "Microsoft.AspNetCore.Html.IHtmlContentContainer", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "MoveTo", + "Parameters": [ + { + "Name": "destination", + "Type": "Microsoft.AspNetCore.Html.IHtmlContentBuilder" + } + ], + "ReturnType": "System.Void", + "Sealed": true, + "Virtual": true, + "ImplementedInterface": "Microsoft.AspNetCore.Html.IHtmlContentContainer", + "Visibility": "Public", + "GenericParameter": [] + }, + { + "Kind": "Method", + "Name": "WriteTo", + "Parameters": [ + { + "Name": "writer", + "Type": "System.IO.TextWriter" + }, + { + "Name": "encoder", + "Type": "System.Text.Encodings.Web.HtmlEncoder" + } + ], + "ReturnType": "System.Void", + "Sealed": true, + "Virtual": true, + "ImplementedInterface": "Microsoft.AspNetCore.Html.IHtmlContent", + "Visibility": "Public", + "GenericParameter": [] + }, { "Kind": "Method", "Name": "get_Count", @@ -76,58 +128,6 @@ "Visibility": "Public", "GenericParameter": [] }, - { - "Kind": "Method", - "Name": "CopyTo", - "Parameters": [ - { - "Name": "destination", - "Type": "Microsoft.AspNetCore.Html.IHtmlContentBuilder" - } - ], - "ReturnType": "System.Void", - "Sealed": true, - "Virtual": true, - "ImplementedInterface": "Microsoft.AspNetCore.Html.IHtmlContentContainer", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "MoveTo", - "Parameters": [ - { - "Name": "destination", - "Type": "Microsoft.AspNetCore.Html.IHtmlContentBuilder" - } - ], - "ReturnType": "System.Void", - "Sealed": true, - "Virtual": true, - "ImplementedInterface": "Microsoft.AspNetCore.Html.IHtmlContentContainer", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "WriteTo", - "Parameters": [ - { - "Name": "writer", - "Type": "System.IO.TextWriter" - }, - { - "Name": "encoder", - "Type": "System.Text.Encodings.Web.HtmlEncoder" - } - ], - "ReturnType": "System.Void", - "Sealed": true, - "Virtual": true, - "ImplementedInterface": "Microsoft.AspNetCore.Html.IHtmlContent", - "Visibility": "Public", - "GenericParameter": [] - }, { "Kind": "Constructor", "Name": ".ctor", diff --git a/src/Microsoft.Extensions.WebEncoders/baseline.netcore.json b/src/Microsoft.Extensions.WebEncoders/baseline.netcore.json index cc93cc7458..6da0ae0754 100644 --- a/src/Microsoft.Extensions.WebEncoders/baseline.netcore.json +++ b/src/Microsoft.Extensions.WebEncoders/baseline.netcore.json @@ -1,5 +1,5 @@ { - "AssemblyIdentity": "Microsoft.Extensions.WebEncoders, Version=2.0.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60", + "AssemblyIdentity": "Microsoft.Extensions.WebEncoders, Version=2.1.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60", "Types": [ { "Name": "Microsoft.Extensions.WebEncoders.WebEncoderOptions", From 47c5edd37aad2a12d14c9dea8cfb22ef48ddb005 Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Wed, 27 Jun 2018 13:39:46 -0700 Subject: [PATCH 165/169] Bumping version from 2.1.1 to 2.1.2 --- version.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.props b/version.props index 669c874829..478dfd16ed 100644 --- a/version.props +++ b/version.props @@ -1,6 +1,6 @@  - 2.1.1 + 2.1.2 rtm $(VersionPrefix) $(VersionPrefix)-$(VersionSuffix)-final From b24ae3eef557b13215950e9642b2a1d0da0ae895 Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Wed, 11 Jul 2018 15:06:31 -0700 Subject: [PATCH 166/169] Reverting version from 2.1.2 back to 2.1.1 As a result of changing the way we apply servicing updates to aspnet core, this repo did not need the version bump because there are no planned product changes in this repo. --- version.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.props b/version.props index 478dfd16ed..669c874829 100644 --- a/version.props +++ b/version.props @@ -1,6 +1,6 @@  - 2.1.2 + 2.1.1 rtm $(VersionPrefix) $(VersionPrefix)-$(VersionSuffix)-final From fd2613f1b2ba062a10015add7db585ca15293632 Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Wed, 11 Jul 2018 18:48:36 -0700 Subject: [PATCH 167/169] Updating dependencies to 2.1.2 and adding a section for pinned variable versions --- build/dependencies.props | 13 ++++++++++--- korebuild-lock.txt | 4 ++-- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/build/dependencies.props b/build/dependencies.props index dc47d2ca18..c5bba50310 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -2,19 +2,26 @@ $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - - 2.1.1-rtm-15793 + + + + 2.1.3-rtm-15802 2.1.0 2.1.1 2.1.1 2.1.1 2.0.0 - 2.1.1 + 2.1.2 15.6.1 2.0.3 4.5.0 2.3.1 2.4.0-beta.1.build3945 + + + + + diff --git a/korebuild-lock.txt b/korebuild-lock.txt index bc84e0cd53..251c227c83 100644 --- a/korebuild-lock.txt +++ b/korebuild-lock.txt @@ -1,2 +1,2 @@ -version:2.1.1-rtm-15793 -commithash:988313f4b064d6c69fc6f7b845b6384a6af3447a +version:2.1.3-rtm-15802 +commithash:a7c08b45b440a7d2058a0aa1eaa3eb6ba811976a From 252ae0c434d93f5bfaf949c35edb9ef59730d0a3 Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Thu, 12 Jul 2018 11:53:20 -0700 Subject: [PATCH 168/169] Pin version variables to the ASP.NET Core 2.1.2 baseline This reverts our previous policy of cascading versions on all servicing updates. This moves variables into the 'pinned' section, and points them to the latest stable release (versions that were used at the time of the 2.1.2 release). --- build/dependencies.props | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/build/dependencies.props b/build/dependencies.props index c5bba50310..3c314a3476 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -4,12 +4,8 @@ - + 2.1.3-rtm-15802 - 2.1.0 - 2.1.1 - 2.1.1 - 2.1.1 2.0.0 2.1.2 15.6.1 @@ -23,5 +19,10 @@ - - + + 2.1.0 + 2.1.1 + 2.1.1 + 2.1.1 + + \ No newline at end of file From 1ab08d70ef462dddcf71f3b419493b10db081eae Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Fri, 9 Nov 2018 16:17:15 -0800 Subject: [PATCH 169/169] Reorganize source code in preparation to move into aspnet/AspNetCore Prior to reorganization, this source code was found in https://github.com/aspnet/HtmlAbstractions/tree/252ae0c434d93f5bfaf949c35edb9ef59730d0a3 --- .appveyor.yml | 17 - .gitattributes | 51 -- .github/ISSUE_TEMPLATE.md | 3 - .gitignore | 40 -- .travis.yml | 27 - CONTRIBUTING.md | 4 - Directory.Build.props | 24 - Directory.Build.targets | 7 - HtmlAbstractions.sln | 90 --- LICENSE.txt | 14 - NuGet.config | 7 - NuGetPackageVerifier.json | 7 - README.md | 9 - build.cmd | 2 - build.sh | 8 - build/Key.snk | Bin 596 -> 0 bytes build/dependencies.props | 28 - build/repo.props | 15 - build/sources.props | 17 - korebuild-lock.txt | 2 - korebuild.json | 4 - run.cmd | 2 - run.ps1 | 196 ------ run.sh | 231 ------- .../Abstractions/src}/HtmlContentBuilder.cs | 0 .../src}/HtmlContentBuilderExtensions.cs | 0 .../src}/HtmlFormattableString.cs | 0 .../Abstractions/src}/HtmlString.cs | 0 .../Abstractions/src}/IHtmlContent.cs | 0 .../Abstractions/src}/IHtmlContentBuilder.cs | 0 .../src}/IHtmlContentContainer.cs | 0 ...rosoft.AspNetCore.Html.Abstractions.csproj | 4 +- .../src/Properties/AssemblyInfo.cs | 8 + .../Abstractions/src}/baseline.netcore.json | 0 .../test}/HtmlContentBuilderExtensionsTest.cs | 0 .../test}/HtmlContentBuilderTest.cs | 0 .../test}/HtmlFormattableStringTest.cs | 0 ....AspNetCore.Html.Abstractions.Tests.csproj | 12 + .../Properties/AssemblyInfo.cs | 8 - .../EncoderServiceCollectionExtensions.cs | 83 --- .../Microsoft.Extensions.WebEncoders.csproj | 19 - .../Testing/HtmlTestEncoder.cs | 104 ---- .../Testing/JavaScriptTestEncoder.cs | 104 ---- .../Testing/UrlTestEncoder.cs | 104 ---- .../WebEncoderOptions.cs | 21 - .../baseline.netcore.json | 564 ------------------ test/Directory.Build.props | 17 - ...t.AspNetCore.Html.Abstractions.Test.csproj | 12 - ...EncoderServiceCollectionExtensionsTests.cs | 90 --- .../HtmlTestEncoderTest.cs | 26 - ...rosoft.Extensions.WebEncoders.Tests.csproj | 15 - version.props | 12 - 52 files changed, 22 insertions(+), 1986 deletions(-) delete mode 100644 .appveyor.yml delete mode 100644 .gitattributes delete mode 100644 .github/ISSUE_TEMPLATE.md delete mode 100644 .gitignore delete mode 100644 .travis.yml delete mode 100644 CONTRIBUTING.md delete mode 100644 Directory.Build.props delete mode 100644 Directory.Build.targets delete mode 100644 HtmlAbstractions.sln delete mode 100644 LICENSE.txt delete mode 100644 NuGet.config delete mode 100644 NuGetPackageVerifier.json delete mode 100644 README.md delete mode 100644 build.cmd delete mode 100755 build.sh delete mode 100644 build/Key.snk delete mode 100644 build/dependencies.props delete mode 100644 build/repo.props delete mode 100644 build/sources.props delete mode 100644 korebuild-lock.txt delete mode 100644 korebuild.json delete mode 100644 run.cmd delete mode 100644 run.ps1 delete mode 100755 run.sh rename src/{Microsoft.AspNetCore.Html.Abstractions => Html/Abstractions/src}/HtmlContentBuilder.cs (100%) rename src/{Microsoft.AspNetCore.Html.Abstractions => Html/Abstractions/src}/HtmlContentBuilderExtensions.cs (100%) rename src/{Microsoft.AspNetCore.Html.Abstractions => Html/Abstractions/src}/HtmlFormattableString.cs (100%) rename src/{Microsoft.AspNetCore.Html.Abstractions => Html/Abstractions/src}/HtmlString.cs (100%) rename src/{Microsoft.AspNetCore.Html.Abstractions => Html/Abstractions/src}/IHtmlContent.cs (100%) rename src/{Microsoft.AspNetCore.Html.Abstractions => Html/Abstractions/src}/IHtmlContentBuilder.cs (100%) rename src/{Microsoft.AspNetCore.Html.Abstractions => Html/Abstractions/src}/IHtmlContentContainer.cs (100%) rename src/{Microsoft.AspNetCore.Html.Abstractions => Html/Abstractions/src}/Microsoft.AspNetCore.Html.Abstractions.csproj (74%) mode change 100755 => 100644 create mode 100644 src/Html/Abstractions/src/Properties/AssemblyInfo.cs rename src/{Microsoft.AspNetCore.Html.Abstractions => Html/Abstractions/src}/baseline.netcore.json (100%) rename {test/Microsoft.AspNetCore.Html.Abstractions.Test => src/Html/Abstractions/test}/HtmlContentBuilderExtensionsTest.cs (100%) rename {test/Microsoft.AspNetCore.Html.Abstractions.Test => src/Html/Abstractions/test}/HtmlContentBuilderTest.cs (100%) rename {test/Microsoft.AspNetCore.Html.Abstractions.Test => src/Html/Abstractions/test}/HtmlFormattableStringTest.cs (100%) create mode 100644 src/Html/Abstractions/test/Microsoft.AspNetCore.Html.Abstractions.Tests.csproj delete mode 100644 src/Microsoft.AspNetCore.Html.Abstractions/Properties/AssemblyInfo.cs delete mode 100644 src/Microsoft.Extensions.WebEncoders/EncoderServiceCollectionExtensions.cs delete mode 100755 src/Microsoft.Extensions.WebEncoders/Microsoft.Extensions.WebEncoders.csproj delete mode 100644 src/Microsoft.Extensions.WebEncoders/Testing/HtmlTestEncoder.cs delete mode 100644 src/Microsoft.Extensions.WebEncoders/Testing/JavaScriptTestEncoder.cs delete mode 100644 src/Microsoft.Extensions.WebEncoders/Testing/UrlTestEncoder.cs delete mode 100644 src/Microsoft.Extensions.WebEncoders/WebEncoderOptions.cs delete mode 100644 src/Microsoft.Extensions.WebEncoders/baseline.netcore.json delete mode 100644 test/Directory.Build.props delete mode 100755 test/Microsoft.AspNetCore.Html.Abstractions.Test/Microsoft.AspNetCore.Html.Abstractions.Test.csproj delete mode 100644 test/Microsoft.Extensions.WebEncoders.Tests/EncoderServiceCollectionExtensionsTests.cs delete mode 100644 test/Microsoft.Extensions.WebEncoders.Tests/HtmlTestEncoderTest.cs delete mode 100755 test/Microsoft.Extensions.WebEncoders.Tests/Microsoft.Extensions.WebEncoders.Tests.csproj delete mode 100644 version.props diff --git a/.appveyor.yml b/.appveyor.yml deleted file mode 100644 index 4eea96ab69..0000000000 --- a/.appveyor.yml +++ /dev/null @@ -1,17 +0,0 @@ -init: -- git config --global core.autocrlf true -branches: - only: - - dev - - /^release\/.*$/ - - /^(.*\/)?ci-.*$/ -build_script: -- ps: .\run.ps1 default-build -clone_depth: 1 -environment: - global: - DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true - DOTNET_CLI_TELEMETRY_OPTOUT: 1 -test: 'off' -deploy: 'off' -os: Visual Studio 2017 diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 66abdf279e..0000000000 --- a/.gitattributes +++ /dev/null @@ -1,51 +0,0 @@ -*.doc diff=astextplain -*.DOC diff=astextplain -*.docx diff=astextplain -*.DOCX diff=astextplain -*.dot diff=astextplain -*.DOT diff=astextplain -*.pdf diff=astextplain -*.PDF diff=astextplain -*.rtf diff=astextplain -*.RTF diff=astextplain - -*.jpg binary -*.png binary -*.gif binary - -*.cs text=auto diff=csharp -*.vb text=auto -*.resx text=auto -*.c text=auto -*.cpp text=auto -*.cxx text=auto -*.h text=auto -*.hxx text=auto -*.py text=auto -*.rb text=auto -*.java text=auto -*.html text=auto -*.htm text=auto -*.css text=auto -*.scss text=auto -*.sass text=auto -*.less text=auto -*.js text=auto -*.lisp text=auto -*.clj text=auto -*.sql text=auto -*.php text=auto -*.lua text=auto -*.m text=auto -*.asm text=auto -*.erl text=auto -*.fs text=auto -*.fsx text=auto -*.hs text=auto - -*.csproj text=auto -*.vbproj text=auto -*.fsproj text=auto -*.dbproj text=auto -*.sln text=auto eol=crlf -*.sh eol=lf \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md deleted file mode 100644 index 101a084f0a..0000000000 --- a/.github/ISSUE_TEMPLATE.md +++ /dev/null @@ -1,3 +0,0 @@ -THIS ISSUE TRACKER IS CLOSED - please log new issues here: https://github.com/aspnet/Home/issues - -For information about this change, see https://github.com/aspnet/Announcements/issues/283 diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 6da3c6a3e9..0000000000 --- a/.gitignore +++ /dev/null @@ -1,40 +0,0 @@ -[Oo]bj/ -[Bb]in/ -TestResults/ -.nuget/ -*.sln.ide/ -_ReSharper.*/ -packages/ -artifacts/ -PublishProfiles/ -.vs/ -bower_components/ -node_modules/ -**/wwwroot/lib/ -debugSettings.json -project.lock.json -*.user -*.suo -*.cache -*.docstates -_ReSharper.* -nuget.exe -*net45.csproj -*net451.csproj -*k10.csproj -*.psess -*.vsp -*.pidb -*.userprefs -*DS_Store -*.ncrunchsolution -*.*sdf -*.ipch -.settings -*.sln.ide -node_modules -**/[Cc]ompiler/[Rr]esources/**/*.js -*launchSettings.json -.build/ -.testPublish/ -global.json diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 64bdbb4441..0000000000 --- a/.travis.yml +++ /dev/null @@ -1,27 +0,0 @@ -language: csharp -sudo: false -dist: trusty -env: - global: - - DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true - - DOTNET_CLI_TELEMETRY_OPTOUT: 1 -mono: none -os: -- linux -- osx -osx_image: xcode8.2 -addons: - apt: - packages: - - libunwind8 -branches: - only: - - dev - - /^release\/.*$/ - - /^(.*\/)?ci-.*$/ -before_install: -- if test "$TRAVIS_OS_NAME" == "osx"; then brew update; brew install openssl; ln -s - /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib /usr/local/lib/; ln -s /usr/local/opt/openssl/lib/libssl.1.0.0.dylib - /usr/local/lib/; fi -script: -- ./build.sh diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index 64ff041d5c..0000000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,4 +0,0 @@ -Contributing -====== - -Information on contributing to this repo is in the [Contributing Guide](https://github.com/aspnet/Home/blob/dev/CONTRIBUTING.md) in the Home repo. diff --git a/Directory.Build.props b/Directory.Build.props deleted file mode 100644 index b7176c688d..0000000000 --- a/Directory.Build.props +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - https://github.com/aspnet/HtmlAbstractions - git - $(MSBuildThisFileDirectory) - $(MSBuildThisFileDirectory)build\Key.snk - true - true - true - - - - - - - diff --git a/Directory.Build.targets b/Directory.Build.targets deleted file mode 100644 index 53b3f6e1da..0000000000 --- a/Directory.Build.targets +++ /dev/null @@ -1,7 +0,0 @@ - - - $(MicrosoftNETCoreApp20PackageVersion) - $(MicrosoftNETCoreApp21PackageVersion) - $(NETStandardLibrary20PackageVersion) - - diff --git a/HtmlAbstractions.sln b/HtmlAbstractions.sln deleted file mode 100644 index 5ee1cb4612..0000000000 --- a/HtmlAbstractions.sln +++ /dev/null @@ -1,90 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26127.0 -MinimumVisualStudioVersion = 15.0.26730.03 -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{A5A15F1C-885A-452A-A731-B0173DDBD913}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{F31FF137-390C-49BF-A3BD-7C6ED3597C21}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.AspNetCore.Html.Abstractions", "src\Microsoft.AspNetCore.Html.Abstractions\Microsoft.AspNetCore.Html.Abstractions.csproj", "{68A28E4A-3ADE-4187-9625-4FF185887CB3}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.AspNetCore.Html.Abstractions.Test", "test\Microsoft.AspNetCore.Html.Abstractions.Test\Microsoft.AspNetCore.Html.Abstractions.Test.csproj", "{2D187B88-94BD-4A39-AC97-F8F8B9363301}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{B4962A29-BE69-4A18-9B4F-B803EEE31EAA}" - ProjectSection(SolutionItems) = preProject - NuGetPackageVerifier.json = NuGetPackageVerifier.json - EndProjectSection -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Extensions.WebEncoders", "src\Microsoft.Extensions.WebEncoders\Microsoft.Extensions.WebEncoders.csproj", "{DD2CE416-765E-4000-A03E-C2FF165DA1B6}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Extensions.WebEncoders.Tests", "test\Microsoft.Extensions.WebEncoders.Tests\Microsoft.Extensions.WebEncoders.Tests.csproj", "{7AE2731D-43CD-4CF8-850A-4914DE2CE930}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|Mixed Platforms = Debug|Mixed Platforms - Debug|x86 = Debug|x86 - Release|Any CPU = Release|Any CPU - Release|Mixed Platforms = Release|Mixed Platforms - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {68A28E4A-3ADE-4187-9625-4FF185887CB3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {68A28E4A-3ADE-4187-9625-4FF185887CB3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {68A28E4A-3ADE-4187-9625-4FF185887CB3}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {68A28E4A-3ADE-4187-9625-4FF185887CB3}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {68A28E4A-3ADE-4187-9625-4FF185887CB3}.Debug|x86.ActiveCfg = Debug|Any CPU - {68A28E4A-3ADE-4187-9625-4FF185887CB3}.Debug|x86.Build.0 = Debug|Any CPU - {68A28E4A-3ADE-4187-9625-4FF185887CB3}.Release|Any CPU.ActiveCfg = Release|Any CPU - {68A28E4A-3ADE-4187-9625-4FF185887CB3}.Release|Any CPU.Build.0 = Release|Any CPU - {68A28E4A-3ADE-4187-9625-4FF185887CB3}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {68A28E4A-3ADE-4187-9625-4FF185887CB3}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {68A28E4A-3ADE-4187-9625-4FF185887CB3}.Release|x86.ActiveCfg = Release|Any CPU - {68A28E4A-3ADE-4187-9625-4FF185887CB3}.Release|x86.Build.0 = Release|Any CPU - {2D187B88-94BD-4A39-AC97-F8F8B9363301}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2D187B88-94BD-4A39-AC97-F8F8B9363301}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2D187B88-94BD-4A39-AC97-F8F8B9363301}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {2D187B88-94BD-4A39-AC97-F8F8B9363301}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {2D187B88-94BD-4A39-AC97-F8F8B9363301}.Debug|x86.ActiveCfg = Debug|Any CPU - {2D187B88-94BD-4A39-AC97-F8F8B9363301}.Debug|x86.Build.0 = Debug|Any CPU - {2D187B88-94BD-4A39-AC97-F8F8B9363301}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2D187B88-94BD-4A39-AC97-F8F8B9363301}.Release|Any CPU.Build.0 = Release|Any CPU - {2D187B88-94BD-4A39-AC97-F8F8B9363301}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {2D187B88-94BD-4A39-AC97-F8F8B9363301}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {2D187B88-94BD-4A39-AC97-F8F8B9363301}.Release|x86.ActiveCfg = Release|Any CPU - {2D187B88-94BD-4A39-AC97-F8F8B9363301}.Release|x86.Build.0 = Release|Any CPU - {DD2CE416-765E-4000-A03E-C2FF165DA1B6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DD2CE416-765E-4000-A03E-C2FF165DA1B6}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DD2CE416-765E-4000-A03E-C2FF165DA1B6}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {DD2CE416-765E-4000-A03E-C2FF165DA1B6}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {DD2CE416-765E-4000-A03E-C2FF165DA1B6}.Debug|x86.ActiveCfg = Debug|Any CPU - {DD2CE416-765E-4000-A03E-C2FF165DA1B6}.Debug|x86.Build.0 = Debug|Any CPU - {DD2CE416-765E-4000-A03E-C2FF165DA1B6}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DD2CE416-765E-4000-A03E-C2FF165DA1B6}.Release|Any CPU.Build.0 = Release|Any CPU - {DD2CE416-765E-4000-A03E-C2FF165DA1B6}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {DD2CE416-765E-4000-A03E-C2FF165DA1B6}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {DD2CE416-765E-4000-A03E-C2FF165DA1B6}.Release|x86.ActiveCfg = Release|Any CPU - {DD2CE416-765E-4000-A03E-C2FF165DA1B6}.Release|x86.Build.0 = Release|Any CPU - {7AE2731D-43CD-4CF8-850A-4914DE2CE930}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7AE2731D-43CD-4CF8-850A-4914DE2CE930}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7AE2731D-43CD-4CF8-850A-4914DE2CE930}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {7AE2731D-43CD-4CF8-850A-4914DE2CE930}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {7AE2731D-43CD-4CF8-850A-4914DE2CE930}.Debug|x86.ActiveCfg = Debug|Any CPU - {7AE2731D-43CD-4CF8-850A-4914DE2CE930}.Debug|x86.Build.0 = Debug|Any CPU - {7AE2731D-43CD-4CF8-850A-4914DE2CE930}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7AE2731D-43CD-4CF8-850A-4914DE2CE930}.Release|Any CPU.Build.0 = Release|Any CPU - {7AE2731D-43CD-4CF8-850A-4914DE2CE930}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {7AE2731D-43CD-4CF8-850A-4914DE2CE930}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {7AE2731D-43CD-4CF8-850A-4914DE2CE930}.Release|x86.ActiveCfg = Release|Any CPU - {7AE2731D-43CD-4CF8-850A-4914DE2CE930}.Release|x86.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {68A28E4A-3ADE-4187-9625-4FF185887CB3} = {A5A15F1C-885A-452A-A731-B0173DDBD913} - {2D187B88-94BD-4A39-AC97-F8F8B9363301} = {F31FF137-390C-49BF-A3BD-7C6ED3597C21} - {DD2CE416-765E-4000-A03E-C2FF165DA1B6} = {A5A15F1C-885A-452A-A731-B0173DDBD913} - {7AE2731D-43CD-4CF8-850A-4914DE2CE930} = {F31FF137-390C-49BF-A3BD-7C6ED3597C21} - EndGlobalSection -EndGlobal diff --git a/LICENSE.txt b/LICENSE.txt deleted file mode 100644 index 7b2956ecee..0000000000 --- a/LICENSE.txt +++ /dev/null @@ -1,14 +0,0 @@ -Copyright (c) .NET Foundation and Contributors - -All rights reserved. - -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software distributed -under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -CONDITIONS OF ANY KIND, either express or implied. See the License for the -specific language governing permissions and limitations under the License. diff --git a/NuGet.config b/NuGet.config deleted file mode 100644 index e32bddfd51..0000000000 --- a/NuGet.config +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/NuGetPackageVerifier.json b/NuGetPackageVerifier.json deleted file mode 100644 index b153ab1515..0000000000 --- a/NuGetPackageVerifier.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "Default": { - "rules": [ - "DefaultCompositeRule" - ] - } -} \ No newline at end of file diff --git a/README.md b/README.md deleted file mode 100644 index a1e3579e7a..0000000000 --- a/README.md +++ /dev/null @@ -1,9 +0,0 @@ -HtmlAbstractions -========== -AppVeyor: [![AppVeyor](https://ci.appveyor.com/api/projects/status/cu9y78vsdp19e5on/branch/dev?svg=true)](https://ci.appveyor.com/project/aspnetci/htmlabstractions/branch/dev) - -Travis: [![Travis](https://travis-ci.org/aspnet/HtmlAbstractions.svg?branch=dev)](https://travis-ci.org/aspnet/HtmlAbstractions) - -HTML abstractions used for building HTML content, including types such as `HtmlString` and `IHtmlContent`. - -This project is part of ASP.NET Core. You can find samples, documentation and getting started instructions for ASP.NET Core at the [Home](https://github.com/aspnet/home) repo. diff --git a/build.cmd b/build.cmd deleted file mode 100644 index c0050bda12..0000000000 --- a/build.cmd +++ /dev/null @@ -1,2 +0,0 @@ -@ECHO OFF -PowerShell -NoProfile -NoLogo -ExecutionPolicy unrestricted -Command "[System.Threading.Thread]::CurrentThread.CurrentCulture = ''; [System.Threading.Thread]::CurrentThread.CurrentUICulture = '';& '%~dp0run.ps1' default-build %*; exit $LASTEXITCODE" diff --git a/build.sh b/build.sh deleted file mode 100755 index 98a4b22765..0000000000 --- a/build.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env bash - -set -euo pipefail -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" - -# Call "sync" between "chmod" and execution to prevent "text file busy" error in Docker (aufs) -chmod +x "$DIR/run.sh"; sync -"$DIR/run.sh" default-build "$@" diff --git a/build/Key.snk b/build/Key.snk deleted file mode 100644 index e10e4889c125d3120cd9e81582243d70f7cbb806..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 596 zcmV-a0;~N80ssI2Bme+XQ$aES1ONa50098=Iw=HCsnz~#iVhm& zj%TU(_THUee?3yHBjk$37ysB?i5#7WD$={H zV4B!OxRPrb|8)HPg~A}8P>^=#y<)56#=E&NzcjOtPK~<4n6GHt=K$ro*T(lhby_@U zEk(hLzk1H)0yXj{A_5>fk-TgNoP|q6(tP2xo8zt8i%212CWM#AeCd?`hS|4~L({h~Moo(~vy&3Z z1uI}`fd^*>o=rwbAGymj6RM^pZm(*Kfhs+Y1#`-2JPWZMK8@;ZWCk2+9bX4YP);~fj-BU*R zQPvWv$89!{Rl9wM+zR>_TSkn^voYxA?2G iKnV#iZ6Ah`K>b=@=IjYJXrxL124zR(38)nxe+&q_$QXwJ diff --git a/build/dependencies.props b/build/dependencies.props deleted file mode 100644 index 3c314a3476..0000000000 --- a/build/dependencies.props +++ /dev/null @@ -1,28 +0,0 @@ - - - $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - - - - - 2.1.3-rtm-15802 - 2.0.0 - 2.1.2 - 15.6.1 - 2.0.3 - 4.5.0 - 2.3.1 - 2.4.0-beta.1.build3945 - - - - - - - - 2.1.0 - 2.1.1 - 2.1.1 - 2.1.1 - - \ No newline at end of file diff --git a/build/repo.props b/build/repo.props deleted file mode 100644 index dab1601c88..0000000000 --- a/build/repo.props +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - Internal.AspNetCore.Universe.Lineup - 2.1.0-rc1-* - https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json - - - - - - - diff --git a/build/sources.props b/build/sources.props deleted file mode 100644 index 9215df9751..0000000000 --- a/build/sources.props +++ /dev/null @@ -1,17 +0,0 @@ - - - - - $(DotNetRestoreSources) - - $(RestoreSources); - https://dotnet.myget.org/F/dotnet-core/api/v3/index.json; - https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json; - https://dotnet.myget.org/F/aspnetcore-tools/api/v3/index.json; - - - $(RestoreSources); - https://api.nuget.org/v3/index.json; - - - diff --git a/korebuild-lock.txt b/korebuild-lock.txt deleted file mode 100644 index 251c227c83..0000000000 --- a/korebuild-lock.txt +++ /dev/null @@ -1,2 +0,0 @@ -version:2.1.3-rtm-15802 -commithash:a7c08b45b440a7d2058a0aa1eaa3eb6ba811976a diff --git a/korebuild.json b/korebuild.json deleted file mode 100644 index 678d8bb948..0000000000 --- a/korebuild.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "$schema": "https://raw.githubusercontent.com/aspnet/BuildTools/release/2.1/tools/korebuild.schema.json", - "channel": "release/2.1" -} diff --git a/run.cmd b/run.cmd deleted file mode 100644 index d52d5c7e68..0000000000 --- a/run.cmd +++ /dev/null @@ -1,2 +0,0 @@ -@ECHO OFF -PowerShell -NoProfile -NoLogo -ExecutionPolicy unrestricted -Command "[System.Threading.Thread]::CurrentThread.CurrentCulture = ''; [System.Threading.Thread]::CurrentThread.CurrentUICulture = '';& '%~dp0run.ps1' %*; exit $LASTEXITCODE" diff --git a/run.ps1 b/run.ps1 deleted file mode 100644 index 27dcf848f8..0000000000 --- a/run.ps1 +++ /dev/null @@ -1,196 +0,0 @@ -#!/usr/bin/env powershell -#requires -version 4 - -<# -.SYNOPSIS -Executes KoreBuild commands. - -.DESCRIPTION -Downloads korebuild if required. Then executes the KoreBuild command. To see available commands, execute with `-Command help`. - -.PARAMETER Command -The KoreBuild command to run. - -.PARAMETER Path -The folder to build. Defaults to the folder containing this script. - -.PARAMETER Channel -The channel of KoreBuild to download. Overrides the value from the config file. - -.PARAMETER DotNetHome -The directory where .NET Core tools will be stored. - -.PARAMETER ToolsSource -The base url where build tools can be downloaded. Overrides the value from the config file. - -.PARAMETER Update -Updates KoreBuild to the latest version even if a lock file is present. - -.PARAMETER ConfigFile -The path to the configuration file that stores values. Defaults to korebuild.json. - -.PARAMETER ToolsSourceSuffix -The Suffix to append to the end of the ToolsSource. Useful for query strings in blob stores. - -.PARAMETER Arguments -Arguments to be passed to the command - -.NOTES -This function will create a file $PSScriptRoot/korebuild-lock.txt. This lock file can be committed to source, but does not have to be. -When the lockfile is not present, KoreBuild will create one using latest available version from $Channel. - -The $ConfigFile is expected to be an JSON file. It is optional, and the configuration values in it are optional as well. Any options set -in the file are overridden by command line parameters. - -.EXAMPLE -Example config file: -```json -{ - "$schema": "https://raw.githubusercontent.com/aspnet/BuildTools/dev/tools/korebuild.schema.json", - "channel": "dev", - "toolsSource": "https://aspnetcore.blob.core.windows.net/buildtools" -} -``` -#> -[CmdletBinding(PositionalBinding = $false)] -param( - [Parameter(Mandatory = $true, Position = 0)] - [string]$Command, - [string]$Path = $PSScriptRoot, - [Alias('c')] - [string]$Channel, - [Alias('d')] - [string]$DotNetHome, - [Alias('s')] - [string]$ToolsSource, - [Alias('u')] - [switch]$Update, - [string]$ConfigFile, - [string]$ToolsSourceSuffix, - [Parameter(ValueFromRemainingArguments = $true)] - [string[]]$Arguments -) - -Set-StrictMode -Version 2 -$ErrorActionPreference = 'Stop' - -# -# Functions -# - -function Get-KoreBuild { - - $lockFile = Join-Path $Path 'korebuild-lock.txt' - - if (!(Test-Path $lockFile) -or $Update) { - Get-RemoteFile "$ToolsSource/korebuild/channels/$Channel/latest.txt" $lockFile $ToolsSourceSuffix - } - - $version = Get-Content $lockFile | Where-Object { $_ -like 'version:*' } | Select-Object -first 1 - if (!$version) { - Write-Error "Failed to parse version from $lockFile. Expected a line that begins with 'version:'" - } - $version = $version.TrimStart('version:').Trim() - $korebuildPath = Join-Paths $DotNetHome ('buildtools', 'korebuild', $version) - - if (!(Test-Path $korebuildPath)) { - Write-Host -ForegroundColor Magenta "Downloading KoreBuild $version" - New-Item -ItemType Directory -Path $korebuildPath | Out-Null - $remotePath = "$ToolsSource/korebuild/artifacts/$version/korebuild.$version.zip" - - try { - $tmpfile = Join-Path ([IO.Path]::GetTempPath()) "KoreBuild-$([guid]::NewGuid()).zip" - Get-RemoteFile $remotePath $tmpfile $ToolsSourceSuffix - if (Get-Command -Name 'Expand-Archive' -ErrorAction Ignore) { - # Use built-in commands where possible as they are cross-plat compatible - Expand-Archive -Path $tmpfile -DestinationPath $korebuildPath - } - else { - # Fallback to old approach for old installations of PowerShell - Add-Type -AssemblyName System.IO.Compression.FileSystem - [System.IO.Compression.ZipFile]::ExtractToDirectory($tmpfile, $korebuildPath) - } - } - catch { - Remove-Item -Recurse -Force $korebuildPath -ErrorAction Ignore - throw - } - finally { - Remove-Item $tmpfile -ErrorAction Ignore - } - } - - return $korebuildPath -} - -function Join-Paths([string]$path, [string[]]$childPaths) { - $childPaths | ForEach-Object { $path = Join-Path $path $_ } - return $path -} - -function Get-RemoteFile([string]$RemotePath, [string]$LocalPath, [string]$RemoteSuffix) { - if ($RemotePath -notlike 'http*') { - Copy-Item $RemotePath $LocalPath - return - } - - $retries = 10 - while ($retries -gt 0) { - $retries -= 1 - try { - Invoke-WebRequest -UseBasicParsing -Uri $($RemotePath + $RemoteSuffix) -OutFile $LocalPath - return - } - catch { - Write-Verbose "Request failed. $retries retries remaining" - } - } - - Write-Error "Download failed: '$RemotePath'." -} - -# -# Main -# - -# Load configuration or set defaults - -$Path = Resolve-Path $Path -if (!$ConfigFile) { $ConfigFile = Join-Path $Path 'korebuild.json' } - -if (Test-Path $ConfigFile) { - try { - $config = Get-Content -Raw -Encoding UTF8 -Path $ConfigFile | ConvertFrom-Json - if ($config) { - if (!($Channel) -and (Get-Member -Name 'channel' -InputObject $config)) { [string] $Channel = $config.channel } - if (!($ToolsSource) -and (Get-Member -Name 'toolsSource' -InputObject $config)) { [string] $ToolsSource = $config.toolsSource} - } - } - catch { - Write-Warning "$ConfigFile could not be read. Its settings will be ignored." - Write-Warning $Error[0] - } -} - -if (!$DotNetHome) { - $DotNetHome = if ($env:DOTNET_HOME) { $env:DOTNET_HOME } ` - elseif ($env:USERPROFILE) { Join-Path $env:USERPROFILE '.dotnet'} ` - elseif ($env:HOME) {Join-Path $env:HOME '.dotnet'}` - else { Join-Path $PSScriptRoot '.dotnet'} -} - -if (!$Channel) { $Channel = 'dev' } -if (!$ToolsSource) { $ToolsSource = 'https://aspnetcore.blob.core.windows.net/buildtools' } - -# Execute - -$korebuildPath = Get-KoreBuild -Import-Module -Force -Scope Local (Join-Path $korebuildPath 'KoreBuild.psd1') - -try { - Set-KoreBuildSettings -ToolsSource $ToolsSource -DotNetHome $DotNetHome -RepoPath $Path -ConfigFile $ConfigFile - Invoke-KoreBuildCommand $Command @Arguments -} -finally { - Remove-Module 'KoreBuild' -ErrorAction Ignore -} diff --git a/run.sh b/run.sh deleted file mode 100755 index 834961fc3a..0000000000 --- a/run.sh +++ /dev/null @@ -1,231 +0,0 @@ -#!/usr/bin/env bash - -set -euo pipefail - -# -# variables -# - -RESET="\033[0m" -RED="\033[0;31m" -YELLOW="\033[0;33m" -MAGENTA="\033[0;95m" -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -[ -z "${DOTNET_HOME:-}" ] && DOTNET_HOME="$HOME/.dotnet" -verbose=false -update=false -repo_path="$DIR" -channel='' -tools_source='' -tools_source_suffix='' - -# -# Functions -# -__usage() { - echo "Usage: $(basename "${BASH_SOURCE[0]}") command [options] [[--] ...]" - echo "" - echo "Arguments:" - echo " command The command to be run." - echo " ... Arguments passed to the command. Variable number of arguments allowed." - echo "" - echo "Options:" - echo " --verbose Show verbose output." - echo " -c|--channel The channel of KoreBuild to download. Overrides the value from the config file.." - echo " --config-file The path to the configuration file that stores values. Defaults to korebuild.json." - echo " -d|--dotnet-home The directory where .NET Core tools will be stored. Defaults to '\$DOTNET_HOME' or '\$HOME/.dotnet." - echo " --path The directory to build. Defaults to the directory containing the script." - echo " -s|--tools-source|-ToolsSource The base url where build tools can be downloaded. Overrides the value from the config file." - echo " --tools-source-suffix|-ToolsSourceSuffix The suffix to append to tools-source. Useful for query strings." - echo " -u|--update Update to the latest KoreBuild even if the lock file is present." - echo "" - echo "Description:" - echo " This function will create a file \$DIR/korebuild-lock.txt. This lock file can be committed to source, but does not have to be." - echo " When the lockfile is not present, KoreBuild will create one using latest available version from \$channel." - - if [[ "${1:-}" != '--no-exit' ]]; then - exit 2 - fi -} - -get_korebuild() { - local version - local lock_file="$repo_path/korebuild-lock.txt" - if [ ! -f "$lock_file" ] || [ "$update" = true ]; then - __get_remote_file "$tools_source/korebuild/channels/$channel/latest.txt" "$lock_file" "$tools_source_suffix" - fi - version="$(grep 'version:*' -m 1 "$lock_file")" - if [[ "$version" == '' ]]; then - __error "Failed to parse version from $lock_file. Expected a line that begins with 'version:'" - return 1 - fi - version="$(echo "${version#version:}" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')" - local korebuild_path="$DOTNET_HOME/buildtools/korebuild/$version" - - { - if [ ! -d "$korebuild_path" ]; then - mkdir -p "$korebuild_path" - local remote_path="$tools_source/korebuild/artifacts/$version/korebuild.$version.zip" - tmpfile="$(mktemp)" - echo -e "${MAGENTA}Downloading KoreBuild ${version}${RESET}" - if __get_remote_file "$remote_path" "$tmpfile" "$tools_source_suffix"; then - unzip -q -d "$korebuild_path" "$tmpfile" - fi - rm "$tmpfile" || true - fi - - source "$korebuild_path/KoreBuild.sh" - } || { - if [ -d "$korebuild_path" ]; then - echo "Cleaning up after failed installation" - rm -rf "$korebuild_path" || true - fi - return 1 - } -} - -__error() { - echo -e "${RED}error: $*${RESET}" 1>&2 -} - -__warn() { - echo -e "${YELLOW}warning: $*${RESET}" -} - -__machine_has() { - hash "$1" > /dev/null 2>&1 - return $? -} - -__get_remote_file() { - local remote_path=$1 - local local_path=$2 - local remote_path_suffix=$3 - - if [[ "$remote_path" != 'http'* ]]; then - cp "$remote_path" "$local_path" - return 0 - fi - - local failed=false - if __machine_has wget; then - wget --tries 10 --quiet -O "$local_path" "${remote_path}${remote_path_suffix}" || failed=true - else - failed=true - fi - - if [ "$failed" = true ] && __machine_has curl; then - failed=false - curl --retry 10 -sSL -f --create-dirs -o "$local_path" "${remote_path}${remote_path_suffix}" || failed=true - fi - - if [ "$failed" = true ]; then - __error "Download failed: $remote_path" 1>&2 - return 1 - fi -} - -# -# main -# - -command="${1:-}" -shift - -while [[ $# -gt 0 ]]; do - case $1 in - -\?|-h|--help) - __usage --no-exit - exit 0 - ;; - -c|--channel|-Channel) - shift - channel="${1:-}" - [ -z "$channel" ] && __usage - ;; - --config-file|-ConfigFile) - shift - config_file="${1:-}" - [ -z "$config_file" ] && __usage - if [ ! -f "$config_file" ]; then - __error "Invalid value for --config-file. $config_file does not exist." - exit 1 - fi - ;; - -d|--dotnet-home|-DotNetHome) - shift - DOTNET_HOME="${1:-}" - [ -z "$DOTNET_HOME" ] && __usage - ;; - --path|-Path) - shift - repo_path="${1:-}" - [ -z "$repo_path" ] && __usage - ;; - -s|--tools-source|-ToolsSource) - shift - tools_source="${1:-}" - [ -z "$tools_source" ] && __usage - ;; - --tools-source-suffix|-ToolsSourceSuffix) - shift - tools_source_suffix="${1:-}" - [ -z "$tools_source_suffix" ] && __usage - ;; - -u|--update|-Update) - update=true - ;; - --verbose|-Verbose) - verbose=true - ;; - --) - shift - break - ;; - *) - break - ;; - esac - shift -done - -if ! __machine_has unzip; then - __error 'Missing required command: unzip' - exit 1 -fi - -if ! __machine_has curl && ! __machine_has wget; then - __error 'Missing required command. Either wget or curl is required.' - exit 1 -fi - -[ -z "${config_file:-}" ] && config_file="$repo_path/korebuild.json" -if [ -f "$config_file" ]; then - if __machine_has jq ; then - if jq '.' "$config_file" >/dev/null ; then - config_channel="$(jq -r 'select(.channel!=null) | .channel' "$config_file")" - config_tools_source="$(jq -r 'select(.toolsSource!=null) | .toolsSource' "$config_file")" - else - __warn "$config_file is invalid JSON. Its settings will be ignored." - fi - elif __machine_has python ; then - if python -c "import json,codecs;obj=json.load(codecs.open('$config_file', 'r', 'utf-8-sig'))" >/dev/null ; then - config_channel="$(python -c "import json,codecs;obj=json.load(codecs.open('$config_file', 'r', 'utf-8-sig'));print(obj['channel'] if 'channel' in obj else '')")" - config_tools_source="$(python -c "import json,codecs;obj=json.load(codecs.open('$config_file', 'r', 'utf-8-sig'));print(obj['toolsSource'] if 'toolsSource' in obj else '')")" - else - __warn "$config_file is invalid JSON. Its settings will be ignored." - fi - else - __warn 'Missing required command: jq or pyton. Could not parse the JSON file. Its settings will be ignored.' - fi - - [ ! -z "${config_channel:-}" ] && channel="$config_channel" - [ ! -z "${config_tools_source:-}" ] && tools_source="$config_tools_source" -fi - -[ -z "$channel" ] && channel='dev' -[ -z "$tools_source" ] && tools_source='https://aspnetcore.blob.core.windows.net/buildtools' - -get_korebuild -set_korebuildsettings "$tools_source" "$DOTNET_HOME" "$repo_path" "$config_file" -invoke_korebuild_command "$command" "$@" diff --git a/src/Microsoft.AspNetCore.Html.Abstractions/HtmlContentBuilder.cs b/src/Html/Abstractions/src/HtmlContentBuilder.cs similarity index 100% rename from src/Microsoft.AspNetCore.Html.Abstractions/HtmlContentBuilder.cs rename to src/Html/Abstractions/src/HtmlContentBuilder.cs diff --git a/src/Microsoft.AspNetCore.Html.Abstractions/HtmlContentBuilderExtensions.cs b/src/Html/Abstractions/src/HtmlContentBuilderExtensions.cs similarity index 100% rename from src/Microsoft.AspNetCore.Html.Abstractions/HtmlContentBuilderExtensions.cs rename to src/Html/Abstractions/src/HtmlContentBuilderExtensions.cs diff --git a/src/Microsoft.AspNetCore.Html.Abstractions/HtmlFormattableString.cs b/src/Html/Abstractions/src/HtmlFormattableString.cs similarity index 100% rename from src/Microsoft.AspNetCore.Html.Abstractions/HtmlFormattableString.cs rename to src/Html/Abstractions/src/HtmlFormattableString.cs diff --git a/src/Microsoft.AspNetCore.Html.Abstractions/HtmlString.cs b/src/Html/Abstractions/src/HtmlString.cs similarity index 100% rename from src/Microsoft.AspNetCore.Html.Abstractions/HtmlString.cs rename to src/Html/Abstractions/src/HtmlString.cs diff --git a/src/Microsoft.AspNetCore.Html.Abstractions/IHtmlContent.cs b/src/Html/Abstractions/src/IHtmlContent.cs similarity index 100% rename from src/Microsoft.AspNetCore.Html.Abstractions/IHtmlContent.cs rename to src/Html/Abstractions/src/IHtmlContent.cs diff --git a/src/Microsoft.AspNetCore.Html.Abstractions/IHtmlContentBuilder.cs b/src/Html/Abstractions/src/IHtmlContentBuilder.cs similarity index 100% rename from src/Microsoft.AspNetCore.Html.Abstractions/IHtmlContentBuilder.cs rename to src/Html/Abstractions/src/IHtmlContentBuilder.cs diff --git a/src/Microsoft.AspNetCore.Html.Abstractions/IHtmlContentContainer.cs b/src/Html/Abstractions/src/IHtmlContentContainer.cs similarity index 100% rename from src/Microsoft.AspNetCore.Html.Abstractions/IHtmlContentContainer.cs rename to src/Html/Abstractions/src/IHtmlContentContainer.cs diff --git a/src/Microsoft.AspNetCore.Html.Abstractions/Microsoft.AspNetCore.Html.Abstractions.csproj b/src/Html/Abstractions/src/Microsoft.AspNetCore.Html.Abstractions.csproj old mode 100755 new mode 100644 similarity index 74% rename from src/Microsoft.AspNetCore.Html.Abstractions/Microsoft.AspNetCore.Html.Abstractions.csproj rename to src/Html/Abstractions/src/Microsoft.AspNetCore.Html.Abstractions.csproj index 271cc6c7fa..f914769d17 --- a/src/Microsoft.AspNetCore.Html.Abstractions/Microsoft.AspNetCore.Html.Abstractions.csproj +++ b/src/Html/Abstractions/src/Microsoft.AspNetCore.Html.Abstractions.csproj @@ -1,8 +1,8 @@  - Microsoft ASP.NET Core ASP.NET Core HTML abstractions used for building HTML content. + Commonly used types: Microsoft.AspNetCore.Html.HtmlString Microsoft.AspNetCore.Html.IHtmlContent @@ -12,7 +12,7 @@ Microsoft.AspNetCore.Html.IHtmlContent - + diff --git a/src/Html/Abstractions/src/Properties/AssemblyInfo.cs b/src/Html/Abstractions/src/Properties/AssemblyInfo.cs new file mode 100644 index 0000000000..cb0b47442c --- /dev/null +++ b/src/Html/Abstractions/src/Properties/AssemblyInfo.cs @@ -0,0 +1,8 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using System.Reflection; +using System.Resources; +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("Microsoft.AspNetCore.Html.Abstractions.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] diff --git a/src/Microsoft.AspNetCore.Html.Abstractions/baseline.netcore.json b/src/Html/Abstractions/src/baseline.netcore.json similarity index 100% rename from src/Microsoft.AspNetCore.Html.Abstractions/baseline.netcore.json rename to src/Html/Abstractions/src/baseline.netcore.json diff --git a/test/Microsoft.AspNetCore.Html.Abstractions.Test/HtmlContentBuilderExtensionsTest.cs b/src/Html/Abstractions/test/HtmlContentBuilderExtensionsTest.cs similarity index 100% rename from test/Microsoft.AspNetCore.Html.Abstractions.Test/HtmlContentBuilderExtensionsTest.cs rename to src/Html/Abstractions/test/HtmlContentBuilderExtensionsTest.cs diff --git a/test/Microsoft.AspNetCore.Html.Abstractions.Test/HtmlContentBuilderTest.cs b/src/Html/Abstractions/test/HtmlContentBuilderTest.cs similarity index 100% rename from test/Microsoft.AspNetCore.Html.Abstractions.Test/HtmlContentBuilderTest.cs rename to src/Html/Abstractions/test/HtmlContentBuilderTest.cs diff --git a/test/Microsoft.AspNetCore.Html.Abstractions.Test/HtmlFormattableStringTest.cs b/src/Html/Abstractions/test/HtmlFormattableStringTest.cs similarity index 100% rename from test/Microsoft.AspNetCore.Html.Abstractions.Test/HtmlFormattableStringTest.cs rename to src/Html/Abstractions/test/HtmlFormattableStringTest.cs diff --git a/src/Html/Abstractions/test/Microsoft.AspNetCore.Html.Abstractions.Tests.csproj b/src/Html/Abstractions/test/Microsoft.AspNetCore.Html.Abstractions.Tests.csproj new file mode 100644 index 0000000000..0e77dbbfb3 --- /dev/null +++ b/src/Html/Abstractions/test/Microsoft.AspNetCore.Html.Abstractions.Tests.csproj @@ -0,0 +1,12 @@ + + + + $(StandardTestTfms) + + + + + + + + diff --git a/src/Microsoft.AspNetCore.Html.Abstractions/Properties/AssemblyInfo.cs b/src/Microsoft.AspNetCore.Html.Abstractions/Properties/AssemblyInfo.cs deleted file mode 100644 index bde0132dbb..0000000000 --- a/src/Microsoft.AspNetCore.Html.Abstractions/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System.Reflection; -using System.Resources; -using System.Runtime.CompilerServices; - -[assembly: InternalsVisibleTo("Microsoft.AspNetCore.Html.Abstractions.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] diff --git a/src/Microsoft.Extensions.WebEncoders/EncoderServiceCollectionExtensions.cs b/src/Microsoft.Extensions.WebEncoders/EncoderServiceCollectionExtensions.cs deleted file mode 100644 index 72f5e369a1..0000000000 --- a/src/Microsoft.Extensions.WebEncoders/EncoderServiceCollectionExtensions.cs +++ /dev/null @@ -1,83 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using System.Text.Encodings.Web; -using Microsoft.Extensions.DependencyInjection.Extensions; -using Microsoft.Extensions.Options; -using Microsoft.Extensions.WebEncoders; - -namespace Microsoft.Extensions.DependencyInjection -{ - /// - /// Extension methods for setting up web encoding services in an . - /// - public static class EncoderServiceCollectionExtensions - { - /// - /// Adds , and - /// to the specified . - /// - /// The . - /// The so that additional calls can be chained. - public static IServiceCollection AddWebEncoders(this IServiceCollection services) - { - if (services == null) - { - throw new ArgumentNullException(nameof(services)); - } - - services.AddOptions(); - - // Register the default encoders - // We want to call the 'Default' property getters lazily since they perform static caching - services.TryAddSingleton( - CreateFactory(() => HtmlEncoder.Default, settings => HtmlEncoder.Create(settings))); - services.TryAddSingleton( - CreateFactory(() => JavaScriptEncoder.Default, settings => JavaScriptEncoder.Create(settings))); - services.TryAddSingleton( - CreateFactory(() => UrlEncoder.Default, settings => UrlEncoder.Create(settings))); - - return services; - } - - /// - /// Adds , and - /// to the specified . - /// - /// The . - /// An to configure the provided . - /// The so that additional calls can be chained. - public static IServiceCollection AddWebEncoders(this IServiceCollection services, Action setupAction) - { - if (services == null) - { - throw new ArgumentNullException(nameof(services)); - } - - if (setupAction == null) - { - throw new ArgumentNullException(nameof(setupAction)); - } - - services.AddWebEncoders(); - services.Configure(setupAction); - - return services; - } - - private static Func CreateFactory( - Func defaultFactory, - Func customSettingsFactory) - { - return serviceProvider => - { - var settings = serviceProvider - ?.GetService>() - ?.Value - ?.TextEncoderSettings; - return (settings != null) ? customSettingsFactory(settings) : defaultFactory(); - }; - } - } -} diff --git a/src/Microsoft.Extensions.WebEncoders/Microsoft.Extensions.WebEncoders.csproj b/src/Microsoft.Extensions.WebEncoders/Microsoft.Extensions.WebEncoders.csproj deleted file mode 100755 index 5e6b3392b5..0000000000 --- a/src/Microsoft.Extensions.WebEncoders/Microsoft.Extensions.WebEncoders.csproj +++ /dev/null @@ -1,19 +0,0 @@ - - - - Microsoft .NET Extensions - Contains registration and configuration APIs to add the core framework encoders to a dependency injection container. - netstandard2.0 - $(NoWarn);CS1591 - true - true - aspnetcore - - - - - - - - - diff --git a/src/Microsoft.Extensions.WebEncoders/Testing/HtmlTestEncoder.cs b/src/Microsoft.Extensions.WebEncoders/Testing/HtmlTestEncoder.cs deleted file mode 100644 index 162ce4f6c1..0000000000 --- a/src/Microsoft.Extensions.WebEncoders/Testing/HtmlTestEncoder.cs +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using System.IO; -using System.Text.Encodings.Web; - -namespace Microsoft.Extensions.WebEncoders.Testing -{ - /// - /// Encoder used for unit testing. - /// - public sealed class HtmlTestEncoder : HtmlEncoder - { - public override int MaxOutputCharactersPerInputCharacter - { - get { return 1; } - } - - public override string Encode(string value) - { - if (value == null) - { - throw new ArgumentNullException(nameof(value)); - } - - if (value.Length == 0) - { - return string.Empty; - } - - return $"HtmlEncode[[{value}]]"; - } - - public override void Encode(TextWriter output, char[] value, int startIndex, int characterCount) - { - if (output == null) - { - throw new ArgumentNullException(nameof(output)); - } - - if (value == null) - { - throw new ArgumentNullException(nameof(value)); - } - - if (characterCount == 0) - { - return; - } - - output.Write("HtmlEncode[["); - output.Write(value, startIndex, characterCount); - output.Write("]]"); - } - - public override void Encode(TextWriter output, string value, int startIndex, int characterCount) - { - if (output == null) - { - throw new ArgumentNullException(nameof(output)); - } - - if (value == null) - { - throw new ArgumentNullException(nameof(value)); - } - - if (characterCount == 0) - { - return; - } - - output.Write("HtmlEncode[["); - output.Write(value.Substring(startIndex, characterCount)); - output.Write("]]"); - } - - public override bool WillEncode(int unicodeScalar) - { - return false; - } - - public override unsafe int FindFirstCharacterToEncode(char* text, int textLength) - { - return -1; - } - - public override unsafe bool TryEncodeUnicodeScalar( - int unicodeScalar, - char* buffer, - int bufferLength, - out int numberOfCharactersWritten) - { - if (buffer == null) - { - throw new ArgumentNullException(nameof(buffer)); - } - - numberOfCharactersWritten = 0; - return false; - } - } -} \ No newline at end of file diff --git a/src/Microsoft.Extensions.WebEncoders/Testing/JavaScriptTestEncoder.cs b/src/Microsoft.Extensions.WebEncoders/Testing/JavaScriptTestEncoder.cs deleted file mode 100644 index bef4461676..0000000000 --- a/src/Microsoft.Extensions.WebEncoders/Testing/JavaScriptTestEncoder.cs +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using System.IO; -using System.Text.Encodings.Web; - -namespace Microsoft.Extensions.WebEncoders.Testing -{ - /// - /// Encoder used for unit testing. - /// - public class JavaScriptTestEncoder : JavaScriptEncoder - { - public override int MaxOutputCharactersPerInputCharacter - { - get { return 1; } - } - - public override string Encode(string value) - { - if (value == null) - { - throw new ArgumentNullException(nameof(value)); - } - - if (value.Length == 0) - { - return string.Empty; - } - - return $"JavaScriptEncode[[{value}]]"; - } - - public override void Encode(TextWriter output, char[] value, int startIndex, int characterCount) - { - if (output == null) - { - throw new ArgumentNullException(nameof(output)); - } - - if (value == null) - { - throw new ArgumentNullException(nameof(value)); - } - - if (characterCount == 0) - { - return; - } - - output.Write("JavaScriptEncode[["); - output.Write(value, startIndex, characterCount); - output.Write("]]"); - } - - public override void Encode(TextWriter output, string value, int startIndex, int characterCount) - { - if (output == null) - { - throw new ArgumentNullException(nameof(output)); - } - - if (value == null) - { - throw new ArgumentNullException(nameof(value)); - } - - if (characterCount == 0) - { - return; - } - - output.Write("JavaScriptEncode[["); - output.Write(value.Substring(startIndex, characterCount)); - output.Write("]]"); - } - - public override bool WillEncode(int unicodeScalar) - { - return false; - } - - public override unsafe int FindFirstCharacterToEncode(char* text, int textLength) - { - return -1; - } - - public override unsafe bool TryEncodeUnicodeScalar( - int unicodeScalar, - char* buffer, - int bufferLength, - out int numberOfCharactersWritten) - { - if (buffer == null) - { - throw new ArgumentNullException(nameof(buffer)); - } - - numberOfCharactersWritten = 0; - return false; - } - } -} \ No newline at end of file diff --git a/src/Microsoft.Extensions.WebEncoders/Testing/UrlTestEncoder.cs b/src/Microsoft.Extensions.WebEncoders/Testing/UrlTestEncoder.cs deleted file mode 100644 index 295bda63e8..0000000000 --- a/src/Microsoft.Extensions.WebEncoders/Testing/UrlTestEncoder.cs +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using System.IO; -using System.Text.Encodings.Web; - -namespace Microsoft.Extensions.WebEncoders.Testing -{ - /// - /// Encoder used for unit testing. - /// - public class UrlTestEncoder : UrlEncoder - { - public override int MaxOutputCharactersPerInputCharacter - { - get { return 1; } - } - - public override string Encode(string value) - { - if (value == null) - { - throw new ArgumentNullException(nameof(value)); - } - - if (value.Length == 0) - { - return string.Empty; - } - - return $"UrlEncode[[{value}]]"; - } - - public override void Encode(TextWriter output, char[] value, int startIndex, int characterCount) - { - if (output == null) - { - throw new ArgumentNullException(nameof(output)); - } - - if (value == null) - { - throw new ArgumentNullException(nameof(value)); - } - - if (characterCount == 0) - { - return; - } - - output.Write("UrlEncode[["); - output.Write(value, startIndex, characterCount); - output.Write("]]"); - } - - public override void Encode(TextWriter output, string value, int startIndex, int characterCount) - { - if (output == null) - { - throw new ArgumentNullException(nameof(output)); - } - - if (value == null) - { - throw new ArgumentNullException(nameof(value)); - } - - if (characterCount == 0) - { - return; - } - - output.Write("UrlEncode[["); - output.Write(value.Substring(startIndex, characterCount)); - output.Write("]]"); - } - - public override bool WillEncode(int unicodeScalar) - { - return false; - } - - public override unsafe int FindFirstCharacterToEncode(char* text, int textLength) - { - return -1; - } - - public override unsafe bool TryEncodeUnicodeScalar( - int unicodeScalar, - char* buffer, - int bufferLength, - out int numberOfCharactersWritten) - { - if (buffer == null) - { - throw new ArgumentNullException(nameof(buffer)); - } - - numberOfCharactersWritten = 0; - return false; - } - } -} \ No newline at end of file diff --git a/src/Microsoft.Extensions.WebEncoders/WebEncoderOptions.cs b/src/Microsoft.Extensions.WebEncoders/WebEncoderOptions.cs deleted file mode 100644 index 2f5e770a0c..0000000000 --- a/src/Microsoft.Extensions.WebEncoders/WebEncoderOptions.cs +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System.Text.Encodings.Web; - -namespace Microsoft.Extensions.WebEncoders -{ - /// - /// Specifies options common to all three encoders (HtmlEncode, JavaScriptEncode, UrlEncode). - /// - public sealed class WebEncoderOptions - { - /// - /// Specifies which code points are allowed to be represented unescaped by the encoders. - /// - /// - /// If this property is null, then the encoders will use their default allow lists. - /// - public TextEncoderSettings TextEncoderSettings { get; set; } - } -} diff --git a/src/Microsoft.Extensions.WebEncoders/baseline.netcore.json b/src/Microsoft.Extensions.WebEncoders/baseline.netcore.json deleted file mode 100644 index 6da0ae0754..0000000000 --- a/src/Microsoft.Extensions.WebEncoders/baseline.netcore.json +++ /dev/null @@ -1,564 +0,0 @@ -{ - "AssemblyIdentity": "Microsoft.Extensions.WebEncoders, Version=2.1.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60", - "Types": [ - { - "Name": "Microsoft.Extensions.WebEncoders.WebEncoderOptions", - "Visibility": "Public", - "Kind": "Class", - "Sealed": true, - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "get_TextEncoderSettings", - "Parameters": [], - "ReturnType": "System.Text.Encodings.Web.TextEncoderSettings", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_TextEncoderSettings", - "Parameters": [ - { - "Name": "value", - "Type": "System.Text.Encodings.Web.TextEncoderSettings" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.Extensions.WebEncoders.Testing.HtmlTestEncoder", - "Visibility": "Public", - "Kind": "Class", - "Sealed": true, - "BaseType": "System.Text.Encodings.Web.HtmlEncoder", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "get_MaxOutputCharactersPerInputCharacter", - "Parameters": [], - "ReturnType": "System.Int32", - "Virtual": true, - "Override": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "Encode", - "Parameters": [ - { - "Name": "value", - "Type": "System.String" - } - ], - "ReturnType": "System.String", - "Virtual": true, - "Override": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "Encode", - "Parameters": [ - { - "Name": "output", - "Type": "System.IO.TextWriter" - }, - { - "Name": "value", - "Type": "System.Char[]" - }, - { - "Name": "startIndex", - "Type": "System.Int32" - }, - { - "Name": "characterCount", - "Type": "System.Int32" - } - ], - "ReturnType": "System.Void", - "Virtual": true, - "Override": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "Encode", - "Parameters": [ - { - "Name": "output", - "Type": "System.IO.TextWriter" - }, - { - "Name": "value", - "Type": "System.String" - }, - { - "Name": "startIndex", - "Type": "System.Int32" - }, - { - "Name": "characterCount", - "Type": "System.Int32" - } - ], - "ReturnType": "System.Void", - "Virtual": true, - "Override": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "WillEncode", - "Parameters": [ - { - "Name": "unicodeScalar", - "Type": "System.Int32" - } - ], - "ReturnType": "System.Boolean", - "Virtual": true, - "Override": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "FindFirstCharacterToEncode", - "Parameters": [ - { - "Name": "text", - "Type": "System.Char*" - }, - { - "Name": "textLength", - "Type": "System.Int32" - } - ], - "ReturnType": "System.Int32", - "Virtual": true, - "Override": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "TryEncodeUnicodeScalar", - "Parameters": [ - { - "Name": "unicodeScalar", - "Type": "System.Int32" - }, - { - "Name": "buffer", - "Type": "System.Char*" - }, - { - "Name": "bufferLength", - "Type": "System.Int32" - }, - { - "Name": "numberOfCharactersWritten", - "Type": "System.Int32", - "Direction": "Out" - } - ], - "ReturnType": "System.Boolean", - "Virtual": true, - "Override": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.Extensions.WebEncoders.Testing.JavaScriptTestEncoder", - "Visibility": "Public", - "Kind": "Class", - "BaseType": "System.Text.Encodings.Web.JavaScriptEncoder", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "get_MaxOutputCharactersPerInputCharacter", - "Parameters": [], - "ReturnType": "System.Int32", - "Virtual": true, - "Override": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "Encode", - "Parameters": [ - { - "Name": "value", - "Type": "System.String" - } - ], - "ReturnType": "System.String", - "Virtual": true, - "Override": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "Encode", - "Parameters": [ - { - "Name": "output", - "Type": "System.IO.TextWriter" - }, - { - "Name": "value", - "Type": "System.Char[]" - }, - { - "Name": "startIndex", - "Type": "System.Int32" - }, - { - "Name": "characterCount", - "Type": "System.Int32" - } - ], - "ReturnType": "System.Void", - "Virtual": true, - "Override": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "Encode", - "Parameters": [ - { - "Name": "output", - "Type": "System.IO.TextWriter" - }, - { - "Name": "value", - "Type": "System.String" - }, - { - "Name": "startIndex", - "Type": "System.Int32" - }, - { - "Name": "characterCount", - "Type": "System.Int32" - } - ], - "ReturnType": "System.Void", - "Virtual": true, - "Override": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "WillEncode", - "Parameters": [ - { - "Name": "unicodeScalar", - "Type": "System.Int32" - } - ], - "ReturnType": "System.Boolean", - "Virtual": true, - "Override": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "FindFirstCharacterToEncode", - "Parameters": [ - { - "Name": "text", - "Type": "System.Char*" - }, - { - "Name": "textLength", - "Type": "System.Int32" - } - ], - "ReturnType": "System.Int32", - "Virtual": true, - "Override": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "TryEncodeUnicodeScalar", - "Parameters": [ - { - "Name": "unicodeScalar", - "Type": "System.Int32" - }, - { - "Name": "buffer", - "Type": "System.Char*" - }, - { - "Name": "bufferLength", - "Type": "System.Int32" - }, - { - "Name": "numberOfCharactersWritten", - "Type": "System.Int32", - "Direction": "Out" - } - ], - "ReturnType": "System.Boolean", - "Virtual": true, - "Override": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.Extensions.WebEncoders.Testing.UrlTestEncoder", - "Visibility": "Public", - "Kind": "Class", - "BaseType": "System.Text.Encodings.Web.UrlEncoder", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "get_MaxOutputCharactersPerInputCharacter", - "Parameters": [], - "ReturnType": "System.Int32", - "Virtual": true, - "Override": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "Encode", - "Parameters": [ - { - "Name": "value", - "Type": "System.String" - } - ], - "ReturnType": "System.String", - "Virtual": true, - "Override": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "Encode", - "Parameters": [ - { - "Name": "output", - "Type": "System.IO.TextWriter" - }, - { - "Name": "value", - "Type": "System.Char[]" - }, - { - "Name": "startIndex", - "Type": "System.Int32" - }, - { - "Name": "characterCount", - "Type": "System.Int32" - } - ], - "ReturnType": "System.Void", - "Virtual": true, - "Override": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "Encode", - "Parameters": [ - { - "Name": "output", - "Type": "System.IO.TextWriter" - }, - { - "Name": "value", - "Type": "System.String" - }, - { - "Name": "startIndex", - "Type": "System.Int32" - }, - { - "Name": "characterCount", - "Type": "System.Int32" - } - ], - "ReturnType": "System.Void", - "Virtual": true, - "Override": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "WillEncode", - "Parameters": [ - { - "Name": "unicodeScalar", - "Type": "System.Int32" - } - ], - "ReturnType": "System.Boolean", - "Virtual": true, - "Override": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "FindFirstCharacterToEncode", - "Parameters": [ - { - "Name": "text", - "Type": "System.Char*" - }, - { - "Name": "textLength", - "Type": "System.Int32" - } - ], - "ReturnType": "System.Int32", - "Virtual": true, - "Override": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "TryEncodeUnicodeScalar", - "Parameters": [ - { - "Name": "unicodeScalar", - "Type": "System.Int32" - }, - { - "Name": "buffer", - "Type": "System.Char*" - }, - { - "Name": "bufferLength", - "Type": "System.Int32" - }, - { - "Name": "numberOfCharactersWritten", - "Type": "System.Int32", - "Direction": "Out" - } - ], - "ReturnType": "System.Boolean", - "Virtual": true, - "Override": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.Extensions.DependencyInjection.EncoderServiceCollectionExtensions", - "Visibility": "Public", - "Kind": "Class", - "Abstract": true, - "Static": true, - "Sealed": true, - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "AddWebEncoders", - "Parameters": [ - { - "Name": "services", - "Type": "Microsoft.Extensions.DependencyInjection.IServiceCollection" - } - ], - "ReturnType": "Microsoft.Extensions.DependencyInjection.IServiceCollection", - "Static": true, - "Extension": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "AddWebEncoders", - "Parameters": [ - { - "Name": "services", - "Type": "Microsoft.Extensions.DependencyInjection.IServiceCollection" - }, - { - "Name": "setupAction", - "Type": "System.Action" - } - ], - "ReturnType": "Microsoft.Extensions.DependencyInjection.IServiceCollection", - "Static": true, - "Extension": true, - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - } - ] -} \ No newline at end of file diff --git a/test/Directory.Build.props b/test/Directory.Build.props deleted file mode 100644 index 0b706cbca5..0000000000 --- a/test/Directory.Build.props +++ /dev/null @@ -1,17 +0,0 @@ - - - - - netcoreapp2.1 - $(DeveloperBuildTestTfms) - netcoreapp2.1;netcoreapp2.0 - $(StandardTestTfms);net461 - - - - - - - - - diff --git a/test/Microsoft.AspNetCore.Html.Abstractions.Test/Microsoft.AspNetCore.Html.Abstractions.Test.csproj b/test/Microsoft.AspNetCore.Html.Abstractions.Test/Microsoft.AspNetCore.Html.Abstractions.Test.csproj deleted file mode 100755 index 1577693497..0000000000 --- a/test/Microsoft.AspNetCore.Html.Abstractions.Test/Microsoft.AspNetCore.Html.Abstractions.Test.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - $(StandardTestTfms) - - - - - - - - diff --git a/test/Microsoft.Extensions.WebEncoders.Tests/EncoderServiceCollectionExtensionsTests.cs b/test/Microsoft.Extensions.WebEncoders.Tests/EncoderServiceCollectionExtensionsTests.cs deleted file mode 100644 index 0178bba2d5..0000000000 --- a/test/Microsoft.Extensions.WebEncoders.Tests/EncoderServiceCollectionExtensionsTests.cs +++ /dev/null @@ -1,90 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System.Text.Encodings.Web; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.WebEncoders.Testing; -using Xunit; - -namespace Microsoft.Extensions.WebEncoders -{ - public class EncoderServiceCollectionExtensionsTests - { - [Fact] - public void AddWebEncoders_WithoutOptions_RegistersDefaultEncoders() - { - // Arrange - var serviceCollection = new ServiceCollection(); - - // Act - serviceCollection.AddWebEncoders(); - - // Assert - var serviceProvider = serviceCollection.BuildServiceProvider(); - Assert.Same(HtmlEncoder.Default, serviceProvider.GetRequiredService()); // default encoder - Assert.Same(HtmlEncoder.Default, serviceProvider.GetRequiredService()); // as singleton instance - Assert.Same(JavaScriptEncoder.Default, serviceProvider.GetRequiredService()); // default encoder - Assert.Same(JavaScriptEncoder.Default, serviceProvider.GetRequiredService()); // as singleton instance - Assert.Same(UrlEncoder.Default, serviceProvider.GetRequiredService()); // default encoder - Assert.Same(UrlEncoder.Default, serviceProvider.GetRequiredService()); // as singleton instance - } - - [Fact] - public void AddWebEncoders_WithOptions_RegistersEncodersWithCustomCodeFilter() - { - // Arrange - var serviceCollection = new ServiceCollection(); - - // Act - serviceCollection.AddWebEncoders(options => - { - options.TextEncoderSettings = new TextEncoderSettings(); - options.TextEncoderSettings.AllowCharacters("ace".ToCharArray()); // only these three chars are allowed - }); - - // Assert - var serviceProvider = serviceCollection.BuildServiceProvider(); - - var htmlEncoder = serviceProvider.GetRequiredService(); - Assert.Equal("abcde", htmlEncoder.Encode("abcde")); - Assert.Same(htmlEncoder, serviceProvider.GetRequiredService()); // as singleton instance - - var javaScriptEncoder = serviceProvider.GetRequiredService(); - Assert.Equal(@"a\u0062c\u0064e", javaScriptEncoder.Encode("abcde")); - Assert.Same(javaScriptEncoder, serviceProvider.GetRequiredService()); // as singleton instance - - var urlEncoder = serviceProvider.GetRequiredService(); - Assert.Equal("a%62c%64e", urlEncoder.Encode("abcde")); - Assert.Same(urlEncoder, serviceProvider.GetRequiredService()); // as singleton instance - } - - [Fact] - public void AddWebEncoders_DoesNotOverrideExistingRegisteredEncoders() - { - // Arrange - var serviceCollection = new ServiceCollection(); - - // Act - serviceCollection.AddSingleton(); - serviceCollection.AddSingleton(); - // we don't register an existing URL encoder - serviceCollection.AddWebEncoders(options => - { - options.TextEncoderSettings = new TextEncoderSettings(); - options.TextEncoderSettings.AllowCharacters("ace".ToCharArray()); // only these three chars are allowed - }); - - // Assert - var serviceProvider = serviceCollection.BuildServiceProvider(); - - var htmlEncoder = serviceProvider.GetRequiredService(); - Assert.Equal("HtmlEncode[[abcde]]", htmlEncoder.Encode("abcde")); - - var javaScriptEncoder = serviceProvider.GetRequiredService(); - Assert.Equal("JavaScriptEncode[[abcde]]", javaScriptEncoder.Encode("abcde")); - - var urlEncoder = serviceProvider.GetRequiredService(); - Assert.Equal("a%62c%64e", urlEncoder.Encode("abcde")); - } - } -} diff --git a/test/Microsoft.Extensions.WebEncoders.Tests/HtmlTestEncoderTest.cs b/test/Microsoft.Extensions.WebEncoders.Tests/HtmlTestEncoderTest.cs deleted file mode 100644 index baafedc4de..0000000000 --- a/test/Microsoft.Extensions.WebEncoders.Tests/HtmlTestEncoderTest.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using Xunit; - -namespace Microsoft.Extensions.WebEncoders.Testing -{ - public class HtmlTestEncoderTest - { - [Theory] - [InlineData("", "")] - [InlineData("abcd", "HtmlEncode[[abcd]]")] - [InlineData("<<''\"\">>", "HtmlEncode[[<<''\"\">>]]")] - public void StringEncode_EncodesAsExpected(string input, string expectedOutput) - { - // Arrange - var encoder = new HtmlTestEncoder(); - - // Act - var output = encoder.Encode(input); - - // Assert - Assert.Equal(expectedOutput, output); - } - } -} diff --git a/test/Microsoft.Extensions.WebEncoders.Tests/Microsoft.Extensions.WebEncoders.Tests.csproj b/test/Microsoft.Extensions.WebEncoders.Tests/Microsoft.Extensions.WebEncoders.Tests.csproj deleted file mode 100755 index 247ccd19b3..0000000000 --- a/test/Microsoft.Extensions.WebEncoders.Tests/Microsoft.Extensions.WebEncoders.Tests.csproj +++ /dev/null @@ -1,15 +0,0 @@ - - - - $(StandardTestTfms) - - - - - - - - - - - diff --git a/version.props b/version.props deleted file mode 100644 index 669c874829..0000000000 --- a/version.props +++ /dev/null @@ -1,12 +0,0 @@ - - - 2.1.1 - rtm - $(VersionPrefix) - $(VersionPrefix)-$(VersionSuffix)-final - t000 - a- - $(FeatureBranchVersionPrefix)$(VersionSuffix)-$([System.Text.RegularExpressions.Regex]::Replace('$(FeatureBranchVersionSuffix)', '[^\w-]', '-')) - $(VersionSuffix)-$(BuildNumber) - -