This repository has been archived by the owner on Jul 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 181
/
Directory.Build.targets
79 lines (72 loc) · 3.52 KB
/
Directory.Build.targets
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<?xml version="1.0" encoding="utf-8"?>
<Project>
<!-- Depending on whether it is a VSIX, MSIL or nupkg, choose the correct certificate.
1) By default, the VSIX project just packages the contents, so
CopyBuildOutputToOutputDirectory/IncludeAssemblyInVSIXContainer will be
false. But if you have a VSIX that builds a DLL as well, it will have both
properties set as true.
2) When conditions are chosen from top-down... so if multiple ones are true,
the first one it encounters is the type it chooses.
-->
<Choose>
<When Condition="'$(TargetVsixContainerName)' != '' AND '$(CopyBuildOutputToOutputDirectory)' == 'false' AND '$(IncludeAssemblyInVSIXContainer)' == 'false'">
<ItemGroup>
<FilesToSign Include="$(TargetVsixContainer)">
<Authenticode>VsixSHA2</Authenticode>
</FilesToSign>
</ItemGroup>
</When>
<When Condition="'$(TargetExt)'!='.nupkg'">
<ItemGroup>
<FilesToSign Include="$(OutDir)\$(TargetName)$(TargetExt)">
<Authenticode>Microsoft400</Authenticode>
</FilesToSign>
</ItemGroup>
</When>
<Otherwise>
<ItemGroup>
<!-- try to sign all nupkg files under $(OutDir)-->
<FilesToSign Include="$(OutDir)\**\%(Filename).nupkg">
<Authenticode>NuGet</Authenticode>
</FilesToSign>
</ItemGroup>
</Otherwise>
</Choose>
<ItemGroup>
<AdditionalFiles Include="$(MSBuildThisFileDirectory)\stylecop.json" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.VisualStudioEng.MicroBuild.Core" Version="0.4.1" Condition="!$(IsTest)" PrivateAssets="all" />
<PackageReference Include="StyleCop.Analyzers" Version="1.1.1-beta.61" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.6.2" Condition=" '$(IsPackage)' != 'true' " PrivateAssets="all" />
</ItemGroup>
<!-- Work around an issue where portable PDB is not supported yet in Api scan tool.
This does not work in Directory.Build.props because $(TargetFramework) has not been set yet
when it is imported. -->
<PropertyGroup>
<DebugType Condition=" $(TargetFramework.StartsWith('net4')) ">Full</DebugType>
</PropertyGroup>
<!-- In .NET Core SDK 1.0-rc3, all *.cs files are implicitly added for compiled. This includes the test files we embed as resources.
We explicitly remove them here so that they are not compiled.
BUG: https://github.com/dotnet/sdk/issues/977 -->
<Target Name="RemoveEmbeddedResources"
BeforeTargets="CoreCompile">
<ItemGroup>
<Compile Remove="@(EmbeddedResource-> '%(Identity)')" />
</ItemGroup>
</Target>
<Target Name="CopyBuildOutputToRawDirectory"
AfterTargets="AfterBuild"
Condition="!$(IsTest) AND '$(IsPackage)' != 'true' ">
<MakeDir Directories="$(RawBinariesDropDirectory)\$(TargetFramework)" />
<Message Text="Copying $(OutDir)\$(TargetName)$(TargetExt) to $(RawBinariesDropDirectory)\$(TargetFramework)"
Importance="low" />
<Copy SourceFiles="$(OutDir)\$(TargetName)$(TargetExt)"
DestinationFolder="$(RawBinariesDropDirectory)\$(TargetFramework)" />
<MakeDir Directories="$(RawSymbolsDropDirectory)\$(TargetFramework)" />
<Message Text="Copying $(OutDir)\$(TargetName).pdb to $(RawSymbolsDropDirectory)\$(TargetFramework)"
Importance="low" />
<Copy SourceFiles="$(OutDir)\$(TargetName).pdb"
DestinationFolder="$(RawSymbolsDropDirectory)\$(TargetFramework)" />
</Target>
</Project>