[Bf-blender-cvs] [fb4ec706cdf] master: make.bat: Support optional paths for `make format`
Ray Molenkamp
noreply at git.blender.org
Wed Jun 5 15:30:50 CEST 2019
Commit: fb4ec706cdf8d56c8b18f43100c5a6ae7fcdb607
Author: Ray Molenkamp
Date: Wed Jun 5 07:30:45 2019 -0600
Branches: master
https://developer.blender.org/rBfb4ec706cdf8d56c8b18f43100c5a6ae7fcdb607
make.bat: Support optional paths for `make format`
make.bat now supports optional parameters to restrict
the formatting to a specific folder. Multiple paths
may be given
example:
make.bat format source/blender/blenkernel source/blender/gpu
===================================================================
M build_files/windows/format.cmd
M build_files/windows/parse_arguments.cmd
M build_files/windows/show_help.cmd
===================================================================
diff --git a/build_files/windows/format.cmd b/build_files/windows/format.cmd
index 04610944e16..9dd6f1fc83b 100644
--- a/build_files/windows/format.cmd
+++ b/build_files/windows/format.cmd
@@ -20,6 +20,6 @@ set FORMAT_PATHS=%BLENDER_DIR%\source\tools\utils_maintenance\clang_format_paths
REM The formatting script expects clang-format to be in the current PATH.
set PATH=%CF_PATH%;%PATH%
-%PYTHON% %FORMAT_PATHS%
+%PYTHON% %FORMAT_PATHS% %FORMAT_ARGS%
:EOF
diff --git a/build_files/windows/parse_arguments.cmd b/build_files/windows/parse_arguments.cmd
index 0f87f8787c4..8c8b473dbcf 100644
--- a/build_files/windows/parse_arguments.cmd
+++ b/build_files/windows/parse_arguments.cmd
@@ -93,6 +93,8 @@ if NOT "%1" == "" (
set VERBOSE=1
) else if "%1" == "format" (
set FORMAT=1
+ set FORMAT_ARGS=%2 %3 %4 %5 %6 %7 %8 %9
+ goto EOF
) else (
echo Command "%1" unknown, aborting!
exit /b 1
diff --git a/build_files/windows/show_help.cmd b/build_files/windows/show_help.cmd
index 5ac59939eec..08a6c40731c 100644
--- a/build_files/windows/show_help.cmd
+++ b/build_files/windows/show_help.cmd
@@ -13,6 +13,7 @@ echo - update ^(Update both SVN and GIT^)
echo - code_update ^(Update only GIT^)
echo - nobuild ^(only generate project files^)
echo - showhash ^(Show git hashes of source tree^)
+echo - format [path] ^(Format the source using clang-format, path is optional, requires python 3.x to be available^)
echo.
echo Configuration options
echo - verbose ^(enable diagnostic output during configuration^)
More information about the Bf-blender-cvs
mailing list