This repository has been archived by the owner on Nov 19, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2k
/
build-all.cmd
80 lines (65 loc) · 2.77 KB
/
build-all.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
78
79
@echo off
:: (enable termination from subroutine)
SETLOCAL
set ERROR_CODE=0
if "%selfWrapped%"=="" (
set selfWrapped=true
%ComSpec% /s /c ""%~0" %*"
goto :eof
)
echo.
echo Accord.NET Framework - all project configurations builder
echo =========================================================
echo.
:: Use Microsoft's vswhere.exe to locate the appropriate version of MSBuild:
for /f "usebackq tokens=1* delims=: " %%i in (`Tools\vswhere -latest -requires Microsoft.Component.MSBuild`) do (
if /i "%%i"=="installationPath" set InstallDir=%%j
)
set MSBUILD="%InstallDir%\MSBuild\15.0\Bin\MSBuild.exe"
echo This Windows batch file will use MSBuild.exe from the path
echo %MSBUILD%
echo to compile the Debug and Release versions of the framework.
echo.
::pause
del /q "Setup\bin\*.log"
echo.
call:MSBUILD "Sources\Accord.NET.sln", "Debug", "x64", "Rebuild"
call:MSBUILD "Sources\Accord.NET.sln", "Debug", "Any CPU", "Build"
call:MSBUILD "Sources\Accord.NET.sln", "mono", "Any CPU", "Rebuild"
call:MSBUILD "Sources\Accord.NET.sln", "net35", "x64", "Rebuild"
call:MSBUILD "Sources\Accord.NET.sln", "net35", "Any CPU", "Build"
call:MSBUILD "Sources\Accord.NET.sln", "net40", "x64", "Rebuild"
call:MSBUILD "Sources\Accord.NET.sln", "net40", "Any CPU", "Build"
call:MSBUILD "Sources\Accord.NET.sln", "net45", "x64", "Rebuild"
call:MSBUILD "Sources\Accord.NET.sln", "net45", "Any CPU", "Build"
call:MSBUILD "Sources\Accord.NET.sln", "net46", "x64", "Rebuild"
call:MSBUILD "Sources\Accord.NET.sln", "net46", "Any CPU", "Build"
call:MSBUILD "Sources\Accord.NET.sln", "net462", "x64", "Rebuild"
call:MSBUILD "Sources\Accord.NET.sln", "net462", "Any CPU", "Build"
echo.
call:MSBUILD "Samples\Samples.sln", "Release", "x86", "Rebuild"
call:MSBUILD "Samples\Samples.sln", "Release", "x64", "Build"
::: Building netstandard2.0 packages from the command line still doesn't work very well:
::call:DNBUILD "Sources\Accord.NET (NETStandard).sln","netstandard2.0"
::call:MSBUILD "Sources\Accord.NET (NETStandard).sln","netstandard2.0","Any CPU",Rebuild
exit /b %ERROR_CODE%
goto:eof
:DNBUILD
set SOLUTION=%~1
set CONFIGURATION=%~2
dotnet build %SOLUTION% --configuration %CONFIGURATION% --no-incremental
goto:eof
:MSBUILD
set SOLUTION=%~1
set CONFIGURATION=%~2
set PLATFORM=%~3
set TASK=%~4
echo.
echo - Building %SOLUTION% in %CONFIGURATION% / %PLATFORM% configuration...
%MSBUILD% /m "%SOLUTION%" /t:%TASK% /property:Prefer32bit=false /p:Configuration=%CONFIGURATION% /p:Platform="%PLATFORM%" /fl /flp:logfile="Setup\bin\Build.%CONFIGURATION%.%PLATFORM%.log";verbosity=normal /consoleloggerparameters:ErrorsOnly;Summary /verbosity:minimal /nologo
set ERROR_CODE=%errorlevel%
if %ERROR_CODE% neq 0 (
echo Exiting with %ERROR_CODE%
exit /b %ERROR_CODE%
)
goto:eof