Skip to content

Commit

Permalink
install servicehub json files in common7/servicehub folders (dotnet#3…
Browse files Browse the repository at this point in the history
…4563)

* moved files

* opt-in to new "serviceOverride": true support and refactor directory structure to share json files with devdiv insertion projects

* added swr for servicehub json files.

* delete projects not needed

* moving to auto generated service.json approach

* made json file included in vsix

* generate swr file

* address PR feedbacks and remove duplications except vsix manifest

* use relative path in json file

* share duplicated string to multiple csproj

* fix swr package name

* PR feedbacks
  • Loading branch information
heejaechang authored Apr 18, 2019
1 parent f09ab5f commit 3f6afea
Show file tree
Hide file tree
Showing 16 changed files with 136 additions and 126 deletions.
7 changes: 7 additions & 0 deletions Roslyn.sln
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.CodeAnalysis.Exte
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.CodeAnalysis.ExternalAccess.Xamarin.Remote", "src\Tools\ExternalAccess\Xamarin.Remote\Microsoft.CodeAnalysis.ExternalAccess.Xamarin.Remote.csproj", "{DE53934B-7FC1-48A0-85AB-C519FBBD02CF}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Roslyn.VisualStudio.Setup.ServiceHub", "src\Setup\DevDivVsix\ServiceHubConfig\Roslyn.VisualStudio.Setup.ServiceHub.csproj", "{3D33BBFD-EC63-4E8C-A714-0A48A3809A87}"
EndProject
Global
GlobalSection(SharedMSBuildProjectFiles) = preSolution
src\Compilers\VisualBasic\BasicAnalyzerDriver\BasicAnalyzerDriver.projitems*{2523d0e6-df32-4a3e-8ae0-a19bffae2ef6}*SharedItemsImports = 4
Expand Down Expand Up @@ -1063,6 +1065,10 @@ Global
{DE53934B-7FC1-48A0-85AB-C519FBBD02CF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DE53934B-7FC1-48A0-85AB-C519FBBD02CF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DE53934B-7FC1-48A0-85AB-C519FBBD02CF}.Release|Any CPU.Build.0 = Release|Any CPU
{3D33BBFD-EC63-4E8C-A714-0A48A3809A87}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3D33BBFD-EC63-4E8C-A714-0A48A3809A87}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3D33BBFD-EC63-4E8C-A714-0A48A3809A87}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3D33BBFD-EC63-4E8C-A714-0A48A3809A87}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -1251,6 +1257,7 @@ Global
{655A5B07-39B8-48CD-8590-8AC0C2B708D8} = {8977A560-45C2-4EC2-A849-97335B382C74}
{FA51A3CB-5174-4D99-B76E-DC31C5361DF3} = {8977A560-45C2-4EC2-A849-97335B382C74}
{DE53934B-7FC1-48A0-85AB-C519FBBD02CF} = {8977A560-45C2-4EC2-A849-97335B382C74}
{3D33BBFD-EC63-4E8C-A714-0A48A3809A87} = {BE25E872-1667-4649-9D19-96B83E75A44E}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {604E6B91-7BC0-4126-AE07-D4D2FEFC3D29}
Expand Down
57 changes: 57 additions & 0 deletions eng/targets/GenerateServiceHubConfigurationFiles.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -->
<Project>
<!--
The inclusion of this file will cause *.servicehub.service.json files to be created. and these json files contain configuration for the servicehub on how it
should configure our services in servicehub process
-->
<ItemGroup>
<ServiceHubService Include="roslynCodeAnalysis" ClassName="Microsoft.CodeAnalysis.Remote.CodeAnalysisService" />
<ServiceHubService Include="roslynRemoteHost" ClassName="Microsoft.CodeAnalysis.Remote.RemoteHostService" />
<ServiceHubService Include="roslynSnapshot" ClassName="Microsoft.CodeAnalysis.Remote.SnapshotService" />
<ServiceHubService Include="roslynRemoteSymbolSearchUpdateEngine" ClassName="Microsoft.CodeAnalysis.Remote.RemoteSymbolSearchUpdateEngine" />
</ItemGroup>

