-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.xml
66 lines (56 loc) · 2.38 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
65
66
<?xml version="1.0" encoding="UTF-8"?>
<project name="php-build-plugin-pdo-informix" default="test">
<property name="working.dir" value="${basedir}/test/working-dir" />
<property environment="env"/>
<target name="test"
depends="initialize-test-environment, run-tests, clean-up"
description="Prepares the environment and runs the tests" />
<target name="initialize-test-environment" depends="remove-working-dir,
create-working-dir, install-php-build, install-plugin, install-bats" />
<target name="remove-working-dir" description="Removes the working directory">
<delete dir="${working.dir}"/>
</target>
<target name="create-working-dir">
<mkdir dir="${working.dir}" />
</target>
<target name="clean-up">
<antcall target="remove-working-dir" />
</target>
<target name="install-php-build">
<property name="php-build.clone.dir" value="${working.dir}/php-build-clone" />
<exec executable="git" failonerror="true">
<arg value="clone" />
<arg value="https://github.com/php-build/php-build.git" />
<arg value="${php-build.clone.dir}" />
</exec>
<exec executable="${php-build.clone.dir}/install.sh" failonerror="true">
<env key="PREFIX" value="${working.dir}"/>
</exec>
</target>
<target name="install-plugin">
<exec executable="ln" failonerror="true">
<arg value="-v" />
<arg value="-s" />
<arg value="${basedir}/src/pdo_informix.sh" />
<arg value="${working.dir}/share/php-build/plugins.d/" />
</exec>
</target>
<target name="install-bats">
<property name="bats.clone.dir" value="${working.dir}/bats-clone" />
<exec executable="git" failonerror="true">
<arg value="clone" />
<arg value="https://github.com/sstephenson/bats.git" />
<arg value="${bats.clone.dir}" />
</exec>
<exec executable="${bats.clone.dir}/install.sh" failonerror="true">
<arg value="${working.dir}" />
</exec>
</target>
<target name="run-tests" description="Runs the tests">
<exec executable="sh" failonerror="true">
<env key="PATH" value="${env.PATH}:${working.dir}/bin"/>
<arg value="-c"/>
<arg value="bats test/*bats"/>
</exec>
</target>
</project>