From e218d8c24bfbd5384e040417e533ede96c4e831b Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Fri, 23 Aug 2019 19:35:02 +0200 Subject: Build: integrate make_update.py into Windows make.bat --- build_files/windows/check_libraries.cmd | 9 +++++++++ build_files/windows/find_dependencies.cmd | 8 +++++--- build_files/windows/format.cmd | 5 +++-- build_files/windows/parse_arguments.cmd | 8 +++----- build_files/windows/update_sources.cmd | 25 ++++++++++--------------- 5 files changed, 30 insertions(+), 25 deletions(-) (limited to 'build_files/windows') diff --git a/build_files/windows/check_libraries.cmd b/build_files/windows/check_libraries.cmd index fcae2c90657..b838c7d7d19 100644 --- a/build_files/windows/check_libraries.cmd +++ b/build_files/windows/check_libraries.cmd @@ -39,6 +39,15 @@ if NOT EXIST %BUILD_VS_LIBDIR% ( ) ) ) +) else ( + if NOT EXIST %PYTHON% ( + if not "%SVN%"=="" ( + echo. + echo Python not found in external libraries, updating to latest version + echo. + "%SVN%" update %BUILD_VS_LIBDIR% + ) + ) ) if NOT EXIST %BUILD_VS_LIBDIR% ( diff --git a/build_files/windows/find_dependencies.cmd b/build_files/windows/find_dependencies.cmd index a861cf1c98b..6a2233ecff7 100644 --- a/build_files/windows/find_dependencies.cmd +++ b/build_files/windows/find_dependencies.cmd @@ -2,10 +2,12 @@ REM find all dependencies and set the corresponding environment variables. for %%X in (svn.exe) do (set SVN=%%~$PATH:X) for %%X in (cmake.exe) do (set CMAKE=%%~$PATH:X) for %%X in (git.exe) do (set GIT=%%~$PATH:X) +set PYTHON=%BLENDER_DIR%\..\lib\win64_vc14\python\37\bin\python.exe if NOT "%verbose%" == "" ( - echo svn : "%SVN%" - echo cmake : "%CMAKE%" - echo git : "%GIT%" + echo svn : "%SVN%" + echo cmake : "%CMAKE%" + echo git : "%GIT%" + echo python : "%PYTHON%" ) if "%CMAKE%" == "" ( echo Cmake not found in path, required for building, exiting... diff --git a/build_files/windows/format.cmd b/build_files/windows/format.cmd index f036257e220..43f8b61727d 100644 --- a/build_files/windows/format.cmd +++ b/build_files/windows/format.cmd @@ -9,7 +9,7 @@ exit /b 1 :detect_done echo found clang-format in %CF_PATH% -if EXIST %BLENDER_DIR%\..\lib\win64_vc14\python\37\bin\python.exe ( +if EXIST %PYTHON% ( set PYTHON=%BLENDER_DIR%\..\lib\win64_vc14\python\37\bin\python.exe goto detect_python_done ) @@ -25,6 +25,7 @@ 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% %FORMAT_ARGS% +REM Use -B to avoid writing __pycache__ in lib directory and causing update conflicts. +%PYTHON% -B %FORMAT_PATHS% %FORMAT_ARGS% :EOF diff --git a/build_files/windows/parse_arguments.cmd b/build_files/windows/parse_arguments.cmd index 3f40ef1f5ef..cb375b7fc9f 100644 --- a/build_files/windows/parse_arguments.cmd +++ b/build_files/windows/parse_arguments.cmd @@ -82,12 +82,10 @@ if NOT "%1" == "" ( REM Non-Build Commands ) else if "%1" == "update" ( SET BUILD_UPDATE=1 - set BUILD_UPDATE_SVN=1 - set BUILD_UPDATE_GIT=1 + set BUILD_UPDATE_ARGS= ) else if "%1" == "code_update" ( SET BUILD_UPDATE=1 - set BUILD_UPDATE_SVN=0 - set BUILD_UPDATE_GIT=1 + set BUILD_UPDATE_ARGS="--only-code" ) else if "%1" == "ninja" ( SET BUILD_WITH_NINJA=1 ) else if "%1" == "clean" ( @@ -108,4 +106,4 @@ if NOT "%1" == "" ( :EOF exit /b 0 :ERR -exit /b 1 \ No newline at end of file +exit /b 1 diff --git a/build_files/windows/update_sources.cmd b/build_files/windows/update_sources.cmd index 1f571eaf92d..f8fbd383090 100644 --- a/build_files/windows/update_sources.cmd +++ b/build_files/windows/update_sources.cmd @@ -1,18 +1,13 @@ -if "%BUILD_UPDATE_SVN%" == "1" ( - if "%SVN%" == "" ( - echo svn not found, cannot update libraries - goto UPDATE_GIT - ) - "%SVN%" up "%BLENDER_DIR%/../lib/*" +if EXIST %PYTHON% ( + goto detect_python_done ) -:UPDATE_GIT -if "%BUILD_UPDATE_GIT%" == "1" ( - if "%GIT%" == "" ( - echo Git not found, cannot update code - goto EOF - ) - "%GIT%" pull --rebase - "%GIT%" submodule foreach git pull --rebase origin master -) +echo python not found in lib folder +exit /b 1 + +:detect_python_done + +REM Use -B to avoid writing __pycache__ in lib directory and causing update conflicts. +%PYTHON% -B %BLENDER_DIR%\build_files\utils\make_update.py --git-command "%GIT%" --svn-command "%SVN%" %BUILD_UPDATE_ARGS% + :EOF -- cgit v1.2.3