Skip to content

Commit 702aa62

Browse files
committed
Remove Razor Runtime projects
1 parent d20b297 commit 702aa62

File tree

99 files changed

+5087
-90
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+5087
-90
lines changed

src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X.Test.csproj

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@
1313

1414
<ItemGroup>
1515
<ProjectReference Include="..\..\src\Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X\Microsoft.AspNetCore.Mvc.Razor.Extensions.Version1_X.csproj" />
16-
<ProjectReference Include="..\Microsoft.AspNetCore.Razor.Test.Common\Microsoft.AspNetCore.Razor.Test.Common.csproj" />
17-
<ProjectReference Include="..\..\src\Microsoft.AspNetCore.Razor.Runtime\Microsoft.AspNetCore.Razor.Runtime.csproj" />
1816
<ProjectReference Include="..\..\src\Microsoft.CodeAnalysis.Razor\Microsoft.CodeAnalysis.Razor.csproj" />
17+
18+
<ProjectReference Include="..\Microsoft.AspNetCore.Razor.Test.Common\Microsoft.AspNetCore.Razor.Test.Common.csproj" />
19+
<ProjectReference Include="..\Microsoft.AspNetCore.Razor.Test.MvcShim.Version1_X\Microsoft.AspNetCore.Razor.Test.MvcShim.Version1_X.csproj" />
1920
</ItemGroup>
2021

2122
<ItemGroup>
@@ -25,19 +26,6 @@
2526
<PackageReference Include="Moq" Version="$(MoqPackageVersion)" />
2627
</ItemGroup>
2728

28-
<ItemGroup>
29-
<!-- We need this to compile but don't want it referenced by the project. It is included dynamically in CodeGeneration tests. -->
30-
<ProjectReference Include="..\Microsoft.AspNetCore.Razor.Test.MvcShim.Version1_X\Microsoft.AspNetCore.Razor.Test.MvcShim.Version1_X.csproj">
31-
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
32-
<OutputItemType>Content</OutputItemType>
33-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
34-
<Targets>Build</Targets>
35-
</ProjectReference>
36-
37-
<!-- Due to how DependencyContext.Load handles our special MvcShim reference above we need to also reference the MvcShim's DiagnosticSource dependency -->
38-
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="$(SystemDiagnosticsDiagnosticSourcePackageVersion)" />
39-
</ItemGroup>
40-
4129
<ItemGroup>
4230
<MvcShim Condition="$(TargetFramework) != ''" Include="$(ArtifactsBinDir)\Microsoft.AspNetCore.Razor.Test.MvcShim.Version1_X\$(Configuration)\$(TargetFramework)\Microsoft.AspNetCore.Razor.Test.MvcShim.Version1_X.deps.json" />
4331
</ItemGroup>

src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X.Test.csproj

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@
1313

1414
<ItemGroup>
1515
<ProjectReference Include="..\..\src\Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X\Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X.csproj" />
16-
<ProjectReference Include="..\Microsoft.AspNetCore.Razor.Test.Common\Microsoft.AspNetCore.Razor.Test.Common.csproj" />
17-
<ProjectReference Include="..\..\src\Microsoft.AspNetCore.Razor.Runtime\Microsoft.AspNetCore.Razor.Runtime.csproj" />
1816
<ProjectReference Include="..\..\src\Microsoft.CodeAnalysis.Razor\Microsoft.CodeAnalysis.Razor.csproj" />
17+
18+
<ProjectReference Include="..\Microsoft.AspNetCore.Razor.Test.Common\Microsoft.AspNetCore.Razor.Test.Common.csproj" />
19+
<ProjectReference Include="..\Microsoft.AspNetCore.Razor.Test.MvcShim.Version2_X\Microsoft.AspNetCore.Razor.Test.MvcShim.Version2_X.csproj" />
1920
</ItemGroup>
2021

