提交 4d69e674 编写于 作者: J Jared Parsons

Disable implicit transitive references in VSIX projects

By default the new SDK will cause projecs to reference the full
transitive closure of project references, not just the direct
references. This is fine in most cases but caused breaks in our VSIX
projects.

Our VSIX projects often reference project with specific extra metadata
to control whether or not their contents are included in the final VSIX.
That extra metadata is not applied to projects which are implicitly
referenced by the new SDK. That caused our VSIX to bloat in size and
have functionally incorrect contents.

Fixed this by disabling implicit transitive references for our VSIX
projects.

https://github.com/dotnet/sdk/issues/1366
上级 d2fbb9e9
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!--
Defining this target will disable the new SDK behavior of implicit transitive project
references. This is a fine feature in general but the current implementation breaks VSIX
construction by including a number of projects that should not be included.
https://github.com/dotnet/sdk/issues/1366
-->
<Target Name="IncludeTransitiveProjectReferences">
</Target>
</Project>
...@@ -319,7 +319,7 @@ ...@@ -319,7 +319,7 @@
2) The SDK targets don't currently look at the ReferenceCopyLocalPaths produced 2) The SDK targets don't currently look at the ReferenceCopyLocalPaths produced
by the NuGet build task. --> by the NuGet build task. -->
<Target Name="IncludeNuGetResolvedAssets" DependsOnTargets="RunResolvePackageDependencies" Condition="'@(NuGetPackageToIncludeInVsix)' != ''"> <Target Name="IncludeNuGetResolvedAssets" DependsOnTargets="ResolvePackageDependenciesForBuild" Condition="'@(NuGetPackageToIncludeInVsix)' != ''">
<ItemGroup> <ItemGroup>
<_ReferenceCopyLocalPathsWithPotentialInclusions Include="@(ReferenceCopyLocalPaths)"> <_ReferenceCopyLocalPathsWithPotentialInclusions Include="@(ReferenceCopyLocalPaths)">
<NuGetPackageToIncludeInVsix>%(NuGetPackageToIncludeInVsix.Identity)</NuGetPackageToIncludeInVsix> <NuGetPackageToIncludeInVsix>%(NuGetPackageToIncludeInVsix.Identity)</NuGetPackageToIncludeInVsix>
...@@ -363,6 +363,7 @@ ...@@ -363,6 +363,7 @@
<Import Project="GenerateAssemblyInfo.targets" Condition="'$(ProjectLanguage)' == 'CSharp' OR '$(ProjectLanguage)' == 'VB'" /> <Import Project="GenerateAssemblyInfo.targets" Condition="'$(ProjectLanguage)' == 'CSharp' OR '$(ProjectLanguage)' == 'VB'" />
<Import Project="GenerateInternalsVisibleTo.targets" /> <Import Project="GenerateInternalsVisibleTo.targets" />
<Import Project="DisableTransitiveReferences.targets" Condition="'$(RoslynProjectType)' == 'Vsix' AND '$(RoslynSdkProject)' == 'true'" />
<ItemDefinitionGroup> <ItemDefinitionGroup>
<VSIXSourceItem> <VSIXSourceItem>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册