From 89243f8bb812eb72dc2d3a44a1a4d5424b6e9555 Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Mon, 20 Nov 2017 12:18:30 -0800 Subject: [PATCH 01/16] Use MSBuild to set NuGet feeds instead of NuGet.config --- Directory.Build.props | 1 + NuGet.config | 5 +---- build/sources.props | 17 +++++++++++++++++ 3 files changed, 19 insertions(+), 4 deletions(-) create mode 100644 build/sources.props diff --git a/Directory.Build.props b/Directory.Build.props index 60d2bcd5c5..b935597fe9 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,6 +1,7 @@  + Microsoft ASP.NET Core diff --git a/NuGet.config b/NuGet.config index 8e5234a8c0..e32bddfd51 100644 --- a/NuGet.config +++ b/NuGet.config @@ -2,9 +2,6 @@ - - - - + diff --git a/build/sources.props b/build/sources.props new file mode 100644 index 0000000000..e6a1c2b358 --- /dev/null +++ b/build/sources.props @@ -0,0 +1,17 @@ + + + + + $(DotNetRestoreSources) + + $(RestoreSources); + https://dotnet.myget.org/F/aspnetcore-ci-dev/api/v3/index.json; + https://dotnet.myget.org/F/aspnetcore-tools/api/v3/index.json; + https://dotnet.myget.org/F/roslyn/api/v3/index.json; + + + $(RestoreSources); + https://api.nuget.org/v3/index.json; + + + From 50fa43d35b2a11ee5a7e943cfa7b8e28767a2da5 Mon Sep 17 00:00:00 2001 From: Pranav K Date: Tue, 21 Nov 2017 15:48:42 -0800 Subject: [PATCH 02/16] Replace aspnetcore-ci-dev feed with aspnetcore-dev --- build/dependencies.props | 14 +++++++------- build/repo.props | 2 +- build/sources.props | 2 +- korebuild-lock.txt | 4 ++-- src/Directory.Build.props | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/build/dependencies.props b/build/dependencies.props index f3f6353589..04abd98603 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -4,15 +4,15 @@ 0.10.9 - 2.1.0-preview1-15551 - 2.1.0-preview1-27498 - 2.1.0-preview1-27498 + 2.1.0-preview1-15576 + 2.1.0-preview1-27644 + 2.1.0-preview1-27644 2.3.1 2.3.1 - 2.1.0-preview1-27498 + 2.1.0-preview1-27644 2.1.0-preview2-25711-01 - 2.1.0-preview1-27498 - 2.1.0-preview1-27498 + 2.1.0-preview1-27644 + 2.1.0-preview1-27644 2.0.0 15.3.0 15.0.26606 @@ -28,7 +28,7 @@ 7.10.6071 1.3.7 4.7.49 - 2.0.0 + 2.0.0 10.0.1 1.1.92 4.4.1 diff --git a/build/repo.props b/build/repo.props index 453bb5783c..11253d9b18 100644 --- a/build/repo.props +++ b/build/repo.props @@ -12,6 +12,6 @@ Internal.AspNetCore.Universe.Lineup - https://dotnet.myget.org/F/aspnetcore-ci-dev/api/v3/index.json + https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json diff --git a/build/sources.props b/build/sources.props index e6a1c2b358..181b021f88 100644 --- a/build/sources.props +++ b/build/sources.props @@ -5,7 +5,7 @@ $(DotNetRestoreSources) $(RestoreSources); - https://dotnet.myget.org/F/aspnetcore-ci-dev/api/v3/index.json; + https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json; https://dotnet.myget.org/F/aspnetcore-tools/api/v3/index.json; https://dotnet.myget.org/F/roslyn/api/v3/index.json; diff --git a/korebuild-lock.txt b/korebuild-lock.txt index 95f4613014..1a99066b7c 100644 --- a/korebuild-lock.txt +++ b/korebuild-lock.txt @@ -1,2 +1,2 @@ -version:2.1.0-preview1-15567 -commithash:903e3104807b1bb8cddd28bdef205b1e2dc021d1 +version:2.1.0-preview1-15576 +commithash:2f3856d2ba4f659fcb9253215b83946a06794a27 diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 38e0d15d69..25771e8046 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -8,7 +8,7 @@ - + From a5ddd2baf145ef048f043e1a523f3c52820f236f Mon Sep 17 00:00:00 2001 From: Pranav K Date: Wed, 29 Nov 2017 14:09:29 -0800 Subject: [PATCH 03/16] Specify runtime versions to install --- build/repo.props | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/build/repo.props b/build/repo.props index 11253d9b18..5368f8f2b0 100644 --- a/build/repo.props +++ b/build/repo.props @@ -1,8 +1,10 @@  + + - + @@ -14,4 +16,9 @@ Internal.AspNetCore.Universe.Lineup https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json + + + + + From 4b81c9261b15cd96935600a5ae4a30ce0f140b77 Mon Sep 17 00:00:00 2001 From: Ryan Brandenburg Date: Fri, 1 Dec 2017 10:26:33 -0800 Subject: [PATCH 04/16] Update bootstrappers --- run.ps1 | 17 +++++++++++------ run.sh | 30 +++++++++++++++++++----------- 2 files changed, 30 insertions(+), 17 deletions(-) diff --git a/run.ps1 b/run.ps1 index 49c2899856..27dcf848f8 100644 --- a/run.ps1 +++ b/run.ps1 @@ -29,6 +29,9 @@ Updates KoreBuild to the latest version even if a lock file is present. .PARAMETER ConfigFile The path to the configuration file that stores values. Defaults to korebuild.json. +.PARAMETER ToolsSourceSuffix +The Suffix to append to the end of the ToolsSource. Useful for query strings in blob stores. + .PARAMETER Arguments Arguments to be passed to the command @@ -51,7 +54,7 @@ Example config file: #> [CmdletBinding(PositionalBinding = $false)] param( - [Parameter(Mandatory=$true, Position = 0)] + [Parameter(Mandatory = $true, Position = 0)] [string]$Command, [string]$Path = $PSScriptRoot, [Alias('c')] @@ -63,6 +66,7 @@ param( [Alias('u')] [switch]$Update, [string]$ConfigFile, + [string]$ToolsSourceSuffix, [Parameter(ValueFromRemainingArguments = $true)] [string[]]$Arguments ) @@ -79,7 +83,7 @@ function Get-KoreBuild { $lockFile = Join-Path $Path 'korebuild-lock.txt' if (!(Test-Path $lockFile) -or $Update) { - Get-RemoteFile "$ToolsSource/korebuild/channels/$Channel/latest.txt" $lockFile + Get-RemoteFile "$ToolsSource/korebuild/channels/$Channel/latest.txt" $lockFile $ToolsSourceSuffix } $version = Get-Content $lockFile | Where-Object { $_ -like 'version:*' } | Select-Object -first 1 @@ -96,7 +100,7 @@ function Get-KoreBuild { try { $tmpfile = Join-Path ([IO.Path]::GetTempPath()) "KoreBuild-$([guid]::NewGuid()).zip" - Get-RemoteFile $remotePath $tmpfile + Get-RemoteFile $remotePath $tmpfile $ToolsSourceSuffix if (Get-Command -Name 'Expand-Archive' -ErrorAction Ignore) { # Use built-in commands where possible as they are cross-plat compatible Expand-Archive -Path $tmpfile -DestinationPath $korebuildPath @@ -124,7 +128,7 @@ function Join-Paths([string]$path, [string[]]$childPaths) { return $path } -function Get-RemoteFile([string]$RemotePath, [string]$LocalPath) { +function Get-RemoteFile([string]$RemotePath, [string]$LocalPath, [string]$RemoteSuffix) { if ($RemotePath -notlike 'http*') { Copy-Item $RemotePath $LocalPath return @@ -134,7 +138,7 @@ function Get-RemoteFile([string]$RemotePath, [string]$LocalPath) { while ($retries -gt 0) { $retries -= 1 try { - Invoke-WebRequest -UseBasicParsing -Uri $RemotePath -OutFile $LocalPath + Invoke-WebRequest -UseBasicParsing -Uri $($RemotePath + $RemoteSuffix) -OutFile $LocalPath return } catch { @@ -161,7 +165,8 @@ if (Test-Path $ConfigFile) { if (!($Channel) -and (Get-Member -Name 'channel' -InputObject $config)) { [string] $Channel = $config.channel } if (!($ToolsSource) -and (Get-Member -Name 'toolsSource' -InputObject $config)) { [string] $ToolsSource = $config.toolsSource} } - } catch { + } + catch { Write-Warning "$ConfigFile could not be read. Its settings will be ignored." Write-Warning $Error[0] } diff --git a/run.sh b/run.sh index c278423acc..834961fc3a 100755 --- a/run.sh +++ b/run.sh @@ -17,6 +17,7 @@ update=false repo_path="$DIR" channel='' tools_source='' +tools_source_suffix='' # # Functions @@ -29,13 +30,14 @@ __usage() { echo " ... Arguments passed to the command. Variable number of arguments allowed." echo "" echo "Options:" - echo " --verbose Show verbose output." - echo " -c|--channel The channel of KoreBuild to download. Overrides the value from the config file.." - echo " --config-file The path to the configuration file that stores values. Defaults to korebuild.json." - echo " -d|--dotnet-home The directory where .NET Core tools will be stored. Defaults to '\$DOTNET_HOME' or '\$HOME/.dotnet." - echo " --path The directory to build. Defaults to the directory containing the script." - echo " -s|--tools-source|-ToolsSource The base url where build tools can be downloaded. Overrides the value from the config file." - echo " -u|--update Update to the latest KoreBuild even if the lock file is present." + echo " --verbose Show verbose output." + echo " -c|--channel The channel of KoreBuild to download. Overrides the value from the config file.." + echo " --config-file The path to the configuration file that stores values. Defaults to korebuild.json." + echo " -d|--dotnet-home The directory where .NET Core tools will be stored. Defaults to '\$DOTNET_HOME' or '\$HOME/.dotnet." + echo " --path The directory to build. Defaults to the directory containing the script." + echo " -s|--tools-source|-ToolsSource The base url where build tools can be downloaded. Overrides the value from the config file." + echo " --tools-source-suffix|-ToolsSourceSuffix The suffix to append to tools-source. Useful for query strings." + echo " -u|--update Update to the latest KoreBuild even if the lock file is present." echo "" echo "Description:" echo " This function will create a file \$DIR/korebuild-lock.txt. This lock file can be committed to source, but does not have to be." @@ -50,7 +52,7 @@ get_korebuild() { local version local lock_file="$repo_path/korebuild-lock.txt" if [ ! -f "$lock_file" ] || [ "$update" = true ]; then - __get_remote_file "$tools_source/korebuild/channels/$channel/latest.txt" "$lock_file" + __get_remote_file "$tools_source/korebuild/channels/$channel/latest.txt" "$lock_file" "$tools_source_suffix" fi version="$(grep 'version:*' -m 1 "$lock_file")" if [[ "$version" == '' ]]; then @@ -66,7 +68,7 @@ get_korebuild() { local remote_path="$tools_source/korebuild/artifacts/$version/korebuild.$version.zip" tmpfile="$(mktemp)" echo -e "${MAGENTA}Downloading KoreBuild ${version}${RESET}" - if __get_remote_file "$remote_path" "$tmpfile"; then + if __get_remote_file "$remote_path" "$tmpfile" "$tools_source_suffix"; then unzip -q -d "$korebuild_path" "$tmpfile" fi rm "$tmpfile" || true @@ -98,6 +100,7 @@ __machine_has() { __get_remote_file() { local remote_path=$1 local local_path=$2 + local remote_path_suffix=$3 if [[ "$remote_path" != 'http'* ]]; then cp "$remote_path" "$local_path" @@ -106,14 +109,14 @@ __get_remote_file() { local failed=false if __machine_has wget; then - wget --tries 10 --quiet -O "$local_path" "$remote_path" || failed=true + wget --tries 10 --quiet -O "$local_path" "${remote_path}${remote_path_suffix}" || failed=true else failed=true fi if [ "$failed" = true ] && __machine_has curl; then failed=false - curl --retry 10 -sSL -f --create-dirs -o "$local_path" "$remote_path" || failed=true + curl --retry 10 -sSL -f --create-dirs -o "$local_path" "${remote_path}${remote_path_suffix}" || failed=true fi if [ "$failed" = true ]; then @@ -164,6 +167,11 @@ while [[ $# -gt 0 ]]; do tools_source="${1:-}" [ -z "$tools_source" ] && __usage ;; + --tools-source-suffix|-ToolsSourceSuffix) + shift + tools_source_suffix="${1:-}" + [ -z "$tools_source_suffix" ] && __usage + ;; -u|--update|-Update) update=true ;; From 9edbf87f3168bb1b6d6f0162991a00a1e9070c52 Mon Sep 17 00:00:00 2001 From: Ryan Brandenburg Date: Mon, 4 Dec 2017 11:29:09 -0800 Subject: [PATCH 05/16] Remove unneeded exclusion --- NuGetPackageVerifier.json | 40 +++++++++++++-------------------------- build/dependencies.props | 21 ++++++++++---------- korebuild-lock.txt | 4 ++-- 3 files changed, 26 insertions(+), 39 deletions(-) diff --git a/NuGetPackageVerifier.json b/NuGetPackageVerifier.json index b21a624bcd..1ec6f7c986 100644 --- a/NuGetPackageVerifier.json +++ b/NuGetPackageVerifier.json @@ -1,30 +1,16 @@ { - "adx": { - "rules": [ - "DefaultCompositeRule" - ], - "packages": { - "Microsoft.VisualStudio.LanguageServices.Razor": { - "Exclusions": { - "WRONG_THIRDPARTY_DEPENDENCY_VERSION": { - "Microsoft.VisualStudio.LanguageServices.Razor; .NETFramework,Version=v4.6": "This package intentionally depends on version 9.0.1 of Newtonsoft.Json because of the dependency on Visual Studio." - } - } - } - } - }, - "adx-nonshipping": { // Packages written by the ADX team but that don't ship on NuGet.org (thus, no need to scan anything in them) - "rules": [ - // Don't run any rules for packages the ADX team creates but doesn't ship. - ], - "packages": { - "Microsoft.AspNetCore.Razor.TagHelpers.Testing.Sources": { }, - "RazorPageGenerator": { } - } - }, - "Default": { // Rules to run for packages not listed in any other set. - "rules": [ - "DefaultCompositeRule" - ] + "adx-nonshipping": { // Packages written by the ADX team but that don't ship on NuGet.org (thus, no need to scan anything in them) + "rules": [ + // Don't run any rules for packages the ADX team creates but doesn't ship. + ], + "packages": { + "Microsoft.AspNetCore.Razor.TagHelpers.Testing.Sources": {}, + "RazorPageGenerator": {} } + }, + "Default": { // Rules to run for packages not listed in any other set. + "rules": [ + "DefaultCompositeRule" + ] + } } \ No newline at end of file diff --git a/build/dependencies.props b/build/dependencies.props index 04abd98603..5546a54db6 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -4,16 +4,17 @@ 0.10.9 - 2.1.0-preview1-15576 - 2.1.0-preview1-27644 - 2.1.0-preview1-27644 + 2.1.0-preview1-15620 + 2.1.0-preview1-27723 + 2.1.0-preview1-27723 2.3.1 2.3.1 - 2.1.0-preview1-27644 + 2.1.0-preview1-27723 2.1.0-preview2-25711-01 - 2.1.0-preview1-27644 - 2.1.0-preview1-27644 + 2.1.0-preview1-27723 + 2.1.0-preview1-27723 2.0.0 + 2.1.0-preview1-25915-01 15.3.0 15.0.26606 15.0.26606 @@ -31,7 +32,7 @@ 2.0.0 10.0.1 1.1.92 - 4.4.1 + 4.5.0-preview1-25914-04 9.0.1 2.6.0-beta1-62023-02 2.6.0-beta1-62023-02 @@ -42,9 +43,9 @@ 2.6.0-beta1-62023-02 2.6.0-beta1-62023-02 2.6.0-beta1-62023-02 - 0.7.0 - 2.3.0 - 2.3.0 + 0.8.0 + 2.3.1 + 2.3.1 diff --git a/korebuild-lock.txt b/korebuild-lock.txt index 1a99066b7c..fe4a961da3 100644 --- a/korebuild-lock.txt +++ b/korebuild-lock.txt @@ -1,2 +1,2 @@ -version:2.1.0-preview1-15576 -commithash:2f3856d2ba4f659fcb9253215b83946a06794a27 +version:2.1.0-preview1-15620 +commithash:6432b49a2c00310416df39b6fe548ef4af9c6011 From ec4e127a70061a8cf5c80e78f1cae6f4e66d8c5b Mon Sep 17 00:00:00 2001 From: Pranav K Date: Fri, 17 Nov 2017 13:00:26 -0800 Subject: [PATCH 06/16] Use MicrosoftNETCoreApp21PackageVersion to determine the runtime framework in netcoreapp2.1 --- Directory.Build.targets | 1 + build/dependencies.props | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Directory.Build.targets b/Directory.Build.targets index e83ff95e39..894b1d0cf8 100644 --- a/Directory.Build.targets +++ b/Directory.Build.targets @@ -1,5 +1,6 @@  $(MicrosoftNETCoreApp20PackageVersion) + $(MicrosoftNETCoreApp21PackageVersion) diff --git a/build/dependencies.props b/build/dependencies.props index 5546a54db6..226ed378ec 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -1,4 +1,4 @@ - + $(MSBuildAllProjects);$(MSBuildThisFileFullPath) From 3413c74c2d3fe40da0aedd43cf40466561350f6a Mon Sep 17 00:00:00 2001 From: "ASP.NET CI" Date: Sun, 10 Dec 2017 13:37:33 -0800 Subject: [PATCH 07/16] Update dependencies.props [auto-updated: dependencies] --- build/dependencies.props | 12 ++++++------ korebuild-lock.txt | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/build/dependencies.props b/build/dependencies.props index 226ed378ec..171c2e4e8d 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -4,15 +4,15 @@ 0.10.9 - 2.1.0-preview1-15620 - 2.1.0-preview1-27723 - 2.1.0-preview1-27723 + 2.1.0-preview1-15618 + 2.1.0-preview1-27773 + 2.1.0-preview1-27773 2.3.1 2.3.1 - 2.1.0-preview1-27723 + 2.1.0-preview1-27773 2.1.0-preview2-25711-01 - 2.1.0-preview1-27723 - 2.1.0-preview1-27723 + 2.1.0-preview1-27773 + 2.1.0-preview1-27773 2.0.0 2.1.0-preview1-25915-01 15.3.0 diff --git a/korebuild-lock.txt b/korebuild-lock.txt index fe4a961da3..e7cce93009 100644 --- a/korebuild-lock.txt +++ b/korebuild-lock.txt @@ -1,2 +1,2 @@ -version:2.1.0-preview1-15620 -commithash:6432b49a2c00310416df39b6fe548ef4af9c6011 +version:2.1.0-preview1-15618 +commithash:00ce1383114015fe89b221146036e59e6bc11219 From f578819c6ebd0fcabd4f3767d1cf44a986ede634 Mon Sep 17 00:00:00 2001 From: "ASP.NET CI" Date: Wed, 13 Dec 2017 21:33:19 +0000 Subject: [PATCH 08/16] Update dependencies.props --- build/dependencies.props | 19 ++++++++++--------- korebuild-lock.txt | 4 ++-- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/build/dependencies.props b/build/dependencies.props index 171c2e4e8d..ed8054896c 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -3,18 +3,18 @@ $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - 0.10.9 - 2.1.0-preview1-15618 - 2.1.0-preview1-27773 - 2.1.0-preview1-27773 + 0.10.11 + 2.1.0-preview1-15626 + 2.1.0-preview1-27807 + 2.1.0-preview1-27807 2.3.1 2.3.1 - 2.1.0-preview1-27773 + 2.1.0-preview1-27807 2.1.0-preview2-25711-01 - 2.1.0-preview1-27773 - 2.1.0-preview1-27773 + 2.1.0-preview1-27807 + 2.1.0-preview1-27807 2.0.0 - 2.1.0-preview1-25915-01 + 2.1.0-preview1-26008-01 15.3.0 15.0.26606 15.0.26606 @@ -32,7 +32,8 @@ 2.0.0 10.0.1 1.1.92 - 4.5.0-preview1-25914-04 + 4.5.0-preview1-26006-06 + 4.5.0-preview1-26006-06 9.0.1 2.6.0-beta1-62023-02 2.6.0-beta1-62023-02 diff --git a/korebuild-lock.txt b/korebuild-lock.txt index e7cce93009..8d52a6128c 100644 --- a/korebuild-lock.txt +++ b/korebuild-lock.txt @@ -1,2 +1,2 @@ -version:2.1.0-preview1-15618 -commithash:00ce1383114015fe89b221146036e59e6bc11219 +version:2.1.0-preview1-15626 +commithash:fd6410e9c90c428bc01238372303ad09cb9ec889 From c88f7be1abd63f58633eea5637f64cb8a2cc61f0 Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Wed, 20 Dec 2017 12:41:17 -0800 Subject: [PATCH 09/16] Include the VSIX and MPack files in the bill of materials --- build/MPack.targets | 48 ++++++++++++++++++++++++++++----------------- build/VSIX.targets | 35 +++++++++++++++++++++++++++------ korebuild-lock.txt | 4 ++-- version.props | 1 - 4 files changed, 61 insertions(+), 27 deletions(-) diff --git a/build/MPack.targets b/build/MPack.targets index 303fb57e7c..fab409499e 100644 --- a/build/MPack.targets +++ b/build/MPack.targets @@ -1,12 +1,37 @@  $(PackageDependsOn);GenerateMPack + $(GetArtifactInfoDependsOn);GetMPackArtifactInfo Microsoft.VisualStudio.Mac.RazorAddin $(RepositoryRoot)tooling\$(AddinName)\ + shipoob + + $(IntermediateDir)mpack\ + $(AddinDirectory)bin\$(Configuration)\net461\ + Microsoft.VisualStudio.Mac.LanguageServices.Razor + $(RepositoryRoot)src\$(LanguageServiceName)\bin\$(Configuration)\net461\ + $(AddinName)_$(AddinVersion) + $(MPackName).mpack + $(BuildDir)$(MPackFileName) + $(BuildDir)$(MPackName).zip + $(AddinDirectory)Properties\_Manifest.addin.xml + $(MPackIntermediateOutputPath)addin.info + + + + + MPackFile + $(AddinName) + $(AddinVersion) + $(MPackArtifactCategory) + + + + @@ -19,21 +44,8 @@ 3. All language service binaries --> - - $(ArtifactsDir)msbuild\ - $(MSBuildArtifactsDir)sources\ - $(AddinDirectory)bin\$(Configuration)\net461\ - Microsoft.VisualStudio.Mac.LanguageServices.Razor - $(RepositoryRoot)src\$(LanguageServiceName)\bin\$(Configuration)\net46\ - $(AddinName)_$(AddinVersion) - $(MPackName).mpack - $(BuildDir)$(MPackFileName) - $(BuildDir)$(MPackName).zip - $(AddinDirectory)Properties\_Manifest.addin.xml - $(MPackSourcesDir)addin.info - - - + + @@ -53,11 +65,11 @@ - - + + - + diff --git a/build/VSIX.targets b/build/VSIX.targets index adcf0969de..92d9451853 100644 --- a/build/VSIX.targets +++ b/build/VSIX.targets @@ -3,10 +3,12 @@ true $(RestoreDependsOn);RestoreVSIX $(PackageDependsOn);PackageVSIX + $(GetArtifactInfoDependsOn);GetVSIXArtifactInfo Microsoft.VisualStudio.RazorExtension $(BuildDir)$(VSIXName).vsix + $(BuildDir)$(VSIXName).json $(RepositoryRoot)tooling\$(VSIXName)\$(VSIXName).csproj - $(ArtifactsDir)msbuild\ + shipoob + + + + + + VsixPackage + $(PackageVersion) + $(VSIXArtifactCategory) + $(VSIXName) + + + + VsixPackageManifestFile + $(VSIXArtifactCategory) + $(VSIXName).vsix + $(VSIXName) + + + + + - $(MSBuildArtifactsDir)vsix-restore.rsp + $(LogOutputDir)vsix-restore.rsp @@ -36,7 +59,7 @@ - + - $(MSBuildArtifactsDir)vsix.log - $(MSBuildArtifactsDir)vsix-build.rsp + $(LogOutputDir)vsix.log + $(LogOutputDir)vsix-build.rsp @@ -70,7 +93,7 @@ /p:Configuration=$(Configuration);" /> - + $(VersionPrefix)-$(VersionSuffix)-final t000 $(VersionSuffix)-$(BuildNumber) - 7.0 $(VSForMacVersion).$(BuildNumber) From 03ef44aa1d65aba7d9a1b82c782b5a128fbf6b23 Mon Sep 17 00:00:00 2001 From: "ASP.NET CI" Date: Sun, 31 Dec 2017 21:49:09 +0000 Subject: [PATCH 10/16] Update dependencies.props [auto-updated: dependencies] --- build/dependencies.props | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/build/dependencies.props b/build/dependencies.props index ed8054896c..c6f30a3e76 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -4,17 +4,18 @@ 0.10.11 - 2.1.0-preview1-15626 - 2.1.0-preview1-27807 - 2.1.0-preview1-27807 + 2.1.0-preview1-15651 + 2.1.0-preview1-27942 + 2.1.0-preview1-27942 2.3.1 2.3.1 - 2.1.0-preview1-27807 + 2.1.0-preview1-27942 + 2.1.0-preview1-27942 2.1.0-preview2-25711-01 - 2.1.0-preview1-27807 - 2.1.0-preview1-27807 + 2.1.0-preview1-27942 + 2.1.0-preview1-27942 2.0.0 - 2.1.0-preview1-26008-01 + 2.1.0-preview1-26016-05 15.3.0 15.0.26606 15.0.26606 @@ -32,8 +33,8 @@ 2.0.0 10.0.1 1.1.92 - 4.5.0-preview1-26006-06 - 4.5.0-preview1-26006-06 + 4.5.0-preview1-26016-05 + 4.5.0-preview1-26016-05 9.0.1 2.6.0-beta1-62023-02 2.6.0-beta1-62023-02 From e35bc1176c7238f12da9fbfa965384ceb6a5e35a Mon Sep 17 00:00:00 2001 From: "ASP.NET CI" Date: Thu, 4 Jan 2018 01:55:16 +0000 Subject: [PATCH 11/16] Update dependencies.props [auto-updated: dependencies] --- build/dependencies.props | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/build/dependencies.props b/build/dependencies.props index c6f30a3e76..25a8c97269 100644 --- a/build/dependencies.props +++ b/build/dependencies.props @@ -5,15 +5,15 @@ 0.10.11 2.1.0-preview1-15651 - 2.1.0-preview1-27942 - 2.1.0-preview1-27942 + 2.1.0-preview1-27965 + 2.1.0-preview1-27965 2.3.1 2.3.1 - 2.1.0-preview1-27942 - 2.1.0-preview1-27942 + 2.1.0-preview1-27965 + 2.1.0-preview1-27965 2.1.0-preview2-25711-01 - 2.1.0-preview1-27942 - 2.1.0-preview1-27942 + 2.1.0-preview1-27965 + 2.1.0-preview1-27965 2.0.0 2.1.0-preview1-26016-05 15.3.0 From 23e3a872afa083e96f673cff41f19402150121f3 Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Fri, 12 Jan 2018 14:29:59 -0800 Subject: [PATCH 12/16] Update build tools to 2.1.0-preview1-15670 and update list of exclusions for Razor.Design --- NuGetPackageVerifier.json | 2 +- korebuild-lock.txt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/NuGetPackageVerifier.json b/NuGetPackageVerifier.json index 1ec6f7c986..605348bb23 100644 --- a/NuGetPackageVerifier.json +++ b/NuGetPackageVerifier.json @@ -13,4 +13,4 @@ "DefaultCompositeRule" ] } -} \ No newline at end of file +} diff --git a/korebuild-lock.txt b/korebuild-lock.txt index edcad60bc4..181b38dcfe 100644 --- a/korebuild-lock.txt +++ b/korebuild-lock.txt @@ -1,2 +1,2 @@ -version:2.1.0-preview1-15639 -commithash:231066d459f3c86a94b5bdcd197a3c2e4992a7ff +version:2.1.0-preview1-15670 +commithash:49176144e03c3015d83b21e3f1d0ce093c05ecc3 From 141b0b47632110d195b00e37cdc2ab4cd3c4622e Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Thu, 28 Dec 2017 14:10:04 -0800 Subject: [PATCH 13/16] Upgrade to build tools 2.1.0-preview1-15651 --- Directory.Build.props | 1 + build/MPack.targets | 2 ++ build/VSIX.targets | 3 +++ build/repo.props | 1 + 4 files changed, 7 insertions(+) diff --git a/Directory.Build.props b/Directory.Build.props index b935597fe9..0e070d36a3 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -12,6 +12,7 @@ true true true + Microsoft full diff --git a/build/MPack.targets b/build/MPack.targets index fab409499e..9ace8e3e8d 100644 --- a/build/MPack.targets +++ b/build/MPack.targets @@ -29,6 +29,8 @@ $(AddinVersion) $(MPackArtifactCategory) + + diff --git a/build/VSIX.targets b/build/VSIX.targets index 92d9451853..7cd27381f2 100644 --- a/build/VSIX.targets +++ b/build/VSIX.targets @@ -34,6 +34,9 @@ $(VSIXName) + + + diff --git a/build/repo.props b/build/repo.props index 5368f8f2b0..a3a5fbdbc0 100644 --- a/build/repo.props +++ b/build/repo.props @@ -11,6 +11,7 @@ + Internal.AspNetCore.Universe.Lineup From 5e0e09ac069894a4c28bc72e35ba0b952cbf660f Mon Sep 17 00:00:00 2001 From: "N. Taylor Mullen" Date: Tue, 16 Jan 2018 13:00:16 -0800 Subject: [PATCH 14/16] Remove MPack assets. --- build/MPack.targets | 77 --------------------------------------------- build/repo.targets | 1 - 2 files changed, 78 deletions(-) delete mode 100644 build/MPack.targets diff --git a/build/MPack.targets b/build/MPack.targets deleted file mode 100644 index 9ace8e3e8d..0000000000 --- a/build/MPack.targets +++ /dev/null @@ -1,77 +0,0 @@ - - - $(PackageDependsOn);GenerateMPack - $(GetArtifactInfoDependsOn);GetMPackArtifactInfo - Microsoft.VisualStudio.Mac.RazorAddin - $(RepositoryRoot)tooling\$(AddinName)\ - shipoob - - $(IntermediateDir)mpack\ - $(AddinDirectory)bin\$(Configuration)\net461\ - Microsoft.VisualStudio.Mac.LanguageServices.Razor - $(RepositoryRoot)src\$(LanguageServiceName)\bin\$(Configuration)\net461\ - $(AddinName)_$(AddinVersion) - $(MPackName).mpack - $(BuildDir)$(MPackFileName) - $(BuildDir)$(MPackName).zip - $(AddinDirectory)Properties\_Manifest.addin.xml - $(MPackIntermediateOutputPath)addin.info - - - - - - - - - MPackFile - $(AddinName) - $(AddinVersion) - $(MPackArtifactCategory) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build/repo.targets b/build/repo.targets index 4841052ed6..70e1e2bd11 100644 --- a/build/repo.targets +++ b/build/repo.targets @@ -1,6 +1,5 @@  - From 92111ea515504d80fedadeb23aeb748b6a946ca5 Mon Sep 17 00:00:00 2001 From: "N. Taylor Mullen" Date: Tue, 16 Jan 2018 12:28:41 -0800 Subject: [PATCH 15/16] Make Block and Span cache Length. - Part of caching length required the `Span`'s `ReplaceWith` method to propagate its changes to its parent so that it can propogate the change to invalidate all parent length caches. - Added Span and Block tests to validate the interaction of caching. #1927 --- .../Legacy/Block.cs | 30 +++++++++- .../Legacy/Span.cs | 30 +++++++++- .../Legacy/BlockTest.cs | 36 ++++++++++++ .../Legacy/SpanTest.cs | 58 +++++++++++++++++++ 4 files changed, 152 insertions(+), 2 deletions(-) create mode 100644 test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/SpanTest.cs diff --git a/src/Microsoft.AspNetCore.Razor.Language/Legacy/Block.cs b/src/Microsoft.AspNetCore.Razor.Language/Legacy/Block.cs index 781a6e0b5b..9084f43a4e 100644 --- a/src/Microsoft.AspNetCore.Razor.Language/Legacy/Block.cs +++ b/src/Microsoft.AspNetCore.Razor.Language/Legacy/Block.cs @@ -11,6 +11,8 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy { internal class Block : SyntaxTreeNode { + private int? _length; + public Block(BlockBuilder source) : this(source.Type, source.Children, source.ChunkGenerator) { @@ -58,7 +60,25 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy } } - public override int Length => Children.Sum(child => child.Length); + public override int Length + { + get + { + if (_length == null) + { + var length = 0; + for (var i = 0; i < Children.Count; i++) + { + length += Children[i].Length; + } + + _length = length; + } + + return _length.Value; + } + } + public virtual IEnumerable Flatten() { @@ -214,6 +234,14 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy visitor.VisitBlock(this); } + internal void ChildChanged() + { + // A node in our graph has changed. We'll need to recompute our length the next time we're asked for it. + _length = null; + + Parent?.ChildChanged(); + } + private class EquivalenceComparer : IEqualityComparer { public static readonly EquivalenceComparer Default = new EquivalenceComparer(); diff --git a/src/Microsoft.AspNetCore.Razor.Language/Legacy/Span.cs b/src/Microsoft.AspNetCore.Razor.Language/Legacy/Span.cs index 2e7a04189c..880e8ee6f6 100644 --- a/src/Microsoft.AspNetCore.Razor.Language/Legacy/Span.cs +++ b/src/Microsoft.AspNetCore.Razor.Language/Legacy/Span.cs @@ -12,6 +12,7 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy { private static readonly int TypeHashCode = typeof(Span).GetHashCode(); private string _content; + private int? _length; private SourceLocation _start; public Span(SpanBuilder builder) @@ -32,7 +33,31 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy public override bool IsBlock => false; - public override int Length => Content.Length; + public override int Length + { + get + { + if (_length == null) + { + var length = 0; + if (_content == null) + { + for (var i = 0; i < Symbols.Count; i++) + { + length += Symbols[i].Content.Length; + } + } + else + { + length = _content.Length; + } + + _length = length; + } + + return _length.Value; + } + } public override SourceLocation Start => _start; @@ -79,6 +104,9 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy ChunkGenerator = builder.ChunkGenerator ?? SpanChunkGenerator.Null; _start = builder.Start; _content = null; + _length = null; + + Parent?.ChildChanged(); // Since we took references to the values in SpanBuilder, clear its references out builder.Reset(); diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/BlockTest.cs b/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/BlockTest.cs index aa826bb323..dc57fb1147 100644 --- a/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/BlockTest.cs +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/BlockTest.cs @@ -8,6 +8,42 @@ namespace Microsoft.AspNetCore.Razor.Language.Legacy { public class BlockTest { + [Fact] + public void ChildChanged_NotifiesParent() + { + // Arrange + var spanBuilder = new SpanBuilder(SourceLocation.Zero); + spanBuilder.Accept(new HtmlSymbol("hello", HtmlSymbolType.Text)); + var span = spanBuilder.Build(); + var blockBuilder = new BlockBuilder() + { + Type = BlockKindInternal.Markup, + }; + blockBuilder.Children.Add(span); + var childBlock = blockBuilder.Build(); + blockBuilder = new BlockBuilder() + { + Type = BlockKindInternal.Markup, + }; + blockBuilder.Children.Add(childBlock); + var parentBlock = blockBuilder.Build(); + var originalBlockLength = parentBlock.Length; + spanBuilder = new SpanBuilder(SourceLocation.Zero); + spanBuilder.Accept(new HtmlSymbol("hi", HtmlSymbolType.Text)); + span.ReplaceWith(spanBuilder); + + // Wire up parents now so we can re-trigger ChildChanged to cause cache refresh. + span.Parent = childBlock; + childBlock.Parent = parentBlock; + + // Act + childBlock.ChildChanged(); + + // Assert + Assert.Equal(5, originalBlockLength); + Assert.Equal(2, parentBlock.Length); + } + [Fact] public void ConstructorWithBlockBuilderSetsParent() { diff --git a/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/SpanTest.cs b/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/SpanTest.cs new file mode 100644 index 0000000000..4c2ee94e41 --- /dev/null +++ b/test/Microsoft.AspNetCore.Razor.Language.Test/Legacy/SpanTest.cs @@ -0,0 +1,58 @@ +// Copyright (c) .NET Foundation. All rights reserved. +// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. + +using Xunit; + +namespace Microsoft.AspNetCore.Razor.Language.Legacy +{ + public class SpanTest + { + [Fact] + public void ReplaceWith_ResetsLength() + { + // Arrange + var builder = new SpanBuilder(SourceLocation.Zero); + builder.Accept(new HtmlSymbol("hello", HtmlSymbolType.Text)); + var span = builder.Build(); + var newBuilder = new SpanBuilder(SourceLocation.Zero); + newBuilder.Accept(new HtmlSymbol("hi", HtmlSymbolType.Text)); + var originalLength = span.Length; + + // Act + span.ReplaceWith(newBuilder); + + // Assert + Assert.Equal(5, originalLength); + Assert.Equal(2, span.Length); + } + + + // Note: This is more of an integration-like test. However, it's valuable to determine + // that the Span's ReplaceWith code is properly propogating change notifications to parents. + [Fact] + public void ReplaceWith_NotifiesParentChildHasChanged() + { + // Arrange + var spanBuilder = new SpanBuilder(SourceLocation.Zero); + spanBuilder.Accept(new HtmlSymbol("hello", HtmlSymbolType.Text)); + var span = spanBuilder.Build(); + var blockBuilder = new BlockBuilder() + { + Type = BlockKindInternal.Markup, + }; + blockBuilder.Children.Add(span); + var block = blockBuilder.Build(); + span.Parent = block; + var originalBlockLength = block.Length; + var newSpanBuilder = new SpanBuilder(SourceLocation.Zero); + newSpanBuilder.Accept(new HtmlSymbol("hi", HtmlSymbolType.Text)); + + // Act + span.ReplaceWith(newSpanBuilder); + + // Assert + Assert.Equal(5, originalBlockLength); + Assert.Equal(2, block.Length); + } + } +} From af12a455ffbaa59c403f94850d4ac28eab66fb28 Mon Sep 17 00:00:00 2001 From: "N. Taylor Mullen" Date: Tue, 23 Jan 2018 12:08:15 -0800 Subject: [PATCH 16/16] Update RazorExtensions VSIX version to 15.7. --- .../Microsoft.VisualStudio.RazorExtension.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tooling/Microsoft.VisualStudio.RazorExtension/Microsoft.VisualStudio.RazorExtension.csproj b/tooling/Microsoft.VisualStudio.RazorExtension/Microsoft.VisualStudio.RazorExtension.csproj index 173c65a752..8dd9db4535 100644 --- a/tooling/Microsoft.VisualStudio.RazorExtension/Microsoft.VisualStudio.RazorExtension.csproj +++ b/tooling/Microsoft.VisualStudio.RazorExtension/Microsoft.VisualStudio.RazorExtension.csproj @@ -1,7 +1,7 @@  - 15.6 + 15.7 $(VsixVersion).$(BuildNumber) $(VsixVersion).999999 15.0