forked from dotnet/sdk
/
Microsoft.DotNet.ApiCompat.Task.csproj
97 lines (85 loc) · 5.47 KB
/
Microsoft.DotNet.ApiCompat.Task.csproj
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
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net6.0;net472</TargetFrameworks>
<TargetFrameworks Condition="'$(DotNetBuildFromSource)' == 'true'">net8.0;net472</TargetFrameworks>
<IsPackable>true</IsPackable>
<IsShippingPackage>true</IsShippingPackage>
<StrongNameKeyId>Open</StrongNameKeyId>
<IncludeBuildOutput>false</IncludeBuildOutput>
<!-- This package doesn't contain any lib or ref assemblies because it's a tooling package.-->
<NoWarn>$(NoWarn);NU5128</NoWarn>
<Nullable>enable</Nullable>
<TargetsForTfmSpecificContentInPackage>$(TargetsForTfmSpecificContentInPackage);_AddBuildOutputToPackageCore;_AddBuildOutputToPackageDesktop</TargetsForTfmSpecificContentInPackage>
<PackageDescription>MSBuild tasks and targets to perform api compatibility checks on assemblies and packages.</PackageDescription>
</PropertyGroup>
<!-- SDK's task infrastructure -->
<ItemGroup>
<Compile Include="..\..\Tasks\Common\TaskBase.cs" LinkBase="Common" />
<Compile Include="..\..\Tasks\Common\Logger.cs" LinkBase="Common" />
<Compile Include="..\..\Tasks\Common\LogAdapter.cs" LinkBase="Common" />
<Compile Include="..\..\Tasks\Common\BuildErrorException.cs" LinkBase="Common" />
<Compile Include="..\..\Tasks\Common\Message.cs" LinkBase="Common" />
<Compile Include="..\..\Tasks\Common\MessageLevel.cs" LinkBase="Common" />
</ItemGroup>
<!-- Include MSBuild logger -->
<ItemGroup>
<Compile Include="..\..\Microsoft.DotNet.ApiSymbolExtensions\Logging\MSBuildLog.cs" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Update="Resources.resx" GenerateSource="true" SubType="Designer" Generator="MSBuild:_GenerateResxSource" ClassName="Microsoft.DotNet.ApiCompat.Resources" ManifestResourceName="Microsoft.DotNet.ApiCompat.Resources" />
</ItemGroup>
<ItemGroup>
<!-- ExcludeAssets="Runtime" is being set to avoid adding package references and dependencies of package and project references into the package. -->
<PackageReference Include="Microsoft.Build.Framework" Version="$(MicrosoftBuildPackageVersion)" ExcludeAssets="Runtime" />
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="$(MicrosoftBuildUtilitiesCoreVersion)" ExcludeAssets="Runtime" />
<ProjectReference Include="..\Microsoft.DotNet.PackageValidation\Microsoft.DotNet.PackageValidation.csproj" ExcludeAssets="Runtime" />
<ProjectReference Include="..\Microsoft.DotNet.ApiCompatibility\Microsoft.DotNet.ApiCompatibility.csproj" ExcludeAssets="Runtime" />
<!-- We carry NuGet as part of the package in case the package is used with an older SDKs or with full framework MSBuild. -->
<PackageReference Include="NuGet.Frameworks" Version="$(NuGetBuildTasksPackageVersion)" />
<PackageReference Include="NuGet.Packaging" Version="$(NuGetBuildTasksPackageVersion)" />
<PackageReference Include="NuGet.Protocol" Version="$(NuGetBuildTasksPackageVersion)" />
</ItemGroup>
<ItemGroup>
<None Include="**\*.props;**\*.targets" Pack="true" PackagePath="%(RecursiveDir)%(Filename)%(Extension)" />
<None Include="..\..\Tasks\Microsoft.NET.Build.Tasks\targets\Microsoft.NET.ApiCompat.Common.targets" Pack="true" Link="build/Microsoft.NET.ApiCompat.Common.targets" PackagePath="build/%(Filename)%(Extension)" />
<None Include="..\..\Tasks\Microsoft.NET.Build.Tasks\targets\Microsoft.NET.ApiCompat.ValidatePackage.targets" Pack="true" Link="build/Microsoft.NET.ApiCompat.ValidatePackage.targets" PackagePath="build/%(Filename)%(Extension)" />
<None Include="$(RepoRoot)LICENSE.txt" PackagePath="LICENSE.txt" Pack="true" />
</ItemGroup>
<ItemGroup>
<!--
Update all PackageReference and ProjectReference Items to have
PrivateAssets="All" and default Publish to true.
This removes the dependency nodes from the generated nuspec and
forces the publish output to contain the dlls.
-->
<PackageReference Update="@(PackageReference)">
<PrivateAssets>All</PrivateAssets>
<Publish Condition="'%(PackageReference.Publish)' == ''">true</Publish>
<ExcludeAssets Condition="'%(PackageReference.Publish)' == 'false'">runtime</ExcludeAssets>
</PackageReference>
<ProjectReference Update="@(ProjectReference)">
<PrivateAssets>All</PrivateAssets>
<Publish Condition="'%(ProjectReference.Publish)' == ''">true</Publish>
</ProjectReference>
<!--
Update all Reference items to have Pack="false"
This removes the frameworkDependency nodes from the generated nuspec
-->
<Reference Update="@(Reference)">
<Pack>false</Pack>
</Reference>
</ItemGroup>
<Target Name="_AddBuildOutputToPackageCore" DependsOnTargets="Publish" Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp'">
<ItemGroup>
<!-- Publish .NET Core assets and include them in the package under tools directory. -->
<TfmSpecificPackageFile Include="$(PublishDir)**" PackagePath="tools/$(TargetFramework)/%(RecursiveDir)%(FileName)%(Extension)" />
</ItemGroup>
</Target>
<Target Name="_AddBuildOutputToPackageDesktop" Condition="'$(TargetFrameworkIdentifier)' != '.NETCoreApp'">
<ItemGroup>
<!-- Include .NET Framework build outputs in the package under tools directory. -->
<TfmSpecificPackageFile Include="$(OutputPath)**" PackagePath="tools/$(TargetFramework)/%(RecursiveDir)%(FileName)%(Extension)" />
</ItemGroup>
</Target>
<Import Project="..\Microsoft.DotNet.ApiCompat.Shared\Microsoft.DotNet.ApiCompat.Shared.projitems" Label="Shared" />
</Project>