|
4 | 4 | <TargetFramework>$(NetVSCode)</TargetFramework> |
5 | 5 | <ImplicitUsings>enable</ImplicitUsings> |
6 | 6 | <Nullable>enable</Nullable> |
| 7 | + <IsShippingPackage>true</IsShippingPackage> |
7 | 8 |
|
8 | | - <!-- Ensure we run our custom target, below, to copy compiler project references --> |
9 | | - <TargetsForTfmSpecificBuildOutput>$(TargetsForTfmSpecificBuildOutput);CopyProjectReferencesToPackage</TargetsForTfmSpecificBuildOutput> |
| 9 | + <!-- |
| 10 | + Build a nuget package for this project. This is not consumed as a standard NuGet package; it just |
| 11 | + contains the extension binaries to be packaged in the VS Code VSIX. |
| 12 | + --> |
| 13 | + <IsPackable>true</IsPackable> |
| 14 | + |
| 15 | + <!-- This is not a standard nuget package and only consumed by the extension build. We don't care if the folder structure doesn't match what nuget expects. --> |
| 16 | + <NoWarn>$(NoWarn);NU5100</NoWarn> |
| 17 | + |
| 18 | + <BeforePack>PackPublishContent;$(BeforePack)</BeforePack> |
10 | 19 | </PropertyGroup> |
11 | | - <ItemGroup> |
12 | | - <Compile Remove="S:\razor\src\Shared\files\LanguageSupport\IsExternalInit.cs" /> |
13 | | - </ItemGroup> |
14 | 20 |
|
15 | 21 | <ItemGroup> |
| 22 | + <!-- Below package references are covered by the binaries shipped by roslyn and do not need to be packaged--> |
16 | 23 | <PackageReference Include="Microsoft.CodeAnalysis.CSharp" /> |
17 | 24 | <PackageReference Include="Microsoft.CodeAnalysis.Workspaces.Common" /> |
18 | 25 | <PackageReference Include="Microsoft.Extensions.ObjectPool" /> |
19 | 26 | <PackageReference Include="Microsoft.Extensions.Logging" /> |
20 | 27 | <PackageReference Include="Microsoft.CodeAnalysis.ExternalAccess.Razor.Features" /> |
| 28 | + |
| 29 | + <!-- Roslyn does not use Microsoft.VisualStudio.LanguageServer.Protocol so we have to pack it --> |
21 | 30 | <PackageReference Include="Microsoft.VisualStudio.LanguageServer.Protocol" GeneratePathProperty="True" /> |
22 | 31 | </ItemGroup> |
23 | 32 |
|
|
31 | 40 | <InternalsVisibleTo Include="Microsoft.VisualStudioCode.RazorExtension.Test" Key="$(RazorKey)" /> |
32 | 41 | </ItemGroup> |
33 | 42 |
|
34 | | - <ItemGroup> |
35 | | - <Content Include="$(PkgMicrosoft_VisualStudio_LanguageServer_Protocol)\lib\netstandard2.0\Microsoft.VisualStudio.LanguageServer.Protocol.dll" Pack="true" PackagePath="content" CopyToOutputDirectory="PreserveNewest" /> |
36 | | - </ItemGroup> |
37 | | - |
38 | | - <!-- |
39 | | - Include the build output of project references in the package created. We need to do this because the compiler packages |
40 | | - are published via a separate process to tooling, so anything that references this package will try to transitively pull |
41 | | - in the compiler packages, but will be unable to find packages with the same version. |
42 | | -
|
43 | | - This means we end up with the package for this project including the following additional DLLs: |
44 | | - * Microsoft.CodeAnalysis.Razor.Compiler.dll |
45 | | - * Microsoft.AspNetCore.Razor.Utilities.Shared.dll |
46 | | -
|
47 | | - (and Microsoft.VisualStudioCode.RazorExtension.dll obviously) |
48 | | - --> |
49 | | - <Target DependsOnTargets="ResolveReferences" Name="CopyProjectReferencesToPackage"> |
| 43 | + <Target Name="PackPublishContent" DependsOnTargets="Publish"> |
50 | 44 | <ItemGroup> |
51 | | - <BuildOutputInPackage Include="@(ReferenceCopyLocalPaths->WithMetadataValue('ReferenceSourceTarget', 'ProjectReference'))" /> |
| 45 | + <Content Include="$(PkgMicrosoft_VisualStudio_LanguageServer_Protocol)\lib\netstandard2.0\Microsoft.VisualStudio.LanguageServer.Protocol.dll" Pack="true" PackagePath="content" CopyToOutputDirectory="PreserveNewest" /> |
| 46 | + <Content Include="$(TargetPath)" Pack="true" PackagePath="content" CopyToOutputDirectory="PreserveNewest" /> |
| 47 | + |
| 48 | + <Content Include="$(PublishDir)\Microsoft.AspNetCore.Razor.Utilities.Shared.dll" Pack="true" PackagePath="content" CopyToOutputDirectory="PreserveNewest" /> |
| 49 | + <Content Include="$(PublishDir)\Microsoft.CodeAnalysis.Razor.Compiler.dll" Pack="true" PackagePath="content" CopyToOutputDirectory="PreserveNewest" /> |
| 50 | + <Content Include="$(PublishDir)\Microsoft.CodeAnalysis.Razor.Workspaces.dll" Pack="true" PackagePath="content" CopyToOutputDirectory="PreserveNewest" /> |
| 51 | + |
| 52 | + <!-- We don't need to include everything in the bin folder but we do need to add localization resources for the compiler dll --> |
| 53 | + <Content Include="$(PublishDir)\cs\**\*.*" Pack="true" PackagePath="content\cs\" CopyToOutputDirectory="PreserveNewest" /> |
| 54 | + <Content Include="$(PublishDir)\de\**\*.*" Pack="true" PackagePath="content\de\" CopyToOutputDirectory="PreserveNewest" /> |
| 55 | + <Content Include="$(PublishDir)\es\**\*.*" Pack="true" PackagePath="content\es\" CopyToOutputDirectory="PreserveNewest" /> |
| 56 | + <Content Include="$(PublishDir)\fr\**\*.*" Pack="true" PackagePath="content\fr\" CopyToOutputDirectory="PreserveNewest" /> |
| 57 | + <Content Include="$(PublishDir)\it\**\*.*" Pack="true" PackagePath="content\it\" CopyToOutputDirectory="PreserveNewest" /> |
| 58 | + <Content Include="$(PublishDir)\ja\**\*.*" Pack="true" PackagePath="content\ja\" CopyToOutputDirectory="PreserveNewest" /> |
| 59 | + <Content Include="$(PublishDir)\ko\**\*.*" Pack="true" PackagePath="content\ko\" CopyToOutputDirectory="false" /> |
| 60 | + <Content Include="$(PublishDir)\pl\**\*.*" Pack="true" PackagePath="content\pl\" CopyToOutputDirectory="false" /> |
| 61 | + <Content Include="$(PublishDir)\pt-BR\**\*.*" Pack="true" PackagePath="content\pt-BR\" CopyToOutputDirectory="false" /> |
| 62 | + <Content Include="$(PublishDir)\ru\**\*.*" Pack="true" PackagePath="content\ru\" CopyToOutputDirectory="false" /> |
| 63 | + <Content Include="$(PublishDir)\tr\**\*.*" Pack="true" PackagePath="content\tr\" CopyToOutputDirectory="false" /> |
| 64 | + <Content Include="$(PublishDir)\zh-Hans\**\*.*" Pack="true" PackagePath="content\zh-Hans\" CopyToOutputDirectory="false" /> |
| 65 | + <Content Include="$(PublishDir)\zh-Hant\**\*.*" Pack="true" PackagePath="content\zh-Hant\" CopyToOutputDirectory="false" /> |
52 | 66 | </ItemGroup> |
53 | 67 | </Target> |
54 | 68 | </Project> |
0 commit comments