-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDirectory.Build.targets
39 lines (39 loc) · 1.68 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
<Project>
<PropertyGroup Condition="'$(IsPackable)' != 'false'">
<BeforePack>$(BeforePack);IncludeAnalyzersInPackage;</BeforePack>
</PropertyGroup>
<ItemGroup>
<EmbeddedResource Include="Properties\ILLink.*.xml"
LogicalName="%(Filename)%(Extension)" />
<None Include="Properties\Directory.Package\**\*"
Pack="true"
PackagePath="%(RecursiveDir)%(Filename)%(Extension)" />
</ItemGroup>
<Target Name="GetAnalyzerPackFiles"
DependsOnTargets="$(GenerateNuspecDependsOn)"
Returns="@(AnalyzerPackFile)">
<ItemGroup>
<AnalyzerPackFile Include="@(_BuildOutputInPackage)"
PackagePath="analyzers/dotnet/$(AnalyzerLanguage)/%(TargetPath)" />
<AnalyzerPackFile Include="@(_TargetPathsToSymbols)"
PackagePath="analyzers/dotnet/$(AnalyzerLanguage)/%(TargetPath)"
IsSymbol="true" />
</ItemGroup>
</Target>
<Target Name="IncludeAnalyzersInPackage">
<MSBuild Projects="@(ProjectReference->WithMetadataValue('PackAsAnalyzer', 'true'))"
Targets="GetAnalyzerPackFiles"
RemoveProperties="SetTargetFramework">
<Output TaskParameter="TargetOutputs"
ItemName="AnalyzerPackFile" />
</MSBuild>
<ItemGroup>
<Content Include="@(AnalyzerPackFile)"
Pack="true"
Condition="'%(AnalyzerPackFile.IsSymbol)' != 'true'" />
<_TargetPathsToSymbols Include="@(AnalyzerPackFile)"
TargetPath="/%(AnalyzerPackFile.PackagePath)"
Condition="'%(AnalyzerPackFile.IsSymbol)' == 'true'" />
</ItemGroup>
</Target>
</Project>