Skip to content

[main] Update dependencies from dotnet/razor #36041

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Oct 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -278,18 +278,18 @@
<Uri>https://github.com/dotnet/aspnetcore</Uri>
<Sha>34ef6922fb525dcecc8a3f9b7750414de93af438</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.Razor.Tooling.Internal" Version="7.0.0-preview.23511.4">
<Dependency Name="Microsoft.CodeAnalysis.Razor.Tooling.Internal" Version="7.0.0-preview.23512.2">
<Uri>https://github.com/dotnet/razor</Uri>
<Sha>ea7808bb229c458521f5059f4832a241dde927ac</Sha>
<Sha>23afad2ca6e9de2b205bcaaa391f9758681a36f2</Sha>
<SourceBuild RepoName="razor" ManagedOnly="true" />
</Dependency>
<Dependency Name="Microsoft.AspNetCore.Mvc.Razor.Extensions.Tooling.Internal" Version="7.0.0-preview.23511.4">
<Dependency Name="Microsoft.AspNetCore.Mvc.Razor.Extensions.Tooling.Internal" Version="7.0.0-preview.23512.2">
<Uri>https://github.com/dotnet/razor</Uri>
<Sha>ea7808bb229c458521f5059f4832a241dde927ac</Sha>
<Sha>23afad2ca6e9de2b205bcaaa391f9758681a36f2</Sha>
</Dependency>
<Dependency Name="Microsoft.NET.Sdk.Razor.SourceGenerators.Transport" Version="7.0.0-preview.23511.4">
<Dependency Name="Microsoft.NET.Sdk.Razor.SourceGenerators.Transport" Version="7.0.0-preview.23512.2">
<Uri>https://github.com/dotnet/razor</Uri>
<Sha>ea7808bb229c458521f5059f4832a241dde927ac</Sha>
<Sha>23afad2ca6e9de2b205bcaaa391f9758681a36f2</Sha>
</Dependency>
<Dependency Name="Microsoft.Extensions.FileProviders.Embedded" Version="9.0.0-alpha.1.23511.14">
<Uri>https://github.com/dotnet/aspnetcore</Uri>
Expand Down
6 changes: 3 additions & 3 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,9 @@
</PropertyGroup>
<!-- Dependencies from https://github.com/dotnet/razor -->
<PropertyGroup>
<MicrosoftAspNetCoreMvcRazorExtensionsToolingInternalPackageVersion>7.0.0-preview.23511.4</MicrosoftAspNetCoreMvcRazorExtensionsToolingInternalPackageVersion>
<MicrosoftCodeAnalysisRazorToolingInternalVersion>7.0.0-preview.23511.4</MicrosoftCodeAnalysisRazorToolingInternalVersion>
<MicrosoftNETSdkRazorSourceGeneratorsTransportPackageVersion>7.0.0-preview.23511.4</MicrosoftNETSdkRazorSourceGeneratorsTransportPackageVersion>
<MicrosoftAspNetCoreMvcRazorExtensionsToolingInternalPackageVersion>7.0.0-preview.23512.2</MicrosoftAspNetCoreMvcRazorExtensionsToolingInternalPackageVersion>
<MicrosoftCodeAnalysisRazorToolingInternalVersion>7.0.0-preview.23512.2</MicrosoftCodeAnalysisRazorToolingInternalVersion>
<MicrosoftNETSdkRazorSourceGeneratorsTransportPackageVersion>7.0.0-preview.23512.2</MicrosoftNETSdkRazorSourceGeneratorsTransportPackageVersion>
</PropertyGroup>
<PropertyGroup>
<!-- Dependencies from https://github.com/dotnet/wpf -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ Copyright (c) .NET Foundation. All rights reserved.

<ItemGroup>
<RazorExtension Include="MVC-3.0">
<AssemblyName>Microsoft.AspNetCore.Mvc.Razor.Extensions</AssemblyName>
<AssemblyFilePath>$(RazorSdkDirectoryRoot)tools\Microsoft.AspNetCore.Mvc.Razor.Extensions.dll</AssemblyFilePath>
<AssemblyName>Microsoft.CodeAnalysis.Razor.Compiler.Mvc</AssemblyName>
<AssemblyFilePath>$(RazorSdkDirectoryRoot)tools\Microsoft.CodeAnalysis.Razor.Compiler.Mvc.dll</AssemblyFilePath>
</RazorExtension>
</ItemGroup>

