aboutsummaryrefslogtreecommitdiff
path: root/devtools/create_project/scripts/prebuild.cmd
blob: 0efaab190c58113cbea9fde0273155501f64625e (plain)
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
@echo off

REM ---------------------------------------------------------------
REM -- Pre-Build Script
REM ---------------------------------------------------------------
REM
REM Generate file with revision number
REM
REM Expected parameters
REM    Root folder (the source root folder)
REM    Target folder (the build output folder, will be used to copy internal_revision.h)

if "%~1"=="" goto error_root
if "%~2"=="" goto error_target

REM Run the revision script
@call cscript "%~1/devtools/create_project/scripts/revision.vbs" "%~1" "%~2" 1>NUL
if not %errorlevel% == 0 goto error_script
goto done

:error_root
echo Invalid root folder (%~1)!
goto done

:error_target
echo Invalid target folder (%~2)!
goto done

:error_script:
echo An error occurred while running the revision script!

:done
exit /B0