-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
81 lines (70 loc) · 2.57 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="JMB Donation" default="make" basedir=".">
<tstamp>
<format property="build.date" pattern="%Y-%m-%d" />
</tstamp>
<property file="build.ini" />
<target name="help">
<echo>Use `$ phing -l` to list the available targets.</echo>
</target>
<target name="make-dev" description="Builds the extension release package for development testing.">
<echo msg="Deleting old development build." />
<delete quiet="yes" includeemptydirs="true">
<fileset dir="releases">
<include name="plg_${extension}_dev.zip" />
</fileset>
</delete>
<echo msg="Making the development ${extension} package." />
<mkdir dir="releases" />
<zip destfile="releases/plg_${extension}_dev.zip">
<fileset dir=".">
<include name="fields/**" />
<include name="language/**" />
<include name="layouts/**" />
<include name="media/**" />
<include name="license.*" />
<include name="install.php" />
<include name="${extension}.*" />
</fileset>
</zip>
</target>
<target name="make" description="Builds the extension release package for a version.">
<echo msg="Making the ${extension} package for version ${version}." />
<zip destfile="releases/plg_${extension}_${version}.zip">
<fileset dir=".">
<include name="fields/**" />
<include name="language/**" />
<include name="layouts/**" />
<include name="media/**" />
<include name="license.*" />
<include name="install.php" />
<include name="${extension}.*" />
</fileset>
</zip>
</target>
<target name="tag" description="Tags the repository using git.">
<gitcommit repository="." message="Tagging release `${version}`." allFiles="true" />
<gittag repository="." name="${version}" annotate="true" message="${version}" />
<echo>Push tags manually with `$ git push --tags origin`.</echo>
</target>
<target name="set-version" description="Sets the <version> tag in all XML files with the version from the build.ini file.">
<phingcall target="replace-xml">
<property name="tag" value="version" />
<property name="tagValue" value="${version}" />
</phingcall>
</target>
<target name="replace-xml" description="[PRIVATE] Sets an XML tag with a new value.">
<echo message="Replacing '${tag}' tag with '${tagValue}'."/>
<reflexive>
<fileset dir=".">
<include pattern="**/*.xml" />
</fileset>
<filterchain>
<replaceregexp>
<regexp pattern="<${tag}>(.*?)</${tag}>"
replace="<${tag}>${tagValue}</${tag}>"/>
</replaceregexp>
</filterchain>
</reflexive>
</target>
</project>