forked from ubisoft/Sharpmake
-
Notifications
You must be signed in to change notification settings - Fork 0
/
UpdateSamplesOutput.bat
93 lines (80 loc) · 4.53 KB
/
UpdateSamplesOutput.bat
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
@echo off
:: Clear previous run status
COLOR
:: First compile sharpmake to insure we are trying to deploy using an executable corresponding to the code.
dotnet build Sharpmake.sln -c Release
if %errorlevel% NEQ 0 goto error
set SHARPMAKE_EXECUTABLE=%~dp0Sharpmake.Application\bin\Release\net6.0\Sharpmake.Application.exe
if not exist %SHARPMAKE_EXECUTABLE% echo Cannot find sharpmake executable in %~dp0Sharpmake.Application\bin\Release\net6.0 & pause & goto error
echo Using executable %SHARPMAKE_EXECUTABLE%
:: main
set ERRORLEVEL_BACKUP=0
:: samples
call :UpdateRef samples ConfigureOrder main.sharpmake.cs reference ConfigureOrder
if not "%ERRORLEVEL_BACKUP%" == "0" goto error
call :UpdateRef samples CPPCLI CLRTest.sharpmake.cs reference CPPCLI
if not "%ERRORLEVEL_BACKUP%" == "0" goto error
call :UpdateRef samples CSharpHelloWorld HelloWorld.sharpmake.cs reference CSharpHelloWorld
if not "%ERRORLEVEL_BACKUP%" == "0" goto error
call :UpdateRef samples HelloWorld HelloWorld.sharpmake.cs reference HelloWorld
if not "%ERRORLEVEL_BACKUP%" == "0" goto error
call :UpdateRef samples HelloLinux HelloLinux.Main.sharpmake.cs reference HelloLinux
if not "%ERRORLEVEL_BACKUP%" == "0" goto error
call :UpdateRef samples HelloAssembly HelloAssembly.sharpmake.cs reference HelloAssembly
if not "%ERRORLEVEL_BACKUP%" == "0" goto error
call :UpdateRef samples CSharpVsix CSharpVsix.sharpmake.cs reference CSharpVsix
if not "%ERRORLEVEL_BACKUP%" == "0" goto error
call :UpdateRef samples CSharpWCF CSharpWCF.sharpmake.cs reference CSharpWCF\codebase
if not "%ERRORLEVEL_BACKUP%" == "0" goto error
call :UpdateRef samples CSharpImports CSharpImports.sharpmake.cs reference CSharpImports
if not "%ERRORLEVEL_BACKUP%" == "0" goto error
call :UpdateRef samples PackageReferences PackageReferences.sharpmake.cs reference PackageReferences
if not "%ERRORLEVEL_BACKUP%" == "0" goto error
:: skipped in regression tests
::call :UpdateRef samples QTFileCustomBuild QTFileCustomBuild.sharpmake.cs reference QTFileCustomBuild
::if not "%ERRORLEVEL_BACKUP%" == "0" goto error
:: skipped in regression tests
::call :UpdateRef samples FastBuildSimpleExecutable FastBuildSimpleExecutable.sharpmake.cs reference FastBuildSimpleExecutable\projects
::if not "%ERRORLEVEL_BACKUP%" == "0" goto error
call :UpdateRef samples SimpleExeLibDependency SimpleExeLibDependency.sharpmake.cs reference SimpleExeLibDependency
if not "%ERRORLEVEL_BACKUP%" == "0" goto error
call :UpdateRef samples NetCore\DotNetCoreFrameworkHelloWorld HelloWorld.sharpmake.cs reference NetCore\DotNetCoreFrameworkHelloWorld
if not "%ERRORLEVEL_BACKUP%" == "0" goto error
call :UpdateRef samples NetCore\DotNetFrameworkHelloWorld HelloWorld.sharpmake.cs reference NetCore\DotNetFrameworkHelloWorld
if not "%ERRORLEVEL_BACKUP%" == "0" goto error
call :UpdateRef samples NetCore\DotNetMultiFrameworksHelloWorld HelloWorld.sharpmake.cs reference NetCore\DotNetMultiFrameworksHelloWorld
if not "%ERRORLEVEL_BACKUP%" == "0" goto error
call :UpdateRef samples NetCore\DotNetOSMultiFrameworksHelloWorld HelloWorld.sharpmake.cs reference NetCore\DotNetOSMultiFrameworksHelloWorld
if not "%ERRORLEVEL_BACKUP%" == "0" goto error
:: functional tests
:: Skipped in regression tests
::call :UpdateRef Sharpmake.FunctionalTests FastBuildFunctionalTest FastBuildFunctionalTest.sharpmake.cs reference FastBuildFunctionalTest
::if not "%ERRORLEVEL_BACKUP%" == "0" goto error
@COLOR 2F
echo References update succeeded!
timeout /t 5
goto end
:: function Update the reference folder that's used for regression tests
:: params: testScopedCurrentDirectory,
:: folderPath,
:: mainFile,
:: outputDirectory
:: remapRootPath
:UpdateRef
:: backup current directory
pushd %CD%
:: set testScopedCurrentDirectory as current
cd /d %~dp0%~1
echo Updating references of %2...
rd /s /q "%~2\%~4"
call %SHARPMAKE_EXECUTABLE% /sources(@'%~2\%~3') /outputdir(@'%~2\%~4') /remaproot(@'%~5') /verbose
set ERRORLEVEL_BACKUP=%errorlevel%
:: restore caller current directory
popd
goto :end
:end
exit /b 0
:error
@COLOR 4F
pause
exit /b 1