blob: 5498769515955ec11621a92d5f2b7523eb15024d [file] [log] [blame]
Bram Moolenaar81275ca2016-02-24 21:02:20 +01001@echo off
2:: Batch file for building/testing Vim on AppVeyor
Christopher Plewright5a57a5e2023-01-16 13:01:28 +00003set target=%1
Bram Moolenaar81275ca2016-02-24 21:02:20 +01004
5setlocal ENABLEDELAYEDEXPANSION
6cd %APPVEYOR_BUILD_FOLDER%
7
Christopher Plewright474f2262023-01-15 13:23:20 +00008:: Python3
9set PYTHON3_VER=311
10set PYTHON3_RELEASE=3.11.1
11set PYTHON3_URL=https://www.python.org/ftp/python/%PYTHON3_RELEASE%/python-%PYTHON3_RELEASE%-amd64.exe
12set PYTHON3_DIR=C:\python%PYTHON3_VER%-x64
13
Christopher Plewright5a57a5e2023-01-16 13:01:28 +000014set "VSWHERE=%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe"
15
16if 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
24if not exist "%VCVARSALL%" (
25 set "VCVARSALL=%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC\vcvarsall.bat"
26)
27call "%VCVARSALL%" x64
28
29goto %target%
30echo Unknown build target.
31exit 1
32
33:: ----------------------------------------------------------------------------
34:install
35@echo on
Christopher Plewright474f2262023-01-15 13:23:20 +000036if not exist downloads mkdir downloads
37
38:: Python 3
39if not exist %PYTHON3_DIR% (
40 call :downloadfile %PYTHON3_URL% downloads\python3.exe
Christopher Plewright5a57a5e2023-01-16 13:01:28 +000041 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
Christopher Plewright474f2262023-01-15 13:23:20 +000045)
Christopher Plewright5a57a5e2023-01-16 13:01:28 +000046@echo off
47goto :eof
48
49:: ----------------------------------------------------------------------------
50:build
Christopher Plewright474f2262023-01-15 13:23:20 +000051
Bram Moolenaar81275ca2016-02-24 21:02:20 +010052cd src
Bram Moolenaar7ce2aa02019-07-16 20:00:11 +020053
Bram Moolenaar81275ca2016-02-24 21:02:20 +010054echo "Building MSVC 64bit console Version"
K.Takata47d16662022-01-26 16:20:21 +000055nmake -f Make_mvc.mak CPU=AMD64 ^
Bram Moolenaarf9a343f2020-07-29 16:32:21 +020056 OLE=no GUI=no IME=yes ICONV=yes DEBUG=no ^
K.Takataf89be8d2021-05-29 12:42:47 +020057 FEATURES=%FEATURE%
58if not exist vim.exe (
59 echo Build failure.
60 exit 1
61)
Bram Moolenaar81275ca2016-02-24 21:02:20 +010062
63:: build MSVC huge version with python and channel support
64:: GUI needs to be last, so that testing works
65echo "Building MSVC 64bit GUI Version"
66if "%FEATURE%" == "HUGE" (
K.Takata47d16662022-01-26 16:20:21 +000067 nmake -f Make_mvc.mak CPU=AMD64 ^
Bram Moolenaarf9a343f2020-07-29 16:32:21 +020068 OLE=no GUI=yes IME=yes ICONV=yes DEBUG=no POSTSCRIPT=yes ^
69 PYTHON_VER=27 DYNAMIC_PYTHON=yes PYTHON=C:\Python27-x64 ^
Christopher Plewright474f2262023-01-15 13:23:20 +000070 PYTHON3_VER=%PYTHON3_VER% DYNAMIC_PYTHON3=yes PYTHON3=%PYTHON3_DIR% ^
K.Takataf89be8d2021-05-29 12:42:47 +020071 FEATURES=%FEATURE%
Bram Moolenaar81275ca2016-02-24 21:02:20 +010072) ELSE (
K.Takata47d16662022-01-26 16:20:21 +000073 nmake -f Make_mvc.mak CPU=AMD64 ^
Bram Moolenaarf9a343f2020-07-29 16:32:21 +020074 OLE=no GUI=yes IME=yes ICONV=yes DEBUG=no ^
K.Takataf89be8d2021-05-29 12:42:47 +020075 FEATURES=%FEATURE%
Bram Moolenaar81275ca2016-02-24 21:02:20 +010076)
K.Takataf89be8d2021-05-29 12:42:47 +020077if not exist gvim.exe (
78 echo Build failure.
79 exit 1
80)
81.\gvim -u NONE -c "redir @a | ver |0put a | wq" ver_msvc.txt || exit 1
Bram Moolenaar81275ca2016-02-24 21:02:20 +010082
Bram Moolenaarf9a343f2020-07-29 16:32:21 +020083echo "version output MSVC console"
K.Takataf89be8d2021-05-29 12:42:47 +020084.\vim --version || exit 1
Bram Moolenaarf9a343f2020-07-29 16:32:21 +020085echo "version output MSVC GUI"
K.Takataf89be8d2021-05-29 12:42:47 +020086type ver_msvc.txt || exit 1
Christopher Plewright474f2262023-01-15 13:23:20 +000087
88goto :eof
Christopher Plewright474f2262023-01-15 13:23:20 +000089
Christopher Plewright5a57a5e2023-01-16 13:01:28 +000090:: ----------------------------------------------------------------------------
91:test
92@echo on
93cd src/testdir
94:: Testing with MSVC gvim
95path %PYTHON3_DIR%;%PATH%
96nmake -f Make_mvc.mak VIMPROG=..\gvim
97nmake -f Make_mvc.mak clean
98:: Testing with MSVC console version
99nmake -f Make_mvc.mak VIMPROG=..\vim
100
101@echo off
102goto :eof
103
104:: ----------------------------------------------------------------------------
Christopher Plewright474f2262023-01-15 13:23:20 +0000105:downloadfile
106:: call :downloadfile <URL> <localfile>
107if not exist %2 (
108 curl -f -L %1 -o %2
109)
110if ERRORLEVEL 1 (
111 rem Retry once.
112 curl -f -L %1 -o %2 || exit 1
113)
114@goto :eof