forked from dotnet/CliCommandLineParser
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.proj
47 lines (39 loc) · 1.56 KB
/
build.proj
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
<Project DefaultTargets="BuildAll">
<Target Name="BuildAll" DependsOnTargets="Restore;Build;Test;Pack" />
<PropertyGroup>
<Configuration Condition="'$(Configuration)' == ''">Debug</Configuration>
</PropertyGroup>
<Target Name="Restore">
<Exec Command="dotnet restore CommandLine-netcore.sln /p:Configuration=$(Configuration)" />
</Target>
<Target Name="Build">
<Exec Command="dotnet build CommandLine-netcore.sln /p:Configuration=$(Configuration)" />
</Target>
<Target Name="Test">
<Exec Command="dotnet test CommandLine.Tests/CommandLine.Tests-netcore.csproj -l:trx /p:Configuration=$(Configuration)" />
</Target>
<Target Name="Pack">
<Exec Command="dotnet pack CommandLine/CommandLine-netcore.csproj --no-build /p:Configuration=$(Configuration)" />
</Target>
<Target Name="MakeVersionProps">
<MakeDir Condition="!Exists('obj')"
Directories="obj" />
<Exec Command="git rev-list --count HEAD"
Condition="'$(CommitCount)' == ''"
ConsoleToMSBuild="true">
<Output TaskParameter="ConsoleOutput" PropertyName="CommitCount" />
</Exec>
<PropertyGroup>
<GitCommitInfoPropsContent>
<Project ToolsVersion="15.0">
<PropertyGroup>
<CommitCount>$(CommitCount)</CommitCount>
</PropertyGroup>
</Project>
</GitCommitInfoPropsContent>
</PropertyGroup>
<WriteLinesToFile File="obj/CommitCount.props"
Lines="$(GitCommitInfoPropsContent)"
Overwrite="true" />
</Target>
</Project>