diff --git a/.azure/pipelines/ci.yml b/.azure/pipelines/ci.yml
index 755ffe182e..00d95c3a1d 100644
--- a/.azure/pipelines/ci.yml
+++ b/.azure/pipelines/ci.yml
@@ -17,6 +17,10 @@ pr:
include:
- '*'
+variables:
+- name: DOTNET_SKIP_FIRST_TIME_EXPERIENCE
+ value: true
+
jobs:
- template: jobs/default-build.yml
parameters:
@@ -46,14 +50,14 @@ jobs:
# if they have already been signed. This results in slower builds due to re-submitting the same .nupkg many times for signing.
# The sign settings have been configured to
- - script: ./eng/scripts/cibuild.cmd -arch x64 /p:DisableCodeSigning=true /bl:artifacts/log/build.x64.binlog
+ - script: ./eng/scripts/cibuild.cmd -BuildNative -arch x64 /p:DisableCodeSigning=true /bl:artifacts/log/build.x64.binlog
displayName: Build x64
# TODO: make it possible to build for one Windows architecture at a time
# This is going to actually build x86 native assets. See https://github.com/aspnet/AspNetCore/issues/7196
# Build the x86 shared framework
# Set DisableSignCheck because we'll run sign check in an explicit step after installers build
- - script: ./eng/scripts/cibuild.cmd -arch x86 -NoRestore /t:BuildSharedFx /p:DisableCodeSigning=true /bl:artifacts/log/build.x86.binlog
+ - script: ./eng/scripts/cibuild.cmd -arch x86 -NoRestore -BuildNative /t:BuildSharedFx /p:DisableCodeSigning=true /bl:artifacts/log/build.x86.binlog
displayName: Build x86
# This is in a separate build step with -forceCoreMsbuild to workaround MAX_PATH limitations - https://github.com/Microsoft/msbuild/issues/53
@@ -324,7 +328,7 @@ jobs:
agentOs: Windows
isTestingJob: true
buildScript: ./eng/scripts/cibuild.cmd
- buildArgs: -test "/p:SkipIISBackwardsCompatibilityTests=true /p:SkipIISTests=true /p:SkipIISExpressTests=true /p:SkipIISForwardsCompatibilityTests=true /p:RunTemplateTests=false /p:BuildSiteExtensions=false"
+ buildArgs: -test -BuildNative "/p:SkipIISBackwardsCompatibilityTests=true /p:SkipIISTests=true /p:SkipIISExpressTests=true /p:SkipIISForwardsCompatibilityTests=true /p:RunTemplateTests=false /p:BuildSiteExtensions=false"
beforeBuild:
- powershell: "& ./src/Servers/IIS/tools/UpdateIISExpressCertificate.ps1; & ./src/Servers/IIS/tools/update_schema.ps1"
displayName: Setup IISExpress test certificates and schema
diff --git a/.azure/pipelines/helix-test.yml b/.azure/pipelines/helix-test.yml
index 1740ceb6cb..1b512109b1 100644
--- a/.azure/pipelines/helix-test.yml
+++ b/.azure/pipelines/helix-test.yml
@@ -15,7 +15,7 @@ jobs:
agentOs: Windows
timeoutInMinutes: 240
steps:
- - script: .\build.cmd -all -ci /t:Helix /p:IsHelixJob=true /bl:$env:BUILD_SOURCESDIRECTORY\artifacts\log\SendToHelix.binlog
+ - script: .\build.cmd -all -ci /p:BuildNative=true /t:Helix /p:IsHelixJob=true /bl:$env:BUILD_SOURCESDIRECTORY\artifacts\log\SendToHelix.binlog
displayName: Run build.cmd helix target
env:
SYSTEM_ACCESSTOKEN: $(System.AccessToken) # We need to set this env var to publish helix results to Azure Dev Ops
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index efbfe08ee4..222522b092 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -28,6 +28,12 @@ Our team members also monitor several other discussion forums:
## Contributing code and content
+We accept fixes and features! Here are some resources to help you get started on how to contribute code or new content.
+
+* Look at the [Contributor documentation](/docs/) to get started on building the source code on your own.
+* ["Help wanted" issues](https://github.com/aspnet/AspNetCore/labels/help%20wanted) - these issues are up for grabs. Comment on an issue if you want to create a fix.
+* ["Good first issue" issues](https://github.com/aspnet/AspNetCore/labels/good%20first%20issue) - we think these are a good for newcomers.
+
### Identifying the scale
If you would like to contribute to one of our repositories, first identify the scale of what you would like to contribute. If it is small (grammar/spelling or a bug fix) feel free to start working on a fix. If you are submitting a feature or substantial code contribution, please discuss it with the team and ensure it follows the product roadmap. You might also read these two blogs posts on contributing code: [Open Source Contribution Etiquette](http://tirania.org/blog/archive/2010/Dec-31.html) by Miguel de Icaza and [Don't "Push" Your Pull Requests](https://www.igvita.com/2011/12/19/dont-push-your-pull-requests/) by Ilya Grigorik. All code submissions will be rigorously reviewed and tested by the ASP.NET and Entity Framework teams, and only those that meet an extremely high bar for both quality and design/roadmap appropriateness will be merged into the source.
diff --git a/Directory.Build.props b/Directory.Build.props
index 8b002c635e..3331e894f6 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -1,6 +1,15 @@
+
+
+
+
+
Microsoft ASP.NET Core
@@ -121,7 +130,6 @@
$(MSBuildProjectName)-ref
-
@@ -190,7 +198,7 @@
$(MSBuildThisFileDirectory)src\Mvc\Mvc.Testing\src\Microsoft.AspNetCore.Mvc.Testing.targets
- true
+ true
$(ArtifactsObjDir)TargetingPack.Layout\$(Configuration)\
diff --git a/Directory.Build.targets b/Directory.Build.targets
index 212c9878c2..2486a20a85 100644
--- a/Directory.Build.targets
+++ b/Directory.Build.targets
@@ -81,9 +81,12 @@
- $(MicrosoftNETCoreAppPackageVersion)
- $(MicrosoftNETCoreAppPackageVersion)
- $(MicrosoftNETCoreAppPackageVersion)
+
+ $(MicrosoftNETCoreAppPackageVersion)
+
+ $(MicrosoftNETCoreAppPackageVersion)
+
+ $(MicrosoftNETCoreAppPackageVersion)
@@ -95,6 +98,10 @@
$(SharedFxVersion)
+
+ $(NETStandardLibraryRefPackageVersion)
+
+
diff --git a/SECURITY.md b/SECURITY.md
new file mode 100644
index 0000000000..92d052767f
--- /dev/null
+++ b/SECURITY.md
@@ -0,0 +1,15 @@
+# Security Policy
+
+## Supported Versions
+
+The .NET Core and ASP.NET Core support policy, including supported versions can be found at the [.NET Core Support Policy Page](https://dotnet.microsoft.com/platform/support/policy/dotnet-core).
+
+## Reporting a Vulnerability
+
+Security issues and bugs should be reported privately, via email, to the Microsoft Security Response Center (MSRC) secure@microsoft.com.
+You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your
+original message. Further information, including the MSRC PGP key, can be found in the [Security TechCenter](https://technet.microsoft.com/en-us/security/ff852094.aspx).
+
+Reports via MSRC may qualify for the .NET Core Bug Bounty. Details of the .NET Core Bug Bounty including terms and conditions are at [https://aka.ms/corebounty](https://aka.ms/corebounty).
+
+Please do not open issues for anything you think might have a security implication.
diff --git a/build.ps1 b/build.ps1
index b382ae3867..726946a89b 100644
--- a/build.ps1
+++ b/build.ps1
@@ -258,13 +258,12 @@ elseif ($Projects) {
}
# When adding new sub-group build flags, add them to this check.
elseif((-not $BuildNative) -and (-not $BuildManaged) -and (-not $BuildNodeJS) -and (-not $BuildInstallers) -and (-not $BuildJava)) {
- Write-Warning "No default group of projects was specified, so building the 'managed' and 'native' subsets of projects. Run ``build.cmd -help`` for more details."
+ Write-Warning "No default group of projects was specified, so building the 'managed' subsets of projects. Run ``build.cmd -help`` for more details."
# This goal of this is to pick a sensible default for `build.cmd` with zero arguments.
# Now that we support subfolder invokations of build.cmd, we will be pushing to have build.cmd build everything (-all) by default
$BuildManaged = $true
- $BuildNative = $true
}
if ($BuildInstallers) { $MSBuildArguments += "/p:BuildInstallers=true" }
diff --git a/build/repo.props b/build/repo.props
index 4282500c14..681ba52b0a 100644
--- a/build/repo.props
+++ b/build/repo.props
@@ -3,6 +3,13 @@
$(TargetOsName)-$(TargetArchitecture)
+
+ true
+ true
+ true
+ true
+
+
true
@@ -27,13 +34,7 @@
true
$(RepoRoot)src\Shared\
-
-
-
- true
- true
- true
- true
+ true
diff --git a/build/sources.props b/build/sources.props
index 26d8be6677..decee683d3 100644
--- a/build/sources.props
+++ b/build/sources.props
@@ -10,10 +10,12 @@
$(RestoreSources);
+ https://dotnetfeed.blob.core.windows.net/aspnet-blazor/index.json;
https://dotnetfeed.blob.core.windows.net/aspnet-extensions/index.json;
https://dotnetfeed.blob.core.windows.net/aspnet-entityframeworkcore/index.json;
https://dotnetfeed.blob.core.windows.net/aspnet-aspnetcore-tooling/index.json;
https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json;
+ https://dotnet.myget.org/F/roslyn/api/v3/index.json;
https://grpc.jfrog.io/grpc/api/nuget/v3/grpc-nuget-dev;
https://api.nuget.org/v3/index.json;
@@ -27,11 +29,6 @@
$(RestoreSources);
https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json;
-
-
- $(RestoreSources);
- https://dotnet.myget.org/F/blazor-dev/api/v3/index.json;
-
https://dotnetcli.blob.core.windows.net/dotnet/
diff --git a/docs/DailyBuilds.md b/docs/DailyBuilds.md
index 08ff052f20..9438aba917 100644
--- a/docs/DailyBuilds.md
+++ b/docs/DailyBuilds.md
@@ -33,4 +33,4 @@ These are available in the [Visual Studio Preview](https://www.visualstudio.com/
* *Enable Source Link support* in Visual Studio should be enabled.
* *Enable source server support* in Visual should be enabled.
* *Enable Just My Code* should be disabled
-* Add https://dotnet.myget.org/F/aspnetcore-dev/symbols to the list of symbol servers in the Visual Studio Debugging options
+* Under Symbols enable the *Microsoft Symbol Servers* setting.
diff --git a/eng/GenAPI.exclusions.txt b/eng/GenAPI.exclusions.txt
index 4595fc772a..3053eb79e1 100644
--- a/eng/GenAPI.exclusions.txt
+++ b/eng/GenAPI.exclusions.txt
@@ -5,6 +5,7 @@ T:Microsoft.AspNetCore.Mvc.ApplicationModels.PageParameterModel
T:Microsoft.AspNetCore.Mvc.ApplicationModels.PagePropertyModel
# Manually implemented - https://github.com/aspnet/AspNetCore/issues/8825
T:Microsoft.AspNetCore.Components.AuthorizeView
+T:Microsoft.AspNetCore.Components.AuthorizeViewCore
T:Microsoft.AspNetCore.Components.CascadingAuthenticationState
T:Microsoft.AspNetCore.Components.CascadingValue`1
T:Microsoft.AspNetCore.Components.Forms.DataAnnotationsValidator
@@ -18,6 +19,6 @@ T:Microsoft.AspNetCore.Components.Forms.InputText
T:Microsoft.AspNetCore.Components.Forms.InputTextArea
T:Microsoft.AspNetCore.Components.Forms.ValidationMessage`1
T:Microsoft.AspNetCore.Components.Forms.ValidationSummary
-T:Microsoft.AspNetCore.Components.Layouts.LayoutDisplay
+T:Microsoft.AspNetCore.Components.PageDisplay
T:Microsoft.AspNetCore.Components.Routing.NavLink
T:Microsoft.AspNetCore.Components.Routing.Router
\ No newline at end of file
diff --git a/eng/ProjectReferences.props b/eng/ProjectReferences.props
index fa3ee5688b..d7b785a06f 100644
--- a/eng/ProjectReferences.props
+++ b/eng/ProjectReferences.props
@@ -8,7 +8,7 @@
-
+
@@ -54,9 +54,9 @@
-
+
diff --git a/eng/PublishSymbols.proj b/eng/PublishSymbols.proj
new file mode 100644
index 0000000000..dd2c968566
--- /dev/null
+++ b/eng/PublishSymbols.proj
@@ -0,0 +1,62 @@
+
+
+
+ netcoreapp3.0
+ true
+ artifacts\manifests\
+ true
+
+
+ 3650
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/eng/SharedFramework.External.props b/eng/SharedFramework.External.props
index d735b0764f..e894b2f988 100644
--- a/eng/SharedFramework.External.props
+++ b/eng/SharedFramework.External.props
@@ -83,7 +83,7 @@
These compilation references are necessary to compile netstandard2.0 assemblies which are in the shared framework.
This references are part of Microsoft.NETCore.App, so are listed here as references to be used during compilation only.
-->
-
+
<_CompilationOnlyReference Include="System.Buffers" />
<_CompilationOnlyReference Include="System.ComponentModel.Annotations" />
<_CompilationOnlyReference Include="System.Runtime.CompilerServices.Unsafe" />
diff --git a/eng/SharedFramework.Local.props b/eng/SharedFramework.Local.props
index 2c605f63cd..065172aad2 100644
--- a/eng/SharedFramework.Local.props
+++ b/eng/SharedFramework.Local.props
@@ -9,7 +9,9 @@
+
+
@@ -33,7 +35,6 @@
-
@@ -46,12 +47,10 @@
-
-
diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml
index fc32cbe01a..5dc1c2282c 100644
--- a/eng/Version.Details.xml
+++ b/eng/Version.Details.xml
@@ -9,392 +9,404 @@
-->
-
+
+ https://github.com/aspnet/Blazor
+ 9bc8036bf68fd159fffa56f93f8b2471bf96efd4
+
+
https://github.com/aspnet/AspNetCore-Tooling
- 62e33dac1d5ec88ab15d7af694c1adf29ffc4c59
+ 0156446a321deedadd175bdb32c8d1526be5f28d
-
+
https://github.com/aspnet/AspNetCore-Tooling
- 62e33dac1d5ec88ab15d7af694c1adf29ffc4c59
+ 0156446a321deedadd175bdb32c8d1526be5f28d
-
+
https://github.com/aspnet/AspNetCore-Tooling
- 62e33dac1d5ec88ab15d7af694c1adf29ffc4c59
+ 0156446a321deedadd175bdb32c8d1526be5f28d
-
+
https://github.com/aspnet/AspNetCore-Tooling
- 62e33dac1d5ec88ab15d7af694c1adf29ffc4c59
+ 0156446a321deedadd175bdb32c8d1526be5f28d
-
+
https://github.com/aspnet/EntityFrameworkCore
- 08edd86216be4857b45b47bf0a9b29e98e525c05
+ fd63251e1941070438c27577ed6b0068e33a139a
-
+
https://github.com/aspnet/EntityFrameworkCore
- 08edd86216be4857b45b47bf0a9b29e98e525c05
+ fd63251e1941070438c27577ed6b0068e33a139a
-
+
https://github.com/aspnet/EntityFrameworkCore
- 08edd86216be4857b45b47bf0a9b29e98e525c05
+ fd63251e1941070438c27577ed6b0068e33a139a
-
+
https://github.com/aspnet/EntityFrameworkCore
- 08edd86216be4857b45b47bf0a9b29e98e525c05
+ fd63251e1941070438c27577ed6b0068e33a139a
-
+
https://github.com/aspnet/EntityFrameworkCore
- 08edd86216be4857b45b47bf0a9b29e98e525c05
+ fd63251e1941070438c27577ed6b0068e33a139a
-
+
https://github.com/aspnet/EntityFrameworkCore
- 08edd86216be4857b45b47bf0a9b29e98e525c05
+ fd63251e1941070438c27577ed6b0068e33a139a
-
+
https://github.com/aspnet/EntityFrameworkCore
- 08edd86216be4857b45b47bf0a9b29e98e525c05
+ fd63251e1941070438c27577ed6b0068e33a139a
-
+
https://github.com/aspnet/Extensions
- 8dfb4ece7ca9a6dea14264dafc38a0c953874559
+ bfea1edf9e2e9a5465f331517149c4f543ac2ba6
-
+
https://github.com/aspnet/Extensions
- 8dfb4ece7ca9a6dea14264dafc38a0c953874559
+ bfea1edf9e2e9a5465f331517149c4f543ac2ba6
-
+
https://github.com/aspnet/Extensions
- 8dfb4ece7ca9a6dea14264dafc38a0c953874559
+ bfea1edf9e2e9a5465f331517149c4f543ac2ba6
-
+
https://github.com/aspnet/Extensions
- 8dfb4ece7ca9a6dea14264dafc38a0c953874559
+ bfea1edf9e2e9a5465f331517149c4f543ac2ba6
-
+
https://github.com/aspnet/Extensions
- 8dfb4ece7ca9a6dea14264dafc38a0c953874559
+ bfea1edf9e2e9a5465f331517149c4f543ac2ba6
-
+
https://github.com/aspnet/Extensions
- 8dfb4ece7ca9a6dea14264dafc38a0c953874559
+ bfea1edf9e2e9a5465f331517149c4f543ac2ba6
-
+
https://github.com/aspnet/Extensions
- 8dfb4ece7ca9a6dea14264dafc38a0c953874559
+ bfea1edf9e2e9a5465f331517149c4f543ac2ba6
-
+
https://github.com/aspnet/Extensions
- 8dfb4ece7ca9a6dea14264dafc38a0c953874559
+ bfea1edf9e2e9a5465f331517149c4f543ac2ba6
-
+
https://github.com/aspnet/Extensions
- 8dfb4ece7ca9a6dea14264dafc38a0c953874559
+ bfea1edf9e2e9a5465f331517149c4f543ac2ba6
-
+
https://github.com/aspnet/Extensions
- 8dfb4ece7ca9a6dea14264dafc38a0c953874559
+ bfea1edf9e2e9a5465f331517149c4f543ac2ba6
-
+
https://github.com/aspnet/Extensions
- 8dfb4ece7ca9a6dea14264dafc38a0c953874559
+ bfea1edf9e2e9a5465f331517149c4f543ac2ba6
-
+
https://github.com/aspnet/Extensions
- 8dfb4ece7ca9a6dea14264dafc38a0c953874559
+ bfea1edf9e2e9a5465f331517149c4f543ac2ba6
-
+
https://github.com/aspnet/Extensions
- 8dfb4ece7ca9a6dea14264dafc38a0c953874559
+ bfea1edf9e2e9a5465f331517149c4f543ac2ba6
-
+
https://github.com/aspnet/Extensions
- 8dfb4ece7ca9a6dea14264dafc38a0c953874559
+ bfea1edf9e2e9a5465f331517149c4f543ac2ba6
-
+
https://github.com/aspnet/Extensions
- 8dfb4ece7ca9a6dea14264dafc38a0c953874559
+ bfea1edf9e2e9a5465f331517149c4f543ac2ba6
-
+
https://github.com/aspnet/Extensions
- 8dfb4ece7ca9a6dea14264dafc38a0c953874559
+ bfea1edf9e2e9a5465f331517149c4f543ac2ba6
-
+
https://github.com/aspnet/Extensions
- 8dfb4ece7ca9a6dea14264dafc38a0c953874559
+ bfea1edf9e2e9a5465f331517149c4f543ac2ba6
-
+
https://github.com/aspnet/Extensions
- 8dfb4ece7ca9a6dea14264dafc38a0c953874559
+ bfea1edf9e2e9a5465f331517149c4f543ac2ba6
-
+
https://github.com/aspnet/Extensions
- 8dfb4ece7ca9a6dea14264dafc38a0c953874559
+ bfea1edf9e2e9a5465f331517149c4f543ac2ba6
-
+
https://github.com/aspnet/Extensions
- 8dfb4ece7ca9a6dea14264dafc38a0c953874559
+ bfea1edf9e2e9a5465f331517149c4f543ac2ba6
-
+
https://github.com/aspnet/Extensions
- 8dfb4ece7ca9a6dea14264dafc38a0c953874559
+ bfea1edf9e2e9a5465f331517149c4f543ac2ba6
-
+
https://github.com/aspnet/Extensions
- 8dfb4ece7ca9a6dea14264dafc38a0c953874559
+ bfea1edf9e2e9a5465f331517149c4f543ac2ba6
-
+
https://github.com/aspnet/Extensions
- 8dfb4ece7ca9a6dea14264dafc38a0c953874559
+ bfea1edf9e2e9a5465f331517149c4f543ac2ba6
-
+
https://github.com/aspnet/Extensions
- 8dfb4ece7ca9a6dea14264dafc38a0c953874559
+ bfea1edf9e2e9a5465f331517149c4f543ac2ba6
-
+
https://github.com/aspnet/Extensions
- 8dfb4ece7ca9a6dea14264dafc38a0c953874559
+ bfea1edf9e2e9a5465f331517149c4f543ac2ba6
-
+
https://github.com/aspnet/Extensions
- 8dfb4ece7ca9a6dea14264dafc38a0c953874559
+ bfea1edf9e2e9a5465f331517149c4f543ac2ba6
-
+
https://github.com/aspnet/Extensions
- 8dfb4ece7ca9a6dea14264dafc38a0c953874559
+ bfea1edf9e2e9a5465f331517149c4f543ac2ba6
-
+
https://github.com/aspnet/Extensions
- 8dfb4ece7ca9a6dea14264dafc38a0c953874559
+ bfea1edf9e2e9a5465f331517149c4f543ac2ba6
-
+
https://github.com/aspnet/Extensions
- 8dfb4ece7ca9a6dea14264dafc38a0c953874559
+ bfea1edf9e2e9a5465f331517149c4f543ac2ba6
-
+
https://github.com/aspnet/Extensions
- 8dfb4ece7ca9a6dea14264dafc38a0c953874559
+ bfea1edf9e2e9a5465f331517149c4f543ac2ba6
-
+
https://github.com/aspnet/Extensions
- 8dfb4ece7ca9a6dea14264dafc38a0c953874559
+ bfea1edf9e2e9a5465f331517149c4f543ac2ba6
-
+
https://github.com/aspnet/Extensions
- 8dfb4ece7ca9a6dea14264dafc38a0c953874559
+ bfea1edf9e2e9a5465f331517149c4f543ac2ba6
-
+
https://github.com/aspnet/Extensions
- 8dfb4ece7ca9a6dea14264dafc38a0c953874559
+ bfea1edf9e2e9a5465f331517149c4f543ac2ba6
-
+
https://github.com/aspnet/Extensions
- 8dfb4ece7ca9a6dea14264dafc38a0c953874559
+ bfea1edf9e2e9a5465f331517149c4f543ac2ba6
-
+
https://github.com/aspnet/Extensions
- 8dfb4ece7ca9a6dea14264dafc38a0c953874559
+ bfea1edf9e2e9a5465f331517149c4f543ac2ba6
-
+
https://github.com/aspnet/Extensions
- 8dfb4ece7ca9a6dea14264dafc38a0c953874559
+ bfea1edf9e2e9a5465f331517149c4f543ac2ba6
-
+
https://github.com/aspnet/Extensions
- 8dfb4ece7ca9a6dea14264dafc38a0c953874559
+ bfea1edf9e2e9a5465f331517149c4f543ac2ba6
-
+
https://github.com/aspnet/Extensions
- 8dfb4ece7ca9a6dea14264dafc38a0c953874559
+ bfea1edf9e2e9a5465f331517149c4f543ac2ba6
-
+
https://github.com/aspnet/Extensions
- 8dfb4ece7ca9a6dea14264dafc38a0c953874559
+ bfea1edf9e2e9a5465f331517149c4f543ac2ba6
-
+
https://github.com/aspnet/Extensions
- 8dfb4ece7ca9a6dea14264dafc38a0c953874559
+ bfea1edf9e2e9a5465f331517149c4f543ac2ba6
-
+
https://github.com/aspnet/Extensions
- 8dfb4ece7ca9a6dea14264dafc38a0c953874559
+ bfea1edf9e2e9a5465f331517149c4f543ac2ba6
-
+
https://github.com/aspnet/Extensions
- 8dfb4ece7ca9a6dea14264dafc38a0c953874559
+ bfea1edf9e2e9a5465f331517149c4f543ac2ba6
-
+
https://github.com/aspnet/Extensions
- 8dfb4ece7ca9a6dea14264dafc38a0c953874559
+ bfea1edf9e2e9a5465f331517149c4f543ac2ba6
-
+
https://github.com/aspnet/Extensions
- 8dfb4ece7ca9a6dea14264dafc38a0c953874559
+ bfea1edf9e2e9a5465f331517149c4f543ac2ba6
-
+
https://github.com/aspnet/Extensions
- 8dfb4ece7ca9a6dea14264dafc38a0c953874559
+ bfea1edf9e2e9a5465f331517149c4f543ac2ba6
-
+
https://github.com/aspnet/Extensions
- 8dfb4ece7ca9a6dea14264dafc38a0c953874559
+ bfea1edf9e2e9a5465f331517149c4f543ac2ba6
-
+
https://github.com/aspnet/Extensions
- 8dfb4ece7ca9a6dea14264dafc38a0c953874559
+ bfea1edf9e2e9a5465f331517149c4f543ac2ba6
-
+
https://github.com/aspnet/Extensions
- 8dfb4ece7ca9a6dea14264dafc38a0c953874559
+ bfea1edf9e2e9a5465f331517149c4f543ac2ba6
-
+
https://github.com/aspnet/Extensions
- 8dfb4ece7ca9a6dea14264dafc38a0c953874559
+ bfea1edf9e2e9a5465f331517149c4f543ac2ba6
-
+
https://github.com/aspnet/Extensions
- 8dfb4ece7ca9a6dea14264dafc38a0c953874559
+ bfea1edf9e2e9a5465f331517149c4f543ac2ba6
-
+
https://github.com/aspnet/Extensions
- 8dfb4ece7ca9a6dea14264dafc38a0c953874559
+ bfea1edf9e2e9a5465f331517149c4f543ac2ba6
-
+
https://github.com/aspnet/Extensions
- 8dfb4ece7ca9a6dea14264dafc38a0c953874559
+ bfea1edf9e2e9a5465f331517149c4f543ac2ba6
-
+
https://github.com/aspnet/Extensions
- 8dfb4ece7ca9a6dea14264dafc38a0c953874559
+ bfea1edf9e2e9a5465f331517149c4f543ac2ba6
-
+
https://github.com/aspnet/Extensions
- 8dfb4ece7ca9a6dea14264dafc38a0c953874559
+ bfea1edf9e2e9a5465f331517149c4f543ac2ba6
-
+
https://github.com/aspnet/Extensions
- 8dfb4ece7ca9a6dea14264dafc38a0c953874559
+ bfea1edf9e2e9a5465f331517149c4f543ac2ba6
-
+
https://github.com/aspnet/Extensions
- 8dfb4ece7ca9a6dea14264dafc38a0c953874559
+ bfea1edf9e2e9a5465f331517149c4f543ac2ba6
-
+
https://github.com/aspnet/Extensions
- 8dfb4ece7ca9a6dea14264dafc38a0c953874559
+ bfea1edf9e2e9a5465f331517149c4f543ac2ba6
-
+
https://github.com/aspnet/Extensions
- 8dfb4ece7ca9a6dea14264dafc38a0c953874559
+ bfea1edf9e2e9a5465f331517149c4f543ac2ba6
-
+
https://github.com/aspnet/Extensions
- 8dfb4ece7ca9a6dea14264dafc38a0c953874559
+ bfea1edf9e2e9a5465f331517149c4f543ac2ba6
-
+
+ https://github.com/dotnet/corefx
+ e23119d577e644d2c2a25419c88c1181681358e0
+
+
+ https://github.com/dotnet/corefx
+ e23119d577e644d2c2a25419c88c1181681358e0
+
+
+ https://github.com/dotnet/corefx
+ e23119d577e644d2c2a25419c88c1181681358e0
+
+
https://github.com/dotnet/corefx
a28176b5ec68b6da1472934fe9493790d1665cae
-
+
https://github.com/dotnet/corefx
- a28176b5ec68b6da1472934fe9493790d1665cae
+ e23119d577e644d2c2a25419c88c1181681358e0
-
+
https://github.com/dotnet/corefx
- a28176b5ec68b6da1472934fe9493790d1665cae
+ e23119d577e644d2c2a25419c88c1181681358e0
-
+
https://github.com/dotnet/corefx
- a28176b5ec68b6da1472934fe9493790d1665cae
+ e23119d577e644d2c2a25419c88c1181681358e0
-
+
https://github.com/dotnet/corefx
- a28176b5ec68b6da1472934fe9493790d1665cae
+ e23119d577e644d2c2a25419c88c1181681358e0
-
+
https://github.com/dotnet/corefx
- a28176b5ec68b6da1472934fe9493790d1665cae
+ e23119d577e644d2c2a25419c88c1181681358e0
-
+
https://github.com/dotnet/corefx
- a28176b5ec68b6da1472934fe9493790d1665cae
+ e23119d577e644d2c2a25419c88c1181681358e0
-
+
https://github.com/dotnet/corefx
- a28176b5ec68b6da1472934fe9493790d1665cae
+ e23119d577e644d2c2a25419c88c1181681358e0
-
+
https://github.com/dotnet/corefx
- a28176b5ec68b6da1472934fe9493790d1665cae
+ e23119d577e644d2c2a25419c88c1181681358e0
-
+
https://github.com/dotnet/corefx
- a28176b5ec68b6da1472934fe9493790d1665cae
+ e23119d577e644d2c2a25419c88c1181681358e0
-
+
https://github.com/dotnet/corefx
- a28176b5ec68b6da1472934fe9493790d1665cae
+ e23119d577e644d2c2a25419c88c1181681358e0
-
+
https://github.com/dotnet/corefx
- a28176b5ec68b6da1472934fe9493790d1665cae
+ e23119d577e644d2c2a25419c88c1181681358e0
-
+
https://github.com/dotnet/corefx
- a28176b5ec68b6da1472934fe9493790d1665cae
+ e23119d577e644d2c2a25419c88c1181681358e0
-
+
https://github.com/dotnet/corefx
- a28176b5ec68b6da1472934fe9493790d1665cae
+ e23119d577e644d2c2a25419c88c1181681358e0
-
+
https://github.com/dotnet/corefx
- a28176b5ec68b6da1472934fe9493790d1665cae
+ e23119d577e644d2c2a25419c88c1181681358e0
-
+
https://github.com/dotnet/corefx
- a28176b5ec68b6da1472934fe9493790d1665cae
+ e23119d577e644d2c2a25419c88c1181681358e0
-
- https://github.com/dotnet/corefx
- a28176b5ec68b6da1472934fe9493790d1665cae
-
-
- https://github.com/dotnet/corefx
- a28176b5ec68b6da1472934fe9493790d1665cae
-
-
- https://github.com/dotnet/corefx
- a28176b5ec68b6da1472934fe9493790d1665cae
-
-
+
https://github.com/dotnet/core-setup
- 73226d6f119c757813f47b0dc021e8700d525f71
+ 63abc77da6d99470caa5bfa0465afe244105e595
-
+
https://github.com/dotnet/core-setup
- 73226d6f119c757813f47b0dc021e8700d525f71
+ 63abc77da6d99470caa5bfa0465afe244105e595
+
+
+ https://github.com/dotnet/core-setup
+ 63abc77da6d99470caa5bfa0465afe244105e595
-
+
https://github.com/dotnet/corefx
- a28176b5ec68b6da1472934fe9493790d1665cae
+ e23119d577e644d2c2a25419c88c1181681358e0
-
+
https://github.com/aspnet/Extensions
- 8dfb4ece7ca9a6dea14264dafc38a0c953874559
+ bfea1edf9e2e9a5465f331517149c4f543ac2ba6
-
+
https://github.com/dotnet/arcade
- e913fb3b02d4089a91ff91c041c5f6e7c29038b0
+ e6a5d5f970bb872451c6310ae34eda31041fb552
-
+
https://github.com/dotnet/arcade
- e913fb3b02d4089a91ff91c041c5f6e7c29038b0
+ e6a5d5f970bb872451c6310ae34eda31041fb552
-
+
+ https://github.com/dotnet/arcade
+ e6a5d5f970bb872451c6310ae34eda31041fb552
+
+
https://github.com/aspnet/Extensions
- 8dfb4ece7ca9a6dea14264dafc38a0c953874559
+ bfea1edf9e2e9a5465f331517149c4f543ac2ba6
diff --git a/eng/Versions.props b/eng/Versions.props
index 10a317d441..d222619545 100644
--- a/eng/Versions.props
+++ b/eng/Versions.props
@@ -5,6 +5,10 @@
-->
+
+
+ true
+
- 1.0.0-beta.19270.1
+ 1.0.0-beta.19302.2
- 3.0.0-preview6-27714-15
- 3.0.0-preview6-27714-15
+ 3.0.0-preview6-27730-01
+ 3.0.0-preview6-27730-01
+ 2.1.0-preview6-27730-01
- 4.6.0-preview6.19264.9
- 4.6.0-preview6.19264.9
- 4.6.0-preview6.19264.9
+ 4.6.0-preview6.19279.8
+ 4.6.0-preview6.19279.8
+ 4.6.0-preview6.19279.8
4.7.0-preview6.19264.9
- 4.6.0-preview6.19264.9
- 4.6.0-preview6.19264.9
- 4.6.0-preview6.19264.9
- 4.6.0-preview6.19264.9
- 1.7.0-preview6.19264.9
- 4.6.0-preview6.19264.9
- 4.6.0-preview6.19264.9
- 4.6.0-preview6.19264.9
- 4.6.0-preview6.19264.9
- 4.6.0-preview6.19264.9
- 4.6.0-preview6.19264.9
- 4.6.0-preview6.19264.9
- 4.6.0-preview6.19264.9
- 4.6.0-preview6.19264.9
- 4.6.0-preview6.19264.9
+ 4.6.0-preview6.19279.8
+ 4.6.0-preview6.19279.8
+ 4.6.0-preview6.19279.8
+ 4.6.0-preview6.19279.8
+ 1.7.0-preview6.19279.8
+ 4.6.0-preview6.19279.8
+ 4.6.0-preview6.19279.8
+ 4.6.0-preview6.19279.8
+ 4.6.0-preview6.19279.8
+ 4.6.0-preview6.19279.8
+ 4.6.0-preview6.19279.8
+ 4.6.0-preview6.19279.8
+ 4.6.0-preview6.19279.8
+ 4.6.0-preview6.19279.8
+ 4.6.0-preview6.19279.8
- 3.0.0-preview6.19264.9
+ 3.0.0-preview6.19279.8
+
+ 0.10.0-preview7.19303.2
- 3.0.0-preview6.19265.2
- 3.0.0-preview6.19265.2
- 3.0.0-preview6.19265.2
- 3.0.0-preview6.19265.2
- 3.0.0-preview6.19265.2
- 3.0.0-preview6.19265.2
- 3.0.0-preview6.19265.2
- 3.0.0-preview6.19265.2
- 3.0.0-preview6.19265.2
- 3.0.0-preview6.19265.2
- 3.0.0-preview6.19265.2
- 3.0.0-preview6.19265.2
- 3.0.0-preview6.19265.2
- 3.0.0-preview6.19265.2
- 3.0.0-preview6.19265.2
- 3.0.0-preview6.19265.2
- 3.0.0-preview6.19265.2
- 3.0.0-preview6.19265.2
- 3.0.0-preview6.19265.2
- 3.0.0-preview6.19265.2
- 3.0.0-preview6.19265.2
- 3.0.0-preview6.19265.2
- 3.0.0-preview6.19265.2
- 3.0.0-preview6.19265.2
- 3.0.0-preview6.19265.2
- 3.0.0-preview6.19265.2
- 3.0.0-preview6.19265.2
- 3.0.0-preview6.19265.2
- 3.0.0-preview6.19265.2
- 3.0.0-preview6.19265.2
- 3.0.0-preview6.19265.2
- 3.0.0-preview6.19265.2
- 3.0.0-preview6.19265.2
- 3.0.0-preview6.19265.2
- 3.0.0-preview6.19265.2
- 3.0.0-preview6.19265.2
- 3.0.0-preview6.19265.2
- 3.0.0-preview6.19265.2
- 3.0.0-preview6.19265.2
- 3.0.0-preview6.19265.2
- 3.0.0-preview6.19265.2
- 3.0.0-preview6.19265.2
- 3.0.0-preview6.19265.2
- 3.0.0-preview6.19265.2
- 3.0.0-preview6.19265.2
- 3.0.0-preview6.19265.2
- 3.0.0-preview6.19265.2
- 3.0.0-preview6.19265.2
- 3.0.0-preview6.19265.2
- 3.0.0-preview6.19265.2
- 3.0.0-preview6.19265.2
- 3.0.0-preview6.19265.2
- 3.0.0-preview6.19265.2
- 3.0.0-preview6.19265.2
- 3.0.0-preview6.19265.2
- 3.0.0-preview6.19265.2
- 3.0.0-preview6.19265.2
- 3.0.0-preview6.19265.2
- 3.0.0-preview6.19265.2
- 3.0.0-preview6.19265.2
- 3.0.0-preview6.19265.2
+ 3.0.0-preview6.19280.1
+ 3.0.0-preview6.19280.1
+ 3.0.0-preview6.19280.1
+ 3.0.0-preview6.19280.1
+ 3.0.0-preview6.19280.1
+ 3.0.0-preview6.19280.1
+ 3.0.0-preview6.19280.1
+ 3.0.0-preview6.19280.1
+ 3.0.0-preview6.19280.1
+ 3.0.0-preview6.19280.1
+ 3.0.0-preview6.19280.1
+ 3.0.0-preview6.19280.1
+ 3.0.0-preview6.19280.1
+ 3.0.0-preview6.19280.1
+ 3.0.0-preview6.19280.1
+ 3.0.0-preview6.19280.1
+ 3.0.0-preview6.19280.1
+ 3.0.0-preview6.19280.1
+ 3.0.0-preview6.19280.1
+ 3.0.0-preview6.19280.1
+ 3.0.0-preview6.19280.1
+ 3.0.0-preview6.19280.1
+ 3.0.0-preview6.19280.1
+ 3.0.0-preview6.19280.1
+ 3.0.0-preview6.19280.1
+ 3.0.0-preview6.19280.1
+ 3.0.0-preview6.19280.1
+ 3.0.0-preview6.19280.1
+ 3.0.0-preview6.19280.1
+ 3.0.0-preview6.19280.1
+ 3.0.0-preview6.19280.1
+ 3.0.0-preview6.19280.1
+ 3.0.0-preview6.19280.1
+ 3.0.0-preview6.19280.1
+ 3.0.0-preview6.19280.1
+ 3.0.0-preview6.19280.1
+ 3.0.0-preview6.19280.1
+ 3.0.0-preview6.19280.1
+ 3.0.0-preview6.19280.1
+ 3.0.0-preview6.19280.1
+ 3.0.0-preview6.19280.1
+ 3.0.0-preview6.19280.1
+ 3.0.0-preview6.19280.1
+ 3.0.0-preview6.19280.1
+ 3.0.0-preview6.19280.1
+ 3.0.0-preview6.19280.1
+ 3.0.0-preview6.19280.1
+ 3.0.0-preview6.19280.1
+ 3.0.0-preview6.19280.1
+ 3.0.0-preview6.19280.1
+ 3.0.0-preview6.19280.1
+ 3.0.0-preview6.19280.1
+ 3.0.0-preview6.19280.1
+ 3.0.0-preview6.19280.1
+ 3.0.0-preview6.19280.1
+ 3.0.0-preview6.19280.1
+ 3.0.0-preview6.19280.1
+ 3.0.0-preview6.19280.1
+ 3.0.0-preview6.19280.1
+ 3.0.0-preview6.19280.1
+ 3.0.0-preview6.19280.1
- 3.0.0-preview6.19252.4
- 3.0.0-preview6.19252.4
- 3.0.0-preview6.19252.4
- 3.0.0-preview6.19252.4
- 3.0.0-preview6.19252.4
- 3.0.0-preview6.19252.4
- 3.0.0-preview6.19252.4
+ 3.0.0-preview6.19303.2
+ 3.0.0-preview6.19303.2
+ 3.0.0-preview6.19303.2
+ 3.0.0-preview6.19303.2
+ 3.0.0-preview6.19303.2
+ 3.0.0-preview6.19303.2
+ 3.0.0-preview6.19303.2
- 3.0.0-preview6.19270.2
- 3.0.0-preview6.19270.2
- 3.0.0-preview6.19270.2
- 3.0.0-preview6.19270.2
+ 3.0.0-preview6.19303.1
+ 3.0.0-preview6.19303.1
+ 3.0.0-preview6.19303.1
+ 3.0.0-preview6.19303.1
4.5.0
4.4.0
@@ -164,8 +172,6 @@
11.1.0
1.4.0
5.3.0
-
- 0.10.0-preview-20190523.1
2.1.1
2.2.0
diff --git a/eng/common/LoggingCommandFunctions.ps1 b/eng/common/LoggingCommandFunctions.ps1
new file mode 100644
index 0000000000..c225eaecbf
--- /dev/null
+++ b/eng/common/LoggingCommandFunctions.ps1
@@ -0,0 +1,146 @@
+# Source for this file was taken from https://github.com/microsoft/azure-pipelines-task-lib/blob/11c9439d4af17e6475d9fe058e6b2e03914d17e6/powershell/VstsTaskSdk/LoggingCommandFunctions.ps1
+
+# NOTE: You should not be calling these method directly as they are likely to change. Instead you should be calling the Write-Pipeline* functions defined in tools.ps1
+
+$script:loggingCommandPrefix = '##vso['
+$script:loggingCommandEscapeMappings = @( # TODO: WHAT ABOUT "="? WHAT ABOUT "%"?
+ New-Object psobject -Property @{ Token = ';' ; Replacement = '%3B' }
+ New-Object psobject -Property @{ Token = "`r" ; Replacement = '%0D' }
+ New-Object psobject -Property @{ Token = "`n" ; Replacement = '%0A' }
+ New-Object psobject -Property @{ Token = "]" ; Replacement = '%5D' }
+)
+# TODO: BUG: Escape % ???
+# TODO: Add test to verify don't need to escape "=".
+
+<########################################
+# Private functions.
+########################################>
+function Format-LoggingCommandData {
+ [CmdletBinding()]
+ param([string]$Value, [switch]$Reverse)
+
+ if (!$Value) {
+ return ''
+ }
+
+ if (!$Reverse) {
+ foreach ($mapping in $script:loggingCommandEscapeMappings) {
+ $Value = $Value.Replace($mapping.Token, $mapping.Replacement)
+ }
+ } else {
+ for ($i = $script:loggingCommandEscapeMappings.Length - 1 ; $i -ge 0 ; $i--) {
+ $mapping = $script:loggingCommandEscapeMappings[$i]
+ $Value = $Value.Replace($mapping.Replacement, $mapping.Token)
+ }
+ }
+
+ return $Value
+}
+
+function Format-LoggingCommand {
+ [CmdletBinding()]
+ param(
+ [Parameter(Mandatory = $true)]
+ [string]$Area,
+ [Parameter(Mandatory = $true)]
+ [string]$Event,
+ [string]$Data,
+ [hashtable]$Properties)
+
+ # Append the preamble.
+ [System.Text.StringBuilder]$sb = New-Object -TypeName System.Text.StringBuilder
+ $null = $sb.Append($script:loggingCommandPrefix).Append($Area).Append('.').Append($Event)
+
+ # Append the properties.
+ if ($Properties) {
+ $first = $true
+ foreach ($key in $Properties.Keys) {
+ [string]$value = Format-LoggingCommandData $Properties[$key]
+ if ($value) {
+ if ($first) {
+ $null = $sb.Append(' ')
+ $first = $false
+ } else {
+ $null = $sb.Append(';')
+ }
+
+ $null = $sb.Append("$key=$value")
+ }
+ }
+ }
+
+ # Append the tail and output the value.
+ $Data = Format-LoggingCommandData $Data
+ $sb.Append(']').Append($Data).ToString()
+}
+
+function Write-LoggingCommand {
+ [CmdletBinding(DefaultParameterSetName = 'Parameters')]
+ param(
+ [Parameter(Mandatory = $true, ParameterSetName = 'Parameters')]
+ [string]$Area,
+ [Parameter(Mandatory = $true, ParameterSetName = 'Parameters')]
+ [string]$Event,
+ [Parameter(ParameterSetName = 'Parameters')]
+ [string]$Data,
+ [Parameter(ParameterSetName = 'Parameters')]
+ [hashtable]$Properties,
+ [Parameter(Mandatory = $true, ParameterSetName = 'Object')]
+ $Command,
+ [switch]$AsOutput)
+
+ if ($PSCmdlet.ParameterSetName -eq 'Object') {
+ Write-LoggingCommand -Area $Command.Area -Event $Command.Event -Data $Command.Data -Properties $Command.Properties -AsOutput:$AsOutput
+ return
+ }
+
+ $command = Format-LoggingCommand -Area $Area -Event $Event -Data $Data -Properties $Properties
+ if ($AsOutput) {
+ $command
+ } else {
+ Write-Host $command
+ }
+}
+
+function Write-LogIssue {
+ [CmdletBinding()]
+ param(
+ [ValidateSet('warning', 'error')]
+ [Parameter(Mandatory = $true)]
+ [string]$Type,
+ [string]$Message,
+ [string]$ErrCode,
+ [string]$SourcePath,
+ [string]$LineNumber,
+ [string]$ColumnNumber,
+ [switch]$AsOutput)
+
+ $command = Format-LoggingCommand -Area 'task' -Event 'logissue' -Data $Message -Properties @{
+ 'type' = $Type
+ 'code' = $ErrCode
+ 'sourcepath' = $SourcePath
+ 'linenumber' = $LineNumber
+ 'columnnumber' = $ColumnNumber
+ }
+ if ($AsOutput) {
+ return $command
+ }
+
+ if ($Type -eq 'error') {
+ $foregroundColor = $host.PrivateData.ErrorForegroundColor
+ $backgroundColor = $host.PrivateData.ErrorBackgroundColor
+ if ($foregroundColor -isnot [System.ConsoleColor] -or $backgroundColor -isnot [System.ConsoleColor]) {
+ $foregroundColor = [System.ConsoleColor]::Red
+ $backgroundColor = [System.ConsoleColor]::Black
+ }
+ } else {
+ $foregroundColor = $host.PrivateData.WarningForegroundColor
+ $backgroundColor = $host.PrivateData.WarningBackgroundColor
+ if ($foregroundColor -isnot [System.ConsoleColor] -or $backgroundColor -isnot [System.ConsoleColor]) {
+ $foregroundColor = [System.ConsoleColor]::Yellow
+ $backgroundColor = [System.ConsoleColor]::Black
+ }
+ }
+
+ Write-Host $command -ForegroundColor $foregroundColor -BackgroundColor $backgroundColor
+}
\ No newline at end of file
diff --git a/eng/common/PublishToPackageFeed.proj b/eng/common/PublishToPackageFeed.proj
index e17f72644e..a1b1333723 100644
--- a/eng/common/PublishToPackageFeed.proj
+++ b/eng/common/PublishToPackageFeed.proj
@@ -53,6 +53,8 @@
https://dotnetfeed.blob.core.windows.net/dotnet-toolset/index.json
https://dotnetfeed.blob.core.windows.net/dotnet-windowsdesktop/index.json
https://dotnetfeed.blob.core.windows.net/nuget-nugetclient/index.json
+ https://dotnetfeed.blob.core.windows.net/aspnet-entityframework6/index.json
+ https://dotnetfeed.blob.core.windows.net/aspnet-blazor/index.json
Build configuration: 'Debug' or 'Release' (short: -c)"
+ Write-Host " -platform Platform configuration: 'x86', 'x64' or any valid Platform value to pass to msbuild"
Write-Host " -verbosity Msbuild verbosity: q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic] (short: -v)"
Write-Host " -binaryLog Output binary log (short: -bl)"
Write-Host " -help Print help and exit"
@@ -77,6 +79,7 @@ function Build {
InitializeCustomToolset
$bl = if ($binaryLog) { "/bl:" + (Join-Path $LogDir "Build.binlog") } else { "" }
+ $platformArg = if ($platform) { "/p:Platform=$platform" } else { "" }
if ($projects) {
# Re-assign properties to a new variable because PowerShell doesn't let us append properties directly for unclear reasons.
@@ -88,6 +91,7 @@ function Build {
MSBuild $toolsetBuildProj `
$bl `
+ $platformArg `
/p:Configuration=$configuration `
/p:RepoRoot=$RepoRoot `
/p:Restore=$restore `
@@ -129,9 +133,8 @@ try {
Build
}
catch {
- Write-Host $_
- Write-Host $_.Exception
Write-Host $_.ScriptStackTrace
+ Write-PipelineTaskError -Message $_
ExitWithExitCode 1
}
diff --git a/eng/common/build.sh b/eng/common/build.sh
index ce846d888d..6236fc4d38 100755
--- a/eng/common/build.sh
+++ b/eng/common/build.sh
@@ -66,6 +66,7 @@ ci=false
warn_as_error=true
node_reuse=true
binary_log=false
+pipelines_log=false
projects=''
configuration='Debug'
@@ -92,6 +93,9 @@ while [[ $# > 0 ]]; do
-binarylog|-bl)
binary_log=true
;;
+ -pipelineslog|-pl)
+ pipelines_log=true
+ ;;
-restore|-r)
restore=true
;;
@@ -146,6 +150,7 @@ while [[ $# > 0 ]]; do
done
if [[ "$ci" == true ]]; then
+ pipelines_log=true
binary_log=true
node_reuse=false
fi
diff --git a/eng/common/cross/arm64/sources.list.buster b/eng/common/cross/arm64/sources.list.buster
new file mode 100644
index 0000000000..7194ac64a9
--- /dev/null
+++ b/eng/common/cross/arm64/sources.list.buster
@@ -0,0 +1,11 @@
+deb http://deb.debian.org/debian buster main
+deb-src http://deb.debian.org/debian buster main
+
+deb http://deb.debian.org/debian-security/ buster/updates main
+deb-src http://deb.debian.org/debian-security/ buster/updates main
+
+deb http://deb.debian.org/debian buster-updates main
+deb-src http://deb.debian.org/debian buster-updates main
+
+deb http://deb.debian.org/debian buster-backports main contrib non-free
+deb-src http://deb.debian.org/debian buster-backports main contrib non-free
diff --git a/eng/common/cross/arm64/sources.list.stretch b/eng/common/cross/arm64/sources.list.stretch
new file mode 100644
index 0000000000..0e12157743
--- /dev/null
+++ b/eng/common/cross/arm64/sources.list.stretch
@@ -0,0 +1,12 @@
+deb http://deb.debian.org/debian stretch main
+deb-src http://deb.debian.org/debian stretch main
+
+deb http://deb.debian.org/debian-security/ stretch/updates main
+deb-src http://deb.debian.org/debian-security/ stretch/updates main
+
+deb http://deb.debian.org/debian stretch-updates main
+deb-src http://deb.debian.org/debian stretch-updates main
+
+deb http://deb.debian.org/debian stretch-backports main contrib non-free
+deb-src http://deb.debian.org/debian stretch-backports main contrib non-free
+
diff --git a/eng/common/cross/build-rootfs.sh b/eng/common/cross/build-rootfs.sh
index 83ec39195c..34d3d2ba1f 100755
--- a/eng/common/cross/build-rootfs.sh
+++ b/eng/common/cross/build-rootfs.sh
@@ -2,7 +2,7 @@
usage()
{
- echo "Usage: $0 [BuildArch] [LinuxCodeName] [lldbx.y] [--skipunmount] --rootfs ]"
+ echo "Usage: $0 [BuildArch] [LinuxCodeName] [lldbx.y] [--skipunmount] --rootfsdir ]"
echo "BuildArch can be: arm(default), armel, arm64, x86"
echo "LinuxCodeName - optional, Code name for Linux, can be: trusty, xenial(default), zesty, bionic, alpine. If BuildArch is armel, LinuxCodeName is jessie(default) or tizen."
echo "lldbx.y - optional, LLDB version, can be: lldb3.9(default), lldb4.0, lldb5.0, lldb6.0 no-lldb. Ignored for alpine"
@@ -113,12 +113,12 @@ while :; do
__LinuxCodeName=trusty
fi
;;
- xenial) # Ubunry 16.04
+ xenial) # Ubuntu 16.04
if [ "$__LinuxCodeName" != "jessie" ]; then
__LinuxCodeName=xenial
fi
;;
- zesty) # Ununtu 17.04
+ zesty) # Ubuntu 17.04
if [ "$__LinuxCodeName" != "jessie" ]; then
__LinuxCodeName=zesty
fi
@@ -132,7 +132,16 @@ while :; do
__LinuxCodeName=jessie
__UbuntuRepo="http://ftp.debian.org/debian/"
;;
- # TBD Stretch -> Debian 9, Buster -> Debian 10
+ stretch) # Debian 9
+ __LinuxCodeName=stretch
+ __UbuntuRepo="http://ftp.debian.org/debian/"
+ __LLDB_Package="liblldb-6.0-dev"
+ ;;
+ buster) # Debian 10
+ __LinuxCodeName=buster
+ __UbuntuRepo="http://ftp.debian.org/debian/"
+ __LLDB_Package="liblldb-6.0-dev"
+ ;;
tizen)
if [ "$__BuildArch" != "armel" ]; then
echo "Tizen is available only for armel."
diff --git a/eng/common/darc-init.ps1 b/eng/common/darc-init.ps1
index 81ffd16779..dea7cdd903 100644
--- a/eng/common/darc-init.ps1
+++ b/eng/common/darc-init.ps1
@@ -1,5 +1,6 @@
param (
- $darcVersion = $null
+ $darcVersion = $null,
+ $versionEndpoint = "https://maestro-prod.westus2.cloudapp.azure.com/api/assets/darc-version?api-version=2019-01-16"
)
$verbosity = "m"
@@ -16,13 +17,13 @@ function InstallDarcCli ($darcVersion) {
Invoke-Expression "& `"$dotnet`" tool uninstall $darcCliPackageName -g"
}
- # Until we can anonymously query the BAR API for the latest arcade-services
- # build applied to the PROD channel, this is hardcoded.
+ # If the user didn't explicitly specify the darc version,
+ # query the Maestro API for the correct version of darc to install.
if (-not $darcVersion) {
- $darcVersion = '1.1.0-beta.19205.4'
+ $darcVersion = $(Invoke-WebRequest -Uri $versionEndpoint -UseBasicParsing).Content
}
- $arcadeServicesSource = 'https://dotnetfeed.blob.core.windows.net/dotnet-arcade/index.json'
+ $arcadeServicesSource = 'https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json'
Write-Host "Installing Darc CLI version $darcVersion..."
Write-Host "You may need to restart your command window if this is the first dotnet tool you have installed."
diff --git a/eng/common/darc-init.sh b/eng/common/darc-init.sh
index bd7eb46398..abdd0bc05a 100755
--- a/eng/common/darc-init.sh
+++ b/eng/common/darc-init.sh
@@ -1,7 +1,8 @@
#!/usr/bin/env bash
source="${BASH_SOURCE[0]}"
-darcVersion="1.1.0-beta.19205.4"
+darcVersion=''
+versionEndpoint="https://maestro-prod.westus2.cloudapp.azure.com/api/assets/darc-version?api-version=2019-01-16"
while [[ $# > 0 ]]; do
opt="$(echo "$1" | awk '{print tolower($0)}')"
@@ -10,6 +11,10 @@ while [[ $# > 0 ]]; do
darcVersion=$2
shift
;;
+ --versionendpoint)
+ versionEndpoint=$2
+ shift
+ ;;
*)
echo "Invalid argument: $1"
usage
@@ -33,6 +38,10 @@ verbosity=m
. "$scriptroot/tools.sh"
+if [ -z "$darcVersion" ]; then
+ darcVersion=$(curl -X GET "$versionEndpoint" -H "accept: text/plain")
+fi
+
function InstallDarcCli {
local darc_cli_package_name="microsoft.dotnet.darc"
@@ -45,9 +54,9 @@ function InstallDarcCli {
echo $($dotnet_root/dotnet tool uninstall $darc_cli_package_name -g)
fi
- local arcadeServicesSource="https://dotnetfeed.blob.core.windows.net/dotnet-arcade/index.json"
+ local arcadeServicesSource="https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json"
- echo "Installing Darc CLI version $toolset_version..."
+ echo "Installing Darc CLI version $darcVersion..."
echo "You may need to restart your command shell if this is the first dotnet tool you have installed."
echo $($dotnet_root/dotnet tool install $darc_cli_package_name --version $darcVersion --add-source "$arcadeServicesSource" -v $verbosity -g)
}
diff --git a/eng/common/dotnet-install.ps1 b/eng/common/dotnet-install.ps1
index 5987943fd6..0b629b8301 100644
--- a/eng/common/dotnet-install.ps1
+++ b/eng/common/dotnet-install.ps1
@@ -8,9 +8,14 @@ Param(
. $PSScriptRoot\tools.ps1
+$dotnetRoot = Join-Path $RepoRoot ".dotnet"
+
+$installdir = $dotnetRoot
try {
- $dotnetRoot = Join-Path $RepoRoot ".dotnet"
- InstallDotNet $dotnetRoot $version $architecture $runtime $true
+ if ($architecture -and $architecture.Trim() -eq "x86") {
+ $installdir = Join-Path $installdir "x86"
+ }
+ InstallDotNet $installdir $version $architecture $runtime $true
}
catch {
Write-Host $_
@@ -19,4 +24,4 @@ catch {
ExitWithExitCode 1
}
-ExitWithExitCode 0
\ No newline at end of file
+ExitWithExitCode 0
diff --git a/eng/common/templates/steps/send-to-helix.yml b/eng/common/templates/steps/send-to-helix.yml
index d1ce577db5..05df886f55 100644
--- a/eng/common/templates/steps/send-to-helix.yml
+++ b/eng/common/templates/steps/send-to-helix.yml
@@ -5,6 +5,7 @@ parameters:
HelixBuild: $(Build.BuildNumber) # required -- the build number Helix will use to identify this -- automatically set to the AzDO build number
HelixTargetQueues: '' # required -- semicolon delimited list of Helix queues to test on; see https://helix.dot.net/ for a list of queues
HelixAccessToken: '' # required -- access token to make Helix API requests; should be provided by the appropriate variable group
+ HelixConfiguration: '' # optional -- additional property attached to a job
HelixPreCommands: '' # optional -- commands to run before Helix work item execution
HelixPostCommands: '' # optional -- commands to run after Helix work item execution
WorkItemDirectory: '' # optional -- a payload directory to zip up and send to Helix; requires WorkItemCommand; incompatible with XUnitProjects
@@ -35,6 +36,7 @@ steps:
HelixSource: ${{ parameters.HelixSource }}
HelixType: ${{ parameters.HelixType }}
HelixBuild: ${{ parameters.HelixBuild }}
+ HelixConfiguration: ${{ parameters.HelixConfiguration }}
HelixTargetQueues: ${{ parameters.HelixTargetQueues }}
HelixAccessToken: ${{ parameters.HelixAccessToken }}
HelixPreCommands: ${{ parameters.HelixPreCommands }}
@@ -64,6 +66,7 @@ steps:
HelixSource: ${{ parameters.HelixSource }}
HelixType: ${{ parameters.HelixType }}
HelixBuild: ${{ parameters.HelixBuild }}
+ HelixConfiguration: ${{ parameters.HelixConfiguration }}
HelixTargetQueues: ${{ parameters.HelixTargetQueues }}
HelixAccessToken: ${{ parameters.HelixAccessToken }}
HelixPreCommands: ${{ parameters.HelixPreCommands }}
diff --git a/eng/common/tools.ps1 b/eng/common/tools.ps1
index 9ca177b82a..3983d719be 100644
--- a/eng/common/tools.ps1
+++ b/eng/common/tools.ps1
@@ -92,6 +92,68 @@ function Exec-Process([string]$command, [string]$commandArgs) {
}
}
+function Write-PipelineTaskError {
+ [CmdletBinding()]
+ param(
+ [Parameter(Mandatory = $true)]
+ [string]$Message,
+ [Parameter(Mandatory = $false)]
+ [string]$Type = 'error',
+ [string]$ErrCode,
+ [string]$SourcePath,
+ [string]$LineNumber,
+ [string]$ColumnNumber,
+ [switch]$AsOutput)
+
+ if(!$ci) {
+ if($Type -eq 'error') {
+ Write-Error $Message
+ return
+ }
+ elseif ($Type -eq 'warning') {
+ Write-Warning $Message
+ return
+ }
+ }
+
+ if(($Type -ne 'error') -and ($Type -ne 'warning')) {
+ Write-Host $Message
+ return
+ }
+ if(-not $PSBoundParameters.ContainsKey('Type')) {
+ $PSBoundParameters.Add('Type', 'error')
+ }
+ Write-LogIssue @PSBoundParameters
+}
+
+function Write-PipelineSetVariable {
+ [CmdletBinding()]
+ param(
+ [Parameter(Mandatory = $true)]
+ [string]$Name,
+ [string]$Value,
+ [switch]$Secret,
+ [switch]$AsOutput)
+
+ if($ci) {
+ Write-LoggingCommand -Area 'task' -Event 'setvariable' -Data $Value -Properties @{
+ 'variable' = $Name
+ 'issecret' = $Secret
+ } -AsOutput:$AsOutput
+ }
+}
+
+function Write-PipelinePrependPath {
+ [CmdletBinding()]
+ param(
+ [Parameter(Mandatory=$true)]
+ [string]$Path,
+ [switch]$AsOutput)
+ if($ci) {
+ Write-LoggingCommand -Area 'task' -Event 'prependpath' -Data $Path -AsOutput:$AsOutput
+ }
+}
+
function InitializeDotNetCli([bool]$install) {
if (Test-Path variable:global:_DotNetInstallDir) {
return $global:_DotNetInstallDir
@@ -134,7 +196,7 @@ function InitializeDotNetCli([bool]$install) {
if ($install) {
InstallDotNetSdk $dotnetRoot $dotnetSdkVersion
} else {
- Write-Host "Unable to find dotnet with SDK version '$dotnetSdkVersion'" -ForegroundColor Red
+ Write-PipelineTaskError "Unable to find dotnet with SDK version '$dotnetSdkVersion'"
ExitWithExitCode 1
}
}
@@ -147,12 +209,10 @@ function InitializeDotNetCli([bool]$install) {
# It also ensures that VS msbuild will use the downloaded sdk targets.
$env:PATH = "$dotnetRoot;$env:PATH"
- if ($ci) {
- # Make Sure that our bootstrapped dotnet cli is avaliable in future steps of the Azure Pipelines build
- Write-Host "##vso[task.prependpath]$dotnetRoot"
- Write-Host "##vso[task.setvariable variable=DOTNET_MULTILEVEL_LOOKUP]0"
- Write-Host "##vso[task.setvariable variable=DOTNET_SKIP_FIRST_TIME_EXPERIENCE]1"
- }
+ # Make Sure that our bootstrapped dotnet cli is avaliable in future steps of the Azure Pipelines build
+ Write-PipelinePrependPath -Path $dotnetRoot
+ Write-PipelineSetVariable -Name 'DOTNET_MULTILEVEL_LOOKUP' -Value '0'
+ Write-PipelineSetVariable -Name 'DOTNET_SKIP_FIRST_TIME_EXPERIENCE' -Value '1'
return $global:_DotNetInstallDir = $dotnetRoot
}
@@ -184,7 +244,7 @@ function InstallDotNet([string] $dotnetRoot, [string] $version, [string] $archit
& $installScript @installParameters
if ($lastExitCode -ne 0) {
- Write-Host "Failed to install dotnet cli (exit code '$lastExitCode')." -ForegroundColor Red
+ Write-PipelineTaskError -Message "Failed to install dotnet cli (exit code '$lastExitCode')."
ExitWithExitCode $lastExitCode
}
}
@@ -213,7 +273,11 @@ function InitializeVisualStudioMSBuild([bool]$install, [object]$vsRequirements =
if ($env:VSINSTALLDIR -ne $null) {
$msbuildCmd = Get-Command "msbuild.exe" -ErrorAction SilentlyContinue
if ($msbuildCmd -ne $null) {
- if ($msbuildCmd.Version -ge $vsMinVersion) {
+ # Workaround for https://github.com/dotnet/roslyn/issues/35793
+ # Due to this issue $msbuildCmd.Version returns 0.0.0.0 for msbuild.exe 16.2+
+ $msbuildVersion = [Version]::new((Get-Item $msbuildCmd.Path).VersionInfo.ProductVersion.Split(@('-', '+'))[0])
+
+ if ($msbuildVersion -ge $vsMinVersion) {
return $global:_MSBuildExe = $msbuildCmd.Path
}
@@ -354,7 +418,7 @@ function InitializeBuildTool() {
if ($msbuildEngine -eq "dotnet") {
if (!$dotnetRoot) {
- Write-Host "/global.json must specify 'tools.dotnet'." -ForegroundColor Red
+ Write-PipelineTaskError "/global.json must specify 'tools.dotnet'."
ExitWithExitCode 1
}
@@ -363,13 +427,13 @@ function InitializeBuildTool() {
try {
$msbuildPath = InitializeVisualStudioMSBuild -install:$restore
} catch {
- Write-Host $_ -ForegroundColor Red
+ Write-PipelineTaskError $_
ExitWithExitCode 1
}
$buildTool = @{ Path = $msbuildPath; Command = ""; Tool = "vs"; Framework = "net472" }
} else {
- Write-Host "Unexpected value of -msbuildEngine: '$msbuildEngine'." -ForegroundColor Red
+ Write-PipelineTaskError "Unexpected value of -msbuildEngine: '$msbuildEngine'."
ExitWithExitCode 1
}
@@ -386,7 +450,7 @@ function GetDefaultMSBuildEngine() {
return "dotnet"
}
- Write-Host "-msbuildEngine must be specified, or /global.json must specify 'tools.dotnet' or 'tools.vs'." -ForegroundColor Red
+ Write-PipelineTaskError "-msbuildEngine must be specified, or /global.json must specify 'tools.dotnet' or 'tools.vs'."
ExitWithExitCode 1
}
@@ -437,7 +501,7 @@ function InitializeToolset() {
}
if (-not $restore) {
- Write-Host "Toolset version $toolsetVersion has not been restored." -ForegroundColor Red
+ Write-PipelineTaskError "Toolset version $toolsetVersion has not been restored."
ExitWithExitCode 1
}
@@ -522,7 +586,7 @@ function MSBuild-Core() {
$exitCode = Exec-Process $buildTool.Path $cmdArgs
if ($exitCode -ne 0) {
- Write-Host "Build failed." -ForegroundColor Red
+ Write-PipelineTaskError "Build failed."
$buildLog = GetMSBuildBinaryLogCommandLineArgument $args
if ($buildLog -ne $null) {
@@ -550,6 +614,8 @@ function GetMSBuildBinaryLogCommandLineArgument($arguments) {
return $null
}
+. $PSScriptRoot\LoggingCommandFunctions.ps1
+
$RepoRoot = Resolve-Path (Join-Path $PSScriptRoot "..\..")
$EngRoot = Resolve-Path (Join-Path $PSScriptRoot "..")
$ArtifactsDir = Join-Path $RepoRoot "artifacts"
@@ -565,11 +631,8 @@ Create-Directory $ToolsetDir
Create-Directory $TempDir
Create-Directory $LogDir
-if ($ci) {
- Write-Host "##vso[task.setvariable variable=Artifacts]$ArtifactsDir"
- Write-Host "##vso[task.setvariable variable=Artifacts.Toolset]$ToolsetDir"
- Write-Host "##vso[task.setvariable variable=Artifacts.Log]$LogDir"
-
- $env:TEMP = $TempDir
- $env:TMP = $TempDir
-}
+Write-PipelineSetVariable -Name 'Artifacts' -Value $ArtifactsDir
+Write-PipelineSetVariable -Name 'Artifacts.Toolset' -Value $ToolsetDir
+Write-PipelineSetVariable -Name 'Artifacts.Log' -Value $LogDir
+Write-PipelineSetVariable -Name 'TEMP' -Value $TempDir
+Write-PipelineSetVariable -Name 'TMP' -Value $TempDir
diff --git a/eng/common/tools.sh b/eng/common/tools.sh
index df3eb8bce0..fd26f6fbb2 100755
--- a/eng/common/tools.sh
+++ b/eng/common/tools.sh
@@ -1,8 +1,20 @@
+#!/usr/bin/env bash
+
# Initialize variables if they aren't already defined.
# CI mode - set to true on CI server for PR validation build or official build.
ci=${ci:-false}
+# Set to true to use the pipelines logger which will enable Azure logging output.
+# https://github.com/Microsoft/azure-pipelines-tasks/blob/master/docs/authoring/commands.md
+# This flag is meant as a temporary opt-opt for the feature while validate it across
+# our consumers. It will be deleted in the future.
+if [[ "$ci" == true ]]; then
+ pipelines_log=${pipelines_log:-true}
+else
+ pipelines_log=${pipelines_log:-false}
+fi
+
# Build configuration. Common values include 'Debug' and 'Release', but the repository may use other names.
configuration=${configuration:-'Debug'}
@@ -40,6 +52,78 @@ else
use_global_nuget_cache=${use_global_nuget_cache:-true}
fi
+function EmitError {
+ if [[ "$ci" != true ]]; then
+ echo "$@" >&2
+ return
+ fi
+
+ message_type="error"
+ sourcepath=''
+ linenumber=''
+ columnnumber=''
+ error_code=''
+
+ while [[ $# -gt 0 ]]; do
+ opt="$(echo "${1/#--/-}" | awk '{print tolower($0)}')"
+ case "$opt" in
+ -type|-t)
+ message_type=$2
+ shift
+ ;;
+ -sourcepath|-s)
+ sourcepath=$2
+ shift
+ ;;
+ -linenumber|-l)
+ linenumber=$2
+ shift
+ ;;
+ -columnnumber|-col)
+ columnnumber=$2
+ shift
+ ;;
+ -code|-c)
+ error_code=$2
+ shift
+ ;;
+ *)
+ break
+ ;;
+ esac
+
+ shift
+ done
+
+ message='##vso[task.logissue'
+
+ message="$message type=$message_type"
+
+ if [ -n "$sourcepath" ]; then
+ message="$message;sourcepath=$sourcepath"
+ else
+ message="$message;sourcepath=${BASH_SOURCE[1]}"
+ fi
+
+ if [ -n "$linenumber" ]; then
+ message="$message;linenumber=$linenumber"
+ else
+ message="$message;linenumber=${BASH_LINENO[0]}"
+ fi
+
+ if [ -n "$columnnumber" ]; then
+ message="$message;columnnumber=$columnnumber"
+ fi
+
+ if [ -n "$error_code" ]; then
+ message="$message;code=$error_code"
+ fi
+
+ message="$message]$*"
+
+ echo "$message"
+}
+
# Resolve any symlinks in the given path.
function ResolvePath {
local path=$1
@@ -65,7 +149,7 @@ function ReadGlobalVersion {
local pattern="\"$key\" *: *\"(.*)\""
if [[ ! $line =~ $pattern ]]; then
- echo "Error: Cannot find \"$key\" in $global_json_file" >&2
+ EmitError "Error: Cannot find \"$key\" in $global_json_file"
ExitWithExitCode 1
fi
@@ -126,7 +210,7 @@ function InitializeDotNetCli {
if [[ "$install" == true ]]; then
InstallDotNetSdk "$dotnet_root" "$dotnet_sdk_version"
else
- echo "Unable to find dotnet with SDK version '$dotnet_sdk_version'" >&2
+ EmitError "Unable to find dotnet with SDK version '$dotnet_sdk_version'"
ExitWithExitCode 1
fi
fi
@@ -179,7 +263,7 @@ function InstallDotNet {
fi
bash "$install_script" --version $version --install-dir "$root" $archArg $runtimeArg $skipNonVersionedFilesArg || {
local exit_code=$?
- echo "Failed to install dotnet SDK (exit code '$exit_code')." >&2
+ EmitError "Failed to install dotnet SDK (exit code '$exit_code')."
ExitWithExitCode $exit_code
}
}
@@ -216,6 +300,7 @@ function InitializeBuildTool {
# return values
_InitializeBuildTool="$_InitializeDotNetCli/dotnet"
_InitializeBuildToolCommand="msbuild"
+ _InitializeBuildToolFramework="netcoreapp2.1"
}
function GetNuGetPackageCachePath {
@@ -264,7 +349,7 @@ function InitializeToolset {
fi
if [[ "$restore" != true ]]; then
- echo "Toolset version $toolsetVersion has not been restored." >&2
+ EmitError "Toolset version $toolsetVersion has not been restored."
ExitWithExitCode 2
fi
@@ -276,12 +361,12 @@ function InitializeToolset {
fi
echo '' > "$proj"
- MSBuild "$proj" $bl /t:__WriteToolsetLocation /clp:ErrorsOnly\;NoSummary /p:__ToolsetLocationOutputFile="$toolset_location_file"
+ MSBuild-Core "$proj" $bl /t:__WriteToolsetLocation /clp:ErrorsOnly\;NoSummary /p:__ToolsetLocationOutputFile="$toolset_location_file"
local toolset_build_proj=`cat "$toolset_location_file"`
if [[ ! -a "$toolset_build_proj" ]]; then
- echo "Invalid toolset path: $toolset_build_proj" >&2
+ EmitError "Invalid toolset path: $toolset_build_proj"
ExitWithExitCode 3
fi
@@ -304,14 +389,27 @@ function StopProcesses {
}
function MSBuild {
+ local args=$@
+ if [[ "$pipelines_log" == true ]]; then
+ InitializeBuildTool
+ InitializeToolset
+ local toolset_dir="${_InitializeToolset%/*}"
+ local logger_path="$toolset_dir/$_InitializeBuildToolFramework/Microsoft.DotNet.Arcade.Sdk.dll"
+ args=( "${args[@]}" "-logger:$logger_path" )
+ fi
+
+ MSBuild-Core ${args[@]}
+}
+
+function MSBuild-Core {
if [[ "$ci" == true ]]; then
if [[ "$binary_log" != true ]]; then
- echo "Binary log must be enabled in CI build." >&2
+ EmitError "Binary log must be enabled in CI build."
ExitWithExitCode 1
fi
if [[ "$node_reuse" == true ]]; then
- echo "Node reuse must be disabled in CI build." >&2
+ EmitError "Node reuse must be disabled in CI build."
ExitWithExitCode 1
fi
fi
@@ -325,7 +423,7 @@ function MSBuild {
"$_InitializeBuildTool" "$_InitializeBuildToolCommand" /m /nologo /clp:Summary /v:$verbosity /nr:$node_reuse $warnaserror_switch /p:TreatWarningsAsErrors=$warn_as_error /p:ContinuousIntegrationBuild=$ci "$@" || {
local exit_code=$?
- echo "Build failed (exit code '$exit_code')." >&2
+ EmitError "Build failed (exit code '$exit_code')."
ExitWithExitCode $exit_code
}
}
diff --git a/eng/helix/content/InstallNode.ps1 b/eng/helix/content/InstallNode.ps1
new file mode 100644
index 0000000000..862e612582
--- /dev/null
+++ b/eng/helix/content/InstallNode.ps1
@@ -0,0 +1,71 @@
+ <#
+ .SYNOPSIS
+ Installs NodeJs from http://nodejs.org/dist on a machine
+ .DESCRIPTION
+ This script installs NodeJs from http://nodejs.org/dist on a machine.
+ .PARAMETER Version
+ The version of NodeJS to install.
+ .PARAMETER InstallDir
+ The directory to install NodeJS to.
+ .LINK
+ https://nodejs.org/en/
+ #>
+param(
+ [Parameter(Mandatory = $true)]
+ $Version,
+
+ [Parameter(Mandatory = $true)]
+ $InstallDir
+)
+
+$ErrorActionPreference = 'Stop'
+$ProgressPreference = 'SilentlyContinue' # Workaround PowerShell/PowerShell#2138
+
+Set-StrictMode -Version 1
+
+if (Get-Command "node.exe" -ErrorAction SilentlyContinue)
+{
+ Write-Host "Found node.exe in PATH"
+ exit
+}
+
+if (Test-Path "$output_dir\node.exe")
+{
+ Write-Host "Node.exe found at $output_dir"
+ exit
+}
+
+$nodeFile="node-v$Version-win-x64"
+$url="http://nodejs.org/dist/v$Version/$nodeFile.zip"
+Write-Host "Starting download of NodeJs ${Version} from $url"
+Invoke-WebRequest -UseBasicParsing -Uri "$url" -OutFile "nodejs.zip"
+Write-Host "Done downloading NodeJS ${Version}"
+
+$tempPath = [System.IO.Path]::GetTempPath()
+$tempDir = Join-Path $tempPath nodejs
+New-Item -Path "$tempDir" -ItemType "directory" -Force
+Write-Host "Extracting to $tempDir"
+
+if (Get-Command -Name 'Microsoft.PowerShell.Archive\Expand-Archive' -ErrorAction Ignore) {
+ # Use built-in commands where possible as they are cross-plat compatible
+ Microsoft.PowerShell.Archive\Expand-Archive -Path "nodejs.zip" -DestinationPath $tempDir
+}
+else {
+ # Fallback to old approach for old installations of PowerShell
+ Add-Type -AssemblyName System.IO.Compression.FileSystem
+ [System.IO.Compression.ZipFile]::ExtractToDirectory("nodejs.zip", $tempDir)
+}
+
+Write-Host "Expanded NodeJs"
+New-Item -Path "$InstallDir" -ItemType "directory" -Force
+Write-Host "Copying $tempDir\$nodeFile\node.exe to $InstallDir"
+Copy-Item "$tempDir\$nodeFile\node.exe" "$InstallDir\node.exe"
+
+if (Test-Path "$InstallDir\node.exe")
+{
+ Write-Host "Node.exe copied to $InstallDir"
+}
+else
+{
+ Write-Host "Node.exe not copied to $InstallDir"
+}
diff --git a/eng/helix/content/installnode.sh b/eng/helix/content/installnode.sh
new file mode 100644
index 0000000000..5a72cca423
--- /dev/null
+++ b/eng/helix/content/installnode.sh
@@ -0,0 +1,29 @@
+#!/usr/bin/env bash
+
+# Cause the script to fail if any subcommand fails
+set -e
+
+if type -P "node" &>/dev/null; then
+ echo "node is in \$PATH"
+ exit
+fi
+
+node_version=$1
+osname=`uname -s`
+echo $osname
+if [ "$osname" = "Darwin" ]; then
+ platformarch='darwin-x64'
+else
+ platformarch='linux-x64'
+fi
+DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
+output_dir="$DIR/node"
+url="http://nodejs.org/dist/v$node_version/node-v$node_version-$platformarch.tar.gz"
+tmp="$(mktemp -d -t install-node.XXXXXX)"
+trap "rm -rf $tmp" EXIT
+cd "$tmp"
+curl -Lsfo $(basename $url) "$url"
+echo "Installing node from $(basename $url) $url"
+mkdir $output_dir
+echo "Unpacking to $output_dir"
+tar --strip-components 1 -xzf "node-v$node_version-$platformarch.tar.gz" --no-same-owner --directory "$output_dir"
diff --git a/eng/helix/content/runtests.cmd b/eng/helix/content/runtests.cmd
index 8657c61ec1..8344fe5a66 100644
--- a/eng/helix/content/runtests.cmd
+++ b/eng/helix/content/runtests.cmd
@@ -14,7 +14,7 @@ set DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
set DOTNET_MULTILEVEL_LOOKUP=0
set DOTNET_CLI_HOME=%HELIX_CORRELATION_PAYLOAD%\home
-set PATH=%DOTNET_ROOT%;%PATH%
+set PATH=%DOTNET_ROOT%;%PATH%;%HELIX_CORRELATION_PAYLOAD%\node\bin
powershell.exe -NoProfile -ExecutionPolicy unrestricted -Command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; &([scriptblock]::Create((Invoke-WebRequest -useb 'https://dot.net/v1/dotnet-install.ps1'))) -Architecture x64 -Version %sdkVersion% -InstallDir %DOTNET_ROOT%"
powershell.exe -NoProfile -ExecutionPolicy unrestricted -Command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; &([scriptblock]::Create((Invoke-WebRequest -useb 'https://dot.net/v1/dotnet-install.ps1'))) -Architecture x64 -Runtime dotnet -Version %runtimeVersion% -InstallDir %DOTNET_ROOT%"
diff --git a/eng/helix/content/runtests.sh b/eng/helix/content/runtests.sh
index b3a786ee05..e864f097de 100644
--- a/eng/helix/content/runtests.sh
+++ b/eng/helix/content/runtests.sh
@@ -16,7 +16,7 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
export DOTNET_ROOT="$DIR/.dotnet$RANDOM"
# Ensure dotnet comes first on PATH
-export PATH="$DOTNET_ROOT:$PATH"
+export PATH="$DOTNET_ROOT:$PATH:$DIR/node/bin"
# Prevent fallback to global .NET locations. This ensures our tests use the shared frameworks we specify and don't rollforward to something else that might be installed on the machine
export DOTNET_MULTILEVEL_LOOKUP=0
diff --git a/eng/targets/Helix.props b/eng/targets/Helix.props
index b2f297fe63..c6b1b68cd2 100644
--- a/eng/targets/Helix.props
+++ b/eng/targets/Helix.props
@@ -17,6 +17,7 @@
$(MSBuildProjectName)/$(TargetFramework)
false
true
+ 10.15.3
@@ -35,4 +36,12 @@
+
+
+
+
+
+
+
+
diff --git a/eng/targets/Npm.Common.targets b/eng/targets/Npm.Common.targets
index b8dadce6c5..a0eb3e3fa5 100644
--- a/eng/targets/Npm.Common.targets
+++ b/eng/targets/Npm.Common.targets
@@ -53,6 +53,21 @@
+
+
+
+
+
+ <_PackageJsonContent>@(PackageJsonContent->'%(Identity)', '%0a')
+ <_PackageJsonContent>$(_PackageJsonContent.Replace('%(ReplacePackageContent.Identity)', '%(ReplacePackageContent.ReplaceWith)'))
+
+
+
+
diff --git a/eng/targets/ReferenceAssembly.targets b/eng/targets/ReferenceAssembly.targets
index cbe21a8976..605c715eb7 100644
--- a/eng/targets/ReferenceAssembly.targets
+++ b/eng/targets/ReferenceAssembly.targets
@@ -55,7 +55,7 @@
- <_GenAPICommand Condition="'$(MSBuildRuntimeType)' == 'core'">$(ToolHostCmd) --roll-forward-on-no-candidate-fx 2 "$(_GenAPIPath)"
+ <_GenAPICommand Condition="'$(MSBuildRuntimeType)' == 'core'">"$(DotNetTool)" --roll-forward-on-no-candidate-fx 2 "$(_GenAPIPath)"
<_GenAPICmd>$(_GenAPICommand)
<_GenAPICmd>$(_GenAPICmd) "$(TargetPath)"
<_GenAPICmd>$(_GenAPICmd) --lib-path "@(_ReferencePathDirectories)"
diff --git a/global.json b/global.json
index 30db777b99..97f7c9313f 100644
--- a/global.json
+++ b/global.json
@@ -3,10 +3,12 @@
"version": "3.0.100-preview5-011568"
},
"tools": {
+ "dotnet": "3.0.100-preview5-011568",
"jdk": "11.0.3"
},
"msbuild-sdks": {
"Yarn.MSBuild": "1.15.2",
- "Microsoft.DotNet.Helix.Sdk": "2.0.0-beta.19270.1"
+ "Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19302.2",
+ "Microsoft.DotNet.Helix.Sdk": "2.0.0-beta.19302.2"
}
}
diff --git a/src/Analyzers/Analyzers/test/TestFiles/CompilationFeatureDetectorTest/StartupWithUseSignalR.cs b/src/Analyzers/Analyzers/test/TestFiles/CompilationFeatureDetectorTest/StartupWithUseSignalR.cs
index 17159a411c..aa65f83258 100644
--- a/src/Analyzers/Analyzers/test/TestFiles/CompilationFeatureDetectorTest/StartupWithUseSignalR.cs
+++ b/src/Analyzers/Analyzers/test/TestFiles/CompilationFeatureDetectorTest/StartupWithUseSignalR.cs
@@ -9,10 +9,12 @@ namespace Microsoft.AspNetCore.Analyzers.TestFiles.CompilationFeatureDetectorTes
{
public void Configure(IApplicationBuilder app)
{
+#pragma warning disable CS0618 // Type or member is obsolete
app.UseSignalR(routes =>
{
});
+#pragma warning restore CS0618 // Type or member is obsolete
}
}
}
diff --git a/src/Components/Analyzers/src/ComponentFacts.cs b/src/Components/Analyzers/src/ComponentFacts.cs
new file mode 100644
index 0000000000..031df5586f
--- /dev/null
+++ b/src/Components/Analyzers/src/ComponentFacts.cs
@@ -0,0 +1,89 @@
+// 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.Linq;
+using Microsoft.CodeAnalysis;
+
+namespace Microsoft.AspNetCore.Components.Analyzers
+{
+ internal static class ComponentFacts
+ {
+ public static bool IsAnyParameter(ComponentSymbols symbols, IPropertySymbol property)
+ {
+ if (symbols == null)
+ {
+ throw new ArgumentNullException(nameof(symbols));
+ }
+
+ if (property == null)
+ {
+ throw new ArgumentNullException(nameof(property));
+ }
+
+ return property.GetAttributes().Any(a =>
+ {
+ return a.AttributeClass == symbols.ParameterAttribute || a.AttributeClass == symbols.CascadingParameterAttribute;
+ });
+ }
+
+ public static bool IsParameter(ComponentSymbols symbols, IPropertySymbol property)
+ {
+ if (symbols == null)
+ {
+ throw new ArgumentNullException(nameof(symbols));
+ }
+
+ if (property == null)
+ {
+ throw new ArgumentNullException(nameof(property));
+ }
+
+ return property.GetAttributes().Any(a => a.AttributeClass == symbols.ParameterAttribute);
+ }
+
+ public static bool IsParameterWithCaptureUnmatchedValues(ComponentSymbols symbols, IPropertySymbol property)
+ {
+ if (symbols == null)
+ {
+ throw new ArgumentNullException(nameof(symbols));
+ }
+
+ if (property == null)
+ {
+ throw new ArgumentNullException(nameof(property));
+ }
+
+ var attribute = property.GetAttributes().FirstOrDefault(a => a.AttributeClass == symbols.ParameterAttribute);
+ if (attribute == null)
+ {
+ return false;
+ }
+
+ foreach (var kvp in attribute.NamedArguments)
+ {
+ if (string.Equals(kvp.Key, ComponentsApi.ParameterAttribute.CaptureUnmatchedValues, StringComparison.Ordinal))
+ {
+ return kvp.Value.Value as bool? ?? false;
+ }
+ }
+
+ return false;
+ }
+
+ public static bool IsCascadingParameter(ComponentSymbols symbols, IPropertySymbol property)
+ {
+ if (symbols == null)
+ {
+ throw new ArgumentNullException(nameof(symbols));
+ }
+
+ if (property == null)
+ {
+ throw new ArgumentNullException(nameof(property));
+ }
+
+ return property.GetAttributes().Any(a => a.AttributeClass == symbols.CascadingParameterAttribute);
+ }
+ }
+}
diff --git a/src/Components/Analyzers/src/ComponentParameterAnalyzer.cs b/src/Components/Analyzers/src/ComponentParameterAnalyzer.cs
new file mode 100644
index 0000000000..20ad4ab6bd
--- /dev/null
+++ b/src/Components/Analyzers/src/ComponentParameterAnalyzer.cs
@@ -0,0 +1,111 @@
+// 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.Collections.Immutable;
+using System.Linq;
+using Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.CSharp;
+using Microsoft.CodeAnalysis.Diagnostics;
+
+namespace Microsoft.AspNetCore.Components.Analyzers
+{
+ [DiagnosticAnalyzer(LanguageNames.CSharp)]
+ public class ComponentParameterAnalyzer : DiagnosticAnalyzer
+ {
+ public ComponentParameterAnalyzer()
+ {
+ SupportedDiagnostics = ImmutableArray.Create(new[]
+ {
+ DiagnosticDescriptors.ComponentParametersShouldNotBePublic,
+ DiagnosticDescriptors.ComponentParameterCaptureUnmatchedValuesMustBeUnique,
+ DiagnosticDescriptors.ComponentParameterCaptureUnmatchedValuesHasWrongType,
+ });
+ }
+
+ public override ImmutableArray SupportedDiagnostics { get; }
+
+ public override void Initialize(AnalysisContext context)
+ {
+ context.RegisterCompilationStartAction(context =>
+ {
+ if (!ComponentSymbols.TryCreate(context.Compilation, out var symbols))
+ {
+ // Types we need are not defined.
+ return;
+ }
+
+ // This operates per-type because one of the validations we need has to look for duplicates
+ // defined on the same type.
+ context.RegisterSymbolStartAction(context =>
+ {
+ var properties = new List();
+
+ var type = (INamedTypeSymbol)context.Symbol;
+ foreach (var member in type.GetMembers())
+ {
+ if (member is IPropertySymbol property && ComponentFacts.IsAnyParameter(symbols, property))
+ {
+ // Annotated with [Parameter] or [CascadingParameter]
+ properties.Add(property);
+ }
+ }
+
+ if (properties.Count == 0)
+ {
+ return;
+ }
+
+ context.RegisterSymbolEndAction(context =>
+ {
+ var captureUnmatchedValuesParameters = new List();
+
+ // Per-property validations
+ foreach (var property in properties)
+ {
+ if (property.SetMethod?.DeclaredAccessibility == Accessibility.Public)
+ {
+ context.ReportDiagnostic(Diagnostic.Create(
+ DiagnosticDescriptors.ComponentParametersShouldNotBePublic,
+ property.Locations[0],
+ property.ToDisplayString(SymbolDisplayFormat.CSharpErrorMessageFormat)));
+ }
+
+ if (ComponentFacts.IsParameterWithCaptureUnmatchedValues(symbols, property))
+ {
+ captureUnmatchedValuesParameters.Add(property);
+
+ // Check the type, we need to be able to assign a Dictionary
+ var conversion = context.Compilation.ClassifyConversion(symbols.ParameterCaptureUnmatchedValuesRuntimeType, property.Type);
+ if (!conversion.Exists || conversion.IsExplicit)
+ {
+ context.ReportDiagnostic(Diagnostic.Create(
+ DiagnosticDescriptors.ComponentParameterCaptureUnmatchedValuesHasWrongType,
+ property.Locations[0],
+ property.ToDisplayString(SymbolDisplayFormat.CSharpErrorMessageFormat),
+ property.Type.ToDisplayString(SymbolDisplayFormat.CSharpErrorMessageFormat),
+ symbols.ParameterCaptureUnmatchedValuesRuntimeType.ToDisplayString(SymbolDisplayFormat.CSharpErrorMessageFormat)));
+ }
+ }
+ }
+
+ // Check if the type defines multiple CaptureUnmatchedValues parameters. Doing this outside the loop means we place the
+ // errors on the type.
+ if (captureUnmatchedValuesParameters.Count > 1)
+ {
+ context.ReportDiagnostic(Diagnostic.Create(
+ DiagnosticDescriptors.ComponentParameterCaptureUnmatchedValuesMustBeUnique,
+ context.Symbol.Locations[0],
+ type.ToDisplayString(SymbolDisplayFormat.CSharpErrorMessageFormat),
+ Environment.NewLine,
+ string.Join(
+ Environment.NewLine,
+ captureUnmatchedValuesParameters.Select(p => p.ToDisplayString(SymbolDisplayFormat.CSharpErrorMessageFormat)).OrderBy(n => n))));
+ }
+ });
+ }, SymbolKind.NamedType);
+ });
+ }
+ }
+}
diff --git a/src/Components/Analyzers/src/ComponentParametersShouldNotBePublicAnalyzer.cs b/src/Components/Analyzers/src/ComponentParametersShouldNotBePublicAnalyzer.cs
deleted file mode 100644
index a9ef40f12c..0000000000
--- a/src/Components/Analyzers/src/ComponentParametersShouldNotBePublicAnalyzer.cs
+++ /dev/null
@@ -1,76 +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 Microsoft.AspNetCore.Components.Shared;
-using Microsoft.CodeAnalysis;
-using Microsoft.CodeAnalysis.CSharp;
-using Microsoft.CodeAnalysis.CSharp.Syntax;
-using Microsoft.CodeAnalysis.Diagnostics;
-using System.Collections.Immutable;
-using System.Linq;
-
-namespace Microsoft.AspNetCore.Components.Analyzers
-{
- [DiagnosticAnalyzer(LanguageNames.CSharp)]
- public class ComponentParametersShouldNotBePublicAnalyzer : DiagnosticAnalyzer
- {
- public const string DiagnosticId = "BL9993";
- private const string Category = "Encapsulation";
-
- private static readonly LocalizableString Title = new LocalizableResourceString(nameof(Resources.ComponentParametersShouldNotBePublic_Title), Resources.ResourceManager, typeof(Resources));
- private static readonly LocalizableString MessageFormat = new LocalizableResourceString(nameof(Resources.ComponentParametersShouldNotBePublic_Format), Resources.ResourceManager, typeof(Resources));
- private static readonly LocalizableString Description = new LocalizableResourceString(nameof(Resources.ComponentParametersShouldNotBePublic_Description), Resources.ResourceManager, typeof(Resources));
- private static DiagnosticDescriptor Rule = new DiagnosticDescriptor(
- DiagnosticId,
- Title,
- MessageFormat,
- Category,
- DiagnosticSeverity.Warning,
- isEnabledByDefault: true,
- description: Description);
-
- public override ImmutableArray SupportedDiagnostics
- => ImmutableArray.Create(Rule);
-
- public override void Initialize(AnalysisContext context)
- {
- context.RegisterSyntaxNodeAction(AnalyzeSyntax, SyntaxKind.PropertyDeclaration);
- }
-
- private void AnalyzeSyntax(SyntaxNodeAnalysisContext context)
- {
- var semanticModel = context.SemanticModel;
- var declaration = (PropertyDeclarationSyntax)context.Node;
-
- var parameterAttribute = declaration.AttributeLists
- .SelectMany(list => list.Attributes)
- .Where(attr => semanticModel.GetTypeInfo(attr).Type?.ToDisplayString() == ComponentsApi.ParameterAttribute.FullTypeName)
- .FirstOrDefault();
-
- if (parameterAttribute != null && IsPubliclySettable(declaration))
- {
- var identifierText = declaration.Identifier.Text;
- if (!string.IsNullOrEmpty(identifierText))
- {
- context.ReportDiagnostic(Diagnostic.Create(
- Rule,
- declaration.GetLocation(),
- identifierText));
- }
- }
- }
-
- private static bool IsPubliclySettable(PropertyDeclarationSyntax declaration)
- {
- // If the property has a setter explicitly marked private/protected/internal, then it's not public
- var setter = declaration.AccessorList?.Accessors.SingleOrDefault(x => x.Keyword.IsKind(SyntaxKind.SetKeyword));
- if (setter != null && setter.Modifiers.Any(x => x.IsKind(SyntaxKind.PrivateKeyword) || x.IsKind(SyntaxKind.ProtectedKeyword) || x.IsKind(SyntaxKind.InternalKeyword)))
- {
- return false;
- }
-
- // Otherwise fallback to the property declaration modifiers
- return declaration.Modifiers.Any(x => x.IsKind(SyntaxKind.PublicKeyword));
- }
- }
-}
diff --git a/src/Components/Analyzers/src/ComponentParametersShouldNotBePublicCodeFixProvider.cs b/src/Components/Analyzers/src/ComponentParametersShouldNotBePublicCodeFixProvider.cs
index 001e761571..84555969b9 100644
--- a/src/Components/Analyzers/src/ComponentParametersShouldNotBePublicCodeFixProvider.cs
+++ b/src/Components/Analyzers/src/ComponentParametersShouldNotBePublicCodeFixProvider.cs
@@ -1,15 +1,15 @@
-// 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.Collections.Immutable;
+using System.Composition;
+using System.Linq;
+using System.Threading.Tasks;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CodeActions;
using Microsoft.CodeAnalysis.CodeFixes;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
-using System.Collections.Immutable;
-using System.Composition;
-using System.Linq;
-using System.Threading.Tasks;
namespace Microsoft.AspNetCore.Components.Analyzers
{
@@ -19,7 +19,7 @@ namespace Microsoft.AspNetCore.Components.Analyzers
private static readonly LocalizableString Title = new LocalizableResourceString(nameof(Resources.ComponentParametersShouldNotBePublic_FixTitle), Resources.ResourceManager, typeof(Resources));
public override ImmutableArray FixableDiagnosticIds
- => ImmutableArray.Create(ComponentParametersShouldNotBePublicAnalyzer.DiagnosticId);
+ => ImmutableArray.Create(DiagnosticDescriptors.ComponentParametersShouldNotBePublic.Id);
public sealed override FixAllProvider GetFixAllProvider()
{
diff --git a/src/Components/Analyzers/src/ComponentSymbols.cs b/src/Components/Analyzers/src/ComponentSymbols.cs
new file mode 100644
index 0000000000..ba1bfc4869
--- /dev/null
+++ b/src/Components/Analyzers/src/ComponentSymbols.cs
@@ -0,0 +1,65 @@
+// 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 Microsoft.CodeAnalysis;
+
+namespace Microsoft.AspNetCore.Components.Analyzers
+{
+ internal class ComponentSymbols
+ {
+ public static bool TryCreate(Compilation compilation, out ComponentSymbols symbols)
+ {
+ if (compilation == null)
+ {
+ throw new ArgumentNullException(nameof(compilation));
+ }
+
+ var parameterAttribute = compilation.GetTypeByMetadataName(ComponentsApi.ParameterAttribute.MetadataName);
+ if (parameterAttribute == null)
+ {
+ symbols = null;
+ return false;
+ }
+
+ var cascadingParameterAttribute = compilation.GetTypeByMetadataName(ComponentsApi.CascadingParameterAttribute.MetadataName);
+ if (cascadingParameterAttribute == null)
+ {
+ symbols = null;
+ return false;
+ }
+
+ var dictionary = compilation.GetTypeByMetadataName("System.Collections.Generic.Dictionary`2");
+ var @string = compilation.GetSpecialType(SpecialType.System_String);
+ var @object = compilation.GetSpecialType(SpecialType.System_Object);
+ if (dictionary == null || @string == null || @object == null)
+ {
+ symbols = null;
+ return false;
+ }
+
+ var parameterCaptureUnmatchedValuesRuntimeType = dictionary.Construct(@string, @object);
+
+ symbols = new ComponentSymbols(parameterAttribute, cascadingParameterAttribute, parameterCaptureUnmatchedValuesRuntimeType);
+ return true;
+ }
+
+ private ComponentSymbols(
+ INamedTypeSymbol parameterAttribute,
+ INamedTypeSymbol cascadingParameterAttribute,
+ INamedTypeSymbol parameterCaptureUnmatchedValuesRuntimeType)
+ {
+ ParameterAttribute = parameterAttribute;
+ CascadingParameterAttribute = cascadingParameterAttribute;
+ ParameterCaptureUnmatchedValuesRuntimeType = parameterCaptureUnmatchedValuesRuntimeType;
+ }
+
+ public INamedTypeSymbol ParameterAttribute { get; }
+
+ // Dictionary
+ public INamedTypeSymbol ParameterCaptureUnmatchedValuesRuntimeType { get; }
+
+ public INamedTypeSymbol CascadingParameterAttribute { get; }
+ }
+}
diff --git a/src/Components/Analyzers/src/ComponentsApi.cs b/src/Components/Analyzers/src/ComponentsApi.cs
index fdb83c6f05..83eb39cc2c 100644
--- a/src/Components/Analyzers/src/ComponentsApi.cs
+++ b/src/Components/Analyzers/src/ComponentsApi.cs
@@ -1,7 +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.
-namespace Microsoft.AspNetCore.Components.Shared
+namespace Microsoft.AspNetCore.Components.Analyzers
{
// Constants for type and method names used in code-generation
// Keep these in sync with the actual definitions
@@ -13,6 +13,14 @@ namespace Microsoft.AspNetCore.Components.Shared
{
public static readonly string FullTypeName = "Microsoft.AspNetCore.Components.ParameterAttribute";
public static readonly string MetadataName = FullTypeName;
+
+ public static readonly string CaptureUnmatchedValues = "CaptureUnmatchedValues";
+ }
+
+ public static class CascadingParameterAttribute
+ {
+ public static readonly string FullTypeName = "Microsoft.AspNetCore.Components.CascadingParameterAttribute";
+ public static readonly string MetadataName = FullTypeName;
}
}
}
diff --git a/src/Components/Analyzers/src/DiagnosticDescriptors.cs b/src/Components/Analyzers/src/DiagnosticDescriptors.cs
new file mode 100644
index 0000000000..cb380e5646
--- /dev/null
+++ b/src/Components/Analyzers/src/DiagnosticDescriptors.cs
@@ -0,0 +1,41 @@
+// 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 Microsoft.CodeAnalysis;
+
+namespace Microsoft.AspNetCore.Components.Analyzers
+{
+ internal static class DiagnosticDescriptors
+ {
+ // Note: The Razor Compiler (including Components features) use the RZ prefix for diagnostics, so there's currently
+ // no change of clashing between that and the BL prefix used here.
+ //
+ // Tracking https://github.com/aspnet/AspNetCore/issues/10382 to rationalize this
+ public static readonly DiagnosticDescriptor ComponentParametersShouldNotBePublic = new DiagnosticDescriptor(
+ "BL0001",
+ new LocalizableResourceString(nameof(Resources.ComponentParametersShouldNotBePublic_Title), Resources.ResourceManager, typeof(Resources)),
+ new LocalizableResourceString(nameof(Resources.ComponentParametersShouldNotBePublic_Format), Resources.ResourceManager, typeof(Resources)),
+ "Encapsulation",
+ DiagnosticSeverity.Warning,
+ isEnabledByDefault: true,
+ description: new LocalizableResourceString(nameof(Resources.ComponentParametersShouldNotBePublic_Description), Resources.ResourceManager, typeof(Resources)));
+
+ public static readonly DiagnosticDescriptor ComponentParameterCaptureUnmatchedValuesMustBeUnique = new DiagnosticDescriptor(
+ "BL0002",
+ new LocalizableResourceString(nameof(Resources.ComponentParameterCaptureUnmatchedValuesMustBeUnique_Title), Resources.ResourceManager, typeof(Resources)),
+ new LocalizableResourceString(nameof(Resources.ComponentParameterCaptureUnmatchedValuesMustBeUnique_Format), Resources.ResourceManager, typeof(Resources)),
+ "Usage",
+ DiagnosticSeverity.Warning,
+ isEnabledByDefault: true,
+ description: new LocalizableResourceString(nameof(Resources.ComponentParameterCaptureUnmatchedValuesMustBeUnique_Description), Resources.ResourceManager, typeof(Resources)));
+
+ public static readonly DiagnosticDescriptor ComponentParameterCaptureUnmatchedValuesHasWrongType = new DiagnosticDescriptor(
+ "BL0003",
+ new LocalizableResourceString(nameof(Resources.ComponentParameterCaptureUnmatchedValuesHasWrongType_Title), Resources.ResourceManager, typeof(Resources)),
+ new LocalizableResourceString(nameof(Resources.ComponentParameterCaptureUnmatchedValuesHasWrongType_Format), Resources.ResourceManager, typeof(Resources)),
+ "Usage",
+ DiagnosticSeverity.Warning,
+ isEnabledByDefault: true,
+ description: new LocalizableResourceString(nameof(Resources.ComponentParameterCaptureUnmatchedValuesHasWrongType_Description), Resources.ResourceManager, typeof(Resources)));
+ }
+}
diff --git a/src/Components/Analyzers/src/Properties/AssemblyInfo.cs b/src/Components/Analyzers/src/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000000..6e6689b592
--- /dev/null
+++ b/src/Components/Analyzers/src/Properties/AssemblyInfo.cs
@@ -0,0 +1,3 @@
+using System.Runtime.CompilerServices;
+
+[assembly: InternalsVisibleTo("Microsoft.AspNetCore.Components.Analyzers.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")]
diff --git a/src/Components/Analyzers/src/Resources.Designer.cs b/src/Components/Analyzers/src/Resources.Designer.cs
index df4ae809b0..e7f866fe08 100644
--- a/src/Components/Analyzers/src/Resources.Designer.cs
+++ b/src/Components/Analyzers/src/Resources.Designer.cs
@@ -10,7 +10,6 @@
namespace Microsoft.AspNetCore.Components.Analyzers {
using System;
- using System.Reflection;
///
@@ -20,7 +19,7 @@ namespace Microsoft.AspNetCore.Components.Analyzers {
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
@@ -40,7 +39,7 @@ namespace Microsoft.AspNetCore.Components.Analyzers {
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
- global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Microsoft.AspNetCore.Components.Analyzers.Resources", typeof(Resources).GetTypeInfo().Assembly);
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Microsoft.AspNetCore.Components.Analyzers.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
@@ -61,6 +60,60 @@ namespace Microsoft.AspNetCore.Components.Analyzers {
}
}
+ ///
+ /// Looks up a localized string similar to Component parameters with CaptureUnmatchedValuess must be a correct type..
+ ///
+ internal static string ComponentParameterCaptureUnmatchedValuesHasWrongType_Description {
+ get {
+ return ResourceManager.GetString("ComponentParameterCaptureUnmatchedValuesHasWrongType_Description", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Component parameter '{0}' defines CaptureUnmatchedValuess but has an unsupported type '{1}'. Use a type assignable from '{2}'..
+ ///
+ internal static string ComponentParameterCaptureUnmatchedValuesHasWrongType_Format {
+ get {
+ return ResourceManager.GetString("ComponentParameterCaptureUnmatchedValuesHasWrongType_Format", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Component parameter with CaptureUnmatchedValues has the wrong type.
+ ///
+ internal static string ComponentParameterCaptureUnmatchedValuesHasWrongType_Title {
+ get {
+ return ResourceManager.GetString("ComponentParameterCaptureUnmatchedValuesHasWrongType_Title", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Components may only define a single parameter with CaptureUnmatchedValues..
+ ///
+ internal static string ComponentParameterCaptureUnmatchedValuesMustBeUnique_Description {
+ get {
+ return ResourceManager.GetString("ComponentParameterCaptureUnmatchedValuesMustBeUnique_Description", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Component type '{0}' defines properties multiple parameters with CaptureUnmatchedValues. Properties: {1}{2}.
+ ///
+ internal static string ComponentParameterCaptureUnmatchedValuesMustBeUnique_Format {
+ get {
+ return ResourceManager.GetString("ComponentParameterCaptureUnmatchedValuesMustBeUnique_Format", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Component has multiple CaptureUnmatchedValues parameters.
+ ///
+ internal static string ComponentParameterCaptureUnmatchedValuesMustBeUnique_Title {
+ get {
+ return ResourceManager.GetString("ComponentParameterCaptureUnmatchedValuesMustBeUnique_Title", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Component parameters should not have public setters..
///
diff --git a/src/Components/Analyzers/src/Resources.resx b/src/Components/Analyzers/src/Resources.resx
index ec781527eb..2996ec3082 100644
--- a/src/Components/Analyzers/src/Resources.resx
+++ b/src/Components/Analyzers/src/Resources.resx
@@ -1,17 +1,17 @@
-
@@ -129,4 +129,22 @@
Component parameter has public setter
-
\ No newline at end of file
+
+ Components may only define a single parameter with CaptureUnmatchedValues.
+
+
+ Component type '{0}' defines properties multiple parameters with CaptureUnmatchedValues. Properties: {1}{2}
+
+
+ Component has multiple CaptureUnmatchedValues parameters
+
+
+ Component parameters with CaptureUnmatchedValues must be a correct type.
+
+
+ Component parameter '{0}' defines CaptureUnmatchedValues but has an unsupported type '{1}'. Use a type assignable from '{2}'.
+
+
+ Component parameter with CaptureUnmatchedValues has the wrong type
+
+
diff --git a/src/Components/Analyzers/test/ComponentParameterCaptureUnmatchedValuesHasWrongTypeTest.cs b/src/Components/Analyzers/test/ComponentParameterCaptureUnmatchedValuesHasWrongTypeTest.cs
new file mode 100644
index 0000000000..ba547ff85b
--- /dev/null
+++ b/src/Components/Analyzers/test/ComponentParameterCaptureUnmatchedValuesHasWrongTypeTest.cs
@@ -0,0 +1,80 @@
+// 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 Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.Diagnostics;
+using TestHelper;
+using Xunit;
+
+namespace Microsoft.AspNetCore.Components.Analyzers.Test
+{
+ public class ComponentParameterCaptureUnmatchedValuesHasWrongTypeTest : DiagnosticVerifier
+ {
+ [Theory]
+ [InlineData("System.Collections.Generic.IEnumerable>")]
+ [InlineData("System.Collections.Generic.Dictionary")]
+ [InlineData("System.Collections.Generic.IDictionary")]
+ [InlineData("System.Collections.Generic.IReadOnlyDictionary")]
+ public void IgnoresPropertiesWithSupportedType(string propertyType)
+ {
+ var test = $@"
+ namespace ConsoleApplication1
+ {{
+ using {typeof(ParameterAttribute).Namespace};
+ class TypeName
+ {{
+ [Parameter(CaptureUnmatchedValues = true)] {propertyType} MyProperty {{ get; set; }}
+ }}
+ }}" + ComponentsTestDeclarations.Source;
+
+ VerifyCSharpDiagnostic(test);
+ }
+
+ [Fact]
+ public void IgnoresPropertiesWithCaptureUnmatchedValuesFalse()
+ {
+ var test = $@"
+ namespace ConsoleApplication1
+ {{
+ using {typeof(ParameterAttribute).Namespace};
+ class TypeName
+ {{
+ [Parameter(CaptureUnmatchedValues = false)] string MyProperty {{ get; set; }}
+ }}
+ }}" + ComponentsTestDeclarations.Source;
+
+ VerifyCSharpDiagnostic(test);
+ }
+
+ [Fact]
+ public void AddsDiagnosticForInvalidType()
+ {
+ var test = $@"
+ namespace ConsoleApplication1
+ {{
+ using {typeof(ParameterAttribute).Namespace};
+ class TypeName
+ {{
+ [Parameter(CaptureUnmatchedValues = true)] string MyProperty {{ get; set; }}
+ }}
+ }}" + ComponentsTestDeclarations.Source;
+
+ VerifyCSharpDiagnostic(test,
+ new DiagnosticResult
+ {
+ Id = DiagnosticDescriptors.ComponentParameterCaptureUnmatchedValuesHasWrongType.Id,
+ Message = "Component parameter 'ConsoleApplication1.TypeName.MyProperty' defines CaptureUnmatchedValues but has an unsupported type 'string'. Use a type assignable from 'System.Collections.Generic.Dictionary'.",
+ Severity = DiagnosticSeverity.Warning,
+ Locations = new[]
+ {
+ new DiagnosticResultLocation("Test0.cs", 7, 63)
+ }
+ });
+ }
+
+ protected override DiagnosticAnalyzer GetCSharpDiagnosticAnalyzer()
+ {
+ return new ComponentParameterAnalyzer();
+ }
+ }
+}
diff --git a/src/Components/Analyzers/test/ComponentParameterCaptureUnmatchedValuesMustBeUniqueTest.cs b/src/Components/Analyzers/test/ComponentParameterCaptureUnmatchedValuesMustBeUniqueTest.cs
new file mode 100644
index 0000000000..7e2c919287
--- /dev/null
+++ b/src/Components/Analyzers/test/ComponentParameterCaptureUnmatchedValuesMustBeUniqueTest.cs
@@ -0,0 +1,69 @@
+// 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 Microsoft.CodeAnalysis;
+using Microsoft.CodeAnalysis.Diagnostics;
+using TestHelper;
+using Xunit;
+
+namespace Microsoft.AspNetCore.Components.Analyzers.Test
+{
+ public class ComponentParameterCaptureUnmatchedValuesMustBeUniqueTest : DiagnosticVerifier
+ {
+ [Fact]
+ public void IgnoresPropertiesWithCaptureUnmatchedValuesFalse()
+ {
+ var test = $@"
+ namespace ConsoleApplication1
+ {{
+ using System.Collections.Generic;
+ using {typeof(ParameterAttribute).Namespace};
+ class TypeName
+ {{
+ [Parameter(CaptureUnmatchedValues = false)] string MyProperty {{ get; set; }}
+ [Parameter(CaptureUnmatchedValues = true)] Dictionary MyOtherProperty {{ get; set; }}
+ }}
+ }}" + ComponentsTestDeclarations.Source;
+
+ VerifyCSharpDiagnostic(test);
+ }
+
+ [Fact]
+ public void AddsDiagnosticForMultipleCaptureUnmatchedValuesProperties()
+ {
+ var test = $@"
+ namespace ConsoleApplication1
+ {{
+ using System.Collections.Generic;
+ using {typeof(ParameterAttribute).Namespace};
+ class TypeName
+ {{
+ [Parameter(CaptureUnmatchedValues = true)] Dictionary MyProperty {{ get; set; }}
+ [Parameter(CaptureUnmatchedValues = true)] Dictionary MyOtherProperty {{ get; set; }}
+ }}
+ }}" + ComponentsTestDeclarations.Source;
+
+ var message = @"Component type 'ConsoleApplication1.TypeName' defines properties multiple parameters with CaptureUnmatchedValues. Properties: " + Environment.NewLine +
+"ConsoleApplication1.TypeName.MyOtherProperty" + Environment.NewLine +
+"ConsoleApplication1.TypeName.MyProperty";
+
+ VerifyCSharpDiagnostic(test,
+ new DiagnosticResult
+ {
+ Id = DiagnosticDescriptors.ComponentParameterCaptureUnmatchedValuesMustBeUnique.Id,
+ Message = message,
+ Severity = DiagnosticSeverity.Warning,
+ Locations = new[]
+ {
+ new DiagnosticResultLocation("Test0.cs", 6, 15)
+ }
+ });
+ }
+
+ protected override DiagnosticAnalyzer GetCSharpDiagnosticAnalyzer()
+ {
+ return new ComponentParameterAnalyzer();
+ }
+ }
+}
diff --git a/src/Components/Analyzers/test/ComponentParametersShouldNotBePublicTest.cs b/src/Components/Analyzers/test/ComponentParametersShouldNotBePublicTest.cs
index 1a4f93a5a6..8d5df9053f 100644
--- a/src/Components/Analyzers/test/ComponentParametersShouldNotBePublicTest.cs
+++ b/src/Components/Analyzers/test/ComponentParametersShouldNotBePublicTest.cs
@@ -1,7 +1,6 @@
// 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 Microsoft.AspNetCore.Components;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CodeFixes;
using Microsoft.CodeAnalysis.Diagnostics;
@@ -12,15 +11,6 @@ namespace Microsoft.AspNetCore.Components.Analyzers.Test
{
public class ComponentParametersShouldNotBePublic : CodeFixVerifier
{
- static string ParameterSource = $@"
- namespace {typeof(ParameterAttribute).Namespace}
- {{
- public class {typeof(ParameterAttribute).Name} : System.Attribute
- {{
- }}
- }}
-";
-
[Fact]
public void IgnoresPublicPropertiesWithoutParameterAttribute()
{
@@ -31,7 +21,7 @@ namespace Microsoft.AspNetCore.Components.Analyzers.Test
{
public string MyProperty { get; set; }
}
- }" + ParameterSource;
+ }" + ComponentsTestDeclarations.Source;
VerifyCSharpDiagnostic(test);
}
@@ -48,10 +38,10 @@ namespace Microsoft.AspNetCore.Components.Analyzers.Test
{
[Parameter] string MyPropertyNoModifer { get; set; }
[Parameter] private string MyPropertyPrivate { get; set; }
- [Parameter] protected string MyPropertyProtected { get; set; }
- [Parameter] internal string MyPropertyInternal { get; set; }
+ [CascadingParameter] protected string MyPropertyProtected { get; set; }
+ [CascadingParameter] internal string MyPropertyInternal { get; set; }
}
- }" + ParameterSource;
+ }" + ComponentsTestDeclarations.Source;
VerifyCSharpDiagnostic(test);
}
@@ -67,29 +57,29 @@ namespace Microsoft.AspNetCore.Components.Analyzers.Test
class TypeName
{
[Parameter] public string BadProperty1 { get; set; }
- [Parameter] public object BadProperty2 { get; set; }
+ [CascadingParameter] public object BadProperty2 { get; set; }
}
- }" + ParameterSource;
+ }" + ComponentsTestDeclarations.Source;
VerifyCSharpDiagnostic(test,
new DiagnosticResult
{
- Id = "BL9993",
- Message = "Component parameter 'BadProperty1' has a public setter, but component parameters should not be publicly settable.",
+ Id = DiagnosticDescriptors.ComponentParametersShouldNotBePublic.Id,
+ Message = "Component parameter 'ConsoleApplication1.TypeName.BadProperty1' has a public setter, but component parameters should not be publicly settable.",
Severity = DiagnosticSeverity.Warning,
Locations = new[]
{
- new DiagnosticResultLocation("Test0.cs", 8, 13)
+ new DiagnosticResultLocation("Test0.cs", 8, 39)
}
},
new DiagnosticResult
{
- Id = "BL9993",
- Message = "Component parameter 'BadProperty2' has a public setter, but component parameters should not be publicly settable.",
+ Id = DiagnosticDescriptors.ComponentParametersShouldNotBePublic.Id,
+ Message = "Component parameter 'ConsoleApplication1.TypeName.BadProperty2' has a public setter, but component parameters should not be publicly settable.",
Severity = DiagnosticSeverity.Warning,
Locations = new[]
{
- new DiagnosticResultLocation("Test0.cs", 9, 13)
+ new DiagnosticResultLocation("Test0.cs", 9, 48)
}
});
@@ -101,9 +91,9 @@ namespace Microsoft.AspNetCore.Components.Analyzers.Test
class TypeName
{
[Parameter] string BadProperty1 { get; set; }
- [Parameter] object BadProperty2 { get; set; }
+ [CascadingParameter] object BadProperty2 { get; set; }
}
- }" + ParameterSource);
+ }" + ComponentsTestDeclarations.Source);
}
[Fact]
@@ -120,7 +110,7 @@ namespace Microsoft.AspNetCore.Components.Analyzers.Test
[Parameter] public object MyProperty2 { get; protected set; }
[Parameter] public object MyProperty2 { get; internal set; }
}
- }" + ParameterSource;
+ }" + ComponentsTestDeclarations.Source;
VerifyCSharpDiagnostic(test);
}
@@ -132,7 +122,7 @@ namespace Microsoft.AspNetCore.Components.Analyzers.Test
protected override DiagnosticAnalyzer GetCSharpDiagnosticAnalyzer()
{
- return new ComponentParametersShouldNotBePublicAnalyzer();
+ return new ComponentParameterAnalyzer();
}
}
}
diff --git a/src/Components/Analyzers/test/ComponentsTestDeclarations.cs b/src/Components/Analyzers/test/ComponentsTestDeclarations.cs
new file mode 100644
index 0000000000..e09f156ff4
--- /dev/null
+++ b/src/Components/Analyzers/test/ComponentsTestDeclarations.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.
+
+namespace Microsoft.AspNetCore.Components.Analyzers
+{
+ public static class ComponentsTestDeclarations
+ {
+ public static readonly string Source = $@"
+ namespace {typeof(ParameterAttribute).Namespace}
+ {{
+ public class {typeof(ParameterAttribute).Name} : System.Attribute
+ {{
+ public bool CaptureUnmatchedValues {{ get; set; }}
+ }}
+
+ public class {typeof(CascadingParameterAttribute).Name} : System.Attribute
+ {{
+ }}
+ }}
+";
+ }
+}
diff --git a/src/Components/Blazor/Blazor/src/Hosting/WebAssemblyHostBuilder.cs b/src/Components/Blazor/Blazor/src/Hosting/WebAssemblyHostBuilder.cs
index 8cf720e1ca..0b741cbd22 100644
--- a/src/Components/Blazor/Blazor/src/Hosting/WebAssemblyHostBuilder.cs
+++ b/src/Components/Blazor/Blazor/src/Hosting/WebAssemblyHostBuilder.cs
@@ -8,6 +8,8 @@ using Microsoft.AspNetCore.Blazor.Services;
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Routing;
using Microsoft.Extensions.DependencyInjection;
+using Microsoft.Extensions.DependencyInjection.Extensions;
+using Microsoft.Extensions.Logging;
using Microsoft.JSInterop;
namespace Microsoft.AspNetCore.Blazor.Hosting
@@ -92,6 +94,7 @@ namespace Microsoft.AspNetCore.Blazor.Hosting
services.AddSingleton();
services.AddSingleton(WebAssemblyUriHelper.Instance);
services.AddSingleton(WebAssemblyNavigationInterception.Instance);
+ services.AddSingleton();
services.AddSingleton(s =>
{
// Creating the URI helper needs to wait until the JS Runtime is initialized, so defer it.
@@ -102,6 +105,10 @@ namespace Microsoft.AspNetCore.Blazor.Hosting
};
});
+ // Needed for authorization
+ services.AddOptions();
+ services.TryAdd(ServiceDescriptor.Singleton(typeof(ILogger<>), typeof(WebAssemblyConsoleLogger<>)));
+
foreach (var configureServicesAction in _configureServicesActions)
{
configureServicesAction(_BrowserHostBuilderContext, services);
diff --git a/src/Components/Blazor/Blazor/src/Http/WebAssemblyHttpMessageHandler.cs b/src/Components/Blazor/Blazor/src/Http/WebAssemblyHttpMessageHandler.cs
index a7dbb6b9eb..955d5ee664 100644
--- a/src/Components/Blazor/Blazor/src/Http/WebAssemblyHttpMessageHandler.cs
+++ b/src/Components/Blazor/Blazor/src/Http/WebAssemblyHttpMessageHandler.cs
@@ -6,10 +6,11 @@ using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
+using System.Text.Json.Serialization;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Blazor.Services;
-using Microsoft.JSInterop;
+using Microsoft.AspNetCore.Components;
namespace Microsoft.AspNetCore.Blazor.Http
{
@@ -59,7 +60,7 @@ namespace Microsoft.AspNetCore.Blazor.Http
options.RequestInit = new RequestInit
{
Credentials = GetDefaultCredentialsString(),
- Headers = GetHeadersAsStringArray(request),
+ Headers = GetHeaders(request),
Method = request.Method.Method
};
@@ -68,7 +69,7 @@ namespace Microsoft.AspNetCore.Blazor.Http
"Blazor._internal.http.sendAsync",
id,
request.Content == null ? null : await request.Content.ReadAsByteArrayAsync(),
- Json.Serialize(options));
+ JsonSerializer.ToString(options, JsonSerializerOptionsProvider.Options));
return await tcs.Task;
}
@@ -99,7 +100,7 @@ namespace Microsoft.AspNetCore.Blazor.Http
}
else
{
- var responseDescriptor = Json.Deserialize(responseDescriptorJson);
+ var responseDescriptor = JsonSerializer.Parse(responseDescriptorJson, JsonSerializerOptionsProvider.Options);
var responseContent = responseBodyData == null ? null : new ByteArrayContent(responseBodyData);
var responseMessage = responseDescriptor.ToResponseMessage(responseContent);
tcs.SetResult(responseMessage);
@@ -114,10 +115,25 @@ namespace Microsoft.AspNetCore.Blazor.Http
private static byte[] AllocateArray(string length) => new byte[int.Parse(length)];
#pragma warning restore IDE0051 // Remove unused private members
- private string[][] GetHeadersAsStringArray(HttpRequestMessage request)
- => (from header in request.Headers.Concat(request.Content?.Headers ?? Enumerable.Empty>>())
- from headerValue in header.Value // There can be more than one value for each name
- select new[] { header.Key, headerValue }).ToArray();
+ private static IReadOnlyList GetHeaders(HttpRequestMessage request)
+ {
+ var requestHeaders = request.Headers.AsEnumerable();
+ if (request.Content?.Headers != null)
+ {
+ requestHeaders = requestHeaders.Concat(request.Content.Headers);
+ }
+
+ var headers = new List();
+ foreach (var item in requestHeaders)
+ {
+ foreach (var headerValue in item.Value)
+ {
+ headers.Add(new Header { Name = item.Key, Value = headerValue });
+ }
+ }
+
+ return headers;
+ }
private static string GetDefaultCredentialsString()
{
@@ -147,7 +163,7 @@ namespace Microsoft.AspNetCore.Blazor.Http
private class RequestInit
{
public string Credentials { get; set; }
- public string[][] Headers { get; set; }
+ public IReadOnlyList Headers { get; set; }
public string Method { get; set; }
}
@@ -156,7 +172,7 @@ namespace Microsoft.AspNetCore.Blazor.Http
#pragma warning disable 0649
public int StatusCode { get; set; }
public string StatusText { get; set; }
- public string[][] Headers { get; set; }
+ public IReadOnlyList Headers { get; set; }
#pragma warning restore 0649
public HttpResponseMessage ToResponseMessage(HttpContent content)
@@ -168,14 +184,21 @@ namespace Microsoft.AspNetCore.Blazor.Http
var contentHeaders = result.Content?.Headers;
foreach (var pair in Headers)
{
- if (!headers.TryAddWithoutValidation(pair[0], pair[1]))
+ if (!headers.TryAddWithoutValidation(pair.Name, pair.Value))
{
- contentHeaders?.TryAddWithoutValidation(pair[0], pair[1]);
+ contentHeaders?.TryAddWithoutValidation(pair.Name, pair.Value);
}
}
return result;
}
}
+
+ private class Header
+ {
+ public string Name { get; set; }
+
+ public string Value { get; set; }
+ }
}
}
diff --git a/src/Components/Blazor/Blazor/src/Microsoft.AspNetCore.Blazor.csproj b/src/Components/Blazor/Blazor/src/Microsoft.AspNetCore.Blazor.csproj
index fe6a77482a..9dc8358ff5 100644
--- a/src/Components/Blazor/Blazor/src/Microsoft.AspNetCore.Blazor.csproj
+++ b/src/Components/Blazor/Blazor/src/Microsoft.AspNetCore.Blazor.csproj
@@ -1,4 +1,4 @@
-
+
netstandard2.0
diff --git a/src/Components/Blazor/Blazor/src/Services/WebAssemblyConsoleLogger.cs b/src/Components/Blazor/Blazor/src/Services/WebAssemblyConsoleLogger.cs
new file mode 100644
index 0000000000..c86c1cf30b
--- /dev/null
+++ b/src/Components/Blazor/Blazor/src/Services/WebAssemblyConsoleLogger.cs
@@ -0,0 +1,34 @@
+// 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 Microsoft.Extensions.Logging;
+
+namespace Microsoft.AspNetCore.Blazor.Services
+{
+ internal class WebAssemblyConsoleLogger : ILogger, ILogger
+ {
+ public IDisposable BeginScope(TState state)
+ {
+ return NoOpDisposable.Instance;
+ }
+
+ public bool IsEnabled(LogLevel logLevel)
+ {
+ return logLevel >= LogLevel.Warning;
+ }
+
+ public void Log(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func formatter)
+ {
+ var formattedMessage = formatter(state, exception);
+ Console.WriteLine($"[{logLevel}] {formattedMessage}");
+ }
+
+ private class NoOpDisposable : IDisposable
+ {
+ public static NoOpDisposable Instance = new NoOpDisposable();
+
+ public void Dispose() { }
+ }
+ }
+}
diff --git a/src/Components/Blazor/Blazor/src/Services/WebAssemblyLoggerFactory.cs b/src/Components/Blazor/Blazor/src/Services/WebAssemblyLoggerFactory.cs
new file mode 100644
index 0000000000..73458387e7
--- /dev/null
+++ b/src/Components/Blazor/Blazor/src/Services/WebAssemblyLoggerFactory.cs
@@ -0,0 +1,23 @@
+// 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 Microsoft.Extensions.Logging;
+
+namespace Microsoft.AspNetCore.Blazor.Services
+{
+ internal class WebAssemblyLoggerFactory : ILoggerFactory
+ {
+ public void AddProvider(ILoggerProvider provider)
+ {
+ // No-op
+ }
+
+ public ILogger CreateLogger(string categoryName)
+ => new WebAssemblyConsoleLogger
+
+
+
+
diff --git a/src/Components/Blazor/Build/test/BindRazorIntegrationTest.cs b/src/Components/Blazor/Build/test/BindRazorIntegrationTest.cs
index 864d78e4e9..44541b8909 100644
--- a/src/Components/Blazor/Build/test/BindRazorIntegrationTest.cs
+++ b/src/Components/Blazor/Build/test/BindRazorIntegrationTest.cs
@@ -39,8 +39,8 @@ namespace Test
}"));
var component = CompileToComponent(@"
-
-@functions {
+
+@code {
public int ParentValue { get; set; } = 42;
}");
@@ -76,8 +76,8 @@ namespace Test
}"));
var component = CompileToComponent(@"
-
-@functions {
+
+@code {
public int ParentValue { get; set; } = 42;
}");
@@ -113,8 +113,8 @@ namespace Test
}"));
var component = CompileToComponent(@"
-
-@functions {
+
+@code {
public int ParentValue { get; set; } = 42;
}");
@@ -150,8 +150,8 @@ namespace Test
}"));
var component = CompileToComponent(@"
-
-@functions {
+
+@code {
public int ParentValue { get; set; } = 42;
}");
@@ -183,8 +183,8 @@ namespace Test
}"));
var component = CompileToComponent(@"
-
-@functions {
+
+@code {
public string ParentValue { get; set; } = ""hi"";
}");
@@ -216,8 +216,8 @@ namespace Test
}"));
var component = CompileToComponent(@"
-
-@functions {
+
+@code {
public string ParentValue { get; set; } = ""hi"";
}");
@@ -251,8 +251,8 @@ namespace Test
// Act
var result = CompileToCSharp(@"
-
-@functions {
+
+@code {
public string ParentValue { get; set; } = ""hi"";
}");
@@ -260,7 +260,7 @@ namespace Test
var diagnostic = Assert.Single(result.Diagnostics);
Assert.Equal("RZ9989", diagnostic.Id);
Assert.Equal(
- "The attribute 'bind-value' was matched by multiple bind attributes. Duplicates:" + Environment.NewLine +
+ "The attribute '@bind-value' was matched by multiple bind attributes. Duplicates:" + Environment.NewLine +
"Test.BindAttributes" + Environment.NewLine +
"Test.BindAttributes",
diagnostic.GetMessage());
@@ -271,8 +271,8 @@ namespace Test
{
// Arrange
var component = CompileToComponent(@"
-
-@functions {
+
+@code {
public int ParentValue { get; set; } = 42;
}");
@@ -292,8 +292,8 @@ namespace Test
{
// Arrange
var component = CompileToComponent(@"
-
-@functions {
+
+@code {
public DateTime CurrentDate { get; set; } = new DateTime(2018, 1, 1);
}");
@@ -314,8 +314,8 @@ namespace Test
{
// Arrange
var component = CompileToComponent(@"
-
-@functions {
+
+@code {
public DateTime CurrentDate { get; set; } = new DateTime(2018, 1, 1);
public string Format { get; set; } = ""MM/dd/yyyy"";
@@ -338,8 +338,8 @@ namespace Test
{
// Arrange
var component = CompileToComponent(@"
-
-@functions {
+
+@code {
public int ParentValue { get; set; } = 42;
}");
@@ -360,8 +360,8 @@ namespace Test
{
// Arrange
var component = CompileToComponent(@"
-
-@functions {
+
+@code {
public bool Enabled { get; set; }
}");
@@ -381,8 +381,8 @@ namespace Test
{
// Arrange
var component = CompileToComponent(@"
-
-@functions {
+
+@code {
public int ParentValue { get; set; } = 42;
}");
@@ -403,8 +403,8 @@ namespace Test
{
// Arrange
var component = CompileToComponent(@"
-
-@functions {
+
+@code {
public DateTime CurrentDate { get; set; } = new DateTime(2018, 1, 1);
}");
@@ -425,8 +425,8 @@ namespace Test
{
// Arrange
var component = CompileToComponent(@"
-
-@functions {
+
+@code {
public int ParentValue { get; set; } = 42;
}");
@@ -448,8 +448,8 @@ namespace Test
{
// Arrange
var component = CompileToComponent(@"
-
-@functions {
+
+@code {
public int ParentValue { get; set; } = 42;
}");
@@ -474,10 +474,10 @@ namespace Test
{
// Arrange
var component = CompileToComponent(@"
-
+
@(42.ToString())
-@functions {
+@code {
public int ParentValue { get; set; } = 42;
}");
@@ -501,8 +501,8 @@ namespace Test
{
// Arrange & Act
var generated = CompileToCSharp(@"
-
-@functions {
+
+@code {
public string Text { get; set; } = ""text"";
}");
@@ -516,8 +516,8 @@ namespace Test
{
// Arrange & Act
var generated = CompileToCSharp(@"
-
-@functions {
+
+@code {
public string Text { get; set; } = ""text"";
}");
diff --git a/src/Components/Blazor/Build/test/ComponentRenderingRazorIntegrationTest.cs b/src/Components/Blazor/Build/test/ComponentRenderingRazorIntegrationTest.cs
index ae8bb7b26d..0d69f27e1d 100644
--- a/src/Components/Blazor/Build/test/ComponentRenderingRazorIntegrationTest.cs
+++ b/src/Components/Blazor/Build/test/ComponentRenderingRazorIntegrationTest.cs
@@ -216,7 +216,7 @@ namespace Test
var component = CompileToComponent($@"
-@functions {{
+@code {{
private int counter;
private void Increment(UIMouseEventArgs e) {{
counter++;
@@ -261,7 +261,7 @@ namespace Test
var component = CompileToComponent(@"
-@functions {
+@code {
private int counter;
private void Increment(UIEventArgs e) {
counter++;
@@ -445,8 +445,8 @@ namespace Test
// Act
var component = CompileToComponent(@"
-
-@functions {
+
+@code {
public string ParentBgColor { get; set; } = ""#FFFFFF"";
public void OnComponentHover(UIMouseEventArgs e)
diff --git a/src/Components/Blazor/Build/test/GenericComponentRazorIntegrationTest.cs b/src/Components/Blazor/Build/test/GenericComponentRazorIntegrationTest.cs
index 66073c06d7..b780161b0c 100644
--- a/src/Components/Blazor/Build/test/GenericComponentRazorIntegrationTest.cs
+++ b/src/Components/Blazor/Build/test/GenericComponentRazorIntegrationTest.cs
@@ -121,9 +121,9 @@ namespace Test
AdditionalSyntaxTrees.Add(GenericContextComponent);
var component = CompileToComponent(@"
-
() { 1, 2, })"" ref=""_my"" />
+() { 1, 2, })"" @ref=""_my"" />
-@functions {
+@code {
GenericContext _my;
void Foo() { GC.KeepAlive(_my); }
}");
@@ -188,9 +188,9 @@ namespace Test
AdditionalSyntaxTrees.Add(GenericContextComponent);
var component = CompileToComponent(@"
-() { 1, 2, })"" ref=""_my"" />
+() { 1, 2, })"" @ref=""_my"" />
-@functions {
+@code {
GenericContext _my;
void Foo() { GC.KeepAlive(_my); }
}");
@@ -221,9 +221,9 @@ namespace Test
var assembly = CompileToAssembly("Test.cshtml", @"
@typeparam TItem
-
+
-@functions {
+@code {
[Parameter] List MyItems { get; set; }
GenericContext _my;
void Foo() { GC.KeepAlive(_my); }
diff --git a/src/Components/Blazor/Build/test/RenderingRazorIntegrationTest.cs b/src/Components/Blazor/Build/test/RenderingRazorIntegrationTest.cs
index 4aea4cf230..815c5f16fe 100644
--- a/src/Components/Blazor/Build/test/RenderingRazorIntegrationTest.cs
+++ b/src/Components/Blazor/Build/test/RenderingRazorIntegrationTest.cs
@@ -64,7 +64,7 @@ namespace Microsoft.AspNetCore.Blazor.Build.Test
@foreach(var item in items) {
@item
}
- @functions {
+ @code {
string[] items = new[] { ""First"", ""Second"", ""Third"" };
}
");
@@ -296,7 +296,7 @@ namespace Microsoft.AspNetCore.Blazor.Build.Test
// Arrange/Act
var component = CompileToComponent(
@"
- @functions {
+ @code {
public bool HandlerWasCalled { get; set; } = false;
void MyHandleEvent(Microsoft.AspNetCore.Components.UIEventArgs eventArgs)
@@ -340,8 +340,8 @@ namespace Microsoft.AspNetCore.Blazor.Build.Test
{
// Arrange/Act
var component = CompileToComponent(
- @"
- @functions {
+ @"
+ @code {
public string MyValue { get; set; } = ""Initial value"";
}");
var myValueProperty = component.GetType().GetProperty("MyValue");
@@ -375,8 +375,8 @@ namespace Microsoft.AspNetCore.Blazor.Build.Test
{
// Arrange/Act
var component = CompileToComponent(
- @"
- @functions {
+ @"
+ @code {
public string MyValue { get; set; } = ""Initial value"";
}");
var myValueProperty = component.GetType().GetProperty("MyValue");
@@ -410,8 +410,8 @@ namespace Microsoft.AspNetCore.Blazor.Build.Test
{
// Arrange/Act
var component = CompileToComponent(
- @"
- @functions {
+ @"
+ @code {
public DateTime MyDate { get; set; } = new DateTime(2018, 3, 4, 1, 2, 3);
}");
var myDateProperty = component.GetType().GetProperty("MyDate");
@@ -448,8 +448,8 @@ namespace Microsoft.AspNetCore.Blazor.Build.Test
// Arrange/Act
var testDateFormat = "ddd yyyy-MM-dd";
var component = CompileToComponent(
- $@"
- @functions {{
+ $@"
+ @code {{
public DateTime MyDate {{ get; set; }} = new DateTime(2018, 3, 4);
}}");
var myDateProperty = component.GetType().GetProperty("MyDate");
@@ -483,7 +483,7 @@ namespace Microsoft.AspNetCore.Blazor.Build.Test
{
// Arrange
var component = CompileToComponent(@"
-");
+");
// Act
var frames = GetRenderTree(component);
@@ -499,8 +499,8 @@ namespace Microsoft.AspNetCore.Blazor.Build.Test
{
// Arrange
var component = CompileToComponent(@"
-