-
Notifications
You must be signed in to change notification settings - Fork 78
/
Directory.Build.targets
132 lines (116 loc) · 6.36 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
<Project>
<PropertyGroup>
<MicroBuild_NuPkgSigningEnabled Condition="'$(SignType)' == 'Test'">false</MicroBuild_NuPkgSigningEnabled>
</PropertyGroup>
<PropertyGroup>
<Authors>Microsoft</Authors>
<Company>Microsoft</Company>
<Copyright>(c) Microsoft Corporation. All rights reserved.</Copyright>
<PackageProjectUrl>https://github.com/microsoft/SlnGen</PackageProjectUrl>
<PackageLicenseFile>LICENSE.txt</PackageLicenseFile>
<PackageLicensePath>$(MSBuildThisFileDirectory)$(PackageLicenseFile)</PackageLicensePath>
<PackageIcon>Icon.png</PackageIcon>
<PackageIconPath>$(MSBuildThisFileDirectory)branding\$(PackageIcon)</PackageIconPath>
<RepositoryUrl>https://github.com/microsoft/SlnGen.git</RepositoryUrl>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<IncludeSymbols Condition="'$(IncludeSymbols)' == ''">true</IncludeSymbols>
<SymbolPackageFormat Condition="'$(SymbolPackageFormat)' == ''">snupkg</SymbolPackageFormat>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\GlobalSuppressions.cs"
Link="GlobalSuppressions.cs"
Condition="'$(UsingMicrosoftNoTargetsSdk)' != 'true'" />
<AdditionalFiles Include="..\..\stylecop.json"
Visible="false"/>
</ItemGroup>
<PropertyGroup Condition="'$(SignType)' == 'Test'">
<SignAssembly>true</SignAssembly>
<DelaySign Condition="'$(MicroBuild_SigningTargetsImported)' == 'true'">true</DelaySign>
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)Test.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<PropertyGroup Condition="'$(SignType)' == 'Real'">
<SignAssembly>true</SignAssembly>
<DelaySign Condition="'$(IsTestProject)' != 'true'">true</DelaySign>
<AssemblyOriginatorKeyFile Condition="'$(IsTestProject)' != 'true'">$(MSBuildThisFileDirectory)MicrosoftCorporation.snk</AssemblyOriginatorKeyFile>
<AssemblyOriginatorKeyFile Condition="'$(IsTestProject)' == 'true'">$(MSBuildThisFileDirectory)Test.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<ItemGroup Condition="'$(IsPackable)' == 'true'">
<None Include="$(PackageIconPath)"
Pack="true"
PackagePath="\"
Visible="false" />
<None Include="$(PackageLicensePath)"
Pack="true"
PackagePath="$(PackageLicenseFile)"
Visible="false" />
</ItemGroup>
<Target Name="IncludeReferenceCopyLocalPathsInBuildOutputInPackage"
Condition="'$(IncludeReferenceCopyLocalPathsInBuildOutputInPackage)' == 'true'"
BeforeTargets="_GetBuildOutputFilesWithTfm"
DependsOnTargets="ResolveReferences">
<ItemGroup>
<BuildOutputInPackage Include="@(ReferenceCopyLocalPaths->WithMetadataValue('AssetType', 'runtime'))"
TargetPath="$(TargetFramework)\%(ReferenceCopyLocalPaths.DestinationSubDirectory)%(Filename)%(Extension)" />
<BuildOutputInPackage Include="@(ReferenceCopyLocalPaths->WithMetadataValue('CopyLocal', 'true'))"
TargetPath="$(TargetFramework)\%(ReferenceCopyLocalPaths.DestinationSubDirectory)%(Filename)%(Extension)" />
<BuiltProjectOutputGroupOutput Update="@(BuiltProjectOutputGroupOutput)"
Condition="'%(TargetPath)' == ''"
TargetPath="$(TargetFramework)\%(RecursiveDir)%(Filename)%(Extension)" />
<BuiltProjectOutputGroupOutput Update="@(BuiltProjectOutputGroupOutput)"
Condition="'%(TargetPath)' != ''"
TargetPath="$(TargetFramework)\%(TargetPath)" />
</ItemGroup>
</Target>
<Target Name="UpdateSymbolsPackagePath"
AfterTargets="_WalkEachTargetPerFramework">
<ItemGroup>
<_TargetPathsToSymbols Update="@(_TargetPathsToSymbols)"
TargetPath="%(TargetFramework)\%(Filename)%(Extension)" />
</ItemGroup>
</Target>
<ItemDefinitionGroup>
<InternalsVisibleTo>
<Visible>false</Visible>
</InternalsVisibleTo>
</ItemDefinitionGroup>
<ItemGroup>
<InternalsVisibleTo Update="@(InternalsVisibleTo)" Condition="'$(SignType)' == 'Test' Or '$(SignType)' == 'Real'" Key="002400000480000094000000060200000024000052534131000400000100010015c01ae1f50e8cc09ba9eac9147cf8fd9fce2cfe9f8dce4f7301c4132ca9fb50ce8cbf1df4dc18dd4d210e4345c744ecb3365ed327efdbc52603faa5e21daa11234c8c4a73e51f03bf192544581ebe107adee3a34928e39d04e524a9ce729d5090bfd7dad9d10c722c0def9ccc08ff0a03790e48bcd1f9b6c476063e1966a1c4" />
</ItemGroup>
<!--
ShouldSkipTarget should add the current project to the ProjectToSkip item group if it cannot be built with the toolset.
This is useful if a project cannot be built by dotnet.exe or on a particular platform like Mac or Mono.
Add the current project with a Message so that the user understands why it can't be built and how they can build it if they need to.
-->
<Target Name="ShouldSkipProject" Returns="@(ProjectToSkip)">
<ItemGroup Condition="'$(MSBuildRuntimeType)' == 'Core'">
<ProjectToSkip Include="$(MSBuildProjectFullPath)"
Message="Visual Studio Extension (VSIX) projects cannot be built with dotnet.exe and require you to use msbuild.exe or Visual Studio."
Condition="'$(VsSDKVersion)' != ''" />
</ItemGroup>
</Target>
<!-- BEGIN workaround for https://github.com/dotnet/sdk/issues/43339; remove after updated to VS 17.12 or a future 17.11 patch -->
<Target Name="WorkaroundDotnetSdk43339" BeforeTargets="ResolvePackageAssets" Condition=" '$(MSBuildRuntimeType)' == 'Full' and $([MSBuild]::VersionLessThan($(MSBuildVersion), 17.12.0))">
<PrimeSystemTextJson804 />
</Target>
<UsingTask
TaskName="PrimeSystemTextJson804"
TaskFactory="RoslynCodeTaskFactory"
AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.Core.dll" >
<Task>
<Code Type="Fragment" Language="cs">
<![CDATA[
try
{
System.Reflection.Assembly.LoadFrom(@"$(MicrosoftNETBuildTasksDirectoryRoot)\..\..\..\DotnetTools\dotnet-format\BuildHost-net472\System.Text.Json.dll");
}
catch
{
// Best effort: if something moves in the SDK don't break the build.
}
]]>
</Code>
</Task>
</UsingTask>
<!-- END workaround for https://github.com/dotnet/sdk/issues/43339 -->
</Project>