-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.proj
69 lines (59 loc) · 2.92 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!--
localhost
dotnet msbuild build.proj -t:clean,build,test -v:n
github actions
dotnet msbuild build.proj -t:clean,build,test -p:Configuration=Release -verbosity:normal
-->
<PropertyGroup>
<Solution>$(MSBuildProjectDirectory)/xycat.sln</Solution>
<TestDir>$(MSBuildProjectDirectory)/xycat.test</TestDir>
<Configuration Condition="'$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition="'$(Platform)' == '' ">x64</Platform>
</PropertyGroup>
<Choose>
<When Condition="$([MSBuild]::IsOsPlatform('Linux'))" >
<PropertyGroup>
<RuntimeIdentifier>linux-x64</RuntimeIdentifier>
</PropertyGroup>
</When>
<When Condition="$([MSBuild]::IsOsPlatform('Windows'))" >
<PropertyGroup>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
</PropertyGroup>
</When>
</Choose>
<Target Name="os">
<Message Text="RuntimeIdentifier: '$(RuntimeIdentifier)'" Importance="high" />
<Message Text="OS: '$(OS)'" Importance="high" />
<Message Text="Linux? $([MSBuild]::IsOsPlatform('Linux'))" Importance="high" />
<Message Text="Unix? $([MSBuild]::IsOsPlatform('Unix'))" Importance="high" />
<Message Text="Windows? $([MSBuild]::IsOsPlatform('Windows'))" Importance="high" />
<Message Text="OSX? $([MSBuild]::IsOsPlatform('OSX'))" Importance="high" />
</Target>
<Target Name="clean" >
<ItemGroup>
<FoldersToDelete Include="$( [System.IO.Directory]::GetDirectories( ".","publish",SearchOption.AllDirectories ) )"/>
<FoldersToDelete Include="$( [System.IO.Directory]::GetDirectories( ".","obj",SearchOption.AllDirectories ) )"/>
<FoldersToDelete Include="$( [System.IO.Directory]::GetDirectories( ".","bin",SearchOption.AllDirectories ) )"/>
<FoldersToDelete Include="$( [System.IO.Directory]::GetDirectories( ".","lib",SearchOption.AllDirectories ) )"/>
</ItemGroup>
<RemoveDir Directories="@(FoldersToDelete)" />
</Target>
<Target Name="build">
<Message Text="Configuration: $(Configuration)"/>
<Message Text="Platform: $(Platform)"/>
<Exec Command="dotnet build $(Solution)" />
</Target>
<Target Name="test">
<Exec Command="dotnet test $(TestDir) -l "console;verbosity=normal" --no-restore --no-build" />
</Target>
<Target Name="publish">
<ItemGroup>
<Exe Include="xcat" />
<Exe Include="ycat" />
</ItemGroup>
<Exec Command="dotnet publish %(Exe.Identity) -r $(RuntimeIdentifier) -o publish -p:PublishSingleFile=true -p:PublishTrimmed=true --self-contained true" />
</Target>
</Project>