This repository was archived by the owner on Nov 16, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathbuild.proj
More file actions
49 lines (40 loc) · 2.08 KB
/
build.proj
File metadata and controls
49 lines (40 loc) · 2.08 KB
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
<?xml version="1.0" encoding="utf-8"?>
<!--
# Targets
/t:Build
Builds assemblies.
/t:Clean
Removes temporary build outputs.
/t:Test
Runs tests
-->
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildThisFileDirectory)repo.props" />
<PropertyGroup>
<!-- Folders -->
<TestOutputDirectory>$(RepoArtifacts)TestResults</TestOutputDirectory>
<StaticAnalysisOutputDirectory>$(RepoArtifacts)StaticAnalysisResults</StaticAnalysisOutputDirectory>
<!-- General -->
<Configuration Condition="'$(Configuration)' != 'Release'">Debug</Configuration>
<!-- PowerShell -->
<PowerShellCoreCommandPrefix>pwsh -NonInteractive -NoLogo -NoProfile -Command</PowerShellCoreCommandPrefix>
</PropertyGroup>
<Target Name="Build">
<!-- Build the project -->
<Exec Command="dotnet build Partner-Smart-Office.sln -c $(Configuration)" />
</Target>
<Target Name="Clean">
<Message Importance="high" Text="Cleaning..." />
<!-- Clean out the NuGet cache -->
<Exec Command="dotnet nuget locals global-packages --clear" ContinueOnError="WarnAndContinue" IgnoreExitCode="true" />
<!-- Remove Package, Publish, bin, obj, and TestResults directories -->
<Exec Command="$(PowerShellCoreCommandPrefix) "Remove-Item -Path $(RepoArtifacts) -Recurse -Force -ErrorAction Ignore"" IgnoreExitCode="true" />
<Exec Command="$(PowerShellCoreCommandPrefix) "Get-ChildItem -Path $(MSBuildThisFileDirectory) -Recurse -Include 'bin','obj','TestResults' | Remove-Item -Recurse -Force -ErrorAction Ignore"" IgnoreExitCode="true" />
</Target>
<Target Name="Full" DependsOnTargets="Clean;Build;Test" />
<Target Name="Test">
<Message Importance="high" Text="Running unit tests..." />
<MakeDir Directories="$(TestOutputDirectory)" ContinueOnError="false" />
<Exec Command="dotnet test Partner-Smart-Office.sln --configuration $(Configuration) --framework netcoreapp2.2 --logger trx --results-directory "$(TestOutputDirectory)"" />
</Target>
</Project>