This repository has been archived by the owner on Aug 29, 2018. It is now read-only.
forked from joomla-extensions/weblinks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
115 lines (100 loc) · 4.32 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
113
114
115
<?xml version="1.0" encoding="UTF-8"?>
<project name="Weblinks" 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." depends="rebuild-extension-archives">
<echo msg="Deleting old development build." />
<delete quiet="yes" includeemptydirs="true">
<fileset dir="releases">
<include name="pkg_${package}_dev.zip" />
</fileset>
</delete>
<echo msg="Making the development ${package} package ." />
<zip destfile="releases/pkg_${package}_dev.zip">
<fileset dir="build">
<include name="**" />
</fileset>
</zip>
</target>
<target name="make" description="Builds the extension release package for a version." depends="rebuild-extension-archives">
<echo msg="Making the ${package} package for version ${version}." />
<zip destfile="releases/pkg_${package}_${version}.zip">
<fileset dir="build">
<include name="**" />
</fileset>
</zip>
</target>
<target name="rebuild-extension-archives" description="Rebuilds the archive (zip) files for each extension.">
<mkdir dir="build" />
<mkdir dir="releases" />
<echo msg="Cleaning build directory." />
<delete quiet="yes" includeemptydirs="true">
<fileset dir="*">
<include name="build" />
</fileset>
</delete>
<echo msg="Creating extension archives (zip files)." />
<foreach param="extension" target="build-archive">
<fileset dir="src">
<include name="com_*" />
<include name="mod_*" />
<include name="plg_*" />
<include name="tpl_*" />
</fileset>
</foreach>
<copy todir="build" >
<fileset dir="src">
<include name="language/**" />
<include name="pkg_${package}.xml" />
</fileset>
</copy>
</target>
<target name="build-archive" description="Builds an archive for a single extension.">
<zip destfile="build/${extension}.zip" basedir="src/${extension}" />
</target>
<target name="replace-deploy-version" description="Replaces the `__DEPLOY_VERSION__` markers with a designated tag and commits the changes.">
<echo>Replacing "__DEPLOY_VERSION__" with "${version}".</echo>
<reflexive>
<fileset dir=".">
<include pattern="*.md" />
<include pattern="src/**/*.php" />
</fileset>
<filterchain>
<replaceregexp>
<regexp pattern="__DEPLOY_VERSION__" replace="${version}"/>
</replaceregexp>
</filterchain>
</reflexive>
</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}" />
<!--<gitpush repository="." all="true" />-->
<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="src/**/*.xml" />
</fileset>
<filterchain>
<replaceregexp>
<regexp pattern="<${tag}>(.*?)</${tag}>"
replace="<${tag}>${tagValue}</${tag}>"/>
</replaceregexp>
</filterchain>
</reflexive>
</target>
</project>