This repository has been archived by the owner on Dec 7, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 190
/
build.xml
84 lines (71 loc) · 3.22 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<?xml version="1.0" encoding="UTF-8"?>
<project name="dbunit" default="setup">
<target name="setup" depends="clean,install-dependencies"/>
<target name="clean" unless="clean.done" description="Cleanup build artifacts">
<delete dir="${basedir}/build"/>
<delete dir="${basedir}/tools"/>
<delete dir="${basedir}/vendor"/>
<delete file="${basedir}/composer.lock"/>
<property name="clean.done" value="true"/>
</target>
<target name="prepare" unless="prepare.done" depends="clean,install-dependencies,install-tools" description="Prepare for build">
<mkdir dir="${basedir}/build"/>
<property name="prepare.done" value="true"/>
</target>
<target name="install-dependencies" depends="clean" description="Install dependencies with Composer">
<exec executable="composer" taskname="composer">
<arg value="update"/>
<arg value="--no-interaction"/>
<arg value="--no-progress"/>
<arg value="--no-ansi"/>
<arg value="--no-suggest"/>
<arg value="--optimize-autoloader"/>
<arg value="--prefer-stable"/>
</exec>
</target>
<target name="install-tools" unless="tools-installed" depends="-tools-installed" description="Install tools using phive">
<exec executable="phive" taskname="phive">
<arg value="install"/>
</exec>
</target>
<target name="package" depends="prepare,-get-version-number-from-git" description="Package as PHAR">
<copy todir="${basedir}/build/phar" file="${basedir}/LICENSE" />
<copy todir="${basedir}/build/phar" file="${basedir}/manifest.xml" />
<copy todir="${basedir}/build/phar/dbunit">
<fileset dir="${basedir}/src">
<include name="**/*" />
</fileset>
</copy>
<copy file="${basedir}/vendor/symfony/yaml/LICENSE" tofile="${basedir}/build/phar/symfony/LICENSE"/>
<copy todir="${basedir}/build/phar/symfony">
<fileset dir="${basedir}/vendor/symfony">
<include name="**/*.php" />
<exclude name="**/Tests/**" />
</fileset>
</copy>
<exec executable="${basedir}/tools/phpab" taskname="phpab">
<arg value="--all" />
<arg value="--phar" />
<arg value="--output" />
<arg path="${basedir}/build/dbunit-${version}.phar" />
<arg path="${basedir}/build/phar" />
</exec>
<delete dir="${basedir}/build/phar"/>
<exec executable="gpg" failonerror="true">
<arg value="--local-user"/>
<arg value="[email protected]"/>
<arg value="--armor"/>
<arg value="--detach-sign"/>
<arg path="${basedir}/build/dbunit-${version}.phar"/>
</exec>
</target>
<target name="-get-version-number-from-git">
<exec executable="bash" outputproperty="version" failonerror="true" dir="${basedir}">
<arg value="-c" />
<arg value="/usr/bin/git describe --abbrev=0" />
</exec>
</target>
<target name="-tools-installed">
<available file="${basedir}/tools" property="tools-installed" type="dir"/>
</target>
</project>