aboutsummaryrefslogtreecommitdiff
path: root/PxShared/buildtools/clang-format/clang-format-p4.bat
blob: 0b246e3f38377ac812715366e48f333c38639d8e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
@echo off
setlocal

set BLAST_PATH=..\..

if "%*"=="" (
  echo Usage: format-change.bat ^<p4 changelist #^>
  exit /b
)

set change=%~1
for /F %%d IN (directories.txt) do (
  call :format %BLAST_PATH%\%%d
)

exit /b

:format
for /F "delims=#" %%a in ('p4 opened -c %change% %~f1\....h, %~f1\....cpp, %~f1\....cu, %~f1\....hlsl 2^> NUL') do (
  for /F "tokens=3" %%f IN ('p4 where %%a') do (
    echo %%f
    clang-format.exe -i %%f
  )
)