11@ echo off
22:: Batch file for building/testing Vim on AppVeyor
3+ set target = %1
34
45setlocal ENABLEDELAYEDEXPANSION
56cd %APPVEYOR_BUILD_FOLDER%
@@ -10,13 +11,43 @@ set PYTHON3_RELEASE=3.11.1
1011set PYTHON3_URL = https://www.python.org/ftp/python/%PYTHON3_RELEASE% /python-%PYTHON3_RELEASE% -amd64.exe
1112set PYTHON3_DIR = C:\python%PYTHON3_VER% -x64
1213
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
1336if not exist downloads mkdir downloads
1437
1538:: Python 3
1639if not exist %PYTHON3_DIR% (
1740 call :downloadfile %PYTHON3_URL% downloads\python3.exe
18- cmd /c start /wait downloads\python3.exe /quiet TargetDir=%PYTHON3_DIR% Include_pip=0 Include_tcltk=0 Include_test=0 Include_tools=0 AssociateFiles=0 Shortcuts=0 Include_doc=0 Include_launcher=0 InstallLauncherAllUsers=0
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
1945)
46+ @ echo off
47+ goto :eof
48+
49+ :: ----------------------------------------------------------------------------
50+ :build
2051
2152cd src
2253
@@ -53,11 +84,24 @@ echo "version output MSVC console"
5384.\vim --version || exit 1
5485echo " version output MSVC GUI"
5586type ver_msvc.txt || exit 1
56- cd ..
5787
5888goto :eof
59- :: ----------------------------------------------------------------------
6089
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+ :: ----------------------------------------------------------------------------
61105:downloadfile
62106:: call :downloadfile <URL> <localfile>
63107if not exist %2 (
0 commit comments