php-src/appveyor/build_task.bat

58 lines
1.8 KiB
Batchfile
Raw Normal View History

2016-12-16 10:48:08 +00:00
@echo off
if "%APPVEYOR%" equ "True" rmdir /s /q C:\cygwin >NUL 2>NUL
2016-12-17 10:25:06 +00:00
if %errorlevel% neq 0 exit /b 3
if "%APPVEYOR%" equ "True" rmdir /s /q C:\cygwin64 >NUL 2>NUL
if %errorlevel% neq 0 exit /b 3
2016-12-16 10:48:08 +00:00
if "%APPVEYOR%" equ "True" rmdir /s /q C:\mingw >NUL 2>NUL
2016-12-17 10:25:06 +00:00
if %errorlevel% neq 0 exit /b 3
2016-12-16 10:48:08 +00:00
if "%APPVEYOR%" equ "True" rmdir /s /q C:\mingw-w64 >NUL 2>NUL
2016-12-17 10:25:06 +00:00
if %errorlevel% neq 0 exit /b 3
2016-12-16 10:48:08 +00:00
cd /D %APPVEYOR_BUILD_FOLDER%
2016-12-17 10:25:06 +00:00
if %errorlevel% neq 0 exit /b 3
2016-12-16 10:48:08 +00:00
if /i "%APPVEYOR_REPO_BRANCH:~0,4%" equ "php-" (
set BRANCH=%APPVEYOR_REPO_BRANCH:~4,3%
2016-12-16 10:48:08 +00:00
) else (
set BRANCH=master
)
set STABILITY=staging
set DEPS_DIR=%PHP_BUILD_CACHE_BASE_DIR%\deps-%BRANCH%-%PHP_SDK_VC%-%PHP_SDK_ARCH%
2016-12-16 10:48:08 +00:00
rem SDK is cached, deps info is cached as well
echo Updating dependencies in %DEPS_DIR%
cmd /c phpsdk_deps --update --no-backup --branch %BRANCH% --stability %STABILITY% --deps %DEPS_DIR% --crt %PHP_BUILD_CRT%
2016-12-17 10:25:06 +00:00
if %errorlevel% neq 0 exit /b 3
2016-12-16 10:48:08 +00:00
rem Something went wrong, most likely when concurrent builds were to fetch deps
rem updates. It might be, that some locking mechanism is needed.
if not exist "%DEPS_DIR%" (
cmd /c phpsdk_deps --update --force --no-backup --branch %BRANCH% --stability %STABILITY% --deps %DEPS_DIR%
)
if %errorlevel% neq 0 exit /b 3
2017-06-16 23:57:47 +00:00
cmd /c buildconf.bat --force
2016-12-17 10:25:06 +00:00
if %errorlevel% neq 0 exit /b 3
2016-12-16 10:48:08 +00:00
if "%THREAD_SAFE%" equ "0" set ADD_CONF=--disable-zts
set EXT_EXCLUDE_FROM_TEST=snmp,oci8_12c,pdo_oci,pdo_odbc,odbc,pdo_firebird,interbase,ldap,imap,ftp
2016-12-16 10:48:08 +00:00
if "%OPCACHE%" equ "0" set EXT_EXCLUDE_FROM_TEST=%EXT_EXCLUDE_FROM_TEST%,opcache
2017-06-16 23:57:47 +00:00
cmd /c configure.bat ^
2016-12-16 10:48:08 +00:00
--enable-snapshot-build ^
--disable-debug-pack ^
2016-12-16 10:48:08 +00:00
--enable-com-dotnet=shared ^
--without-analyzer ^
--enable-object-out-dir=%PHP_BUILD_OBJ_DIR% ^
--with-php-build=%DEPS_DIR% ^
%ADD_CONF% ^
--with-test-ini-ext-exclude=%EXT_EXCLUDE_FROM_TEST%
2016-12-17 10:25:06 +00:00
if %errorlevel% neq 0 exit /b 3
2016-12-16 10:48:08 +00:00
nmake /NOLOGO
2016-12-17 10:25:06 +00:00
if %errorlevel% neq 0 exit /b 3
2016-12-16 10:48:08 +00:00
exit /b 0