49 lines
1.7 KiB
XML
49 lines
1.7 KiB
XML
<Project Sdk="Microsoft.Build.NoTargets">
|
|
|
|
<PropertyGroup>
|
|
<TargetFramework>$(NetCurrent)</TargetFramework>
|
|
</PropertyGroup>
|
|
|
|
<Target Name="GenerateGraphViz"
|
|
AfterTargets="Build">
|
|
<ItemGroup>
|
|
<RepoProject Include="$(RepoProjectsDir)*.proj"
|
|
Exclude="$(RepoProjectsDir)dotnet.proj;
|
|
$(RepoProjectsDir)package-source-build.proj" />
|
|
</ItemGroup>
|
|
|
|
<MSBuild Projects="@(RepoProject)"
|
|
Targets="GetRepositoryReferences">
|
|
<Output TaskParameter="TargetOutputs" ItemName="RepoReference" />
|
|
</MSBuild>
|
|
|
|
<ItemGroup>
|
|
<RepoLink Include="%(RepoReference.MSBuildSourceProjectFile)" SourceRepo="%(RepoReference.Identity)" />
|
|
<RepoLink TargetRepo="%(Filename)" />
|
|
<RepoLink Text=""%(SourceRepo)" -> "%(TargetRepo)"" />
|
|
</ItemGroup>
|
|
|
|
<PropertyGroup>
|
|
<GraphVizFile>$(BaseIntermediateOutputPath)graphviz.dot</GraphVizFile>
|
|
<GraphVizPngFile>$(BaseIntermediateOutputPath)graphviz.png</GraphVizPngFile>
|
|
<GraphVizContent>digraph {
|
|
graph [ dpi = 150 ]
|
|
@(RepoLink -> '%(Text)')
|
|
}</GraphVizContent>
|
|
</PropertyGroup>
|
|
|
|
<WriteLinesToFile Lines="$(GraphVizContent)"
|
|
File="$(GraphVizFile)"
|
|
Overwrite="True" />
|
|
|
|
<Message Text="$(MSBuildProjectName) -> $(GraphVizFile)" Importance="High" />
|
|
|
|
<Exec Command="$([MSBuild]::NormalizePath('$(GraphVizDir)', 'dot')) $(GraphVizFile) -Tpng:cairo -o $(GraphVizPngFile)"
|
|
Condition="'$(GraphVizDir)' != ''" />
|
|
|
|
<Message Text="$(MSBuildProjectName) -> $(GraphVizPngFile)"
|
|
Importance="High"
|
|
Condition="'$(GraphVizDir)' != ''" />
|
|
</Target>
|
|
|
|
</Project>
|