Permalink
Browse files

Use latest Zephir on AppVeyor

  • Loading branch information...
sergeyklay authored and niden committed Dec 25, 2018
1 parent ff8d71d commit 9e4698aa820788a7d562fd6d09ea68b8978f87e2
Showing with 10 additions and 21 deletions.
  1. +1 −2 appveyor.yml
  2. +9 −19 tests/_ci/appveyor.psm1
@@ -14,7 +14,6 @@ environment:
PHP_SDK_PATH: C:\Projects\php-sdk
PHP_DEVPACK: C:\Projects\php-devpack
TEST_PHP_EXECUTABLE: C:\Projects\php\php.exe
ZEPHIR_PATH: C:\Projects\zephir
PHP_SDK_VERSION: 2.0.7
PACKAGE_PREFIX: phalcon
EXTENSION_NAME: phalcon
@@ -68,7 +67,7 @@ build_script:
- '"%VSCOMNTOOLS%\VsDevCmd" %PLATFORM%'
- '"%VSCOMNTOOLS%\..\..\VC\vcvarsall.bat" %ARCH%'
- '%PHP_SDK_PATH%\bin\phpsdk_setvars'
- '%ZEPHIR_PATH%\bin\zephir.bat generate --backend=ZendEngine3 -Wnonexistent-function -Wnonexistent-class -Wunused-variable'
- '%APPVEYOR_BUILD_FOLDER%\zephir.bat generate --backend=ZendEngine3 -Wnonexistent-function -Wnonexistent-class -Wunused-variable'
- 'cd %APPVEYOR_BUILD_FOLDER%\build'
- 'php gen-build.php'
- 'cd %APPVEYOR_BUILD_FOLDER%\build\php7\safe'
@@ -87,12 +87,6 @@ Function InstallBuildDependencies {

& cmd /c ".\composer.bat install ${ComposerOptions}"
}

If (-not (Test-Path "${Env:ZEPHIR_PATH}\vendor")) {
Set-Location "${Env:ZEPHIR_PATH}"

& cmd /c "${Env:APPVEYOR_BUILD_FOLDER}\composer.bat install ${ComposerOptions}"
}
}

Function EnsurePandocIsInstalled {
@@ -374,23 +368,19 @@ Function InstallParser {
}

Function InstallZephir {
$BaseUri = "https://github.com/phalcon/zephir/archive"
$RemoteUrl = "${BaseUri}/${Env:ZEPHIR_VERSION}.zip"
$ZephirBatch = "${Env:APPVEYOR_BUILD_FOLDER}\zephir.bat"

$DestinationPath = "C:\Downloads\zephir-${Env:ZEPHIR_VERSION}.zip"
If (-not (Test-Path ${Env:ZEPHIR_PATH})) {
If (-not [System.IO.File]::Exists($DestinationPath)) {
Write-Host "Downloading Zephir: ${RemoteUrl} ..."
DownloadFile $RemoteUrl $DestinationPath
}
If (-not (Test-Path -Path $ZephirBatch)) {
$Php = "${Env:PHP_PATH}\php.exe"
$ZephirPhar = "${Env:APPVEYOR_BUILD_FOLDER}\zephir.phar"

$DestinationUnzipPath = "${Env:Temp}\zephir-${Env:ZEPHIR_VERSION}"
$BaseUri = "https://github.com/phalcon/zephir/releases/download"
$RemoteUrl = "${BaseUri}/${Env:ZEPHIR_VERSION}/zephir.phar"

If (-not (Test-Path "$DestinationUnzipPath")) {
Expand-Item7zip $DestinationPath $Env:Temp
}
DownloadFile "${RemoteUrl}" "${ZephirPhar}"

Move-Item -Path "$DestinationUnzipPath" -Destination "${Env:ZEPHIR_PATH}"
Write-Output "@echo off" | Out-File -Encoding "ASCII" -Append $ZephirBatch
Write-Output "${Php} `"${ZephirPhar}`" %*" | Out-File -Encoding "ASCII" -Append $ZephirBatch
}
}

0 comments on commit 9e4698a

Please sign in to comment.