forked from tideways/php-xhprof-extension
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.cmd
62 lines (53 loc) · 2.43 KB
/
install.cmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
@echo off
setlocal enableextensions enabledelayedexpansion
cinst wget
if not exist "%PHP_BUILD_CACHE_BASE_DIR%" (
echo Creating %PHP_BUILD_CACHE_BASE_DIR%
mkdir "%PHP_BUILD_CACHE_BASE_DIR%"
)
if not exist "%PHP_BUILD_OBJ_DIR%" (
echo Creating %PHP_BUILD_OBJ_DIR%
mkdir "%PHP_BUILD_OBJ_DIR%"
)
if not exist "%PHP_BUILD_CACHE_SDK_DIR%" (
echo Cloning remote SDK repository
rem git clone -q --depth=1 --branch %SDK_BRANCH% %SDK_REMOTE% "%PHP_BUILD_CACHE_SDK_DIR%" 2>&1
git clone --branch %SDK_BRANCH% %SDK_REMOTE% "%PHP_BUILD_CACHE_SDK_DIR%" 2>&1
) else (
echo Fetching remote SDK repository
git --git-dir="%PHP_BUILD_CACHE_SDK_DIR%\.git" --work-tree="%PHP_BUILD_CACHE_SDK_DIR%" fetch --prune origin 2>&1
echo Checkout SDK repository branch
git --git-dir="%PHP_BUILD_CACHE_SDK_DIR%\.git" --work-tree="%PHP_BUILD_CACHE_SDK_DIR%" checkout --force %SDK_BRANCH%
)
if "%PHP_REL%"=="master" (
echo git clone -q --depth=1 --branch=%PHP_REL% https://github.com/php/php-src C:\projects\php-src
git clone -q --depth=1 --branch=%PHP_REL% https://github.com/php/php-src C:\projects\php-src
) else (
echo git clone -q --depth=1 --branch=PHP-%PHP_REL% https://github.com/php/php-src C:\projects\php-src
git clone -q --depth=1 --branch=PHP-%PHP_REL% https://github.com/php/php-src C:\projects\php-src
)
xcopy %APPVEYOR_BUILD_FOLDER% C:\projects\php-src\ext\tideways_xhprof\ /s /e /y /f
xcopy %APPVEYOR_BUILD_FOLDER%\LICENSE %APPVEYOR_BUILD_FOLDER%\artifacts\ /y /f
xcopy %APPVEYOR_BUILD_FOLDER%\NOTICE %APPVEYOR_BUILD_FOLDER%\artifacts\ /y /f
if "%APPVEYOR%" equ "True" rmdir /s /q C:\cygwin >NUL 2>NUL
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
if "%APPVEYOR%" equ "True" rmdir /s /q C:\mingw >NUL 2>NUL
if %errorlevel% neq 0 exit /b 3
if "%APPVEYOR%" equ "True" rmdir /s /q C:\mingw-w64 >NUL 2>NUL
if %errorlevel% neq 0 exit /b 3
if "%APPVEYOR_REPO_TAG_NAME%"=="" (
set APPVEYOR_REPO_TAG_NAME=%APPVEYOR_REPO_BRANCH%-%APPVEYOR_REPO_COMMIT:~0,8%
for /f "delims=" %%l in (php_tideways_xhprof.h) do (
if not "%%l"=="" (
set line=%%l
if "!line:~8,27!"=="PHP_TIDEWAYS_XHPROF_VERSION" (
set APPVEYOR_REPO_TAG_NAME=!line:~30,-1!-%APPVEYOR_REPO_BRANCH%-%APPVEYOR_REPO_COMMIT:~0,8%
)
)
)
echo Final repo tag name: !APPVEYOR_REPO_TAG_NAME!
appveyor SetVariable -Name APPVEYOR_REPO_TAG_NAME -Value !APPVEYOR_REPO_TAG_NAME!
)
endlocal