提交 76881584 编写于 作者: T Tomas Matousek

Split VSL.Imports.targets

上级 8a98e578
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- ====================================================================================
Support for in-place modification of the compiled binary.
Since there may be more than one post compile modification, we must take care not
to break incremental builds. A timestemp file is written out when all modification
targets have completed.
Note that the targets participating in post compile modification must list the
sentinel file as one of their outputs, but they should not modify it.
==================================================================================== -->
<PropertyGroup>
<PostCompileBinaryModificationSentinelFile>$(IntermediateOutputPath)$(TargetFileName).pcbm</PostCompileBinaryModificationSentinelFile>
</PropertyGroup>
<Target Name="PostCompileBinaryModification"
AfterTargets="CoreCompile"
DependsOnTargets="ApplyOptimizations"
Inputs="@(IntermediateAssembly)"
Outputs="@(IntermediateAssembly);$(PostCompileBinaryModificationSentinelFile)">
<!-- Write out a sentinel timestamp file to prevent unnecessary work in incremental builds. -->
<Touch AlwaysCreate="true" Files="$(PostCompileBinaryModificationSentinelFile)" />
<ItemGroup>
<FileWrites Include="$(PostCompileBinaryModificationSentinelFile)" />
</ItemGroup>
</Target>
<!-- ====================================================================================
Support for rolling optimization data into assemblies.
==================================================================================== -->
<PropertyGroup>
<OptimizationDataFolderPath>$(MSBuildThisFileDirectory)..\..\..\Closed\OptimizationData</OptimizationDataFolderPath>
<OptimizationDataFile>$([System.IO.Path]::GetFullPath('$(OptimizationDataFolderPath)\$(TargetName).pgo'))</OptimizationDataFile>
<IbcMergePath>$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)..\..\..\Closed\Tools\ibcmerge\ibcmerge.exe'))</IbcMergePath>
</PropertyGroup>
<Target Name="ApplyOptimizations"
Condition="'$(Configuration)' == 'Release' AND '$(NonShipping)' != 'true' AND '$(SkipApplyOptimizations)' != 'true' AND Exists('$(OptimizationDataFile)')"
Inputs="@(IntermediateAssembly)"
Outputs="@(IntermediateAssembly);$(PostCompileBinaryModificationSentinelFile)">
<Message Text="Adding optimization data to @(IntermediateAssembly)"/>
<Exec Command="&quot;$(IbcMergePath)&quot; -q -f -partialNGEN -minify -mo &quot;@(IntermediateAssembly)&quot; -incremental &quot;$(OptimizationDataFile)&quot;" />
</Target>
</Project>
\ No newline at end of file
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- ====================================================================================
Generation of AssemblyVersion attributes from the BuildVersion property
==================================================================================== -->
<PropertyGroup>
<GeneratedAssemblyInfoFile>$(IntermediateOutputPath)GeneratedAssemblyInfo_$(BuildVersion)$(DefaultLanguageSourceExtension)</GeneratedAssemblyInfoFile>
</PropertyGroup>
......
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- ====================================================================================
Generation of InternalsVisibleTo attributes from the project
==================================================================================== -->
<PropertyGroup>
<GeneratedInternalsVisibleToFile>$(IntermediateOutputPath)GeneratedInternalsVisibleTo$(DefaultLanguageSourceExtension)</GeneratedInternalsVisibleToFile>
</PropertyGroup>
......
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<RoslynInternalKey>002400000480000094000000060200000024000052534131000400000100010055e0217eb635f69281051f9a823e0c7edd90f28063eb6c7a742a19b4f6139778ee0af438f47aed3b6e9f99838aa8dba689c7a71ddb860c96d923830b57bbd5cd6119406ddb9b002cf1c723bf272d6acbb7129e9d6dd5a5309c94e0ff4b2c884d45a55f475cd7dba59198086f61f5a8c8b5e601c0edbf269733f6f578fc8579c2</RoslynInternalKey>
</PropertyGroup>
<!-- settings for strong name signing -->
<PropertyGroup>
<RunningInMicroBuild Condition="Exists('$(TF_BUILD_BUILDDIRECTORY)\MicroBuild\MicroBuild.Signing.dll')">true</RunningInMicroBuild>
<ShouldSignBuild Condition="'$(RealSignBuild)' == 'true' OR ('$(RunningInMicroBuild)' == 'true' AND '$(SignType)' == 'real')">true</ShouldSignBuild>
</PropertyGroup>
<Choose>
<When Condition="'$(SignAssembly)' == 'true'">
<Choose>
<!-- Shipping binaries in an "official" build are delay-signed with the MS key; later, the signing
system will finish the strong-name signing. -->
<When Condition="'$(NonShipping)' != 'true'">
<Choose>
<!-- DelaySign if we're real signing, otherwise public sign -->
<When Condition="'$(ShouldSignBuild)' == 'true'">
<PropertyGroup>
<DelaySign>true</DelaySign>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup>
<PublicSign>true</PublicSign>
</PropertyGroup>
</Otherwise>
</Choose>
<PropertyGroup>
<AssemblyOriginatorKeyFile>$(VSLToolsPath)\Strong Name Keys\35MSSharedLib1024.snk</AssemblyOriginatorKeyFile>
<PublicKey>0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9</PublicKey>
<PublicKeyToken>31BF3856AD364E35</PublicKeyToken>
</PropertyGroup>
</When>
<!-- Non-shipping binaries are simply signed with the Roslyn internal key. -->
<Otherwise>
<PropertyGroup>
<AssemblyOriginatorKeyFile>$(VSLToolsPath)\Strong Name Keys\RoslynInternalKey.Private.snk</AssemblyOriginatorKeyFile>
<DelaySign>false</DelaySign>
<PublicKey>$(RoslynInternalKey)</PublicKey>
<PublicKeyToken>fc793a00266884fb</PublicKeyToken>
</PropertyGroup>
</Otherwise>
</Choose>
</When>
</Choose>
<Target Name="VerifySigningFlags" BeforeTargets="CoreCompile">
<Error Condition="('$(RealSignBuild)' == 'true' OR '$(SignType)' == 'real') AND '$(BuildVersion)' == '42.42.42.42'"
Text="Must specify a build version in order to real sign a build." />
</Target>
<!-- Because https://github.com/dotnet/roslyn/issues/7812 is not yet fixed, the IDE doesn't know if we set the PublicSign
flag. As a result, all design-time builds will thing we're real-signing, which causes semantics to get all screwed up.
The workaround for now is, for design-time builds only, to pass the DelaySign flag since that's "good enough". This
must be done in a target versus conditioning on BuildingProject, since BuildingProject itself is correctly set in a
target. -->
<Target Name="FixPublicSignFlagForDesignTimeBuilds" BeforeTargets="CoreCompile" Condition="'$(PublicSign)' == 'true'">
<PropertyGroup Condition="'$(BuildingProject)' == 'false'">
<!-- Turn off PublicSign, because leaving both to true will make the Csc task unhappy -->
<PublicSign>false</PublicSign>
<DelaySign>true</DelaySign>
</PropertyGroup>
</Target>
<!-- ====================================================================================
Support for signing VSIXes
==================================================================================== -->
<UsingTask TaskName="SignFiles" AssemblyFile="$(TF_BUILD_BUILDDIRECTORY)\MicroBuild\MicroBuild.Signing.dll" Condition="'$(RunningInMicroBuild)' == 'true'" />
<PropertyGroup>
<CreateVsixContainerDependsOn>$(CreateVsixContainerDependsOn);SignVsixInputs</CreateVsixContainerDependsOn>
<PrepareForRunDependsOn>$(PrepareForRunDependsOn);SignVsix</PrepareForRunDependsOn>
<ProducingSignedVsix Condition="'$(ShouldSignBuild)' == 'true' AND '$(NonShipping)' != 'true' AND '$(CreateVsixContainer)' == 'true'">true</ProducingSignedVsix>
</PropertyGroup>
<!-- GetTargetPath returns the path under $(OutDir) for each project.
This target adds the $(AuthenticodeCertificateName) as metadata. -->
<Target Name="GetTargetPathWithAuthenticodeCertificateName" DependsOnTargets="GetTargetPath" Returns="@(TargetPathWithAuthenticodeCertificateName)">
<ItemGroup>
<TargetPathWithAuthenticodeCertificateName Include="$(TargetPath)">
<AuthenticodeCertificateName>$(AuthenticodeCertificateName)</AuthenticodeCertificateName>
</TargetPathWithAuthenticodeCertificateName>
</ItemGroup>
</Target>
<Target Name="SignVsixInputs" Condition="'$(ProducingSignedVsix)' == 'true'" DependsOnTargets="GetVsixSourceItems" BeforeTargets="AfterCompile">
<!-- Ensure the build tasks project is already built -->
<MSBuild Projects="$(MSBuildThisFileDirectory)..\..\..\Closed\Setup\BuildTasks\BuildTasks.vbproj" Condition="!Exists('$(OutDir)\Roslyn.Setup.BuildTasks.dll') AND '$(RunningInMicroBuild)' != 'true'" />
<!-- Collect the paths of all dependent projects. GetTargetPath returns the path under $(OutDir) for each project. -->
<MSBuild Projects="@(ProjectReferenceWithConfiguration)"
Targets="GetTargetPathWithAuthenticodeCertificateName"
BuildInParallel="$(BuildInParallel)"
Properties="%(ProjectReferenceWithConfiguration.SetConfiguration); %(ProjectReferenceWithConfiguration.SetPlatform)">
<Output TaskParameter="TargetOutputs" ItemName="VsixInputAssembliesToSign" />
</MSBuild>
<!-- Include the assembly we just built if we're also including it in the VSIX-->
<ItemGroup>
<VsixInputAssembliesToSign Include="@(IntermediateAssembly)" Condition="'$(IncludeAssemblyInVSIXContainer)' == 'true'">
<AuthenticodeCertificateName>$(AuthenticodeCertificateName)</AuthenticodeCertificateName>
</VsixInputAssembliesToSign>
</ItemGroup>
<Message Text="Signing VSIX inputs: using authenticode certificate '%(VsixInputAssembliesToSign.AuthenticodeCertificateName)' for @(VsixInputAssembliesToSign)"/>
<ItemGroup Condition="'$(RunningInMicroBuild)' == 'true'">
<VsixInputAssembliesToSign>
<Authenticode>%(VsixInputAssembliesToSign.AuthenticodeCertificateName)</Authenticode>
<StrongName>72</StrongName>
</VsixInputAssembliesToSign>
</ItemGroup>
<SignFiles Condition="'$(RunningInMicroBuild)' == 'true'"
Files="@(VsixInputAssembliesToSign)"
BinariesDirectory="$(OutDir)"
IntermediatesDirectory="$(IntermediateOutputPath)"
Type="$(SignType)" />
</Target>
<Target Name="SignVsix" Condition="'$(ProducingSignedVsix)' == 'true'" DependsOnTargets="CreateVsixContainer">
<Message Text="Signing VSIX: $(TargetVsixContainer)"/>
<ItemGroup Condition="'$(RunningInMicroBuild)' == 'true'">
<VsixToSign Include="$(TargetVsixContainer)">
<Authenticode>VsixSHA2</Authenticode>
</VsixToSign>
</ItemGroup>
<SignFiles Condition="'$(RunningInMicroBuild)' == 'true'"
Files="@(VsixToSign)"
BinariesDirectory="$(OutDir)"
IntermediatesDirectory="$(IntermediateOutputPath)"
Type="$(SignType)" />
</Target>
</Project>
\ No newline at end of file
......@@ -11,68 +11,9 @@
<CodeAnalysisRuleSet Condition="'$(CodeAnalysisRuleSet)' == '' AND '$(NonShipping)' == 'true'">$(VSLToolsPath)\Rulesets\NonShippingProjectRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRuleSet Condition="'$(CodeAnalysisRuleSet)' == '' AND '$(AnalyzerProject)' == 'true'">$(VSLToolsPath)\Rulesets\AnalyzerProjectRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRuleSet Condition="'$(CodeAnalysisRuleSet)' == ''">$(VSLToolsPath)\Rulesets\Roslyn.ruleset</CodeAnalysisRuleSet>
<RoslynInternalKey>002400000480000094000000060200000024000052534131000400000100010055e0217eb635f69281051f9a823e0c7edd90f28063eb6c7a742a19b4f6139778ee0af438f47aed3b6e9f99838aa8dba689c7a71ddb860c96d923830b57bbd5cd6119406ddb9b002cf1c723bf272d6acbb7129e9d6dd5a5309c94e0ff4b2c884d45a55f475cd7dba59198086f61f5a8c8b5e601c0edbf269733f6f578fc8579c2</RoslynInternalKey>
</PropertyGroup>
<!-- settings for strong name signing -->
<PropertyGroup>
<RunningInMicroBuild Condition="Exists('$(TF_BUILD_BUILDDIRECTORY)\MicroBuild\MicroBuild.Signing.dll')">true</RunningInMicroBuild>
<ShouldSignBuild Condition="'$(RealSignBuild)' == 'true' OR ('$(RunningInMicroBuild)' == 'true' AND '$(SignType)' == 'real')">true</ShouldSignBuild>
</PropertyGroup>
<Choose>
<When Condition="'$(SignAssembly)' == 'true'">
<Choose>
<!-- Shipping binaries in an "official" build are delay-signed with the MS key; later, the signing
system will finish the strong-name signing. -->
<When Condition="'$(NonShipping)' != 'true'">
<Choose>
<!-- DelaySign if we're real signing, otherwise public sign -->
<When Condition="'$(ShouldSignBuild)' == 'true'">
<PropertyGroup>
<DelaySign>true</DelaySign>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup>
<PublicSign>true</PublicSign>
</PropertyGroup>
</Otherwise>
</Choose>
<PropertyGroup>
<AssemblyOriginatorKeyFile>$(VSLToolsPath)\Strong Name Keys\35MSSharedLib1024.snk</AssemblyOriginatorKeyFile>
<PublicKey>0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9</PublicKey>
<PublicKeyToken>31BF3856AD364E35</PublicKeyToken>
</PropertyGroup>
</When>
<!-- Non-shipping binaries are simply signed with the Roslyn internal key. -->
<Otherwise>
<PropertyGroup>
<AssemblyOriginatorKeyFile>$(VSLToolsPath)\Strong Name Keys\RoslynInternalKey.Private.snk</AssemblyOriginatorKeyFile>
<DelaySign>false</DelaySign>
<PublicKey>$(RoslynInternalKey)</PublicKey>
<PublicKeyToken>fc793a00266884fb</PublicKeyToken>
</PropertyGroup>
</Otherwise>
</Choose>
</When>
</Choose>
<!-- Because https://github.com/dotnet/roslyn/issues/7812 is not yet fixed, the IDE doesn't know if we set the PublicSign
flag. As a result, all design-time builds will thing we're real-signing, which causes semantics to get all screwed up.
The workaround for now is, for design-time builds only, to pass the DelaySign flag since that's "good enough". This
must be done in a target versus conditioning on BuildingProject, since BuildingProject itself is correctly set in a
target. -->
<Target Name="FixPublicSignFlagForDesignTimeBuilds" BeforeTargets="CoreCompile" Condition="'$(PublicSign)' == 'true'">
<PropertyGroup Condition="'$(BuildingProject)' == 'false'">
<!-- Turn off PublicSign, because leaving both to true will make the Csc task unhappy -->
<PublicSign>false</PublicSign>
<DelaySign>true</DelaySign>
</PropertyGroup>
</Target>
<Import Project="Signing.targets" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.VisualBasic.targets"
Condition="'$(ProjectLanguage)' == 'VB' And '$(TargetFrameworkIdentifier)' == '.NETPortable'"/>
......@@ -138,10 +79,6 @@
</PropertyGroup>
<Target Name="VerifyBuildFlags">
<Error
Condition="('$(RealSignBuild)' == 'true' OR '$(SignType)' == 'real') AND '$(BuildVersion)' == '42.42.42.42'"
Text="Must specify a build version in order to real sign a build." />
<Error
Condition="'$(CheckForOverflowUnderflow)' != '' OR '$(RemoveIntegerChecks)' != ''"
Text="The following properties cannot be set by individual projects: CheckForOverflowUnderflow and RemoveIntegerChecks" />
......@@ -155,226 +92,12 @@
</PropertyGroup>
</Target>
<!-- ====================================================================================
Support for a IncludeInVSIXLocalOnly Content metadata
==================================================================================== -->
<PropertyGroup>
<GetVsixSourceItemsDependsOn>$(GetVsixSourceItemsDependsOn);IncludeVsixLocalOnlyItems</GetVsixSourceItemsDependsOn>
</PropertyGroup>
<Target Name="IncludeVsixLocalOnlyItems">
<!-- This is shamelessly ripped from Microsoft.VsSDK.targets -->
<ItemGroup>
<VSIXSourceItemLocalOnly Include="@(Content)" Condition="'%(Content.IncludeInVSIXLocalOnly)'=='true' AND '%(Content.VSIXSubPath)'==''">
<!-- Sets VSIXSubPath for content items that are nonlinked files -->
<VSIXSubPath Condition="'%(Content.Link)'==''">%(Content.RelativeDir)</VSIXSubPath>
<!-- Sets VSIXSubPath for content items that are linked files -->
<VSIXSubPath Condition="'%(Content.Link)'!=''">$([System.IO.Path]::GetDirectoryName(%(Content.Link)))</VSIXSubPath>
</VSIXSourceItemLocalOnly>
<VSIXSourceItemLocalOnly Include="@(Content)" Condition="'%(Content.IncludeInVSIXLocalOnly)'=='true' AND '%(Content.VSIXSubPath)'!=''" />
</ItemGroup>
</Target>
<!-- ====================================================================================
Include some of our NuGet-consumed assets into VSIX projects
This exists for two reasons:
1) In some cases, we need to include the contents of a NuGet package that is otherwise
contained within the SuppressFromVsix list, because we're actually the component
inside Visual Studio that ships that component
2) The SDK targets don't currently look at the ReferenceCopyLocalPaths produced
by the NuGet build task.
==================================================================================== -->
<PropertyGroup>
<GetVsixSourceItemsDependsOn>$(GetVsixSourceItemsDependsOn);IncludeNuGetResolvedAssets</GetVsixSourceItemsDependsOn>
</PropertyGroup>
<Target Name="IncludeNuGetResolvedAssets" DependsOnTargets="ResolveNuGetPackageAssets" Condition="'@(NuGetPackageToIncludeInVsix)' != ''">
<ItemGroup>
<_ReferenceCopyLocalPathsWithPotentialInclusions Include="@(ReferenceCopyLocalPaths)">
<NuGetPackageToIncludeInVsix>%(NuGetPackageToIncludeInVsix.Identity)</NuGetPackageToIncludeInVsix>
</_ReferenceCopyLocalPathsWithPotentialInclusions>
<VSIXCopyLocalReferenceSourceItem Include="@(_ReferenceCopyLocalPathsWithPotentialInclusions)"
Condition="'%(_ReferenceCopyLocalPathsWithPotentialInclusions.NuGetPackageId)' == '%(_ReferenceCopyLocalPathsWithPotentialInclusions.NuGetPackageToIncludeInVsix)'">
<ForceIncludeInVsix>true</ForceIncludeInVsix>
<Private>true</Private>
</VSIXCopyLocalReferenceSourceItem>
</ItemGroup>
</Target>
<ItemDefinitionGroup>
<NuGetPackageToIncludeInVsix>
<Visible>false</Visible>
</NuGetPackageToIncludeInVsix>
</ItemDefinitionGroup>
<!-- ====================================================================================
Generation of AssemblyVersion attributes from the BuildVersion property
==================================================================================== -->
<Import Project="VisualStudioSdk.targets" />
<Import Project="GenerateAssemblyInfo.targets" Condition="'$(ProjectLanguage)' == 'CSharp' OR '$(ProjectLanguage)' == 'VB'" />
<Import Project="GenerateVersionInfoResourceFile.targets" Condition="'$(ProjectLanguage)' == 'C++'" />
<!-- ====================================================================================
Generation of InternalsVisibleTo attributes from the project
==================================================================================== -->
<Import Project="GenerateInternalsVisibleTo.targets" />
<!-- ====================================================================================
Generation of syntax models, syntax model tests, and bound trees from xml files
==================================================================================== -->
<Import Project="GenerateCompilerInternals.targets" />
<!-- ====================================================================================
VSSDK
==================================================================================== -->
<Import Project="$(VSToolsPath)\VSSDK\Microsoft.VsSDK.targets" Condition="'$(VSToolsPath)' != '' AND '$(ImportVSSDKTargets)' == 'true'" />
<!-- ====================================================================================
Support for in-place modification of the compiled binary.
Since there may be more than one post compile modification, we must take care not
to break incremental builds. A timestemp file is written out when all modification
targets have completed.
Note that the targets participating in post compile modification must list the
sentinel file as one of their outputs, but they should not modify it.
==================================================================================== -->
<PropertyGroup>
<PostCompileBinaryModificationSentinelFile>$(IntermediateOutputPath)$(TargetFileName).pcbm</PostCompileBinaryModificationSentinelFile>
</PropertyGroup>
<Target Name="PostCompileBinaryModification"
AfterTargets="CoreCompile"
DependsOnTargets="ApplyOptimizations"
Inputs="@(IntermediateAssembly)"
Outputs="@(IntermediateAssembly);$(PostCompileBinaryModificationSentinelFile)">
<!-- Write out a sentinel timestamp file to prevent unnecessary work in incremental builds. -->
<Touch AlwaysCreate="true" Files="$(PostCompileBinaryModificationSentinelFile)" />
<ItemGroup>
<FileWrites Include="$(PostCompileBinaryModificationSentinelFile)" />
</ItemGroup>
</Target>
<!-- ====================================================================================
Support for rolling optimization data into assemblies.
==================================================================================== -->
<PropertyGroup>
<OptimizationDataFolderPath>$(MSBuildThisFileDirectory)..\..\..\Closed\OptimizationData</OptimizationDataFolderPath>
<OptimizationDataFile>$([System.IO.Path]::GetFullPath('$(OptimizationDataFolderPath)\$(TargetName).pgo'))</OptimizationDataFile>
<IbcMergePath>$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)..\..\..\Closed\Tools\ibcmerge\ibcmerge.exe'))</IbcMergePath>
</PropertyGroup>
<Target Name="ApplyOptimizations"
Condition="'$(Configuration)' == 'Release' AND '$(NonShipping)' != 'true' AND '$(SkipApplyOptimizations)' != 'true' AND Exists('$(OptimizationDataFile)')"
Inputs="@(IntermediateAssembly)"
Outputs="@(IntermediateAssembly);$(PostCompileBinaryModificationSentinelFile)">
<Message Text="Adding optimization data to @(IntermediateAssembly)"/>
<Exec Command="&quot;$(IbcMergePath)&quot; -q -f -partialNGEN -minify -mo &quot;@(IntermediateAssembly)&quot; -incremental &quot;$(OptimizationDataFile)&quot;" />
</Target>
<!-- ====================================================================================
Support for signing VSIXes
==================================================================================== -->
<UsingTask TaskName="SignFiles" AssemblyFile="$(TF_BUILD_BUILDDIRECTORY)\MicroBuild\MicroBuild.Signing.dll" Condition="'$(RunningInMicroBuild)' == 'true'" />
<PropertyGroup>
<CreateVsixContainerDependsOn>$(CreateVsixContainerDependsOn);SignVsixInputs</CreateVsixContainerDependsOn>
<PrepareForRunDependsOn>$(PrepareForRunDependsOn);SignVsix</PrepareForRunDependsOn>
<ProducingSignedVsix Condition="'$(ShouldSignBuild)' == 'true' AND '$(NonShipping)' != 'true' AND '$(CreateVsixContainer)' == 'true'">true</ProducingSignedVsix>
</PropertyGroup>
<!-- GetTargetPath returns the path under $(OutDir) for each project.
This target adds the $(AuthenticodeCertificateName) as metadata. -->
<Target Name="GetTargetPathWithAuthenticodeCertificateName" DependsOnTargets="GetTargetPath" Returns="@(TargetPathWithAuthenticodeCertificateName)">
<ItemGroup>
<TargetPathWithAuthenticodeCertificateName Include="$(TargetPath)">
<AuthenticodeCertificateName>$(AuthenticodeCertificateName)</AuthenticodeCertificateName>
</TargetPathWithAuthenticodeCertificateName>
</ItemGroup>
</Target>
<Target Name="SignVsixInputs" Condition="'$(ProducingSignedVsix)' == 'true'" DependsOnTargets="GetVsixSourceItems" BeforeTargets="AfterCompile">
<!-- Ensure the build tasks project is already built -->
<MSBuild Projects="$(MSBuildThisFileDirectory)..\..\..\Closed\Setup\BuildTasks\BuildTasks.vbproj" Condition="!Exists('$(OutDir)\Roslyn.Setup.BuildTasks.dll') AND '$(RunningInMicroBuild)' != 'true'" />
<!-- Collect the paths of all dependent projects. GetTargetPath returns the path under $(OutDir) for each project. -->
<MSBuild Projects="@(ProjectReferenceWithConfiguration)"
Targets="GetTargetPathWithAuthenticodeCertificateName"
BuildInParallel="$(BuildInParallel)"
Properties="%(ProjectReferenceWithConfiguration.SetConfiguration); %(ProjectReferenceWithConfiguration.SetPlatform)">
<Output TaskParameter="TargetOutputs" ItemName="VsixInputAssembliesToSign" />
</MSBuild>
<!-- Include the assembly we just built if we're also including it in the VSIX-->
<ItemGroup>
<VsixInputAssembliesToSign Include="@(IntermediateAssembly)" Condition="'$(IncludeAssemblyInVSIXContainer)' == 'true'">
<AuthenticodeCertificateName>$(AuthenticodeCertificateName)</AuthenticodeCertificateName>
</VsixInputAssembliesToSign>
</ItemGroup>
<Message Text="Signing VSIX inputs: using authenticode certificate '%(VsixInputAssembliesToSign.AuthenticodeCertificateName)' for @(VsixInputAssembliesToSign)"/>
<ItemGroup Condition="'$(RunningInMicroBuild)' == 'true'">
<VsixInputAssembliesToSign>
<Authenticode>%(VsixInputAssembliesToSign.AuthenticodeCertificateName)</Authenticode>
<StrongName>72</StrongName>
</VsixInputAssembliesToSign>
</ItemGroup>
<SignFiles Condition="'$(RunningInMicroBuild)' == 'true'"
Files="@(VsixInputAssembliesToSign)"
BinariesDirectory="$(OutDir)"
IntermediatesDirectory="$(IntermediateOutputPath)"
Type="$(SignType)" />
</Target>
<Target Name="SignVsix" Condition="'$(ProducingSignedVsix)' == 'true'" DependsOnTargets="CreateVsixContainer">
<Message Text="Signing VSIX: $(TargetVsixContainer)"/>
<ItemGroup Condition="'$(RunningInMicroBuild)' == 'true'">
<VsixToSign Include="$(TargetVsixContainer)">
<Authenticode>VsixSHA2</Authenticode>
</VsixToSign>
</ItemGroup>
<SignFiles Condition="'$(RunningInMicroBuild)' == 'true'"
Files="@(VsixToSign)"
BinariesDirectory="$(OutDir)"
IntermediatesDirectory="$(IntermediateOutputPath)"
Type="$(SignType)" />
</Target>
<Import Project="BinaryOptimization.targets" />
</Project>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- ====================================================================================
VSSDK
==================================================================================== -->
<Import Project="$(VSToolsPath)\VSSDK\Microsoft.VsSDK.targets" Condition="'$(VSToolsPath)' != '' AND '$(ImportVSSDKTargets)' == 'true'" />
<!-- ====================================================================================
Support for a IncludeInVSIXLocalOnly Content metadata
==================================================================================== -->
<PropertyGroup>
<GetVsixSourceItemsDependsOn>$(GetVsixSourceItemsDependsOn);IncludeVsixLocalOnlyItems</GetVsixSourceItemsDependsOn>
</PropertyGroup>
<Target Name="IncludeVsixLocalOnlyItems">
<!-- This is shamelessly ripped from Microsoft.VsSDK.targets -->
<ItemGroup>
<VSIXSourceItemLocalOnly Include="@(Content)" Condition="'%(Content.IncludeInVSIXLocalOnly)'=='true' AND '%(Content.VSIXSubPath)'==''">
<!-- Sets VSIXSubPath for content items that are nonlinked files -->
<VSIXSubPath Condition="'%(Content.Link)'==''">%(Content.RelativeDir)</VSIXSubPath>
<!-- Sets VSIXSubPath for content items that are linked files -->
<VSIXSubPath Condition="'%(Content.Link)'!=''">$([System.IO.Path]::GetDirectoryName(%(Content.Link)))</VSIXSubPath>
</VSIXSourceItemLocalOnly>
<VSIXSourceItemLocalOnly Include="@(Content)" Condition="'%(Content.IncludeInVSIXLocalOnly)'=='true' AND '%(Content.VSIXSubPath)'!=''" />
</ItemGroup>
</Target>
<!-- ====================================================================================
Include some of our NuGet-consumed assets into VSIX projects
This exists for two reasons:
1) In some cases, we need to include the contents of a NuGet package that is otherwise
contained within the SuppressFromVsix list, because we're actually the component
inside Visual Studio that ships that component
2) The SDK targets don't currently look at the ReferenceCopyLocalPaths produced
by the NuGet build task.
==================================================================================== -->
<PropertyGroup>
<GetVsixSourceItemsDependsOn>$(GetVsixSourceItemsDependsOn);IncludeNuGetResolvedAssets</GetVsixSourceItemsDependsOn>
</PropertyGroup>
<Target Name="IncludeNuGetResolvedAssets" DependsOnTargets="ResolveNuGetPackageAssets" Condition="'@(NuGetPackageToIncludeInVsix)' != ''">
<ItemGroup>
<_ReferenceCopyLocalPathsWithPotentialInclusions Include="@(ReferenceCopyLocalPaths)">
<NuGetPackageToIncludeInVsix>%(NuGetPackageToIncludeInVsix.Identity)</NuGetPackageToIncludeInVsix>
</_ReferenceCopyLocalPathsWithPotentialInclusions>
<VSIXCopyLocalReferenceSourceItem Include="@(_ReferenceCopyLocalPathsWithPotentialInclusions)"
Condition="'%(_ReferenceCopyLocalPathsWithPotentialInclusions.NuGetPackageId)' == '%(_ReferenceCopyLocalPathsWithPotentialInclusions.NuGetPackageToIncludeInVsix)'">
<ForceIncludeInVsix>true</ForceIncludeInVsix>
<Private>true</Private>
</VSIXCopyLocalReferenceSourceItem>
</ItemGroup>
</Target>
<ItemDefinitionGroup>
<NuGetPackageToIncludeInVsix>
<Visible>false</Visible>
</NuGetPackageToIncludeInVsix>
</ItemDefinitionGroup>
</Project>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册