forked from microsoft/xunit-performance
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BuildCliComponents.cmd
55 lines (41 loc) · 1.81 KB
/
BuildCliComponents.cmd
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
@echo off
goto :main
======================================================================
Build the components of xunit.performance that support build via the
Dotnet CLI.
This script will bootstrap the latest version of the CLI into the
tools directory prior to build.
======================================================================
:main
setlocal
set BuildConfiguration=%1%
if "%BuildConfiguration%"=="" set BuildConfiguration=Debug
set OutputDirectory=%~dp0LocalPackages
set DotNet=%~dp0\tools\bin\dotnet.exe
if exist "%DotNet%" goto :build
echo Installing Dotnet CLI
set DotNet_Path=%~dp0tools\bin
set Init_Tools_Log=%DotNet_Path%\install.log
if NOT exist "%DotNet_Path%" mkdir "%DotNet_Path%"
set /p DotNet_Version=< %~dp0DotNetCLIVersion.txt
set DotNet_Installer_Url=https://raw.githubusercontent.com/dotnet/cli/rel/1.0.0-preview1/scripts/obtain/dotnet-install.ps1
powershell -NoProfile -ExecutionPolicy unrestricted -Command "Invoke-WebRequest -Uri '%DotNet_Installer_Url%' -OutFile '%DotNet_Path%\dotnet-install.ps1'"
echo Executing dotnet installer script %DotNet_Path%\dotnet-install.ps1
powershell -NoProfile -ExecutionPolicy unrestricted -Command "%DotNet_Path%\dotnet-install.ps1 -InstallDir %DotNet_Path% -Version '%DotNet_Version%'"
if NOT exist "%DotNet%" (
echo ERROR: Could not install dotnet cli correctly. See '%Init_Tools_Log%' for more details.
goto :EOF
)
:build
echo Building CLI-based components
pushd %~dp0src\cli\Microsoft.DotNet.xunit.performance.runner.cli
call %DotNet% restore
call %DotNet% build -c %BuildConfiguration%
call %DotNet% pack -c %BuildConfiguration% -o %OutputDirectory%
popd
pushd %~dp0src\cli\Microsoft.DotNet.xunit.performance.analysis.cli
call %DotNet% restore
call %DotNet% build -c %BuildConfiguration%
call %DotNet% pack -c %BuildConfiguration% -o %OutputDirectory%
popd
goto :eof