Skip to content

Commit

Permalink
Merge pull request #34 from phalcon/development
Browse files Browse the repository at this point in the history
v1.1.2
  • Loading branch information
sergeyklay authored Jan 23, 2018
2 parents 935c3fc + b06ffe4 commit c9ce3df
Show file tree
Hide file tree
Showing 27 changed files with 198 additions and 189 deletions.
288 changes: 146 additions & 142 deletions .appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,229 +1,233 @@
version: 1.1.1-{build}
version: 1.1.2-{build}

build: false
#---------------------------------#
# environment configuration #
#---------------------------------#

# environment variables
environment:
matrix:
- PHP_TARGET: 5.5
PHP_VC: 11
PHP_MAJOR: 5
PHP_TYPE: "Win32"
- PHP_TARGET: 5.5
PHP_VC: 11
PHP_MAJOR: 5
PHP_TYPE: "nts-Win32"
- PHP_TARGET: 5.6
PHP_VC: 11
PHP_MAJOR: 5
PHP_TYPE: "Win32"
- PHP_TARGET: 5.6
PHP_VC: 11
PHP_MAJOR: 5
PHP_TYPE: "nts-Win32"
- PHP_TARGET: 7.0
PHP_VC: 14
PHP_MAJOR: 7
PHP_TYPE: "Win32"
PHP_BUILD_TYPE: "Win32"
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013
- PHP_TARGET: 7.0
PHP_VC: 14
PHP_MAJOR: 7
PHP_TYPE: "nts-Win32"
PHP_BUILD_TYPE: "nts-Win32"
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013
- PHP_TARGET: 7.1
PHP_VC: 14
PHP_MAJOR: 7
PHP_TYPE: "Win32"
PHP_BUILD_TYPE: "Win32"
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013
- PHP_TARGET: 7.1
PHP_VC: 14
PHP_MAJOR: 7
PHP_TYPE: "nts-Win32"
PHP_BUILD_TYPE: "nts-Win32"
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013
- PHP_TARGET: 7.2
PHP_VC: 15
PHP_MAJOR: 7
PHP_BUILD_TYPE: "Win32"
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
- PHP_TARGET: 7.2
PHP_VC: 15
PHP_MAJOR: 7
PHP_BUILD_TYPE: "nts-Win32"
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
PHP_DIR: c:\projects\php
PHP_SDK: c:\projects\php-sdk
PHP_DEVPACK: c:\projects\php-devpack
PHP_SDK_BINARY_TOOLS_VER: php-sdk-2.0.7
NO_INTERACTION: 1
PHP_SDK: c:\php-sdk
PHP_DEVPACK: c:\php-devpack
REPORT_EXIT_STATUS: 1

# this is how to allow failing jobs in the matrix
matrix:
# immediately finish build once one of the jobs fails
fast_finish: true
allow_failures:
- platform: x64

# clone entire repository history if not defined
clone_depth: 1

# clone directory
clone_folder: c:\projects\parser

only_commits:
message: /\[win build\]/
#---------------------------------#
# build configuration #
#---------------------------------#

# build platform, i.e. x86, x64, AnyCPU
platform:
- x86
- x64

branches:
only:
- master
- development

# scripts that are called at very beginning, before repo cloning
init:
- SET PATH=C:\Program Files (x86)\MSBuild\%PHP_VC%.0\Bin;C:\Program Files\OpenSSL;C:\php;C:\php-sdk\bin;C:\php-devpack;%PATH%
- SET PATH=C:\Program Files (x86)\Microsoft Visual Studio %PHP_VC%.0\VC;C:\Program Files (x86)\Microsoft Visual Studio %PHP_VC%.0\VC\bin;%PATH%
- SET PATH=C:\Program Files (x86)\MSBuild\%PHP_VC%.0\Bin;C:\Program Files (x86)\Microsoft Visual Studio %PHP_VC%.0\VC;C:\Program Files (x86)\Microsoft Visual Studio %PHP_VC%.0\VC\bin;%PHP_SDK%\bin;%PHP_DIR%\bin;%PHP_DIR%;%PATH%
- SET ANSICON=121x90 (121x90)
- ps: IF ($env:APPVEYOR_REPO_BRANCH -eq "development") {$env:APPVEYOR_CACHE_SKIP_SAVE = "true"}