<PropertyGroup>
<GetVsixSourceItemsDependsOn>$(GetVsixSourceItemsDependsOn);GenerateServiceHubConfigurationFiles</GetVsixSourceItemsDependsOn>
</PropertyGroup>

<Target Name="CalculateServiceHubConfigurationFiles">
<ItemGroup>
<_ServicesWithBitness Include="@(ServiceHubService)" FileSuffix="" HostSuffix=".x86" HostIdSuffix="32" />
<_ServicesWithBitness Include="@(ServiceHubService)" FileSuffix="64" HostSuffix="" HostIdSuffix="" />

<_JsonFile Include="$(IntermediateOutputPath)%(_ServicesWithBitness.FileName)%(_ServicesWithBitness.FileSuffix).servicehub.service.json">
<Content>
<![CDATA[{
"host": "desktopClr%(_ServicesWithBitness.HostSuffix)",
"hostId": "RoslynCodeAnalysisService%(_ServicesWithBitness.HostIdSuffix)",
"hostGroupAllowed": true,
"serviceOverride": true,
"entryPoint": {
"assemblyPath": "$(ServiceHubAssemblyBasePath.Replace('\', '\\'))Microsoft.CodeAnalysis.Remote.ServiceHub.dll",
"fullClassName": "%(_ServicesWithBitness.ClassName)",
"appBasePath": "%VSAPPIDDIR%",
"configPath": "%PkgDefApplicationConfigFile%"
}
}
]]>
</Content>
</_JsonFile>
</ItemGroup>
</Target>

<Target Name="GenerateServiceHubConfigurationFiles"
DependsOnTargets="CalculateServiceHubConfigurationFiles"
BeforeTargets="CreateVsixContainer"
Inputs="$(MSBuildProjectFullPath)"
Outputs="@(_JsonFile)">

<WriteLinesToFile File="%(_JsonFile.Identity)" Lines="%(_JsonFile.Content)" Overwrite="true"/>

<ItemGroup>
<FileWrites Include="@(_JsonFile->'%(Identity)')"/>
<VSIXSourceItem Include="@(_JsonFile->'%(Identity)')" />
</ItemGroup>
</Target>
</Project>
3 changes: 3 additions & 0 deletions eng/targets/Settings.props
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@

<VSSDKTargetPlatformRegRootSuffix>RoslynDev</VSSDKTargetPlatformRegRootSuffix>

<CommonExtensionInstallationRoot>CommonExtensions</CommonExtensionInstallationRoot>
<LanguageServicesExtensionInstallationFolder>Microsoft\ManagedLanguages\VBCSharp\LanguageServices</LanguageServicesExtensionInstallationFolder>

<!-- Disable the implicit nuget fallback folder as it makes it hard to locate and copy ref assemblies to the test output folder -->
<DisableImplicitNuGetFallbackFolder>true</DisableImplicitNuGetFallbackFolder>
<ToolsetPackagesDir>$(RepoRoot)build\ToolsetPackages\</ToolsetPackagesDir>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<IncludeAssemblyInVSIXContainer>false</IncludeAssemblyInVSIXContainer>
<IncludeDebugSymbolsInVSIXContainer>false</IncludeDebugSymbolsInVSIXContainer>
<IncludeDebugSymbolsInLocalVSIXDeployment>false</IncludeDebugSymbolsInLocalVSIXDeployment>
<ExtensionInstallationRoot>CommonExtensions</ExtensionInstallationRoot>
<ExtensionInstallationRoot>$(CommonExtensionInstallationRoot)</ExtensionInstallationRoot>
<ExtensionInstallationFolder>Microsoft\ManagedLanguages\VBCSharp\ExpressionEvaluators</ExtensionInstallationFolder>

<!-- VS Insertion -->
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<!-- Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. -->
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net472</TargetFramework>
<RoslynProjectType>Custom</RoslynProjectType>

<!-- VS Insertion -->
<TargetVsixContainerName>Roslyn.VisualStudio.Setup.ServiceHub.vsix</TargetVsixContainerName>
<VisualStudioInsertionComponent>Microsoft.CodeAnalysis.LanguageServices</VisualStudioInsertionComponent>

