forked from swiftmailer/swiftmailer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
112 lines (103 loc) · 3.94 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<!-- Ant build file for Swift Mailer (Standard Edition) -->
<project name="Swift Mailer SE" default="bundle">
<!-- Config settings -->
<property name="path" value="." />
<property name="builddir" value="${path}/build" />
<property name="src.versionfile" value="${path}/VERSION" />
<!-- Generate version info from VERSION file -->
<loadfile property="bundle.name" srcFile="${src.versionfile}">
<filterchain>
<striplinebreaks />
</filterchain>
</loadfile>
<!-- Generate version number -->
<loadfile property="bundle.version" srcFile="${src.versionfile}">
<filterchain>
<striplinebreaks />
<tokenfilter>
<replacestring from="Swift-" to=""/>
</tokenfilter>
</filterchain>
</loadfile>
<property name="src.readmefile" value="${path}/README" />
<property name="src.changesfile" value="${path}/CHANGES" />
<property name="src.libdir" value="${path}/lib" />
<property name="src.testsuite" value="${path}/test-suite" />
<property name="src.tests" value="${path}/tests" />
<property name="builddir.package" value="${builddir}/${bundle.name}" />
<property name="runtests" value="" />
<filelist id="src.licenses" dir="${path}">
<file name="LICENSE" />
</filelist>
<fileset id="build.simpletest.unneeded"
dir="${builddir.package}/test-suite/lib/simpletest">
<include name="docs/" />
<include name="tutorials/" />
<include name="extensions/" />
<include name="test/" />
<include name="packages/" />
</fileset>
<!-- Bundle all files into a central location -->
<target name="bundle" depends="prepare, clean, copy-classes">
<copy file="${src.versionfile}" todir="${builddir.package}" />
<copy file="${src.changesfile}" todir="${builddir.package}" />
<copy todir="${builddir.package}">
<filelist refid="src.licenses" />
</copy>
<copy file="${src.readmefile}" todir="${builddir.package}" />
<move file="${builddir.package}/tests/acceptance.conf.php.default"
tofile="${builddir.package}/tests/acceptance.conf.php" />
<move file="${builddir.package}/tests/smoke.conf.php.default"
tofile="${builddir.package}/tests/smoke.conf.php" />
</target>
<!-- Copy some *.default files to their required files if needed -->
<target name="prepare">
<copy file="${src.tests}/acceptance.conf.php.default"
tofile="${src.tests}/acceptance.conf.php" />
<copy file="${src.tests}/smoke.conf.php.default"
tofile="${src.tests}/smoke.conf.php" />
</target>
<!-- Clean out the build directory -->
<target name="clean">
<delete includeemptydirs="true">
<fileset dir="${builddir}" includes="**/*" />
</delete>
</target>
<!-- Copy all classes from the class path to the bundle -->
<target name="copy-classes">
<copy todir="${builddir.package}/lib">
<fileset dir="${src.libdir}" />
<filterchain>
<replacetokens>
<token key="SWIFT_VERSION_NUMBER" value="${bundle.version}"/>
</replacetokens>
</filterchain>
</copy>
<copy todir="${builddir.package}/test-suite">
<fileset dir="${src.testsuite}" />
</copy>
<copy todir="${builddir.package}/tests">
<fileset dir="${src.tests}" />
</copy>
<delete includeemptydirs="true">
<fileset refid="build.simpletest.unneeded" />
</delete>
</target>
<!-- Package up the project as a gzip file -->
<target name="package" depends="bundle">
<tar destfile="${builddir.package}.tar.gz" compression="gzip" longfile="gnu">
<fileset dir="${builddir}" />
</tar>
<delete includeemptydirs="true">
<fileset dir="${builddir.package}" includes="**" />
</delete>
</target>
<!-- Run the included unit tests -->
<target name="test" depends="prepare, clean, copy-classes">
<exec executable="php" failonerror="true">
<env key="_" value="php" />
<arg value="${builddir.package}/test-suite/run.php" />
<arg value="${runtests}" />
</exec>
</target>
</project>