-
Notifications
You must be signed in to change notification settings - Fork 58
/
Directory.Build.targets
30 lines (29 loc) · 1.07 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
<Project>
<!-- Clean the local cache when building a package so local projects always get the new content. -->
<Target Name="CleanLocalPackageCache"
AfterTargets="Pack"
Condition=" '$(PackageId)' != '' AND '$(PackageOutputPath)' != '' "
>
<RemoveDir Directories="$(PackageOutputPath)$(PackageId)" />
</Target>
<!--
Write the NuGet package version to a props file so it can be consumed by test and example projects
to reference the locally-built package version. The NuGet package version is generated by
Nerdbank.GitVersioning and includes a git commit hash when on a non-main branch.
-->
<Target Name="WriteVersionProps"
BeforeTargets="Pack"
>
<WriteLinesToFile
File="$(PackageOutputPath)version.props"
Overwrite="true"
WriteOnlyWhenDifferent="true"
Lines="
<Project>;
%20%20<PropertyGroup>;
%20%20%20%20<NodeApiDotNetPackageVersion>$(NuGetPackageVersion)</NodeApiDotNetPackageVersion>;
%20%20</PropertyGroup>;
</Project>"
/>
</Target>
</Project>