-
Notifications
You must be signed in to change notification settings - Fork 14
/
build.xml
83 lines (72 loc) · 2.79 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="Infinity" default="dist">
<!-- Vars -->
<property name="slug" value="infinity-engine" />
<!-- Paths -->
<property name="phpunitpath" value="/usr/local/bin/phpunit" />
<property name="wpclipath" value="/usr/local/bin/wp" />
<property name="etc.dir" location="${basedir}/etc" />
<property name="source.dir" location="${basedir}/src" />
<property name="build.dir" location="${basedir}/build" />
<property name="build.dist" location="${build.dir}/dist" />
<property name="build.doc" location="${build.dir}/doc" />
<property name="build.env" location="${build.dir}/env" />
<!-- Target: prepare -->
<target name="prepare">
<echo message="Preparing build dir..." />
<mkdir dir="${build.dir}" />
</target>
<!-- Target: build-info-ant -->
<target name="build-info-ant">
<echo message="Writing ant build info..." />
<tstamp />
<copy file="${etc.dir}/build.ant.txt" tofile="${build.dist}/BUILD.txt" overwrite="true">
<filterchain>
<replacetokens>
<token key="BUILD_WHEN" value="${TODAY} ${TSTAMP}" />
<token key="BUILD_ANT_VER" value="${ant.version}" />
<token key="BUILD_ANT_PROJ" value="${ant.project.name}" />
<token key="BUILD_ANT_TARG" value="${ant.project.invoked-targets}" />
</replacetokens>
</filterchain>
</copy>
</target>
<!-- Target: build-info-bamboo -->
<target name="build-info-bamboo" if="bamboo.plan" depends="build-info-ant">
<echo message="Writing bamboo build info..." />
<concat destfile="${build.dist}/BUILD.txt" overwrite="yes" append="yes">
<fileset dir="${etc.dir}" includes="build.bamboo.txt" />
<filterchain>
<replacetokens>
<token key="BUILD_BAM_PLAN" value="${bamboo.plan}" />
<token key="BUILD_BAM_URL" value="${bamboo.url}" />
</replacetokens>
</filterchain>
</concat>
</target>
<!-- Target: build-info -->
<target name="build-info" depends="build-info-ant, build-info-bamboo">
<echo message="Done writing build info..." />
</target>
<!-- Target: dist-clean -->
<target name="dist-clean">
<echo message="Removing old dist artifacts..." />
<delete dir="${build.dist}" quiet="true" />
</target>
<!-- Target: dist-prepare -->
<target name="dist-prepare" depends="prepare">
<echo message="Preparing dist dir..." />
<mkdir dir="${build.dist}" />
</target>
<!-- Target: dist (default) -->
<target name="dist" depends="dist-prepare, build-info">
<echo message="Preparing build info..." />
<copy file="${etc.dir}/build.ant.txt" tofile="${build.dir}/BUILD.txt" />
<echo message="Creating zip archive..." />
<zip destfile="${build.dist}/${slug}.zip">
<zipfileset dir="${source.dir}" prefix="${slug}" />
<zipfileset file="${build.dist}/BUILD.txt" prefix="${slug}" />
</zip>
<echo message="Files copied and compressed!" />
</target>
</project>