From 16c11b4c8789064921bea9a7632385c80e6e46f6 Mon Sep 17 00:00:00 2001 From: Steve Sanderson Date: Tue, 27 Nov 2018 11:48:54 +0000 Subject: [PATCH] Integrate src/Components into mondorepo build system --- build/artifacts.props | 8 + build/buildorder.props | 3 +- build/submodules.props | 1 + src/Components/CODE_OF_CONDUCT.md | 3 - src/Components/CONTRIBUTING.md | 40 --- src/Components/Directory.Build.props | 31 +-- src/Components/NuGetPackageVerifier.json | 161 ++++++++++++ src/Components/blazor/Directory.Build.props | 4 + .../Directory.Build.props | 2 +- .../blazor/samples/Directory.Build.props | 2 +- .../blazor/src/Directory.Build.props | 2 +- .../Microsoft.AspNetCore.Blazor.Cli.csproj | 1 + ...crosoft.AspNetCore.Blazor.Templates.csproj | 7 + ...crosoft.AspNetCore.Blazor.Templates.nuspec | 2 +- .../SetPackageProperties.targets | 3 +- ...rosoft.VisualStudio.BlazorExtension.csproj | 6 +- .../Properties/AssemblyInfo.cs | 4 +- src/Components/{ => blazor}/version.props | 3 +- src/Components/build.cmd | 3 +- src/Components/build.sh | 7 +- src/Components/build/dependencies.props | 2 - src/Components/build/repo.props | 2 +- src/Components/global.json | 8 - src/Components/korebuild-lock.txt | 2 - src/Components/run.cmd | 2 - src/Components/run.ps1 | 208 --------------- src/Components/run.sh | 245 ------------------ ...oft.AspNetCore.Components.Analyzers.csproj | 2 + ...ft.AspNetCore.Components.Browser.JS.csproj | 3 +- ...osoft.AspNetCore.Components.Browser.csproj | 1 + ...crosoft.AspNetCore.Components.Build.csproj | 20 +- ...crosoft.AspNetCore.Components.Build.nuspec | 7 +- ...NetCore.Components.Razor.Extensions.csproj | 3 +- ...rosoft.AspNetCore.Components.Server.csproj | 1 + ...Core.Components.TagHelperWorkaround.csproj | 3 +- .../Microsoft.AspNetCore.Components.csproj | 1 + 36 files changed, 239 insertions(+), 564 deletions(-) delete mode 100644 src/Components/CODE_OF_CONDUCT.md delete mode 100644 src/Components/CONTRIBUTING.md create mode 100644 src/Components/NuGetPackageVerifier.json create mode 100644 src/Components/blazor/Directory.Build.props rename src/Components/{ => blazor}/version.props (84%) delete mode 100644 src/Components/global.json delete mode 100644 src/Components/korebuild-lock.txt delete mode 100644 src/Components/run.cmd delete mode 100644 src/Components/run.ps1 delete mode 100644 src/Components/run.sh diff --git a/build/artifacts.props b/build/artifacts.props index a600bd7c46..500f659281 100644 --- a/build/artifacts.props +++ b/build/artifacts.props @@ -29,6 +29,14 @@ + + + + + + + + diff --git a/build/buildorder.props b/build/buildorder.props index fc0cec2f1e..2249f8ba1b 100644 --- a/build/buildorder.props +++ b/build/buildorder.props @@ -29,6 +29,7 @@ - + + diff --git a/build/submodules.props b/build/submodules.props index d46bd6b6aa..a3f733e9e8 100644 --- a/build/submodules.props +++ b/build/submodules.props @@ -40,6 +40,7 @@ + diff --git a/src/Components/CODE_OF_CONDUCT.md b/src/Components/CODE_OF_CONDUCT.md deleted file mode 100644 index 28979d5ef3..0000000000 --- a/src/Components/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,3 +0,0 @@ -# Code of Conduct - -This project has adopted the code of conduct defined by the Contributor Covenant to clarify expected behavior in our community. For more information, see the [.NET Foundation Code of Conduct](https://dotnetfoundation.org/code-of-conduct). diff --git a/src/Components/CONTRIBUTING.md b/src/Components/CONTRIBUTING.md deleted file mode 100644 index 78909b087e..0000000000 --- a/src/Components/CONTRIBUTING.md +++ /dev/null @@ -1,40 +0,0 @@ -# How to contribute - -There are lots of ways to contribute to Blazor and we appreciate the help from the community. You can provide feedback, report bugs, give suggestions, contribute code, and participate in the discussion. - -## Code of conduct - -To better foster an open, innovative and inclusive community please refer to our [Code of Conduct](CODE_OF_CONDUCT.md) when contributing. - -## Provide feedback - -Since Blazor is currently an experimental project, its primary focus at this time is to explore potential long term directions and to collect feedback. We rely on feedback from users and the community to help us determine if Blazor is heading in the right direction. We want to hear about your experience, scenarios, and requirements. - -### Report a bug - -If you think you've found a non-security related bug, please log a new issue in the [Blazor GitHub issue tracker](https://github.com/aspnet/Blazor/issues). When filing issues, please use our [bug filing template](https://github.com/aspnet/Home/wiki/Functional-bug-template). -The best way to get your bug fixed is to be as detailed as you can be about the problem. -Providing a minimal project with steps to reproduce the problem is ideal. -Here are questions you can answer before you file a bug to make sure you're not missing any important information. - -1. Did you read the [documentation](https://blazor.net/docs/index.html)? -2. Did you include the snippet of broken code in the issue? -3. What are the *EXACT* steps to reproduce this problem? -4. What specific version or build are you using? -5. What operating system are you using? - -GitHub supports [markdown](https://help.github.com/articles/github-flavored-markdown/), so when filing bugs make sure you check the formatting before clicking submit. - -> Note: 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://www.microsoft.com/en-us/msrc/). - -### Make a suggestion - -If you have an idea for a new feature or enhancement let us know by filing an [issue](https://github.com/aspnet/blazor/issues). To help us understand and prioritize your idea please provide as much detail about your scenario and why the feature or enhancement would be useful. - -### Ask questions - -If you have a question be sure to first checkout our [documentation](https://github.com/aspnet/blazor/wiki). You can also ask your question on [Stack Overflow](https://stackoverflow.com/) with the [blazor](https://stackoverflow.com/questions/tagged/blazor) tag to get help from the community. But if you're still stuck, file an [issue](https://github.com/aspnet/blazor/issues) and we'll do our best to answer it. - -## Contributing code and content - -Blazor is an open source project and we welcome code and content contributions from the community. For details on how to submit a PR please see the ["Contributing code and content" section of the ASP.NET Contributing Guide](https://github.com/aspnet/Home/blob/master/CONTRIBUTING.md#contributing-code-and-content). diff --git a/src/Components/Directory.Build.props b/src/Components/Directory.Build.props index 676dcf6904..1982153766 100644 --- a/src/Components/Directory.Build.props +++ b/src/Components/Directory.Build.props @@ -1,34 +1,23 @@ - + - - Microsoft ASP.NET Core Blazor - https://github.com/aspnet/blazor - git $(MSBuildThisFileDirectory) - $(MSBuildThisFileDirectory)build\Key.snk - true - true - Microsoft - 7.3 + aspnetcore;components + https://go.microsoft.com/fwlink/?LinkID=288859 + true - - false + + $(MSBuildThisFileDirectory)src\Microsoft.AspNetCore.Components.Build\bin\$(Configuration)\netcoreapp2.1\ - - - - $(ArtifactsBinDir)Microsoft.AspNetCore.Components.Build\netcoreapp2.1\ + false + true + + false - - - diff --git a/src/Components/NuGetPackageVerifier.json b/src/Components/NuGetPackageVerifier.json new file mode 100644 index 0000000000..23e05f16aa --- /dev/null +++ b/src/Components/NuGetPackageVerifier.json @@ -0,0 +1,161 @@ +{ + "adx": { + "rules": [ + "AdxVerificationCompositeRule" + ], + "packages": { + "Microsoft.AspNetCore.Components.Build": { + "Exclusions": { + "ASSEMBLY_COMPANY": { + "tools/Mono.Cecil.dll": "External package", + "tools/Mono.Cecil.Mdb.dll": "External package", + "tools/Mono.Cecil.Pdb.dll": "External package", + "tools/Mono.Cecil.Rocks.dll": "External package" + }, + "BUILD_ITEMS_FRAMEWORK": { + "*": "The netstandard output is purely MSBuild targets" + }, + "DOC_MISSING": { + "lib/netstandard1.0/Microsoft.AspNetCore.Components.TagHelperWorkaround.dll": "Not user visible" + }, + "ASSEMBLY_DESCRIPTION": { + "tools/Microsoft.CodeAnalysis.CSharp.dll": "External package", + "tools/Microsoft.CodeAnalysis.dll": "External package", + "tools/Microsoft.JSInterop.dll": "External package", + "tools/Mono.Cecil.dll": "External package", + "tools/Mono.Cecil.Mdb.dll": "External package", + "tools/Mono.Cecil.Pdb.dll": "External package", + "tools/Mono.Cecil.Rocks.dll": "External package" + }, + "NEUTRAL_RESOURCES_LANGUAGE": { + "tools/Microsoft.CodeAnalysis.CSharp.dll": "External package", + "tools/Microsoft.CodeAnalysis.dll": "External package", + "tools/Mono.Cecil.dll": "External package", + "tools/Mono.Cecil.Mdb.dll": "External package", + "tools/Mono.Cecil.Pdb.dll": "External package", + "tools/Mono.Cecil.Rocks.dll": "External package", + "tools/System.Runtime.CompilerServices.Unsafe.dll": "External package" + }, + "ASSEMBLY_PRODUCT": { + "tools/Microsoft.CodeAnalysis.CSharp.dll": "External package", + "tools/Microsoft.CodeAnalysis.dll": "External package" + }, + "SERVICING_ATTRIBUTE": { + "tools/AngleSharp.dll": "External package", + "tools/Mono.Cecil.dll": "External package", + "tools/Mono.Cecil.Mdb.dll": "External package", + "tools/Mono.Cecil.Pdb.dll": "External package", + "tools/Mono.Cecil.Rocks.dll": "External package" + }, + "WRONG_PUBLICKEYTOKEN": { + "tools/AngleSharp.dll": "External package", + "tools/Microsoft.CodeAnalysis.CSharp.dll": "External package", + "tools/Microsoft.CodeAnalysis.dll": "External package", + "tools/Mono.Cecil.dll": "External package", + "tools/Mono.Cecil.Mdb.dll": "External package", + "tools/Mono.Cecil.Pdb.dll": "External package", + "tools/Mono.Cecil.Rocks.dll": "External package", + "tools/System.CodeDom.dll": "External package", + "tools/System.Runtime.CompilerServices.Unsafe.dll": "External package", + "tools/runtimes/unix/lib/netstandard1.3/System.Text.Encoding.CodePages.dll": "External package", + "tools/runtimes/win/lib/netstandard1.3/System.Text.Encoding.CodePages.dll": "External package" + }, + "ASSEMBLY_INFORMATIONAL_VERSION_MISMATCH": { + "tools/AngleSharp.dll": "External package", + "tools/Microsoft.AspNetCore.Razor.Language.dll": "External package", + "tools/Microsoft.CodeAnalysis.CSharp.dll": "External package", + "tools/Microsoft.CodeAnalysis.dll": "External package", + "tools/Microsoft.CodeAnalysis.Razor.dll": "External package", + "tools/Microsoft.Extensions.CommandLineUtils.dll": "External package", + "tools/Microsoft.Extensions.FileProviders.Abstractions.dll": "External package", + "tools/Microsoft.Extensions.FileProviders.Composite.dll": "External package", + "tools/Microsoft.Extensions.FileProviders.Embedded.dll": "External package", + "tools/Microsoft.Extensions.FileProviders.Physical.dll": "External package", + "tools/Microsoft.Extensions.FileSystemGlobbing.dll": "External package", + "tools/Microsoft.Extensions.Primitives.dll": "External package", + "tools/Microsoft.JSInterop.dll": "External package", + "tools/Mono.Cecil.dll": "External package", + "tools/Mono.Cecil.Mdb.dll": "External package", + "tools/Mono.Cecil.Pdb.dll": "External package", + "tools/Mono.Cecil.Rocks.dll": "External package", + "tools/System.CodeDom.dll": "External package", + "tools/System.Runtime.CompilerServices.Unsafe.dll": "External package", + "tools/runtimes/unix/lib/netstandard1.3/System.Text.Encoding.CodePages.dll": "External package", + "tools/runtimes/win/lib/netstandard1.3/System.Text.Encoding.CodePages.dll": "External package" + }, + "ASSEMBLY_FILE_VERSION_MISMATCH": { + "tools/AngleSharp.dll": "External package", + "tools/Microsoft.AspNetCore.Razor.Language.dll": "External package", + "tools/Microsoft.CodeAnalysis.CSharp.dll": "External package", + "tools/Microsoft.CodeAnalysis.dll": "External package", + "tools/Microsoft.CodeAnalysis.Razor.dll": "External package", + "tools/Microsoft.Extensions.CommandLineUtils.dll": "External package", + "tools/Microsoft.Extensions.FileProviders.Abstractions.dll": "External package", + "tools/Microsoft.Extensions.FileProviders.Composite.dll": "External package", + "tools/Microsoft.Extensions.FileProviders.Embedded.dll": "External package", + "tools/Microsoft.Extensions.FileProviders.Physical.dll": "External package", + "tools/Microsoft.Extensions.FileSystemGlobbing.dll": "External package", + "tools/Microsoft.Extensions.Primitives.dll": "External package", + "tools/Microsoft.JSInterop.dll": "External package", + "tools/Mono.Cecil.dll": "External package", + "tools/Mono.Cecil.Mdb.dll": "External package", + "tools/Mono.Cecil.Pdb.dll": "External package", + "tools/Mono.Cecil.Rocks.dll": "External package", + "tools/System.CodeDom.dll": "External package", + "tools/System.Runtime.CompilerServices.Unsafe.dll": "External package", + "tools/runtimes/unix/lib/netstandard1.3/System.Text.Encoding.CodePages.dll": "External package", + "tools/runtimes/win/lib/netstandard1.3/System.Text.Encoding.CodePages.dll": "External package" + }, + "ASSEMBLY_VERSION_MISMATCH": { + "tools/AngleSharp.dll": "External package", + "tools/Microsoft.AspNetCore.Razor.Language.dll": "External package", + "tools/Microsoft.CodeAnalysis.CSharp.dll": "External package", + "tools/Microsoft.CodeAnalysis.dll": "External package", + "tools/Microsoft.CodeAnalysis.Razor.dll": "External package", + "tools/Microsoft.Extensions.CommandLineUtils.dll": "External package", + "tools/Microsoft.Extensions.FileProviders.Abstractions.dll": "External package", + "tools/Microsoft.Extensions.FileProviders.Composite.dll": "External package", + "tools/Microsoft.Extensions.FileProviders.Embedded.dll": "External package", + "tools/Microsoft.Extensions.FileProviders.Physical.dll": "External package", + "tools/Microsoft.Extensions.FileSystemGlobbing.dll": "External package", + "tools/Microsoft.Extensions.Primitives.dll": "External package", + "tools/Microsoft.JSInterop.dll": "External package", + "tools/Mono.Cecil.dll": "External package", + "tools/Mono.Cecil.Mdb.dll": "External package", + "tools/Mono.Cecil.Pdb.dll": "External package", + "tools/Mono.Cecil.Rocks.dll": "External package", + "tools/System.CodeDom.dll": "External package", + "tools/System.Runtime.CompilerServices.Unsafe.dll": "External package", + "tools/runtimes/unix/lib/netstandard1.3/System.Text.Encoding.CodePages.dll": "External package", + "tools/runtimes/win/lib/netstandard1.3/System.Text.Encoding.CodePages.dll": "External package" + } + } + }, + "Microsoft.AspNetCore.Blazor.Cli": { + "Exclusions": { + "SIGN_STRONGNAME": { + "lib/netcoreapp2.1/dotnet-blazor.dll": "See comments in Microsoft.AspNetCore.Blazor.Cli.csproj" + }, + "WRONG_PUBLICKEYTOKEN": { + "lib/netcoreapp2.1/dotnet-blazor.dll": "See comments in Microsoft.AspNetCore.Blazor.Cli.csproj" + } + } + }, + "Microsoft.AspNetCore.Blazor.Templates": { + "Exclusions": { + "PACKAGE_MISSING_REPO_COMMIT": { + "*": "Not presently available" + }, + "PACKAGE_TYPE_UNEXPECTED": { + "*": "It's a templates package" + } + } + } + } + }, + "Default": { + "rules": [ + "DefaultCompositeRule" + ] + } +} diff --git a/src/Components/blazor/Directory.Build.props b/src/Components/blazor/Directory.Build.props new file mode 100644 index 0000000000..7caa7ec3f9 --- /dev/null +++ b/src/Components/blazor/Directory.Build.props @@ -0,0 +1,4 @@ + + + + diff --git a/src/Components/blazor/benchmarks/Microsoft.AspNetCore.Blazor.E2EPerformance/Directory.Build.props b/src/Components/blazor/benchmarks/Microsoft.AspNetCore.Blazor.E2EPerformance/Directory.Build.props index a431b6c7d6..7e3b3789a9 100644 --- a/src/Components/blazor/benchmarks/Microsoft.AspNetCore.Blazor.E2EPerformance/Directory.Build.props +++ b/src/Components/blazor/benchmarks/Microsoft.AspNetCore.Blazor.E2EPerformance/Directory.Build.props @@ -3,5 +3,5 @@ true - + diff --git a/src/Components/blazor/samples/Directory.Build.props b/src/Components/blazor/samples/Directory.Build.props index 7e3b3789a9..d0da6a5df3 100644 --- a/src/Components/blazor/samples/Directory.Build.props +++ b/src/Components/blazor/samples/Directory.Build.props @@ -3,5 +3,5 @@ true - + diff --git a/src/Components/blazor/src/Directory.Build.props b/src/Components/blazor/src/Directory.Build.props index 5324af7287..f6dae88d2c 100644 --- a/src/Components/blazor/src/Directory.Build.props +++ b/src/Components/blazor/src/Directory.Build.props @@ -1,5 +1,5 @@ - + true diff --git a/src/Components/blazor/src/Microsoft.AspNetCore.Blazor.Cli/Microsoft.AspNetCore.Blazor.Cli.csproj b/src/Components/blazor/src/Microsoft.AspNetCore.Blazor.Cli/Microsoft.AspNetCore.Blazor.Cli.csproj index 4fe3691051..8893742b70 100644 --- a/src/Components/blazor/src/Microsoft.AspNetCore.Blazor.Cli/Microsoft.AspNetCore.Blazor.Cli.csproj +++ b/src/Components/blazor/src/Microsoft.AspNetCore.Blazor.Cli/Microsoft.AspNetCore.Blazor.Cli.csproj @@ -8,6 +8,7 @@ Microsoft.AspNetCore.Blazor.Cli.Program false + Development server for use when building Blazor applications. diff --git a/src/Components/blazor/src/Microsoft.AspNetCore.Blazor.Templates/Microsoft.AspNetCore.Blazor.Templates.csproj b/src/Components/blazor/src/Microsoft.AspNetCore.Blazor.Templates/Microsoft.AspNetCore.Blazor.Templates.csproj index f933c72cbf..a75bd91785 100644 --- a/src/Components/blazor/src/Microsoft.AspNetCore.Blazor.Templates/Microsoft.AspNetCore.Blazor.Templates.csproj +++ b/src/Components/blazor/src/Microsoft.AspNetCore.Blazor.Templates/Microsoft.AspNetCore.Blazor.Templates.csproj @@ -6,8 +6,15 @@ False False 2008 + Templates for ASP.NET Core Blazor projects. + + + + + + false 0.8.0 preview1 + $(VersionPrefix) $(VersionPrefix)-$(VersionSuffix)-final diff --git a/src/Components/build.cmd b/src/Components/build.cmd index c0050bda12..f4169ea5e4 100644 --- a/src/Components/build.cmd +++ b/src/Components/build.cmd @@ -1,2 +1,3 @@ @ECHO OFF -PowerShell -NoProfile -NoLogo -ExecutionPolicy unrestricted -Command "[System.Threading.Thread]::CurrentThread.CurrentCulture = ''; [System.Threading.Thread]::CurrentThread.CurrentUICulture = '';& '%~dp0run.ps1' default-build %*; exit $LASTEXITCODE" +SET RepoRoot="%~dp0..\.." +%RepoRoot%\build.cmd -LockFile %RepoRoot%\korebuild-lock.txt -Path %~dp0 %* diff --git a/src/Components/build.sh b/src/Components/build.sh index 98a4b22765..d5bb0cf631 100644 --- a/src/Components/build.sh +++ b/src/Components/build.sh @@ -1,8 +1,7 @@ #!/usr/bin/env bash set -euo pipefail -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -# Call "sync" between "chmod" and execution to prevent "text file busy" error in Docker (aufs) -chmod +x "$DIR/run.sh"; sync -"$DIR/run.sh" default-build "$@" +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +repo_root="$DIR/../.." +"$repo_root/build.sh" --path "$DIR" --lockfile "$repo_root/korebuild-lock.txt" "$@" diff --git a/src/Components/build/dependencies.props b/src/Components/build/dependencies.props index b46d82443a..84f4d70a72 100644 --- a/src/Components/build/dependencies.props +++ b/src/Components/build/dependencies.props @@ -21,6 +21,4 @@ 0.8.0-preview1-20181126.1 - - diff --git a/src/Components/build/repo.props b/src/Components/build/repo.props index 2db8b851da..aa2dcb542d 100644 --- a/src/Components/build/repo.props +++ b/src/Components/build/repo.props @@ -6,7 +6,7 @@ $(ArtifactsDir)$(Configuration)\packages\ true false - $(MSBuildThisFileDirectory)SignToolData.json + $(MSBuildThisFileDirectory)..\..\..\eng\signcheck.exclusions.txt $(ArtifactsDir)\$(Configuration)\ diff --git a/src/Components/global.json b/src/Components/global.json deleted file mode 100644 index 0f9a7c54ff..0000000000 --- a/src/Components/global.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "sdk": { - "version": "2.1.400" - }, - "msbuild-sdks": { - "Internal.AspNetCore.Sdk": "2.2.0-preview1-20181001.1" - } -} diff --git a/src/Components/korebuild-lock.txt b/src/Components/korebuild-lock.txt deleted file mode 100644 index 210c2aa713..0000000000 --- a/src/Components/korebuild-lock.txt +++ /dev/null @@ -1,2 +0,0 @@ -version:2.2.0-preview1-20181001.1 -commithash:b4d9869fc1acead6346a1067d1642544d0c389ff diff --git a/src/Components/run.cmd b/src/Components/run.cmd deleted file mode 100644 index d52d5c7e68..0000000000 --- a/src/Components/run.cmd +++ /dev/null @@ -1,2 +0,0 @@ -@ECHO OFF -PowerShell -NoProfile -NoLogo -ExecutionPolicy unrestricted -Command "[System.Threading.Thread]::CurrentThread.CurrentCulture = ''; [System.Threading.Thread]::CurrentThread.CurrentUICulture = '';& '%~dp0run.ps1' %*; exit $LASTEXITCODE" diff --git a/src/Components/run.ps1 b/src/Components/run.ps1 deleted file mode 100644 index 412062239a..0000000000 --- a/src/Components/run.ps1 +++ /dev/null @@ -1,208 +0,0 @@ -#!/usr/bin/env powershell -#requires -version 4 - -<# -.SYNOPSIS -Executes KoreBuild commands. - -.DESCRIPTION -Downloads korebuild if required. Then executes the KoreBuild command. To see available commands, execute with `-Command help`. - -.PARAMETER Command -The KoreBuild command to run. - -.PARAMETER Path -The folder to build. Defaults to the folder containing this script. - -.PARAMETER Channel -The channel of KoreBuild to download. Overrides the value from the config file. - -.PARAMETER DotNetHome -The directory where .NET Core tools will be stored. - -.PARAMETER ToolsSource -The base url where build tools can be downloaded. Overrides the value from the config file. - -.PARAMETER Update -Updates KoreBuild to the latest version even if a lock file is present. - -.PARAMETER Reinstall -Re-installs KoreBuild - -.PARAMETER ConfigFile -The path to the configuration file that stores values. Defaults to korebuild.json. - -.PARAMETER ToolsSourceSuffix -The Suffix to append to the end of the ToolsSource. Useful for query strings in blob stores. - -.PARAMETER CI -Sets up CI specific settings and variables. - -.PARAMETER Arguments -Arguments to be passed to the command - -.NOTES -This function will create a file $PSScriptRoot/korebuild-lock.txt. This lock file can be committed to source, but does not have to be. -When the lockfile is not present, KoreBuild will create one using latest available version from $Channel. - -The $ConfigFile is expected to be an JSON file. It is optional, and the configuration values in it are optional as well. Any options set -in the file are overridden by command line parameters. - -.EXAMPLE -Example config file: -```json -{ - "$schema": "https://raw.githubusercontent.com/aspnet/BuildTools/dev/tools/korebuild.schema.json", - "channel": "dev", - "toolsSource": "https://aspnetcore.blob.core.windows.net/buildtools" -} -``` -#> -[CmdletBinding(PositionalBinding = $false)] -param( - [Parameter(Mandatory = $true, Position = 0)] - [string]$Command, - [string]$Path = $PSScriptRoot, - [Alias('c')] - [string]$Channel, - [Alias('d')] - [string]$DotNetHome, - [Alias('s')] - [string]$ToolsSource, - [Alias('u')] - [switch]$Update, - [switch]$Reinstall, - [string]$ToolsSourceSuffix, - [string]$ConfigFile = $null, - [switch]$CI, - [Parameter(ValueFromRemainingArguments = $true)] - [string[]]$Arguments -) - -Set-StrictMode -Version 2 -$ErrorActionPreference = 'Stop' - -# -# Functions -# - -function Get-KoreBuild { - - $lockFile = Join-Path $Path 'korebuild-lock.txt' - - if (!(Test-Path $lockFile) -or $Update) { - Get-RemoteFile "$ToolsSource/korebuild/channels/$Channel/latest.txt" $lockFile $ToolsSourceSuffix - } - - $version = Get-Content $lockFile | Where-Object { $_ -like 'version:*' } | Select-Object -first 1 - if (!$version) { - Write-Error "Failed to parse version from $lockFile. Expected a line that begins with 'version:'" - } - $version = $version.TrimStart('version:').Trim() - $korebuildPath = Join-Paths $DotNetHome ('buildtools', 'korebuild', $version) - - if ($Reinstall -and (Test-Path $korebuildPath)) { - Remove-Item -Force -Recurse $korebuildPath - } - - if (!(Test-Path $korebuildPath)) { - Write-Host -ForegroundColor Magenta "Downloading KoreBuild $version" - New-Item -ItemType Directory -Path $korebuildPath | Out-Null - $remotePath = "$ToolsSource/korebuild/artifacts/$version/korebuild.$version.zip" - - try { - $tmpfile = Join-Path ([IO.Path]::GetTempPath()) "KoreBuild-$([guid]::NewGuid()).zip" - Get-RemoteFile $remotePath $tmpfile $ToolsSourceSuffix - if (Get-Command -Name '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 $tmpfile -DestinationPath $korebuildPath - } - else { - # Fallback to old approach for old installations of PowerShell - Add-Type -AssemblyName System.IO.Compression.FileSystem - [System.IO.Compression.ZipFile]::ExtractToDirectory($tmpfile, $korebuildPath) - } - } - catch { - Remove-Item -Recurse -Force $korebuildPath -ErrorAction Ignore - throw - } - finally { - Remove-Item $tmpfile -ErrorAction Ignore - } - } - - return $korebuildPath -} - -function Join-Paths([string]$path, [string[]]$childPaths) { - $childPaths | ForEach-Object { $path = Join-Path $path $_ } - return $path -} - -function Get-RemoteFile([string]$RemotePath, [string]$LocalPath, [string]$RemoteSuffix) { - if ($RemotePath -notlike 'http*') { - Copy-Item $RemotePath $LocalPath - return - } - - $retries = 10 - while ($retries -gt 0) { - $retries -= 1 - try { - Invoke-WebRequest -UseBasicParsing -Uri $($RemotePath + $RemoteSuffix) -OutFile $LocalPath - return - } - catch { - Write-Verbose "Request failed. $retries retries remaining" - } - } - - Write-Error "Download failed: '$RemotePath'." -} - -# -# Main -# - -# Load configuration or set defaults - -$Path = Resolve-Path $Path -if (!$ConfigFile) { $ConfigFile = Join-Path $Path 'korebuild.json' } - -if (Test-Path $ConfigFile) { - try { - $config = Get-Content -Raw -Encoding UTF8 -Path $ConfigFile | ConvertFrom-Json - if ($config) { - if (!($Channel) -and (Get-Member -Name 'channel' -InputObject $config)) { [string] $Channel = $config.channel } - if (!($ToolsSource) -and (Get-Member -Name 'toolsSource' -InputObject $config)) { [string] $ToolsSource = $config.toolsSource} - } - } - catch { - Write-Warning "$ConfigFile could not be read. Its settings will be ignored." - Write-Warning $Error[0] - } -} - -if (!$DotNetHome) { - $DotNetHome = if ($env:DOTNET_HOME) { $env:DOTNET_HOME } ` - elseif ($env:USERPROFILE) { Join-Path $env:USERPROFILE '.dotnet'} ` - elseif ($env:HOME) {Join-Path $env:HOME '.dotnet'}` - else { Join-Path $PSScriptRoot '.dotnet'} -} - -if (!$Channel) { $Channel = 'dev' } -if (!$ToolsSource) { $ToolsSource = 'https://aspnetcore.blob.core.windows.net/buildtools' } - -# Execute - -$korebuildPath = Get-KoreBuild -Import-Module -Force -Scope Local (Join-Path $korebuildPath 'KoreBuild.psd1') - -try { - Set-KoreBuildSettings -ToolsSource $ToolsSource -DotNetHome $DotNetHome -RepoPath $Path -ConfigFile $ConfigFile -CI:$CI - Invoke-KoreBuildCommand $Command @Arguments -} -finally { - Remove-Module 'KoreBuild' -ErrorAction Ignore -} diff --git a/src/Components/run.sh b/src/Components/run.sh deleted file mode 100644 index 27e7d7ac6f..0000000000 --- a/src/Components/run.sh +++ /dev/null @@ -1,245 +0,0 @@ -#!/usr/bin/env bash - -set -euo pipefail - -# -# variables -# - -RESET="\033[0m" -RED="\033[0;31m" -YELLOW="\033[0;33m" -MAGENTA="\033[0;95m" -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -[ -z "${DOTNET_HOME:-}" ] && DOTNET_HOME="$HOME/.dotnet" -verbose=false -update=false -reinstall=false -repo_path="$DIR" -channel='' -tools_source='' -tools_source_suffix='' -ci=false - -# -# Functions -# -__usage() { - echo "Usage: $(basename "${BASH_SOURCE[0]}") command [options] [[--] ...]" - echo "" - echo "Arguments:" - echo " command The command to be run." - echo " ... Arguments passed to the command. Variable number of arguments allowed." - echo "" - echo "Options:" - echo " --verbose Show verbose output." - echo " -c|--channel The channel of KoreBuild to download. Overrides the value from the config file.." - echo " --config-file The path to the configuration file that stores values. Defaults to korebuild.json." - echo " -d|--dotnet-home The directory where .NET Core tools will be stored. Defaults to '\$DOTNET_HOME' or '\$HOME/.dotnet." - echo " --path The directory to build. Defaults to the directory containing the script." - echo " -s|--tools-source|-ToolsSource The base url where build tools can be downloaded. Overrides the value from the config file." - echo " --tools-source-suffix|-ToolsSourceSuffix The suffix to append to tools-source. Useful for query strings." - echo " -u|--update Update to the latest KoreBuild even if the lock file is present." - echo " --reinstall Reinstall KoreBuild." - echo " --ci Apply CI specific settings and environment variables." - echo "" - echo "Description:" - echo " This function will create a file \$DIR/korebuild-lock.txt. This lock file can be committed to source, but does not have to be." - echo " When the lockfile is not present, KoreBuild will create one using latest available version from \$channel." - - if [[ "${1:-}" != '--no-exit' ]]; then - exit 2 - fi -} - -get_korebuild() { - local version - local lock_file="$repo_path/korebuild-lock.txt" - if [ ! -f "$lock_file" ] || [ "$update" = true ]; then - __get_remote_file "$tools_source/korebuild/channels/$channel/latest.txt" "$lock_file" "$tools_source_suffix" - fi - version="$(grep 'version:*' -m 1 "$lock_file")" - if [[ "$version" == '' ]]; then - __error "Failed to parse version from $lock_file. Expected a line that begins with 'version:'" - return 1 - fi - version="$(echo "${version#version:}" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')" - local korebuild_path="$DOTNET_HOME/buildtools/korebuild/$version" - - if [ "$reinstall" = true ] && [ -d "$korebuild_path" ]; then - rm -rf "$korebuild_path" - fi - - { - if [ ! -d "$korebuild_path" ]; then - mkdir -p "$korebuild_path" - local remote_path="$tools_source/korebuild/artifacts/$version/korebuild.$version.zip" - tmpfile="$(mktemp)" - echo -e "${MAGENTA}Downloading KoreBuild ${version}${RESET}" - if __get_remote_file "$remote_path" "$tmpfile" "$tools_source_suffix"; then - unzip -q -d "$korebuild_path" "$tmpfile" - fi - rm "$tmpfile" || true - fi - - source "$korebuild_path/KoreBuild.sh" - } || { - if [ -d "$korebuild_path" ]; then - echo "Cleaning up after failed installation" - rm -rf "$korebuild_path" || true - fi - return 1 - } -} - -__error() { - echo -e "${RED}error: $*${RESET}" 1>&2 -} - -__warn() { - echo -e "${YELLOW}warning: $*${RESET}" -} - -__machine_has() { - hash "$1" > /dev/null 2>&1 - return $? -} - -__get_remote_file() { - local remote_path=$1 - local local_path=$2 - local remote_path_suffix=$3 - - if [[ "$remote_path" != 'http'* ]]; then - cp "$remote_path" "$local_path" - return 0 - fi - - local failed=false - if __machine_has wget; then - wget --tries 10 --quiet -O "$local_path" "${remote_path}${remote_path_suffix}" || failed=true - else - failed=true - fi - - if [ "$failed" = true ] && __machine_has curl; then - failed=false - curl --retry 10 -sSL -f --create-dirs -o "$local_path" "${remote_path}${remote_path_suffix}" || failed=true - fi - - if [ "$failed" = true ]; then - __error "Download failed: $remote_path" 1>&2 - return 1 - fi -} - -# -# main -# - -command="${1:-}" -shift - -while [[ $# -gt 0 ]]; do - case $1 in - -\?|-h|--help) - __usage --no-exit - exit 0 - ;; - -c|--channel|-Channel) - shift - channel="${1:-}" - [ -z "$channel" ] && __usage - ;; - --config-file|-ConfigFile) - shift - config_file="${1:-}" - [ -z "$config_file" ] && __usage - if [ ! -f "$config_file" ]; then - __error "Invalid value for --config-file. $config_file does not exist." - exit 1 - fi - ;; - -d|--dotnet-home|-DotNetHome) - shift - DOTNET_HOME="${1:-}" - [ -z "$DOTNET_HOME" ] && __usage - ;; - --path|-Path) - shift - repo_path="${1:-}" - [ -z "$repo_path" ] && __usage - ;; - -s|--tools-source|-ToolsSource) - shift - tools_source="${1:-}" - [ -z "$tools_source" ] && __usage - ;; - --tools-source-suffix|-ToolsSourceSuffix) - shift - tools_source_suffix="${1:-}" - [ -z "$tools_source_suffix" ] && __usage - ;; - -u|--update|-Update) - update=true - ;; - --reinstall|-[Rr]einstall) - reinstall=true - ;; - --ci|-[Cc][Ii]) - ci=true - ;; - --verbose|-Verbose) - verbose=true - ;; - --) - shift - break - ;; - *) - break - ;; - esac - shift -done - -if ! __machine_has unzip; then - __error 'Missing required command: unzip' - exit 1 -fi - -if ! __machine_has curl && ! __machine_has wget; then - __error 'Missing required command. Either wget or curl is required.' - exit 1 -fi - -[ -z "${config_file:-}" ] && config_file="$repo_path/korebuild.json" -if [ -f "$config_file" ]; then - if __machine_has jq ; then - if jq '.' "$config_file" >/dev/null ; then - config_channel="$(jq -r 'select(.channel!=null) | .channel' "$config_file")" - config_tools_source="$(jq -r 'select(.toolsSource!=null) | .toolsSource' "$config_file")" - else - __warn "$config_file is invalid JSON. Its settings will be ignored." - fi - elif __machine_has python ; then - if python -c "import json,codecs;obj=json.load(codecs.open('$config_file', 'r', 'utf-8-sig'))" >/dev/null ; then - config_channel="$(python -c "import json,codecs;obj=json.load(codecs.open('$config_file', 'r', 'utf-8-sig'));print(obj['channel'] if 'channel' in obj else '')")" - config_tools_source="$(python -c "import json,codecs;obj=json.load(codecs.open('$config_file', 'r', 'utf-8-sig'));print(obj['toolsSource'] if 'toolsSource' in obj else '')")" - else - __warn "$config_file is invalid JSON. Its settings will be ignored." - fi - else - __warn 'Missing required command: jq or pyton. Could not parse the JSON file. Its settings will be ignored.' - fi - - [ ! -z "${config_channel:-}" ] && channel="$config_channel" - [ ! -z "${config_tools_source:-}" ] && tools_source="$config_tools_source" -fi - -[ -z "$channel" ] && channel='dev' -[ -z "$tools_source" ] && tools_source='https://aspnetcore.blob.core.windows.net/buildtools' - -get_korebuild -set_korebuildsettings "$tools_source" "$DOTNET_HOME" "$repo_path" "$config_file" "$ci" -invoke_korebuild_command "$command" "$@" diff --git a/src/Components/src/Microsoft.AspNetCore.Components.Analyzers/Microsoft.AspNetCore.Components.Analyzers.csproj b/src/Components/src/Microsoft.AspNetCore.Components.Analyzers/Microsoft.AspNetCore.Components.Analyzers.csproj index 410461d2c2..ac47125333 100644 --- a/src/Components/src/Microsoft.AspNetCore.Components.Analyzers/Microsoft.AspNetCore.Components.Analyzers.csproj +++ b/src/Components/src/Microsoft.AspNetCore.Components.Analyzers/Microsoft.AspNetCore.Components.Analyzers.csproj @@ -5,6 +5,7 @@ false true false + Roslyn analyzers for ASP.NET Core Components. @@ -14,6 +15,7 @@ + diff --git a/src/Components/src/Microsoft.AspNetCore.Components.Browser.JS/Microsoft.AspNetCore.Components.Browser.JS.csproj b/src/Components/src/Microsoft.AspNetCore.Components.Browser.JS/Microsoft.AspNetCore.Components.Browser.JS.csproj index dce43c66d6..8181f4be69 100644 --- a/src/Components/src/Microsoft.AspNetCore.Components.Browser.JS/Microsoft.AspNetCore.Components.Browser.JS.csproj +++ b/src/Components/src/Microsoft.AspNetCore.Components.Browser.JS/Microsoft.AspNetCore.Components.Browser.JS.csproj @@ -2,11 +2,12 @@ netcoreapp2.1 + JavaScript runtime files needed for ASP.NET Core Components browser rendering. true Latest ${DefaultItemExcludes};node_modules\** false - + true diff --git a/src/Components/src/Microsoft.AspNetCore.Components.Browser/Microsoft.AspNetCore.Components.Browser.csproj b/src/Components/src/Microsoft.AspNetCore.Components.Browser/Microsoft.AspNetCore.Components.Browser.csproj index b22bb0538d..4c9ce7b8a5 100644 --- a/src/Components/src/Microsoft.AspNetCore.Components.Browser/Microsoft.AspNetCore.Components.Browser.csproj +++ b/src/Components/src/Microsoft.AspNetCore.Components.Browser/Microsoft.AspNetCore.Components.Browser.csproj @@ -2,6 +2,7 @@ netstandard2.0 + Support for rendering ASP.NET Core components in browsers. diff --git a/src/Components/src/Microsoft.AspNetCore.Components.Build/Microsoft.AspNetCore.Components.Build.csproj b/src/Components/src/Microsoft.AspNetCore.Components.Build/Microsoft.AspNetCore.Components.Build.csproj index 9c94289ee5..1864930d01 100644 --- a/src/Components/src/Microsoft.AspNetCore.Components.Build/Microsoft.AspNetCore.Components.Build.csproj +++ b/src/Components/src/Microsoft.AspNetCore.Components.Build/Microsoft.AspNetCore.Components.Build.csproj @@ -2,6 +2,7 @@ netcoreapp2.1 + Build mechanism for ASP.NET Core Components. Exe true @@ -10,10 +11,16 @@ true Microsoft.AspNetCore.Components.Build.nuspec - $(OutputPath)publish\ + obj\publish\ $(IntermediatePackDir)$(TargetFramework)/ + + + + + + @@ -22,7 +29,8 @@ version=$(PackageVersion); publishDir=$([MSBuild]::NormalizeDirectory($(IntermediatePackDir))); razorversion=$(MicrosoftAspNetCoreRazorDesignPackageVersion); - blazormonoversion=$(MicrosoftAspNetCoreBlazorMonoPackageVersion); + blazormonoversion=$(MicrosoftAspNetCoreBlazorMonoPackageVersion); + repositorycommit=$(RepositoryCommit); <_TargetFramework Include="$(TargetFrameworks)" /> @@ -30,14 +38,6 @@ - - - - PreserveNewest - false - - - diff --git a/src/Components/src/Microsoft.AspNetCore.Components.Build/Microsoft.AspNetCore.Components.Build.nuspec b/src/Components/src/Microsoft.AspNetCore.Components.Build/Microsoft.AspNetCore.Components.Build.nuspec index 94ee93f4b3..9e18576236 100644 --- a/src/Components/src/Microsoft.AspNetCore.Components.Build/Microsoft.AspNetCore.Components.Build.nuspec +++ b/src/Components/src/Microsoft.AspNetCore.Components.Build/Microsoft.AspNetCore.Components.Build.nuspec @@ -5,10 +5,13 @@ $version$ Microsoft © Microsoft Corporation. All rights reserved. - Build mechanism for Blazor applications. + Build mechanism for ASP.NET Core Components. + aspnet components + https://go.microsoft.com/fwlink/?LinkID=288859 https://raw.githubusercontent.com/aspnet/Home/2.0.0/LICENSE.txt https://asp.net/ - + + true diff --git a/src/Components/src/Microsoft.AspNetCore.Components.Razor.Extensions/Microsoft.AspNetCore.Components.Razor.Extensions.csproj b/src/Components/src/Microsoft.AspNetCore.Components.Razor.Extensions/Microsoft.AspNetCore.Components.Razor.Extensions.csproj index bb40d71e40..0d6a23ffe7 100644 --- a/src/Components/src/Microsoft.AspNetCore.Components.Razor.Extensions/Microsoft.AspNetCore.Components.Razor.Extensions.csproj +++ b/src/Components/src/Microsoft.AspNetCore.Components.Razor.Extensions/Microsoft.AspNetCore.Components.Razor.Extensions.csproj @@ -4,7 +4,8 @@ netstandard2.0 $(TargetFrameworks);net461 Microsoft.AspNetCore.Components.Razor - + Extensions to the Razor compiler to support building Razor Components. + true diff --git a/src/Components/src/Microsoft.AspNetCore.Components.Server/Microsoft.AspNetCore.Components.Server.csproj b/src/Components/src/Microsoft.AspNetCore.Components.Server/Microsoft.AspNetCore.Components.Server.csproj index b48c8f5004..e6beca7ae9 100644 --- a/src/Components/src/Microsoft.AspNetCore.Components.Server/Microsoft.AspNetCore.Components.Server.csproj +++ b/src/Components/src/Microsoft.AspNetCore.Components.Server/Microsoft.AspNetCore.Components.Server.csproj @@ -2,6 +2,7 @@ netstandard2.0 + Runtime server features for ASP.NET Core Components. diff --git a/src/Components/src/Microsoft.AspNetCore.Components.TagHelperWorkaround/Microsoft.AspNetCore.Components.TagHelperWorkaround.csproj b/src/Components/src/Microsoft.AspNetCore.Components.TagHelperWorkaround/Microsoft.AspNetCore.Components.TagHelperWorkaround.csproj index dbd2f31232..31b6b35b58 100644 --- a/src/Components/src/Microsoft.AspNetCore.Components.TagHelperWorkaround/Microsoft.AspNetCore.Components.TagHelperWorkaround.csproj +++ b/src/Components/src/Microsoft.AspNetCore.Components.TagHelperWorkaround/Microsoft.AspNetCore.Components.TagHelperWorkaround.csproj @@ -3,7 +3,8 @@ netstandard1.0 - false + false + Workaround for a temporary Razor compiler issue needed by ASP.NET Core Components. diff --git a/src/Components/src/Microsoft.AspNetCore.Components/Microsoft.AspNetCore.Components.csproj b/src/Components/src/Microsoft.AspNetCore.Components/Microsoft.AspNetCore.Components.csproj index 23745a96e6..8c211bdda1 100644 --- a/src/Components/src/Microsoft.AspNetCore.Components/Microsoft.AspNetCore.Components.csproj +++ b/src/Components/src/Microsoft.AspNetCore.Components/Microsoft.AspNetCore.Components.csproj @@ -2,6 +2,7 @@ netstandard2.0 + Components feature for ASP.NET Core.