/
DistIL.OptimizerTask.csproj
44 lines (38 loc) · 2.25 KB
/
DistIL.OptimizerTask.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
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<IsPackable>true</IsPackable>
<DevelopmentDependency>true</DevelopmentDependency>
<PackageId>DistIL.OptimizerTask</PackageId>
<Description>MSBuild tasks for post-build IL optimization.</Description>
<!-- Based on
https://learn.microsoft.com/en-us/visualstudio/msbuild/tutorial-custom-task-code-generation
https://github.com/dotnet/runtime/blob/671196dee3edccbdfc8ab11e7ce440dad98ce56f/eng/packaging.targets#L270
https://natemcmaster.com/blog/2017/11/11/msbuild-task-with-dependencies/
-->
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<IncludeBuildOutput>false</IncludeBuildOutput>
<TargetsForTfmSpecificContentInPackage>$(TargetsForTfmSpecificContentInPackage);AddBuildOutputToToolsPackage</TargetsForTfmSpecificContentInPackage>
<!--
NuGet does validation that libraries in a package are exposed as dependencies, but we _explicitly_ do not
want that behavior for MSBuild tasks. They are isolated by design. Therefore we ignore this specific warning. -->
<NoWarn>NU5100;NU5128</NoWarn>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="../DistIL.Cli/DistIL.Cli.csproj" PrivateAssets="all"/>
<Content Include="$(ProjectName).targets" PackagePath="build/" />
<Content Include="*.cs" PackagePath="contentFiles/cs/any/$(PackageId)/%(RecursiveDir)" BuildAction="Compile" />
</ItemGroup>
<!-- Manual invoked target that can be used by toolset packages by adding it to the `TargetsForTfmSpecificContentInPackage` property. -->
<Target Name="AddBuildOutputToToolsPackage">
<ItemGroup>
<!-- Include build outputs in the package under tools directory. -->
<TfmSpecificPackageFile Include="$(OutputPath)**"
Exclude="$(OutputPath)publish\**;
$(OutputPath);
$(OutputPath)$(AssemblyName)*"
PackagePath="tools/$(TargetFramework)/%(RecursiveDir)%(FileName)%(Extension)" />
<!-- Remove symbols from the non symbol package. -->
<TfmSpecificPackageFile Remove="@(TfmSpecificPackageFile->WithMetadataValue('Extension', '.pdb'))" />
</ItemGroup>
</Target>
</Project>