22setlocal
33set D = %~dp0
44set PCBUILD = %D% ..\..\PCbuild\
5+ set PYTHON_EXE = %PCBUILD% ..\externals\pythonx86\tools\python.exe
56if " %Py_OutDir% " == " " set Py_OutDir = %PCBUILD%
67
78set BUILDX86 =
89set BUILDX64 =
910set BUILDARM =
10- set SYNCX86 =
11- set SYNCX64 =
12- set SYNCARM =
1311set REBUILD =
14- set OUTPUT =
15- set PACKAGES =
1612set DEBUG =
17- set DEBUG_SUFFIX =
13+ set TEST =
14+ set _SUFFIX =
1815
1916:CheckOpts
2017if " %~1 " EQU " -h" goto Help
21- if " %~1 " EQU " -x86" (set BUILDX86=1 && set SYNCX86 = 1) && shift && goto CheckOpts
22- if " %~1 " EQU " -x64" (set BUILDX64=1 && set SYNCX64 = 1) && shift && goto CheckOpts
23- if " %~1 " EQU " -arm" (set BUILDARM=1 && set SYNCARM = 1) && shift && goto CheckOpts
18+ if " %~1 " EQU " -x86" (set BUILDX86=1) && shift && goto CheckOpts
19+ if " %~1 " EQU " -x64" (set BUILDX64=1) && shift && goto CheckOpts
20+ if " %~1 " EQU " -arm" (set BUILDARM=1) && shift && goto CheckOpts
21+ if " %~1 " EQU " -t" (set TEST=-t) && shift && goto CheckOpts
2422if " %~1 " EQU " -r" (set REBUILD=-r) && shift && goto CheckOpts
2523if " %~1 " EQU " -d" (set DEBUG=-d && set _SUFFIX = _d) && shift && goto CheckOpts
26- if " %~1 " EQU " -o" (set OUTPUT=" /p:OutputPath=%~2 " ) && shift && shift && goto CheckOpts
27- if " %~1 " EQU " --out" (set OUTPUT=" /p:OutputPath=%~2 " ) && shift && shift && goto CheckOpts
28- if " %~1 " EQU " -p" (set PACKAGES=%PACKAGES% %~2 ) && shift && shift && goto CheckOpts
2924if " %~1 " NEQ " " echo Unknown parameter " %~1 " && exit
3025
3126if not defined BUILDX86 if not defined BUILDX64 if not defined BUILDARM (set BUILDX86=1) && (set BUILDX64=1) && (set BUILDARM=1)
3227
33- :: need x64 python.exe to run sync_win_iot.pl when only building for ARM
34- if defined BUILDARM (
35- if not exist " %PCBUILD% amd64\python.exe" ( set BUILDX64 = 1 )
36- )
37-
3828call " %PCBUILD% find_msbuild.bat" %MSBUILD%
3929if ERRORLEVEL 1 (echo Cannot locate MSBuild.exe on PATH or as MSBUILD variable & exit /b 2)
4030
@@ -45,29 +35,26 @@ if defined DEBUG (set CONFIGURATION=Debug
4535
4636if defined BUILDX86 (
4737 if defined REBUILD ( call " %PCBUILD% build.bat" -e -r
48- ) else if not exist " %Py_OutDir% win32\python.exe" call " %PCBUILD% build.bat" -e %DEBUG%
38+ ) else if not exist " %Py_OutDir% win32\python%_SUFFIX% .exe" call " %PCBUILD% build.bat" -e %DEBUG%
4939 if errorlevel 1 goto :eof
5040
51- if defined SYNCX86 ( %MSBUILD% " %D% sync_win_iot.proj" /p:Configuration=%CONFIGURATION% /p:Platform=x86 %OUTPUT% %PACKAGES% %WINIOT% )
52- if errorlevel 1 goto :eof
41+ %PYTHON_EXE% %D% sync_win_iot.py %DEBUG% %TEST% -p win32
5342)
5443
5544if defined BUILDX64 (
5645 if defined REBUILD ( call " %PCBUILD% build.bat" -p x64 -e -r
57- ) else if not exist " %Py_OutDir% amd64\python.exe" call " %PCBUILD% build.bat" -p x64 -e %DEBUG%
46+ ) else if not exist " %Py_OutDir% amd64\python%_SUFFIX% .exe" call " %PCBUILD% build.bat" -p x64 -e %DEBUG%
5847 if errorlevel 1 goto :eof
5948
60- if defined SYNCX64 ( %MSBUILD% " %D% sync_win_iot.proj" /p:Configuration=%CONFIGURATION% /p:Platform=x64 %OUTPUT% %PACKAGES% %WINIOT% )
61- if errorlevel 1 goto :eof
49+ %PYTHON_EXE% %D% sync_win_iot.py %DEBUG% %TEST% -p amd64
6250)
6351
6452if defined BUILDARM (
65- if defined REBUILD ( call " %PCBUILD% build.bat" -p ARM -e %DEBUG% -r --no-tkinter --no-ssl --no- vs
66- ) else if not exist " %Py_OutDir% arm32\python%_SUFFIX% .exe" call " %PCBUILD% build.bat" -p ARM -e %DEBUG% --no-tkinter --no-vs
53+ if defined REBUILD ( call " %PCBUILD% build.bat" -p ARM -e %DEBUG% -r --no-tkinter --no-vs
54+ ) else if not exist " %Py_OutDir% arm32\python%_SUFFIX% .exe" call " %PCBUILD% build.bat" -p ARM -E %DEBUG% --no-tkinter --no-vs
6755 if errorlevel 1 goto :eof
6856
69- if defined SYNCARM ( %MSBUILD% " %D% sync_win_iot.proj" /p:Configuration=%CONFIGURATION% /p:Platform=ARM /p:" PythonExe=%PCBUILD% amd64\python.exe" %OUTPUT% %PACKAGES% %WINIOT% )
70- if errorlevel 1 goto :eof
57+ %PYTHON_EXE% %D% sync_win_iot.py %DEBUG% %TEST% -p arm32
7158)
7259
7360exit /B 0
7865echo -x86 Build and sync x86 files
7966echo -x64 Build and sync x64 files
8067echo -arm Build and sync arm files (will build X64 to execute tools)
68+ echo -t Include test files
8169echo -d Build Debug configuration
8270echo -r Rebuild rather than incremental build
83- echo --out [DIR] Override output directory
8471echo -h Show usage
0 commit comments