Skip to content

Commit 177e962

Browse files
authored
Enable R2R for servicehub components: (#12385)
* Enable R2R for servicehub components: - Split out service hub components into x64 and arm64 projects - Extract out some common VSIX strings - Only deploy service hub components on official builds - Setup extension VSIX so that it deploys service hub components for developer builds
1 parent 35d9952 commit 177e962

13 files changed

+198
-87
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
artifacts/
1818
[Dd]ebug/
1919
[Rr]elease/
20-
x64/
2120
x86/ !eng/common/cross/x86/
2221
[Bb]in/
2322
[Oo]bj/

Directory.Build.props

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,16 @@
5555
<NetVSAndVSCode>$(NetVS);$(NetVSCode)</NetVSAndVSCode>
5656
</PropertyGroup>
5757

58+
<PropertyGroup Label="VSIX Settings">
59+
<RazorVSSDKTargetPlatformRegRootSuffix>RoslynDev</RazorVSSDKTargetPlatformRegRootSuffix>
60+
<RazorExtensionInstallationRoot>CommonExtensions</RazorExtensionInstallationRoot>
61+
<!-- Base folder for Razor Language Services content inside CommonExtensions -->
62+
<RazorExtensionInstallationFolderBase>Microsoft\RazorLanguageServices</RazorExtensionInstallationFolderBase>
63+
<!-- Sub-folder used by ServiceHub core components -->
64+
<RazorServiceHubCoreSubFolder>ServiceHubCore</RazorServiceHubCoreSubFolder>
65+
<RazorVisualStudioInsertionComponent>Microsoft.VisualStudio.RazorExtension</RazorVisualStudioInsertionComponent>
66+
</PropertyGroup>
67+
5868
<!--
5969
There are effectively three modes that are needed for our source build TFMs and this is where
6070
we calculate them

Razor.sln

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio Version 18
4-
VisualStudioVersion = 18.0.10919.115 main
4+
VisualStudioVersion = 18.0.10919.115
55
MinimumVisualStudioVersion = 16.0.0.0
66
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.VisualStudio.RazorExtension", "src\Razor\src\Microsoft.VisualStudio.RazorExtension\Microsoft.VisualStudio.RazorExtension.csproj", "{BCF712D4-329A-4C7A-8292-9EFC864B2ABA}"
77
EndProject
@@ -40,8 +40,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.VisualStudio.Lang
4040
EndProject
4141
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.CodeAnalysis.Remote.Razor.Test", "src\Razor\test\Microsoft.CodeAnalysis.Remote.Razor.Test\Microsoft.CodeAnalysis.Remote.Razor.Test.csproj", "{39233703-B752-43AC-AD86-E9D3E61B4AD9}"
4242
EndProject
43-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.CodeAnalysis.Remote.Razor.CoreComponents", "src\Razor\src\Microsoft.CodeAnalysis.Remote.Razor.CoreComponents\Microsoft.CodeAnalysis.Remote.Razor.CoreComponents.csproj", "{17C4A6DF-3AA5-43FE-8A0E-53DF14340446}"
44-
EndProject
4543
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{4CAC99E0-6ECE-4264-96C3-AF4EEE7BC9D1}"
4644
ProjectSection(SolutionItems) = preProject
4745
.editorconfig = .editorconfig
@@ -146,6 +144,10 @@ Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Microsoft.CodeAnalysis.Razo
146144
EndProject
147145
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.AspNetCore.Razor.Test.Common.Cohosting", "src\Razor\test\Microsoft.AspNetCore.Razor.Test.Common.Cohosting\Microsoft.AspNetCore.Razor.Test.Common.Cohosting.csproj", "{8586B5E5-6AE9-35C5-01FA-0A02D6D5B2B5}"
148146
EndProject
147+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.CodeAnalysis.Remote.Razor.CoreComponents.x64", "src\Razor\src\Microsoft.CodeAnalysis.Remote.Razor.CoreComponents\x64\Microsoft.CodeAnalysis.Remote.Razor.CoreComponents.x64.csproj", "{0B4CBFB8-DD7B-FC51-8CB7-7946DEACEB8B}"
148+
EndProject
149+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.CodeAnalysis.Remote.Razor.CoreComponents.arm64", "src\Razor\src\Microsoft.CodeAnalysis.Remote.Razor.CoreComponents\arm64\Microsoft.CodeAnalysis.Remote.Razor.CoreComponents.arm64.csproj", "{F748E430-BFFE-93CF-8BD6-B89306AB7B77}"
150+
EndProject
149151
Global
150152
GlobalSection(SolutionConfigurationPlatforms) = preSolution
151153
Debug|Any CPU = Debug|Any CPU
@@ -266,14 +268,6 @@ Global
266268
{39233703-B752-43AC-AD86-E9D3E61B4AD9}.Release|Any CPU.Build.0 = Release|Any CPU
267269
{39233703-B752-43AC-AD86-E9D3E61B4AD9}.ReleaseNoVSIX|Any CPU.ActiveCfg = Release|Any CPU
268270
{39233703-B752-43AC-AD86-E9D3E61B4AD9}.ReleaseNoVSIX|Any CPU.Build.0 = Release|Any CPU
269-
{17C4A6DF-3AA5-43FE-8A0E-53DF14340446}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
270-
{17C4A6DF-3AA5-43FE-8A0E-53DF14340446}.Debug|Any CPU.Build.0 = Debug|Any CPU
271-
{17C4A6DF-3AA5-43FE-8A0E-53DF14340446}.DebugNoVSIX|Any CPU.ActiveCfg = Debug|Any CPU
272-
{17C4A6DF-3AA5-43FE-8A0E-53DF14340446}.DebugNoVSIX|Any CPU.Build.0 = Debug|Any CPU
273-
{17C4A6DF-3AA5-43FE-8A0E-53DF14340446}.Release|Any CPU.ActiveCfg = Release|Any CPU
274-
{17C4A6DF-3AA5-43FE-8A0E-53DF14340446}.Release|Any CPU.Build.0 = Release|Any CPU
275-
{17C4A6DF-3AA5-43FE-8A0E-53DF14340446}.ReleaseNoVSIX|Any CPU.ActiveCfg = Release|Any CPU
276-
{17C4A6DF-3AA5-43FE-8A0E-53DF14340446}.ReleaseNoVSIX|Any CPU.Build.0 = Release|Any CPU
277271
{8CEC0991-259F-4313-B3EF-E398F2B40E61}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
278272
{8CEC0991-259F-4313-B3EF-E398F2B40E61}.Debug|Any CPU.Build.0 = Debug|Any CPU
279273
{8CEC0991-259F-4313-B3EF-E398F2B40E61}.DebugNoVSIX|Any CPU.ActiveCfg = Debug|Any CPU
@@ -538,12 +532,29 @@ Global
538532
{8586B5E5-6AE9-35C5-01FA-0A02D6D5B2B5}.Release|Any CPU.Build.0 = Release|Any CPU
539533
{8586B5E5-6AE9-35C5-01FA-0A02D6D5B2B5}.ReleaseNoVSIX|Any CPU.ActiveCfg = Release|Any CPU
540534
{8586B5E5-6AE9-35C5-01FA-0A02D6D5B2B5}.ReleaseNoVSIX|Any CPU.Build.0 = Release|Any CPU
535+
{0B4CBFB8-DD7B-FC51-8CB7-7946DEACEB8B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
536+
{0B4CBFB8-DD7B-FC51-8CB7-7946DEACEB8B}.Debug|Any CPU.Build.0 = Debug|Any CPU
537+
{0B4CBFB8-DD7B-FC51-8CB7-7946DEACEB8B}.DebugNoVSIX|Any CPU.ActiveCfg = Debug|Any CPU
538+
{0B4CBFB8-DD7B-FC51-8CB7-7946DEACEB8B}.DebugNoVSIX|Any CPU.Build.0 = Debug|Any CPU
539+
{0B4CBFB8-DD7B-FC51-8CB7-7946DEACEB8B}.Release|Any CPU.ActiveCfg = Release|Any CPU
540+
{0B4CBFB8-DD7B-FC51-8CB7-7946DEACEB8B}.Release|Any CPU.Build.0 = Release|Any CPU
541+
{0B4CBFB8-DD7B-FC51-8CB7-7946DEACEB8B}.ReleaseNoVSIX|Any CPU.ActiveCfg = Release|Any CPU
542+
{0B4CBFB8-DD7B-FC51-8CB7-7946DEACEB8B}.ReleaseNoVSIX|Any CPU.Build.0 = Release|Any CPU
543+
{F748E430-BFFE-93CF-8BD6-B89306AB7B77}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
544+
{F748E430-BFFE-93CF-8BD6-B89306AB7B77}.Debug|Any CPU.Build.0 = Debug|Any CPU
545+
{F748E430-BFFE-93CF-8BD6-B89306AB7B77}.DebugNoVSIX|Any CPU.ActiveCfg = Debug|Any CPU
546+
{F748E430-BFFE-93CF-8BD6-B89306AB7B77}.DebugNoVSIX|Any CPU.Build.0 = Debug|Any CPU
547+
{F748E430-BFFE-93CF-8BD6-B89306AB7B77}.Release|Any CPU.ActiveCfg = Release|Any CPU
548+
{F748E430-BFFE-93CF-8BD6-B89306AB7B77}.Release|Any CPU.Build.0 = Release|Any CPU
549+
{F748E430-BFFE-93CF-8BD6-B89306AB7B77}.ReleaseNoVSIX|Any CPU.ActiveCfg = Release|Any CPU
550+
{F748E430-BFFE-93CF-8BD6-B89306AB7B77}.ReleaseNoVSIX|Any CPU.Build.0 = Release|Any CPU
541551
EndGlobalSection
542552
GlobalSection(SolutionProperties) = preSolution
543553
HideSolutionNode = FALSE
544554
EndGlobalSection
545555
GlobalSection(NestedProjects) = preSolution
546556
{BCF712D4-329A-4C7A-8292-9EFC864B2ABA} = {3C0D6505-79B3-49D0-B4C3-176F0F1836ED}
557+
{92463391-81BE-462B-AC3C-78C6C760741F} = {3C0D6505-79B3-49D0-B4C3-176F0F1836ED}
547558
{0F265874-C592-448B-BC4F-3430AB03E0DC} = {3C0D6505-79B3-49D0-B4C3-176F0F1836ED}
548559
{4EAD959D-73B2-4FB2-B46F-16CEB1EF49D4} = {3C0D6505-79B3-49D0-B4C3-176F0F1836ED}
549560
{E5D92DB7-5CBF-410A-9685-FF76F71EC96F} = {3C0D6505-79B3-49D0-B4C3-176F0F1836ED}
@@ -557,7 +568,6 @@ Global
557568
{0D6FD2CD-3C0A-452B-AC12-DE6301C287AC} = {3C0D6505-79B3-49D0-B4C3-176F0F1836ED}
558569
{0FC409AF-B92B-42D0-9096-1F20360D2672} = {92463391-81BE-462B-AC3C-78C6C760741F}
559570
{39233703-B752-43AC-AD86-E9D3E61B4AD9} = {92463391-81BE-462B-AC3C-78C6C760741F}
560-
{17C4A6DF-3AA5-43FE-8A0E-53DF14340446} = {3C0D6505-79B3-49D0-B4C3-176F0F1836ED}
561571
{8CEC0991-259F-4313-B3EF-E398F2B40E61} = {92463391-81BE-462B-AC3C-78C6C760741F}
562572
{87D808DC-5C9D-4D72-A9B7-C828A8DC09FA} = {3C0D6505-79B3-49D0-B4C3-176F0F1836ED}
563573
{0C7CB1C1-6CA3-42A1-AE3A-71A4DF581AC3} = {3C0D6505-79B3-49D0-B4C3-176F0F1836ED}
@@ -601,6 +611,8 @@ Global
601611
{E102632D-EC30-474F-B2EB-6EB07ED45F27} = {440580F4-D746-49BB-AE8E-9F898483EA75}
602612
{6778F3D4-C6C2-4882-9F86-54FCD44B078A} = {3C0D6505-79B3-49D0-B4C3-176F0F1836ED}
603613
{8586B5E5-6AE9-35C5-01FA-0A02D6D5B2B5} = {92463391-81BE-462B-AC3C-78C6C760741F}
614+
{0B4CBFB8-DD7B-FC51-8CB7-7946DEACEB8B} = {3C0D6505-79B3-49D0-B4C3-176F0F1836ED}
615+
{F748E430-BFFE-93CF-8BD6-B89306AB7B77} = {3C0D6505-79B3-49D0-B4C3-176F0F1836ED}
604616
EndGlobalSection
605617
GlobalSection(ExtensibilityGlobals) = postSolution
606618
SolutionGuid = {0035341D-175A-4D05-95E6-F1C2785A1E26}

eng/Versions.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
1+
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
22
<Import Project="Version.Details.props" Condition="Exists('Version.Details.props')" />
33
<!-- Opt-in arcade features -->
44
<PropertyGroup>
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<Project>
2+
3+
<PropertyGroup>
4+
<TargetFramework>$(NetVS)</TargetFramework>
5+
<OutputType>library</OutputType>
6+
<IsShipping>false</IsShipping>
7+
</PropertyGroup>
8+
9+
<!-- VSIX properties -->
10+
<PropertyGroup>
11+
12+
<IsVsixProject>true</IsVsixProject>
13+
<GeneratePkgDefFile>false</GeneratePkgDefFile>
14+
<DeployExtension>false</DeployExtension>
15+
16+
<SetupProductArch>$(ComponentArchitecture)</SetupProductArch>
17+
<IsProductComponent>true</IsProductComponent>
18+
19+
<IncludeAssemblyInVSIXContainer>false</IncludeAssemblyInVSIXContainer>
20+
<IncludeDebugSymbolsInVSIXContainer>false</IncludeDebugSymbolsInVSIXContainer>
21+
<IncludeDebugSymbolsInLocalVSIXDeployment>false</IncludeDebugSymbolsInLocalVSIXDeployment>
22+
23+
<VSSDKTargetPlatformRegRootSuffix>$(RazorVSSDKTargetPlatformRegRootSuffix)</VSSDKTargetPlatformRegRootSuffix>
24+
<ExtensionInstallationRoot>$(RazorExtensionInstallationRoot)</ExtensionInstallationRoot>
25+
<ExtensionInstallationFolder>$(RazorExtensionInstallationFolderBase)\$(RazorServiceHubCoreSubFolder)</ExtensionInstallationFolder>
26+
<VisualStudioInsertionComponent>$(RazorVisualStudioInsertionComponent)</VisualStudioInsertionComponent>
27+
28+
<!-- Only create the VSIX for official builds. In dev builds we reference the bits directly in the razor extension -->
29+
<CreateVsixContainer>false</CreateVsixContainer>
30+
<CreateVsixContainer Condition="'$(OfficialBuildId)' != ''">true</CreateVsixContainer>
31+
32+
</PropertyGroup>
33+
34+
<ItemGroup>
35+
<ProjectReference Include="..\..\Microsoft.CodeAnalysis.Remote.Razor\Microsoft.CodeAnalysis.Remote.Razor.csproj">
36+
37+
<!-- Don't directly reference the project -->
38+
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
39+
40+
<!-- Instead call this target to get a list of what should be included when we build as a VSIX -->
41+
<IncludeOutputGroupsInVSIX>PublishProjectOutputGroup</IncludeOutputGroupsInVSIX>
42+
43+
<!-- Ensure we consume the right components for our architecture and RID -->
44+
<AdditionalProperties>RuntimeIdentifier=win-$(ComponentArchitecture);TargetFramework=$(NetVS)</AdditionalProperties>
45+
46+
<!-- Do not NGEN at install time. They are R2R compiled as part of the build instead -->
47+
<Ngen>false</Ngen>
48+
</ProjectReference>
49+
</ItemGroup>
50+
51+
</Project>

src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor.CoreComponents/Microsoft.CodeAnalysis.Remote.Razor.CoreComponents.csproj

Lines changed: 0 additions & 41 deletions
This file was deleted.

src/Razor/src/Microsoft.CodeAnalysis.Remote.Razor.CoreComponents/Program.cs

Lines changed: 0 additions & 13 deletions
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<ComponentArchitecture>arm64</ComponentArchitecture>
5+
</PropertyGroup>
6+
7+
<Import Project="../CoreComponents.props"/>
8+
9+
</Project>
10+
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
3+
<Metadata>
4+
<Identity Id="Microsoft.VisualStudio.RazorExtension.ServiceHub.arm64" Version="|%CurrentProject%;GetVsixVersion|" Language="en-US" Publisher="Microsoft" />
5+
<DisplayName>Razor Service Hub Components</DisplayName>
6+
<Description xml:space="preserve">Razor Service Hub Components (arm64)</Description>
7+
8+
<!-- This is needed to mark this extension as cloud compliant. -->
9+
<AllowClientRole>true</AllowClientRole>
10+
</Metadata>
11+
<Installation AllUsers="true" Experimental="true">
12+
<InstallationTarget Id="Microsoft.VisualStudio.Community" Version="[17.0,)">
13+
14+
<!-- https://github.com/dotnet/razor/issues/12411
15+
16+
Our current build tools don't support arm64. Use a valid arch (amd64) to pass VSIX checks in the tools.
17+
VS doesn't seem to check this anyway so its fine.
18+
-->
19+
<ProductArchitecture>amd64</ProductArchitecture>
20+
</InstallationTarget>
21+
</Installation>
22+
23+
<Prerequisites>
24+
<Prerequisite Id="Microsoft.VisualStudio.Component.CoreEditor" Version="[17.0,)" DisplayName="Visual Studio core editor" />
25+
</Prerequisites>
26+
27+
</PackageManifest>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<ComponentArchitecture>x64</ComponentArchitecture>
5+
</PropertyGroup>
6+
7+
<Import Project="../CoreComponents.props"/>
8+
9+
</Project>
10+

0 commit comments

Comments
 (0)