2122
<ItemGroup>
@@ -25,20 +26,6 @@
2526
<PackageReference Include="Moq" Version="$(MoqPackageVersion)" />
2627
</ItemGroup>
2728

28-
<ItemGroup>
29-
<!-- We need this to compile but don't want it referenced by the project. It is included dynamically in CodeGeneration tests. -->
30-
<ProjectReference Include="..\Microsoft.AspNetCore.Razor.Test.MvcShim.Version2_X\Microsoft.AspNetCore.Razor.Test.MvcShim.Version2_X.csproj">
31-
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
32-
<OutputItemType>Content</OutputItemType>
33-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
34-
<Targets>Build</Targets>
35-
</ProjectReference>
36-
37-
<!-- Due to how DependencyContext.Load handles our special MvcShim reference above we need to also reference the MvcShim's DiagnosticSource dependency -->
38-
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="$(SystemDiagnosticsDiagnosticSourcePackageVersion)" />
39-
</ItemGroup>
40-
41-
4229
<Target Name="CopyDepsFromShims" AfterTargets="Build">
4330
<ItemGroup>
4431
<MvcShim Condition="$(TargetFramework) != ''" Include="$(ArtifactsBinDir)\Microsoft.AspNetCore.Razor.Test.MvcShim.Version2_X\$(Configuration)\$(TargetFramework)\Microsoft.AspNetCore.Razor.Test.MvcShim.Version2_X.deps.json" />

src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X/test/ViewComponentTypeVisitorTest.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using System.Collections.Generic;
66
using System.Reflection;
77
using Microsoft.CodeAnalysis;
8+
using Microsoft.CodeAnalysis.CSharp;
89
using Xunit;
910