Expand Down
4 changes: 2 additions & 2 deletions src/RazorSdk/Tool/DiscoverCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ internal static void PatchExtensions(CommandOption extensionNames, CommandOption
var extensionName = extensionNames.Values[i];
var replacementFileName = extensionName switch
{
"MVC-1.0" or "MVC-1.1" => "Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X.dll",
"MVC-2.0" or "MVC-2.1" => "Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X.dll",
"MVC-1.0" or "MVC-1.1" => "Microsoft.CodeAnalysis.Razor.Compiler.Mvc.Version1_X.dll",
"MVC-2.0" or "MVC-2.1" => "Microsoft.CodeAnalysis.Razor.Compiler.Mvc.Version2_X.dll",
_ => null,
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public async Task GivenARelativeSourcePathInstallSucceeds()
}

[Fact]
public void GivenNoPackageSourceMappingItShouldError()
public async Task GivenNoPackageSourceMappingItShouldError()
{
string getTestLocalFeedPath = GetTestLocalFeedPath();
string relativePath = Path.GetRelativePath(Environment.CurrentDirectory, getTestLocalFeedPath);
Expand All @@ -179,16 +179,16 @@ public void GivenNoPackageSourceMappingItShouldError()
var patterns = new ReadOnlyDictionary<string, IReadOnlyList<string>>(dictionary);
var mockPackageSourceMapping = new PackageSourceMapping(patterns);

Action a = () => _toolInstaller.DownloadPackageAsync(
Func<Task> a = () => _toolInstaller.DownloadPackageAsync(
TestPackageId,
new NuGetVersion(TestPackageVersion),
new PackageSourceLocation(sourceFeedOverrides: new[] { relativePath }),
packageSourceMapping: mockPackageSourceMapping).GetAwaiter().GetResult();
a.Should().Throw<NuGetPackageInstallerException>().And.Message.Should().Contain(string.Format(Cli.NuGetPackageDownloader.LocalizableStrings.FailedToFindSourceUnderPackageSourceMapping, TestPackageId));
packageSourceMapping: mockPackageSourceMapping);
(await a.Should().ThrowAsync<NuGetPackageInstallerException>()).And.Message.Should().Contain(string.Format(Cli.NuGetPackageDownloader.LocalizableStrings.FailedToFindSourceUnderPackageSourceMapping, TestPackageId));
}

[Fact]
public void GivenPackageSourceMappingFeedNotFoundItShouldError()
public async Task GivenPackageSourceMappingFeedNotFoundItShouldError()
{
string getTestLocalFeedPath = GetTestLocalFeedPath();
string relativePath = Path.GetRelativePath(Environment.CurrentDirectory, getTestLocalFeedPath);
Expand All @@ -200,12 +200,12 @@ public void GivenPackageSourceMappingFeedNotFoundItShouldError()
var patterns = new ReadOnlyDictionary<string, IReadOnlyList<string>>(dictionary);
var mockPackageSourceMapping = new PackageSourceMapping(patterns);

Action a = () => _toolInstaller.DownloadPackageAsync(
Func<Task> a = () => _toolInstaller.DownloadPackageAsync(
TestPackageId,
new NuGetVersion(TestPackageVersion),
new PackageSourceLocation(sourceFeedOverrides: new[] { relativePath }),
packageSourceMapping: mockPackageSourceMapping).GetAwaiter().GetResult();
a.Should().Throw<NuGetPackageInstallerException>().And.Message.Should().Contain(string.Format(Cli.NuGetPackageDownloader.LocalizableStrings.FailedToMapSourceUnderPackageSourceMapping, TestPackageId));
packageSourceMapping: mockPackageSourceMapping);
(await a.Should().ThrowAsync<NuGetPackageInstallerException>()).And.Message.Should().Contain(string.Format(Cli.NuGetPackageDownloader.LocalizableStrings.FailedToMapSourceUnderPackageSourceMapping, TestPackageId));
}

[Fact]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public void CanOverrideScopeIdentifiers()
var scoped = Path.Combine(intermediateOutputPath, "scopedcss", "Styles", "Pages", "Counter.rz.scp.css");
new FileInfo(scoped).Should().Exist();
new FileInfo(scoped).Should().Contain("b-overriden");
var generated = Path.Combine(intermediateOutputPath, "generated", "Microsoft.NET.Sdk.Razor.SourceGenerators", "Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator", "Components_Pages_Counter_razor.g.cs");
var generated = Path.Combine(intermediateOutputPath, "generated", "Microsoft.CodeAnalysis.Razor.Compiler.SourceGenerators", "Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator", "Components_Pages_Counter_razor.g.cs");
new FileInfo(generated).Should().Exist();
new FileInfo(generated).Should().Contain("b-overriden");
new FileInfo(Path.Combine(intermediateOutputPath, "scopedcss", "Components", "Pages", "Index.razor.rz.scp.css")).Should().NotExist();
Expand Down Expand Up @@ -319,7 +319,7 @@ public void Build_RemovingScopedCssAndBuilding_UpdatesGeneratedCodeAndBundle()
new FileInfo(generatedBundle).Should().Exist();
var generatedProjectBundle = Path.Combine(intermediateOutputPath, "scopedcss", "projectbundle", "ComponentApp.bundle.scp.css");
new FileInfo(generatedProjectBundle).Should().Exist();
var generatedCounter = Path.Combine(intermediateOutputPath, "generated", "Microsoft.NET.Sdk.Razor.SourceGenerators", "Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator", "Components_Pages_Counter_razor.g.cs");
var generatedCounter = Path.Combine(intermediateOutputPath, "generated", "Microsoft.CodeAnalysis.Razor.Compiler.SourceGenerators", "Microsoft.NET.Sdk.Razor.SourceGenerators.RazorSourceGenerator", "Components_Pages_Counter_razor.g.cs");
new FileInfo(generatedCounter).Should().Exist();

var componentThumbprint = FileThumbPrint.Create(generatedCounter);
Expand Down