<!-- ServiceHub AssemblyPath -->
<!-- Path to our servicehub entry point dll in Common7\IDE\CommonExtensions\Microsoft\ManagedLanguages\VBCSharp\LanguageServices (our vsix directory)
relative to Common7\ServiceHub\Services\RoslynCodeAnalysisService where our in-box servicehub.service.json files are -->
<ServiceHubAssemblyBasePath>..\..\..\IDE\$(CommonExtensionInstallationRoot)\$(LanguageServicesExtensionInstallationFolder)\</ServiceHubAssemblyBasePath>
</PropertyGroup>

<Target Name="_SetSwrFilePath">
<PropertyGroup>
<_SwrFilePath>$(IntermediateOutputPath)Roslyn.VisualStudio.Setup.ServiceHub.swr</_SwrFilePath>
</PropertyGroup>
</Target>

<Target Name="_GenerateSwrFile"
AfterTargets="Build"
BeforeTargets="SwixBuild"
DependsOnTargets="_SetSwrFilePath;GenerateServiceHubConfigurationFiles"
Outputs="$(_SwrFilePath)">

<ItemGroup>
<_ServiceHubConfigFiles Include="@(ServiceHubService)" FileSuffix="" />
<_ServiceHubConfigFiles Include="@(ServiceHubService)" FileSuffix="64" />
<_FileEntries Include='file source="$(IntermediateOutputPath)%(_ServiceHubConfigFiles.FileName)%(_ServiceHubConfigFiles.FileSuffix).servicehub.service.json"'/>
</ItemGroup>

<PropertyGroup>
<_Lines>
<![CDATA[use vs
package name=$(MSBuildProjectName)
version=$(VsixVersion)
folder InstallDir:\Common7\ServiceHub\Services\RoslynCodeAnalysisService
@(_FileEntries, '%0d%0a ')
]]>
</_Lines>
</PropertyGroup>

<WriteLinesToFile File="$(_SwrFilePath)" Lines="$(_Lines)" Overwrite="true"/>

<ItemGroup>
<FileWrites Include="$(_SwrFilePath)"/>
<SwrFile Include="$(_SwrFilePath)"/>
</ItemGroup>
</Target>

<Import Project="$(RepositoryEngineeringDir)targets\GenerateServiceHubConfigurationFiles.targets" />
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<IncludeAssemblyInVSIXContainer>false</IncludeAssemblyInVSIXContainer>
<IncludeDebugSymbolsInVSIXContainer>false</IncludeDebugSymbolsInVSIXContainer>
<IncludeDebugSymbolsInLocalVSIXDeployment>false</IncludeDebugSymbolsInLocalVSIXDeployment>
<ExtensionInstallationRoot>CommonExtensions</ExtensionInstallationRoot>
<ExtensionInstallationRoot>$(CommonExtensionInstallationRoot)</ExtensionInstallationRoot>
<ExtensionInstallationFolder>Microsoft\ManagedLanguages\VBCSharp\Dependencies</ExtensionInstallationFolder>
</PropertyGroup>
<ItemGroup>
Expand Down
44 changes: 9 additions & 35 deletions src/VisualStudio/Setup/Roslyn.VisualStudio.Setup.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,16 @@
<IncludeAssemblyInVSIXContainer>false</IncludeAssemblyInVSIXContainer>
<IncludeDebugSymbolsInVSIXContainer>false</IncludeDebugSymbolsInVSIXContainer>
<IncludeDebugSymbolsInLocalVSIXDeployment>false</IncludeDebugSymbolsInLocalVSIXDeployment>
<ExtensionInstallationRoot>CommonExtensions</ExtensionInstallationRoot>
<ExtensionInstallationFolder>Microsoft\ManagedLanguages\VBCSharp\LanguageServices</ExtensionInstallationFolder>
<ExtensionInstallationRoot>$(CommonExtensionInstallationRoot)</ExtensionInstallationRoot>
<ExtensionInstallationFolder>$(LanguageServicesExtensionInstallationFolder)</ExtensionInstallationFolder>

