forked from dotnet/msbuild
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Directory.Build.targets
66 lines (56 loc) · 2.73 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
<Project>
<PropertyGroup>
<PackageReadmeFile>README.md</PackageReadmeFile>
<ThirdPartyNotice Condition=" '$(ThirdPartyNotice)' == '' ">$(RepoRoot)THIRDPARTYNOTICES.txt</ThirdPartyNotice>
<AssemblyTitle>$(TargetFileName)</AssemblyTitle>
<Description Condition="'$(Description)' == ''">$(TargetFileName)</Description>
</PropertyGroup>
<ItemGroup Condition=" '$(IsPackable)' == 'true' ">
<None Include="$(ThirdPartyNotice)" Pack="true" PackagePath="notices" Visible="false" />
<None Include="README.md" Pack="true" PackagePath="\" />
</ItemGroup>
<!-- Global Analyzer Config -->
<ItemGroup Condition="'$(ProjectIsDeprecated)' != 'true'">
<!-- Include Common.globalconfig for non-deprecated projects-->
<EditorConfigFiles Include="$(MSBuildThisFileDirectory)eng/Common.globalconfig" />
</ItemGroup>
<!-- Test Project Global Analyzer Config -->
<ItemGroup Condition="'$(IsTestProject)' == 'true'">
<!-- Include Common.Test.globalconfig for Test projects-->
<EditorConfigFiles Include="$(MSBuildThisFileDirectory)eng/Common.Test.globalconfig" />
</ItemGroup>
<Import Project="Sdk.targets" Sdk="Microsoft.DotNet.Arcade.Sdk" />
<Target Name="DeleteDevPackage" AfterTargets="GenerateNuspec">
<!-- If package just built was already in global packages folder, delete it. This helps support a local dev cycle where you are consuming
a package from another repo without having to update the package version each time. -->
<PropertyGroup>
<_PackageFolderInGlobalPackages>$(NuGetPackageRoot)$(PackageId.ToLowerInvariant())\$(PackageVersion)</_PackageFolderInGlobalPackages>
</PropertyGroup>
<RemoveDir Directories="$(_PackageFolderInGlobalPackages)"
Condition="Exists('$(_PackageFolderInGlobalPackages)')" />
</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>