forked from ubisoft/Sharpmake
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUpdateSamplesOutput.bat
59 lines (50 loc) · 2.05 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
@echo off
:: main
set ERRORLEVEL_BACKUP=0
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 CSharpVsix CSharpVsix.sharpmake.cs reference CSharpVsix
if not "%ERRORLEVEL_BACKUP%" == "0" goto error
call :UpdateRef samples PackageReferences PackageReferences.sharpmake.cs reference PackageReferences
if not "%ERRORLEVEL_BACKUP%" == "0" goto error
:: that one is special, the root is the current folder
call :UpdateRef samples SharpmakeGen SharpmakeGen.sharpmake.cs reference %~dp0
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
set SHARPMAKE_EXECUTABLE=%~2\bin\Debug\Sharpmake.Application.exe
if not exist %SHARPMAKE_EXECUTABLE% set SHARPMAKE_EXECUTABLE=%~2\bin\Release\Sharpmake.Application.exe
if not exist %SHARPMAKE_EXECUTABLE% echo Cannot find sharpmake executable in %~dp0%~1\%~2 & pause & goto error
echo Using executable %SHARPMAKE_EXECUTABLE%
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