os: Windows Server 2012 R2

platform:
- x86
- x64

install:
# ==================================================
- echo Setting PHP version...
# ==================================================
- ps: appveyor DownloadFile 'http://windows.php.net/downloads/releases/sha1sum.txt'
- appveyor DownloadFile http://windows.php.net/downloads/releases/sha1sum.txt
- ps: |
$versions = type sha1sum.txt | where { $_ -match "php-(${env:PHP_TARGET}\.\d+)-src" } | foreach { $matches[1] }
$version = $versions.Split(' ')[-1]
$env:PHP_VERSION=${version}
- ps: $env:PHP_PLATFORM="${env:PHP_SDK}\phpdev\vc${env:PHP_VC}\${env:PLATFORM}"
- ps: $env:PHP_SRC="${env:PHP_PLATFORM}\php-${env:PHP_VERSION}-src"
- cmd: rm sha1sum.txt
- ps: >-
If ($env:PLATFORM -eq 'x86') {
If ($env:PHP_TYPE -Match "nts-Win32") {
$env:RELEASE_FOLDER="Release"
$env:PHP_CONFIGURE_FLAGS="--disable-all --enable-cli --enable-zephir_parser=shared --disable-zts"
} Else {
$env:RELEASE_FOLDER="Release_TS"
$env:PHP_CONFIGURE_FLAGS="--disable-all --enable-cli --enable-zephir_parser=shared"
}
} else {
If ($env:PHP_TYPE -Match "nts-Win32") {
$env:RELEASE_FOLDER="x64\Release"
$env:PHP_CONFIGURE_FLAGS="--disable-all --enable-cli --enable-zephir_parser=shared --disable-zts"
} Else {
$env:RELEASE_FOLDER="x64\Release_TS"
$env:PHP_CONFIGURE_FLAGS="--disable-all --enable-cli --enable-zephir_parser=shared"
}
}
If ($env:PHP_VC -eq '11') {
$env:VSCOMNTOOLS=$env:VS110COMNTOOLS
} elseif ($env:PHP_VC -eq '14') {
If ($env:PHP_VC -eq '14') {
$env:VSCOMNTOOLS=$env:VS120COMNTOOLS
} elseif ($env:PHP_VC -eq '15') {
$env:VSCOMNTOOLS=$env:VS140COMNTOOLS
}
If ($env:PLATFORM -eq 'x64') {
$env:ARCH='x86_amd64'
} Else {
$env:ARCH='x86'
}
If ($env:PHP_TARGET -eq '5.5') {
$env:PHP_DEPS_URL="http://windows.php.net/downloads/php-sdk/archives/deps-${env:PHP_TARGET}-vc${env:PHP_VC}-${env:PLATFORM}.7z"
- ps: >-
If ($env:PLATFORM -eq 'x86') {
$env:ARCH='x86'
If ($env:PHP_BUILD_TYPE -Match "nts-Win32") {
$env:RELEASE_FOLDER="Release"
} Else {
$env:RELEASE_FOLDER="Release_TS"
}
} Else {
$env:PHP_DEPS_URL="http://windows.php.net/downloads/php-sdk/deps-${env:PHP_TARGET}-vc${env:PHP_VC}-${env:PLATFORM}.7z"
$env:ARCH='x86_amd64'
If ($env:PHP_BUILD_TYPE -Match "nts-Win32") {
$env:RELEASE_FOLDER="x64\Release"
} Else {
$env:RELEASE_FOLDER="x64\Release_TS"
}
}
If ($env:PHP_TYPE -Match "nts-Win32") {
$env:RELEASE_ZIPBALL="zephir_parser_${env:PLATFORM}_vc${env:PHP_VC}_php${env:PHP_TARGET}-nts_${env:APPVEYOR_BUILD_VERSION}"
- ps: >-
If ($env:PHP_BUILD_TYPE -Match "nts-Win32") {
$env:RELEASE_ZIPBALL="zephir_parser_${env:PLATFORM}_vc${env:PHP_VC}_php${env:PHP_TARGET}-nts_${env:APPVEYOR_BUILD_VERSION}"
} Else {
$env:RELEASE_ZIPBALL="zephir_parser_${env:PLATFORM}_vc${env:PHP_VC}_php${env:PHP_TARGET}_${env:APPVEYOR_BUILD_VERSION}"
$env:RELEASE_ZIPBALL="zephir_parser_${env:PLATFORM}_vc${env:PHP_VC}_php${env:PHP_TARGET}_${env:APPVEYOR_BUILD_VERSION}"
}
- ps: $env:DEVEL_PACK_VERSION="${env:PHP_VERSION}-${env:PHP_BUILD_TYPE}-vc${env:PHP_VC}-${env:PLATFORM}"

# scripts that run after cloning repository
install:
# ==================================================
- echo Initializing Build
# Install PHP SDK binary tools
# ==================================================
- mkdir %PHP_SDK% && cd %PHP_SDK%
- ps: (new-object net.webclient).DownloadFile('http://windows.php.net/downloads/php-sdk/php-sdk-binary-tools-20110915.zip', 'C:\php-sdk.zip')
- 7z.exe x C:\php-sdk.zip | FIND /V "ing "
- phpsdk_buildtree phpdev
- ps: Rename-Item ${env:PHP_SDK}\phpdev\vc9 ${env:PHP_SDK}\phpdev\vc${env:PHP_VC}
- mkdir %PHP_SRC%
- ps: (new-object net.webclient).DownloadFile('https://github.com/OSTC/php-sdk-binary-tools/archive/' + ${env:PHP_SDK_BINARY_TOOLS_VER} + '.zip', ${env:APPVEYOR_BUILD_FOLDER} + '\php-sdk-binary-tools-' + ${env:PHP_SDK_BINARY_TOOLS_VER} + '.zip')
- 7z x -y php-sdk-binary-tools-%PHP_SDK_BINARY_TOOLS_VER%.zip -oC:\projects
- move C:\projects\php-sdk-binary-tools-%PHP_SDK_BINARY_TOOLS_VER% %PHP_SDK%
# ==================================================
- echo Install PHP Dev pack
# Downloading PHP source code
# ==================================================
- cd C:\
- ps: >-
If ($env:PHP_TYPE -Match "nts-Win32") {
$env:DEVEL_PACK_VERSION="${env:PHP_VERSION}-nts-Win32-VC${env:PHP_VC}-${env:PLATFORM}"
} Else {
$env:DEVEL_PACK_VERSION="${env:PHP_VERSION}-Win32-VC${env:PHP_VC}-${env:PLATFORM}"
}
- ps: (new-object net.webclient).DownloadFile('http://windows.php.net/downloads/releases/php-' + ${env:PHP_VERSION} + '-' + ${env:PHP_BUILD_TYPE} + '-vc' + ${env:PHP_VC} + '-' + ${env:PLATFORM} + '.zip', ${env:APPVEYOR_BUILD_FOLDER} + '\php.zip')
- 'mkdir %PHP_DIR% && mv php.zip %PHP_DIR%\php.zip && cd %PHP_DIR%'
- 7z.exe x php.zip | FIND /V "ing "
# ==================================================
- echo Downloading PHP Dev pack source code [http://windows.php.net/downloads/releases/php-devel-pack-%DEVEL_PACK_VERSION%.zip]
# Install PHP Dev pack
# ==================================================
- ps: (new-object net.webclient).DownloadFile('http://windows.php.net/downloads/releases/php-devel-pack-' + ${env:DEVEL_PACK_VERSION} + '.zip', 'C:\php-dev.zip')
- ps: (new-object net.webclient).DownloadFile('http://windows.php.net/downloads/releases/php-devel-pack-' + ${env:DEVEL_PACK_VERSION} + '.zip', ${env:APPVEYOR_BUILD_FOLDER} + '\php-dev.zip')
- cd %APPVEYOR_BUILD_FOLDER%
- 7z.exe x php-dev.zip | FIND /V "ing "
- ps: Rename-Item "php-${env:PHP_VERSION}-devel-VC${env:PHP_VC}-${env:PLATFORM}" C:\php-devpack
- move %APPVEYOR_BUILD_FOLDER%\php-%PHP_VERSION%-devel-VC%PHP_VC%-%PLATFORM% %PHP_DEVPACK%

# to run custom scripts instead of automatic MSBuild
build_script:
# ==================================================
- echo Downloading and preparing PHP source code
# Initializing Build...
# ==================================================
- git clone -b PHP-%PHP_TARGET% --depth 1 https://github.com/php/php-src %PHP_SRC%
- cd %PHP_PLATFORM%
- ps: (new-object net.webclient).DownloadFile(${env:PHP_DEPS_URL}, 'C:\php-sdk-deps.7z')
- 7z.exe x C:\php-sdk-deps.7z | FIND /V "ing "
- cd %PHP_SDK%
- phpsdk_setvars
- cd %APPVEYOR_BUILD_FOLDER%
- git submodule update --init --recursive
- '"%VSCOMNTOOLS%\VsDevCmd" %PLATFORM%'
- vcvarsall %ARCH%
- '"%VSCOMNTOOLS%\..\..\VC\vcvarsall.bat" %ARCH%'
# ==================================================
- echo Preparing extension to build
# Build Zephir Parser
# ==================================================
- mkdir %PHP_SRC%\ext\zephir_parser
- xcopy /s /q c:\projects\parser\*.* %PHP_SRC%\ext\zephir_parser
- cd %PHP_SRC%\ext\zephir_parser
- cd %APPVEYOR_BUILD_FOLDER%
- '%PHP_SDK%\bin\phpsdk_setvars'
- cmd /c build-win32-php%PHP_MAJOR%.bat
# ==================================================
- echo Build PHP with enabled Zephir Parser
# ==================================================
- cd %PHP_SRC%
- buildconf
- configure %PHP_CONFIGURE_FLAGS%
- '%PHP_DEVPACK%\phpize.bat'
- configure --disable-all --enable-zephir_parser=shared
- nmake 2> compile-errors.log 1> compile.log
- echo extension=%PHP_SRC%\%RELEASE_FOLDER%\php_zephir_parser.dll >> C:\Windows\php.ini
- SET PATH=%PHP_SRC%\%RELEASE_FOLDER%;%PATH%
- 'cd %PHP_DIR%'
- 'echo extension_dir=%PHP_DIR%\ext > php.ini'
- 'echo extension=%APPVEYOR_BUILD_FOLDER%\%RELEASE_FOLDER%\php_zephir_parser.dll >> php.ini'
- php -v
- php --ri "Zephir Parser"

build_script:
# scripts to run after build
after_build:
- cd %APPVEYOR_BUILD_FOLDER%
- mkdir %APPVEYOR_BUILD_FOLDER%\package
# ==================================================
- echo Creating package to zip
- echo Convert *.md files to *.html
# ==================================================
- cinst pandoc
- pandoc -v
- cmd: for %%i in (*.md) do pandoc -f markdown -t html5 %%~ni.md > package/%%~ni.html
# ==================================================
- echo Collect artifacts and zip
# ==================================================
- mkdir %APPVEYOR_BUILD_FOLDER%\package
- cd %APPVEYOR_BUILD_FOLDER%\package
# dll
- cp %PHP_SRC%\%RELEASE_FOLDER%\php_zephir_parser.dll .\
- copy %APPVEYOR_BUILD_FOLDER%\%RELEASE_FOLDER%\php_zephir_parser.dll .\
# docs
- 'echo Release date: %DATE% %TIME% > RELEASE.txt'
- 'echo Release version: %APPVEYOR_BUILD_VERSION% >> RELEASE.txt'
- 'echo Git commit: %APPVEYOR_REPO_COMMIT% >> RELEASE.txt'
- 'echo Build type: %PHP_BUILD_TYPE% >> RELEASE.txt'
- 'echo Platform: %PLATFORM% >> RELEASE.txt'
- 'echo Target PHP version: %PHP_TARGET% >> RELEASE.txt'
- 'echo Build worker image: %APPVEYOR_BUILD_WORKER_IMAGE% >> RELEASE.txt'
- cp %APPVEYOR_BUILD_FOLDER%\LICENSE .\
- cp %APPVEYOR_BUILD_FOLDER%\CREDITS .\
- cp %APPVEYOR_BUILD_FOLDER%\VERSION .\
- cp %APPVEYOR_BUILD_FOLDER%\CHANGELOG.md .\
- cp %APPVEYOR_BUILD_FOLDER%\CONTRIBUTING.md .\
- cp %APPVEYOR_BUILD_FOLDER%\README.md .\
- cp %APPVEYOR_BUILD_FOLDER%\README.WIN32-BUILD-SYSTEM .\
- cp %APPVEYOR_BUILD_FOLDER%\NO_WARRANTY .\

after_build:
# ==================================================
- echo Collect artifacts and zip
# ==================================================
- cd %APPVEYOR_BUILD_FOLDER%\package
- 7z a %RELEASE_ZIPBALL%.zip *.*
- mv %RELEASE_ZIPBALL%.zip %APPVEYOR_BUILD_FOLDER%\

on_failure:
- 'dir'
- ps: >-
If (Test-Path -Path ${env:PHP_SRC}\compile-errors.log) {
type ${env:PHP_SRC}\compile-errors.log
}
#---------------------------------#
# artifacts configuration #
#---------------------------------#

If (Test-Path -Path ${env:PHP_SRC}\compile.log) {
type ${env:PHP_SRC}\compile.log
}
artifacts:
# pushing a single file with environment variable in path and "Deployment name" specified
- path: '.\$(RELEASE_ZIPBALL).zip'
type: zip
name: ZephirParser

If (Test-Path -Path ${env:PHP_SRC}\configure.js) {
type ${env:PHP_SRC}\configure.js
}
#---------------------------------#
# global handlers #
#---------------------------------#

on_success:
- 'dir'

# If you need to investigate worker on build finish uncomment this
# to display Remote Desktop connection details and pause the build
# until a special “lock” file on VM desktop is deleted
#on_finish:
# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))

artifacts:
- path: '.\*.zip'
type: zip
name: ZephirParser
on_success:
- 'dir'

on_failure:
- 'dir'
- ps: >-
If (Test-Path -Path ${env:APPVEYOR_BUILD_FOLDER}\compile-errors.log) {
type ${env:APPVEYOR_BUILD_FOLDER}\compile-errors.log
}
If (Test-Path -Path ${env:APPVEYOR_BUILD_FOLDER}\compile.log) {
type ${env:APPVEYOR_BUILD_FOLDER}\compile.log
}
If (Test-Path -Path ${env:APPVEYOR_BUILD_FOLDER}\configure.js) {
type ${env:APPVEYOR_BUILD_FOLDER}\configure.js
}
notifications:
- provider: Email
Expand Down
12 changes: 0 additions & 12 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,7 @@ missing
mkinstalldirs
/modules
run-tests.php
tests/*/*.diff
tests/*/*.out
tests/*/*.php
tests/*/*.exp
tests/*/*.log
tests/*/*.sh

# Tests
php_test_results_*
*.out
*.exp
*.diff
*.php

# Parser files
parser/lemon
Expand Down
Loading

0 comments on commit c9ce3df

Please sign in to comment.