<!-- VS Insertion -->
<VisualStudioInsertionComponent>Microsoft.CodeAnalysis.LanguageServices</VisualStudioInsertionComponent>

<!-- ServiceHub AssemblyPath -->
<!-- Path to our servicehub entry point dll in the vsix directory relative
to our servicehub.servicehub.json files in the same vsix directory -->
<ServiceHubAssemblyBasePath>.\</ServiceHubAssemblyBasePath>
</PropertyGroup>
<ItemGroup Label="Project References">
<ProjectReference Include="..\..\Compilers\Core\Portable\Microsoft.CodeAnalysis.csproj">
Expand Down Expand Up @@ -245,38 +250,6 @@
<IncludeInVSIX>true</IncludeInVSIX>
</Content>
<Content Include="CSharpInteractivePackageRegistration.pkgdef" />
<Content Include="roslynCodeAnalysis.servicehub.service.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<IncludeInVSIX>true</IncludeInVSIX>
</Content>
<Content Include="roslynRemoteHost.servicehub.service.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<IncludeInVSIX>true</IncludeInVSIX>
</Content>
<Content Include="roslynRemoteSymbolSearchUpdateEngine.servicehub.service.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<IncludeInVSIX>true</IncludeInVSIX>
</Content>
<Content Include="roslynSnapshot.servicehub.service.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<IncludeInVSIX>true</IncludeInVSIX>
</Content>
<Content Include="roslynSnapshot64.servicehub.service.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<IncludeInVSIX>true</IncludeInVSIX>
</Content>
<Content Include="roslynCodeAnalysis64.servicehub.service.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<IncludeInVSIX>true</IncludeInVSIX>
</Content>
<Content Include="roslynRemoteHost64.servicehub.service.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<IncludeInVSIX>true</IncludeInVSIX>
</Content>
<Content Include="roslynRemoteSymbolSearchUpdateEngine64.servicehub.service.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<IncludeInVSIX>true</IncludeInVSIX>
</Content>
</ItemGroup>
<ItemGroup>
<None Include="source.extension.vsixmanifest">
Expand All @@ -293,4 +266,5 @@
<PackageReference Include="Microsoft.VisualStudio.Shell.Framework" Version="$(MicrosoftVisualStudioShellFrameworkVersion)" />
<PackageReference Include="SQLitePCLRaw.bundle_green" Version="$(SQLitePCLRawbundle_greenVersion)" />
</ItemGroup>
</Project>
<Import Project="$(RepositoryEngineeringDir)targets\GenerateServiceHubConfigurationFiles.targets" />
</Project>
11 changes: 0 additions & 11 deletions src/VisualStudio/Setup/roslynCodeAnalysis.servicehub.service.json

This file was deleted.

This file was deleted.

11 changes: 0 additions & 11 deletions src/VisualStudio/Setup/roslynRemoteHost.servicehub.service.json

This file was deleted.

11 changes: 0 additions & 11 deletions src/VisualStudio/Setup/roslynRemoteHost64.servicehub.service.json

This file was deleted.

This file was deleted.

This file was deleted.

11 changes: 0 additions & 11 deletions src/VisualStudio/Setup/roslynSnapshot.servicehub.service.json

This file was deleted.

11 changes: 0 additions & 11 deletions src/VisualStudio/Setup/roslynSnapshot64.servicehub.service.json

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<IncludeDebugSymbolsInVSIXContainer>false</IncludeDebugSymbolsInVSIXContainer>
<IncludeDebugSymbolsInLocalVSIXDeployment>false</IncludeDebugSymbolsInLocalVSIXDeployment>
<MinimumVisualStudioVersion>$(VisualStudioVersion)</MinimumVisualStudioVersion>
<ExtensionInstallationRoot>CommonExtensions</ExtensionInstallationRoot>
<ExtensionInstallationRoot>$(CommonExtensionInstallationRoot)</ExtensionInstallationRoot>
<ExtensionInstallationFolder>Microsoft\ManagedLanguages\VBCSharp\InteractiveComponents</ExtensionInstallationFolder>

<!-- VS Insertion -->
Expand Down

0 comments on commit 3f6afea

Please sign in to comment.