Skip to content

Commit c60b162

Browse files
committed
Update build script and add cmd script
1 parent b42c92d commit c60b162

File tree

3 files changed

+40
-1
lines changed

3 files changed

+40
-1
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ install:
2020

2121
# Build libgit2, LibGit2Sharp and run the tests
2222
script:
23-
- ./build.libgit2sharp.sh 'LEAKS_IDENTIFYING'
23+
- ./buildandtest.sh 'LEAKS_IDENTIFYING'
2424

2525
# Only watch the development branch
2626
branches:

buildandtest.cmd

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
@ECHO OFF
2+
3+
REM Sample usages:
4+
REM
5+
REM Building and running tests
6+
REM - build.libgit2sharp.cmd
7+
REM
8+
REM Building and identifying potential leaks while running tests
9+
REM - build.libgit2sharp.cmd "LEAKS_IDENTIFYING"
10+
11+
SETLOCAL
12+
13+
SET EXTRADEFINE=%~1
14+
15+
where dotnet 1>nul 2>nul
16+
IF ERRORLEVEL 1 (
17+
ECHO Cannot find dotnet.exe. Run from a VS2017 Developer Prompt.
18+
EXIT /B 1
19+
)
20+
21+
ECHO ON
22+
23+
SET Configuration=Release
24+
25+
:: Restore packages
26+
dotnet restore "%~dp0\"
27+
@IF ERRORLEVEL 1 EXIT /B %ERRORLEVEL%
28+
29+
:: Build
30+
dotnet build "%~dp0\" /v:minimal /nologo /property:ExtraDefine="%EXTRADEFINE%"
31+
@IF ERRORLEVEL 1 EXIT /B %ERRORLEVEL%
32+
33+
:: Run tests on Desktop and CoreCLR
34+
"%userprofile%\.nuget\packages\xunit.runner.console\2.2.0\tools\xunit.console.exe" "%~dp0bin\LibGit2Sharp.Tests\%Configuration%\net46\LibGit2Sharp.Tests.dll" -noshadow
35+
@IF ERRORLEVEL 1 EXIT /B %ERRORLEVEL%
36+
dotnet test "%~dp0LibGit2Sharp.Tests/LibGit2Sharp.Tests.csproj" --no-build -f netcoreapp1.0
37+
@IF ERRORLEVEL 1 EXIT /B %ERRORLEVEL%
38+
39+
EXIT /B %ERRORLEVEL%
File renamed without changes.

0 commit comments

Comments
 (0)