Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Commit

Permalink
Updated the version of the CLI used from 1.1 to 2.0 (#240)
Browse files Browse the repository at this point in the history
- Added netcoreapp2.0 target to the test permutation
- Restore to a packages folder, and add it to the .gitignore file
- Updated bash script
  • Loading branch information
jorive committed Sep 26, 2017
1 parent fc429e3 commit a254bca
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 24 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -149,6 +149,7 @@ publish/
# NuGet Packages
*.nupkg
# The packages folder can be ignored because of Package Restore
packages/
**/packages/*
# except build/, which is used as an MSBuild target.
!**/packages/build/
Expand Down
2 changes: 1 addition & 1 deletion BuildCliComponents.sh
Expand Up @@ -18,7 +18,7 @@ declare dotnetVersion=`cat DotNetCliVersion.txt`
declare outputDirectory=${currentDir}/LocalPackages
declare dotnetPath=${currentDir}/tools/dotnet/${dotnetVersion}
declare dotnetCmd=${dotnetPath}/dotnet
declare dotnetInstallerUrl=https://raw.githubusercontent.com/dotnet/cli/rel/1.0.0/scripts/obtain/dotnet-install.sh
declare dotnetInstallerUrl=https://raw.githubusercontent.com/dotnet/cli/release/2.0.0/scripts/obtain/dotnet-install.sh
declare dotnetInstallerScript=${dotnetPath}/dotnet-install.sh

if ! [ -f $dotnetCmd ]
Expand Down
29 changes: 19 additions & 10 deletions CiBuild.cmd
@@ -1,19 +1,28 @@
@echo off
@if not defined _echo echo off

setlocal

set BuildConfiguration=Debug
set "ERRORLEVEL="
set "BuildConfiguration=Debug"

:ParseArguments
if "%1" == "" goto :DoneParsing
if /I "%1" == "/?" call :Usage && exit /b 1
if /I "%1" == "/debug" set BuildConfiguration=Debug&&shift&& goto :ParseArguments
if /I "%1" == "/release" set BuildConfiguration=Release&&shift&& goto :ParseArguments
call :Usage && exit /b 1
if "%1" == "" goto :DoneParsing
if /I "%1" == "/?" call :Usage && exit /b 1
if /I "%1" == "/debug" (
set BuildConfiguration=Debug
shift /1
goto :ParseArguments
)
if /I "%1" == "/release" (
set BuildConfiguration=Release
shift /1
goto :ParseArguments
)
call :Usage && exit /b 1
:DoneParsing

build.cmd %BuildConfiguration%

goto :eof
call "%~dp0build.cmd" %BuildConfiguration%
exit /b %ERRORLEVEL%

:Usage
@echo Usage: CiBuild.cmd [/debug^|/release]
Expand Down
2 changes: 1 addition & 1 deletion DotNetCliVersion.txt
@@ -1 +1 @@
1.0.4
2.0.0
14 changes: 8 additions & 6 deletions build.cmd
Expand Up @@ -15,6 +15,9 @@ setlocal enabledelayedexpansion

call "%~dp0.\dotnet-install.cmd" || exit /b 1

echo Where is dotnet.exe?
where.exe dotnet.exe

set procedures=
set procedures=%procedures% build_xunit_performance_core
set procedures=%procedures% build_xunit_performance_execution
Expand Down Expand Up @@ -63,12 +66,11 @@ setlocal
exit /b 1
)

dotnet.exe publish -c %BuildConfiguration% --framework netcoreapp1.0 || exit /b 1
dotnet.exe publish -c %BuildConfiguration% --framework netcoreapp1.1 || exit /b 1
for %%v in (1.0 1.1 2.0) do (
dotnet.exe publish -c %BuildConfiguration% --framework netcoreapp%%v || exit /b 1
dotnet.exe "bin\%BuildConfiguration%\netcoreapp%%v\simpleharness.dll" --perf:collect default+gcapi || exit /b 1
)

rem Use this as a prefix for dotnet.exe in order to launch the process on a different window: START "TITLE GOES HERE" /WAIT
dotnet.exe "bin\%BuildConfiguration%\netcoreapp1.0\simpleharness.dll" || exit /b 1
dotnet.exe "bin\%BuildConfiguration%\netcoreapp1.1\simpleharness.dll" || exit /b 1
exit /b %errorlevel%

:dotnet_build
Expand All @@ -78,7 +80,7 @@ setlocal
echo/ ==========
call :remove_directory bin || exit /b 1
call :remove_directory obj || exit /b 1
dotnet.exe restore || exit /b 1
dotnet.exe restore --no-cache --packages "%~dp0packages" || exit /b 1
dotnet.exe build --no-dependencies -c %BuildConfiguration% --version-suffix %VersionSuffix% || exit /b 1
exit /b 0

Expand Down
16 changes: 11 additions & 5 deletions dotnet-install.cmd
Expand Up @@ -12,7 +12,7 @@ setlocal
set DotNet_Path=%~dp0tools\dotnet\%DotNet_Version%
set DotNet=%DotNet_Path%\dotnet.exe
set Init_Tools_Log=%DotNet_Path%\install.log
set DotNet_Installer_Url=https://raw.githubusercontent.com/dotnet/cli/rel/1.0.0/scripts/obtain/dotnet-install.ps1
set DotNet_Installer_Url=https://raw.githubusercontent.com/dotnet/cli/release/2.0.0/scripts/obtain/dotnet-install.ps1

REM dotnet.exe might exist, but it might not be the right version.
REM Here we verify that if it is not the right version, then we install it
Expand All @@ -37,19 +37,25 @@ setlocal
)

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%'"
for %%v in (1.0.0 1.1.0 2.0.0) do (
echo Installing dotnet sdk version %%~v
powershell -NoProfile -ExecutionPolicy unrestricted -Command "&'%DotNet_Path%\dotnet-install.ps1' -InstallDir '%DotNet_Path%' -Version '%%~v'" || (
call :print_error_message Failed to install dotnet shared runtime %%~v
exit /b 1
)
)

if not exist "%DotNet%" (
call :print_error_message Could not install dotnet cli correctly. See '%Init_Tools_Log%' for more details.
exit /b 1
)

:install_dotnet_cli_exit
ECHO/
ECHO|SET /P VI_DUMMY_ENV_VAR="[%DATE%][%TIME%] dotnet --version "
call "%DotNet%" --version
call "%DotNet%" --info
ECHO/
endlocal& (
set "path=%DotNet_Path%;%path%"
set "PATH=%DotNet_Path%;%PATH%"
exit /b 0
)

Expand Down
2 changes: 2 additions & 0 deletions tests/simpleharness/Program.cs
Expand Up @@ -18,7 +18,9 @@ public static void Main(string[] args)
{
using (var p = new XunitPerformanceHarness(args))
{
Console.Out.WriteLine($"[{DateTime.Now}] Harness start");
p.RunBenchmarks(Assembly.GetEntryAssembly().Location);
Console.Out.WriteLine($"[{DateTime.Now}] Harness stop");
}
}

Expand Down
2 changes: 1 addition & 1 deletion tests/simpleharness/simpleharness.csproj
Expand Up @@ -6,7 +6,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>netcoreapp1.0;netcoreapp1.1</TargetFrameworks>
<TargetFrameworks>netcoreapp1.0;netcoreapp1.1;;netcoreapp2.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit a254bca

Please sign in to comment.