-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild_appveyor.cmd
77 lines (57 loc) · 2.65 KB
/
build_appveyor.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
@echo off
cd %~dp0
ECHO.
ECHO Preparing environment...
SETLOCAL ENABLEEXTENSIONS
SET CACHED_NUGET=%LocalAppData%\NuGet\NuGet.exe
IF "%APPVEYOR_REPO_BRANCH%" == "" SET APPVEYOR_REPO_BRANCH=LOCAL
IF "%APPVEYOR_BUILD_NUMBER%" == "" SET APPVEYOR_BUILD_NUMBER=42
IF "%APPVEYOR_REPO_BRANCH%" == "release" (
SET K_BUILD_VERSION=beta3-%APPVEYOR_BUILD_NUMBER%
) ELSE (
SET K_BUILD_VERSION=%APPVEYOR_REPO_BRANCH%-%APPVEYOR_BUILD_NUMBER%
)
IF EXIST %CACHED_NUGET% goto copynuget
ECHO.
ECHO Preparing NuGet...
IF NOT EXIST %LocalAppData%\NuGet md %LocalAppData%\NuGet
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "$ProgressPreference = 'SilentlyContinue'; Invoke-WebRequest 'https://www.nuget.org/nuget.exe' -OutFile '%CACHED_NUGET%'"
:copynuget
IF EXIST .nuget\nuget.exe goto restore
md .nuget
copy %CACHED_NUGET% .nuget\nuget.exe > nul
:restore
IF EXIST %USERPROFILE%\.k\bin\kvm.cmd goto run
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/aspnet/Home/release/kvminstall.ps1'))"
CALL %USERPROFILE%\.k\bin\kvm install latest -runtime CLR -x86 -alias default || set errorlevel=1
CALL %USERPROFILE%\.k\bin\kvm install latest -runtime CoreCLR -x86 || set errorlevel=1
:run
CALL %USERPROFILE%\.k\bin\kvm use default -runtime CLR -x86 || set errorlevel=1
ECHO.
ECHO Start actual builds...
CALL kpm restore || set errorlevel=1
CALL kpm build src\SmartDev.ConfigurationMapper || set errorlevel=1
CALL kpm build tests\ConfigurationMapper.UnitTests || set errorlevel=1
CALL kpm build tests\ConfigurationMapper.IntegrationTests || set errorlevel=1
ECHO.
ECHO Start tests...
IF NOT EXIST test-results MD test-results
CALL %USERPROFILE%\.k\bin\kvm use default -runtime CoreCLR -x86 || set errorlevel=1
cd tests\ConfigurationMapper.UnitTests
CALL k test -xml ..\..\test-results\ConfigurationMapper.UnitTests.CoreCLR.xml || set errorlevel=1
cd ..\..
cd tests\ConfigurationMapper.IntegrationTests
CALL k test -xml ..\..\test-results\ConfigurationMapper.IntegrationTests.CoreCLR.xml || set errorlevel=1
cd ..\..
CALL %USERPROFILE%\.k\bin\kvm use default -runtime CLR -x86 || set errorlevel=1
cd tests\ConfigurationMapper.UnitTests
CALL k test -xml ..\..\test-results\ConfigurationMapper.UnitTests.CLR.xml || set errorlevel=1
cd ..\..
cd tests\ConfigurationMapper.IntegrationTests
CALL k test -xml ..\..\test-results\ConfigurationMapper.IntegrationTests.CLR.xml || set errorlevel=1
cd ..\..
ECHO.
ECHO Start packaging...
IF NOT EXIST package-results MD package-results
CALL kpm pack src\SmartDev.ConfigurationMapper --out package-results --configuration release || set errorlevel=1
exit /b %errorlevel%