1011
namespace Microsoft.AspNetCore.Mvc.Razor.Extensions.Version2_X
@@ -13,7 +14,7 @@ public class ViewComponentTypeVisitorTest
1314
{
1415
private static readonly Assembly _assembly = typeof(ViewComponentTypeVisitorTest).GetTypeInfo().Assembly;
1516

16-
private static Compilation Compilation { get; } = TestCompilation.Create(_assembly);
17+
private static CSharpCompilation Compilation { get; } = TestCompilation.Create(_assembly);
1718

1819
// In practice MVC will provide a marker attribute for ViewComponents. To prevent a circular reference between MVC and Razor
1920
// we can use a test class as a marker.

src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/Microsoft.AspNetCore.Mvc.Razor.Extensions.Test.csproj

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313

1414
<ItemGroup>
1515
<ProjectReference Include="..\..\src\Microsoft.AspNetCore.Mvc.Razor.Extensions\Microsoft.AspNetCore.Mvc.Razor.Extensions.csproj" />
16-
<ProjectReference Include="..\Microsoft.AspNetCore.Razor.Test.Common\Microsoft.AspNetCore.Razor.Test.Common.csproj" />
17-
<ProjectReference Include="..\..\src\Microsoft.AspNetCore.Razor.Runtime\Microsoft.AspNetCore.Razor.Runtime.csproj" />
1816
<ProjectReference Include="..\..\src\Microsoft.CodeAnalysis.Razor\Microsoft.CodeAnalysis.Razor.csproj" />
17+
<ProjectReference Include="..\Microsoft.AspNetCore.Razor.Test.Common\Microsoft.AspNetCore.Razor.Test.Common.csproj" />
18+
<ProjectReference Include="..\Microsoft.AspNetCore.Razor.Test.MvcShim\Microsoft.AspNetCore.Razor.Test.MvcShim.csproj" />
1919
</ItemGroup>
2020

2121
<ItemGroup>
@@ -25,19 +25,6 @@
2525
<PackageReference Include="Moq" Version="$(MoqPackageVersion)" />
2626
</ItemGroup>
2727

28-
<ItemGroup>
29-
<!-- We need this to compile but don't want it referenced by the project. It is included dynamically in CodeGeneration tests. -->
30-
<ProjectReference Include="..\Microsoft.AspNetCore.Razor.Test.MvcShim\Microsoft.AspNetCore.Razor.Test.MvcShim.csproj">
31-
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
32-
<OutputItemType>Content</OutputItemType>
33-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
34-
<Targets>Build</Targets>
35-
</ProjectReference>
36-
37-
<!-- Due to how DependencyContext.Load handles our special MvcShim reference above we need to also reference the MvcShim's DiagnosticSource dependency -->
38-
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="$(SystemDiagnosticsDiagnosticSourcePackageVersion)" />
39-
</ItemGroup>
40-
4128
<Target Name="CopyDepsFromShims" AfterTargets="Build">
4229
<ItemGroup>
4330
<MvcShim Condition="$(TargetFramework) != ''" Include="$(ArtifactsBinDir)\Microsoft.AspNetCore.Razor.Test.MvcShim\$(Configuration)\$(TargetFramework)\Microsoft.AspNetCore.Razor.Test.MvcShim.deps.json" />

src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/ViewComponentTypeVisitorTest.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using System.Collections.Generic;
66
using System.Reflection;
77
using Microsoft.CodeAnalysis;
8+
using Microsoft.CodeAnalysis.CSharp;
89
using Xunit;
910

1011
namespace Microsoft.AspNetCore.Mvc.Razor.Extensions
@@ -13,7 +14,7 @@ public class ViewComponentTypeVisitorTest
1314
{
1415
private static readonly Assembly _assembly = typeof(ViewComponentTypeVisitorTest).GetTypeInfo().Assembly;
1516

16-
private static Compilation Compilation { get; } = TestCompilation.Create(_assembly);
17+
private static CSharpCompilation Compilation { get; } = TestCompilation.Create(_assembly);
1718

1819
// In practice MVC will provide a marker attribute for ViewComponents. To prevent a circular reference between MVC and Razor
1920
// we can use a test class as a marker.

src/Razor/Microsoft.CodeAnalysis.Razor/test/Microsoft.CodeAnalysis.Razor.Test.csproj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@
1414
<ItemGroup>
1515
<ProjectReference Include="..\..\src\Microsoft.CodeAnalysis.Razor\Microsoft.CodeAnalysis.Razor.csproj" />
1616
<ProjectReference Include="..\..\src\Microsoft.AspNetCore.Razor.Language\Microsoft.AspNetCore.Razor.Language.csproj" />
17-
<ProjectReference Include="..\..\src\Microsoft.AspNetCore.Razor.Runtime\Microsoft.AspNetCore.Razor.Runtime.csproj" />
18-
<ProjectReference Include="..\..\src\Microsoft.AspNetCore.Razor\Microsoft.AspNetCore.Razor.csproj" />
1917
<ProjectReference Include="..\Microsoft.AspNetCore.Razor.Test.Common\Microsoft.AspNetCore.Razor.Test.Common.csproj" />
18+
19+
<!-- Included for definitions of Tag Helper types -->
20+
<ProjectReference Include="..\Microsoft.AspNetCore.Razor.Test.MvcShim\Microsoft.AspNetCore.Razor.Test.MvcShim.csproj" />
2021
</ItemGroup>
2122

2223
<ItemGroup>

src/Razor/test/Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib/Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib.csproj

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@
55
</PropertyGroup>
66

77
<ItemGroup>
8-
<ProjectReference Include="..\..\src\Microsoft.AspNetCore.Razor.Runtime\Microsoft.AspNetCore.Razor.Runtime.csproj" />
9-
</ItemGroup>
10-
11-
<ItemGroup>
8+
<PackageReference Include="Microsoft.AspNetCore.Html.Abstractions" Version="$(MicrosoftAspNetCoreHtmlAbstractionsPackageVersion)" />
129
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="$(SystemDiagnosticsDiagnosticSourcePackageVersion)" />
1310
</ItemGroup>
1411

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
// Copyright (c) .NET Foundation. All rights reserved.
2+
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
3+
4+
using System;
5+
using System.Collections.Generic;
6+
using System.Diagnostics;
7+
using System.Text.Encodings.Web;
8+
using System.Threading.Tasks;
9+
using Microsoft.AspNetCore.Razor.TagHelpers;
10+
11+
namespace Microsoft.AspNetCore.Razor.Runtime.TagHelpers
12+
{
13+
public class TagHelperExecutionContext
14+
{
15+
public TagHelperExecutionContext(
16+
string tagName,
17+
TagMode tagMode,
18+
IDictionary<object, object> items,
19+
string uniqueId,
20+
Func<Task> executeChildContentAsync,
21+
Action<HtmlEncoder> startTagHelperWritingScope,
22+
Func<TagHelperContent> endTagHelperWritingScope)
23+
{
24+
}
25+
26+
public bool ChildContentRetrieved => false;
27+
28+
public IDictionary<object, object> Items { get; private set; }
29+
30+
public IList<ITagHelper> TagHelpers => null;
31+
32+
public TagHelperOutput Output { get; internal set; }
33+
34+
public TagHelperContext Context { get; }
35+
36+
public void Add(ITagHelper tagHelper)
37+
{
38+
}
39+
40+
public void AddHtmlAttribute(string name, object value, HtmlAttributeValueStyle valueStyle)
41+
{
42+
}
43+
44+
public void AddHtmlAttribute(TagHelperAttribute attribute)
45+
{
46+
}
47+
48+
public void AddTagHelperAttribute(string name, object value, HtmlAttributeValueStyle valueStyle)
49+
{
50+
}
51+
52+
public void AddTagHelperAttribute(TagHelperAttribute attribute)
53+
{
54+
}
55+
56+
public void Reinitialize(
57+
string tagName,
58+
TagMode tagMode,
59+
IDictionary<object, object> items,
60+
string uniqueId,
61+
Func<Task> executeChildContentAsync)
62+
{
63+
}
64+
65+
public Task SetOutputContentAsync()
66+
{
67+
throw null;
68+
}
69+
}
70+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Copyright (c) .NET Foundation. All rights reserved.
2+
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
3+
4+
using System;
5+
using System.Collections.Generic;
6+
using System.Threading.Tasks;
7+
using Microsoft.AspNetCore.Razor.TagHelpers;
8+
9+
namespace Microsoft.AspNetCore.Razor.Runtime.TagHelpers
10+
{
11+
public class TagHelperRunner
12+
{
13+
public Task RunAsync(TagHelperExecutionContext executionContext)
14+
{
15+
throw null;
16+
}
17+
}
18+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// Copyright (c) .NET Foundation. All rights reserved.
2+
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
3+
4+
using System;
5+
using System.Collections.Generic;
6+
using System.Text.Encodings.Web;
7+
using System.Threading.Tasks;
8+
using Microsoft.AspNetCore.Razor.TagHelpers;
9+
10+
namespace Microsoft.AspNetCore.Razor.Runtime.TagHelpers
11+
{
12+
public class TagHelperScopeManager
13+
{
14+
public TagHelperScopeManager(
15+
Action<HtmlEncoder> startTagHelperWritingScope,
16+
Func<TagHelperContent> endTagHelperWritingScope)
17+
{
18+
}
19+
20+
public TagHelperExecutionContext Begin(
21+
string tagName,
22+
TagMode tagMode,
23+
string uniqueId,
24+
Func<Task> executeChildContentAsync)
25+
{
26+
throw null;
27+
}
28+
29+
public TagHelperExecutionContext End()
30+
{
31+
throw null;
32+
}
33+
}
34+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
// Copyright (c) .NET Foundation. All rights reserved.
2+
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
3+
4+
using System;
5+
6+
namespace Microsoft.AspNetCore.Razor.TagHelpers
7+
{
8+
/// <summary>
9+
/// Used to override an <see cref="ITagHelper"/> property's HTML attribute name.
10+
/// </summary>
11+
[AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = false)]
12+
public sealed class HtmlAttributeNameAttribute : Attribute
13+
{
14+
private string _dictionaryAttributePrefix;
15+
16+
/// <summary>
17+
/// Instantiates a new instance of the <see cref="HtmlAttributeNameAttribute"/> class with <see cref="Name"/>
18+
/// equal to <c>null</c>.
19+
/// </summary>
20+
/// <remarks>
21+
/// Associated property must not have a public setter and must be compatible with
22+
/// <see cref="System.Collections.Generic.IDictionary{TKey, TValue}"/> where <c>TKey</c> is
23+
/// <see cref="string"/>.
24+
/// </remarks>
25+
public HtmlAttributeNameAttribute()
26+
{
27+
}
28+
29+
/// <summary>
30+
/// Instantiates a new instance of the <see cref="HtmlAttributeNameAttribute"/> class.
31+
/// </summary>
32+
/// <param name="name">
33+
/// HTML attribute name for the associated property. Must be <c>null</c> or empty if associated property does
34+
/// not have a public setter and is compatible with
35+
/// <see cref="System.Collections.Generic.IDictionary{TKey, TValue}"/> where <c>TKey</c> is
36+
/// <see cref="string"/>. Otherwise must not be <c>null</c> or empty.
37+
/// </param>
38+
public HtmlAttributeNameAttribute(string name)
39+
{
40+
Name = name;
41+
}
42+
43+
/// <summary>
44+
/// HTML attribute name of the associated property.
45+
/// </summary>
46+
/// <value>
47+
/// <c>null</c> or empty if and only if associated property does not have a public setter and is compatible
48+
/// with <see cref="System.Collections.Generic.IDictionary{TKey, TValue}"/> where <c>TKey</c> is
49+
/// <see cref="string"/>.
50+
/// </value>
51+
public string Name { get; }
52+
53+
/// <summary>
54+
/// Gets or sets the prefix used to match HTML attribute names. Matching attributes are added to the
55+
/// associated property (an <see cref="System.Collections.Generic.IDictionary{TKey, TValue}"/>).
56+
/// </summary>
57+
/// <remarks>
58+
/// If non-<c>null</c> associated property must be compatible with
59+
/// <see cref="System.Collections.Generic.IDictionary{TKey, TValue}"/> where <c>TKey</c> is
60+
/// <see cref="string"/>.
61+
/// </remarks>
62+
/// <value>
63+
/// <para>
64+
/// If associated property is compatible with
65+
/// <see cref="System.Collections.Generic.IDictionary{TKey, TValue}"/>, default value is <c>Name + "-"</c>.
66+
/// <see cref="Name"/> must not be <c>null</c> or empty in this case.
67+
/// </para>
68+
/// <para>
69+
/// Otherwise default value is <c>null</c>.
70+
/// </para>
71+
/// </value>
72+
public string DictionaryAttributePrefix
73+
{
74+
get
75+
{
76+
return _dictionaryAttributePrefix;
77+
}
78+
set
79+
{
80+
_dictionaryAttributePrefix = value;
81+
DictionaryAttributePrefixSet = true;
82+
}
83+
}
84+
85+
/// <summary>
86+
/// Gets an indication whether <see cref="DictionaryAttributePrefix"/> has been set. Used to distinguish an
87+
/// uninitialized <see cref="DictionaryAttributePrefix"/> value from an explicit <c>null</c> setting.
88+
/// </summary>
89+
/// <value><c>true</c> if <see cref="DictionaryAttributePrefix"/> was set. <c>false</c> otherwise.</value>
90+
public bool DictionaryAttributePrefixSet { get; private set; }
91+
}
92+
}

0 commit comments

Comments
 (0)