11@ echo off
22:: Batch file for building/testing Vim on AppVeyor
3+ set target = %1
34
45setlocal ENABLEDELAYEDEXPANSION
56cd %APPVEYOR_BUILD_FOLDER%
67
8+ :: Python3
9+ set PYTHON3_VER = 311
10+ set PYTHON3_RELEASE = 3.11.1
11+ set PYTHON3_URL = https://www.python.org/ftp/python/%PYTHON3_RELEASE% /python-%PYTHON3_RELEASE% -amd64.exe
12+ set PYTHON3_DIR = C:\python%PYTHON3_VER% -x64
13+
14+ set " VSWHERE = %ProgramFiles(x86)% \Microsoft Visual Studio\Installer\vswhere.exe"
15+
16+ if exist " %VSWHERE% " (
17+ for /f " usebackq delims=" %%i in (
18+ `" %VSWHERE% " -products * -latest -property installationPath`
19+ ) do (
20+ set " VCVARSALL = %%i \VC\Auxiliary\Build\vcvarsall.bat"
21+ )
22+ )
23+
24+ if not exist " %VCVARSALL% " (
25+ set " VCVARSALL = %ProgramFiles(x86)% \Microsoft Visual Studio 14.0\VC\vcvarsall.bat"
26+ )
27+ call " %VCVARSALL% " x64
28+
29+ goto %target%
30+ echo Unknown build target.
31+ exit 1
32+
33+ :: ----------------------------------------------------------------------------
34+ :install
35+ @ echo on
36+ if not exist downloads mkdir downloads
37+
38+ :: Python 3
39+ if not exist %PYTHON3_DIR% (
40+ call :downloadfile %PYTHON3_URL% downloads\python3.exe
41+ cmd /c start /wait downloads\python3.exe /quiet TargetDir=%PYTHON3_DIR% ^
42+ Include_pip=0 Include_tcltk=0 Include_test=0 Include_tools=0 ^
43+ AssociateFiles=0 Shortcuts=0 Include_doc=0 Include_launcher=0 ^
44+ InstallLauncherAllUsers=0
45+ )
46+ @ echo off
47+ goto :eof
48+
49+ :: ----------------------------------------------------------------------------
50+ :build
51+
752cd src
853
954echo " Building MSVC 64bit console Version"
@@ -22,7 +67,7 @@ if "%FEATURE%" == "HUGE" (
2267 nmake -f Make_mvc.mak CPU=AMD64 ^
2368 OLE=no GUI=yes IME=yes ICONV=yes DEBUG=no POSTSCRIPT=yes ^
2469 PYTHON_VER=27 DYNAMIC_PYTHON=yes PYTHON=C:\Python27-x64 ^
25- PYTHON3_VER=35 DYNAMIC_PYTHON3=yes PYTHON3=C:\Python35-x64 ^
70+ PYTHON3_VER=%PYTHON3_VER% DYNAMIC_PYTHON3=yes PYTHON3=%PYTHON3_DIR% ^
2671 FEATURES=%FEATURE%
2772) ELSE (
2873 nmake -f Make_mvc.mak CPU=AMD64 ^
@@ -39,4 +84,31 @@ echo "version output MSVC console"
3984.\vim --version || exit 1
4085echo " version output MSVC GUI"
4186type ver_msvc.txt || exit 1
42- cd ..
87+
88+ goto :eof
89+
90+ :: ----------------------------------------------------------------------------
91+ :test
92+ @ echo on
93+ cd src/testdir
94+ :: Testing with MSVC gvim
95+ path %PYTHON3_DIR% ;%PATH%
96+ nmake -f Make_mvc.mak VIMPROG=..\gvim
97+ nmake -f Make_mvc.mak clean
98+ :: Testing with MSVC console version
99+ nmake -f Make_mvc.mak VIMPROG=..\vim
100+
101+ @ echo off
102+ goto :eof
103+
104+ :: ----------------------------------------------------------------------------
105+ :downloadfile
106+ :: call :downloadfile <URL> <localfile>
107+ if not exist %2 (
108+ curl -f -L %1 -o %2
109+ )
110+ if ERRORLEVEL 1 (
111+ rem Retry once.
112+ curl -f -L %1 -o %2 || exit 1
113+ )
114+ @ goto :eof
0 commit comments