forked from mreg-archive/fpdi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
64 lines (58 loc) · 2.1 KB
/
build.xml
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
63
64
<?xml version="1.0" encoding="UTF-8"?>
<project name="fpdi" basedir="." default="build">
<property name="APP_NAME" value="${phing.project.name}"/>
<property name="APP_ROOT" value="${project.basedir}"/>
<property name="SRC_DIR" value="${APP_ROOT}/src"/>
<property name="TEST_DIR" value="${APP_ROOT}/tests"/>
<property name="VENDOR_DIR" value="${APP_ROOT}/vendor"/>
<property name="FPDI_DIR" value="${APP_ROOT}/fpdi.source"/>
<property name="TEMP_DIR" value="/tmp"/>
<property name="FPDI_URL" value="https://www.setasign.com/supra/kon2_dl/103845/FPDI-1.6.1.zip"/>
<target name="build" depends="convert,test,cleanup">
</target>
<target name="convert" depends="getfpdi,install">
<delete>
<fileset dir="${SRC_DIR}">
<include name="*.php"/>
</fileset>
</delete>
<exec
command="php dev/convert.php ${FPDI_DIR} ${SRC_DIR}"
dir="${APP_ROOT}"
checkreturn="true"
passthru="true"
/>
<delete dir="${FPDI_DIR}"/>
</target>
<target name="getfpdi">
<delete dir="${FPDI_DIR}"/>
<exec command="wget -O ${TEMP_DIR}/fpdi.zip ${FPDI_URL}" dir="${APP_ROOT}"/>
<unzip file="${TEMP_DIR}/fpdi.zip" todir="${FPDI_DIR}"/>
<delete file="${TEMP_DIR}/fpdi.zip"/>
</target>
<target name="test" depends="install">
<exec
command="${VENDOR_DIR}/bin/phpunit --bootstrap=vendor/autoload.php ${TEST_DIR}"
dir="${APP_ROOT}"
checkreturn="true"
passthru="true"
/>
</target>
<target name="cleanup">
<delete file="${TEST_DIR}/FPDF_AA.pdf"/>
<delete file="${TEST_DIR}/TCPDF_AA.pdf"/>
</target>
<target name="install">
<if>
<available file="${VENDOR_DIR}"/>
<else>
<exec
command="composer install --dev"
dir="${APP_ROOT}"
checkreturn="true"
passthru="true"
/>
</else>
</if>
</target>
</project>