This repository has been archived by the owner on Jul 13, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
/
build.xml
131 lines (129 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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
<?xml version="1.0" encoding="UTF-8"?>
<project name="tweetdisplayback" default="dev_head" basedir=".">
<!-- Project properties -->
<property name="repo.dir" value="." />
<property name="version" value="4.0.0.beta" />
<tstamp>
<format property="build.date" pattern="yyyy-MM-dd" />
</tstamp>
<macrodef name="git">
<attribute name="command" />
<attribute name="dir" default="" />
<element name="args" optional="true" />
<sequential>
<exec executable="git" dir="@{dir}">
<arg value="@{command}" />
<args/>
</exec>
</sequential>
</macrodef>
<target
name="dev_head"
description="Builds test packages based on the development head"
depends="rebuild-packages,build-packages"
>
<echo message="Deleting old master build" />
<delete quiet="true">
<fileset dir=".">
<include name="mod_tweetdisplayback_master.zip" />
</fileset>
</delete>
<echo message="Build package" />
<zip destfile="mod_tweetdisplayback_master.zip">
<fileset dir="packages">
<include name="**" />
</fileset>
</zip>
</target>
<target
name="release"
description="Builds release packages based on the development head"
depends="rebuild-packages,build-packages"
>
<echo message="Build package" />
<zip destfile="releases/mod_tweetdisplayback_${version}.zip">
<fileset dir="packages">
<include name="**" />
</fileset>
</zip>
<echo message="Committing version" />
<git command="commit">
<args>
<arg value="-S" />
<arg value="-a" />
<arg value="-m 'Prepare ${version} release'" />
</args>
</git>
<echo message="Creating Git tag" />
<git command="tag">
<args>
<arg value="-s" />
<arg value="${version}" />
<arg value="-m 'Tagged ${version} release'" />
</args>
</git>
<echo message="Pushing Version commit and tag to GitHub" />
<git command="push">
</git>
<git command="push">
<args>
<arg value="--tags" />
</args>
</git>
</target>
<target name="build-packages" description="Stages the common files" depends="rebuild-packages">
<echo message="Create temp folder" />
<mkdir dir="packages" />
<echo message="Copy files" />
<copy todir="packages/fields">
<fileset dir="fields" />
</copy>
<copy todir="packages/language">
<fileset dir="language" />
</copy>
<copy todir="packages/libraries">
<fileset dir="libraries" />
</copy>
<copy todir="packages/media">
<fileset dir="media" />
</copy>
<copy todir="packages/tmpl">
<fileset dir="tmpl" />
</copy>
<copy todir="packages">
<fileset dir=".">
<include name="helper.php" />
<include name="index.html" />
<include name="mod_tweetdisplayback.php" />
<include name="mod_tweetdisplayback.xml" />
<include name="script.php" />
</fileset>
</copy>
<replace file="packages/mod_tweetdisplayback.xml" token="##DATE##" value="${build.date}" />
<replace file="packages/mod_tweetdisplayback.xml" token="##VERSION##" value="${version}" />
</target>
<target name="rebuild-packages" description="Delete old packages">
<echo message="Deleting packages dir" />
<delete dir="${repo.dir}/packages" includeemptydirs="true" failonerror="true" />
<echo message="Creating packages dir" />
<mkdir dir="packages" />
</target>
<target name="phpcs" description="Generate codestyle report using PHP_CodeSniffer">
<echo message="Remove previous codestyle report" />
<delete quiet="true">
<fileset dir=".">
<include name="build/logs/checkstyle.xml" />
</fileset>
</delete>
<echo message="Running phpcs with Joomla! Coding Standards" />
<exec executable="phpcs">
<arg value="--report=checkstyle" />
<arg value="--extensions=php" />
<arg value="-p" />
<arg value="--report-file=${repo.dir}/build/logs/checkstyle.xml" />
<arg value="--standard=${repo.dir}/build/phpcs/Joomla" />
<arg value="--ignore=${repo.dir}/packages/*,${repo.dir}/releases/*,${repo.dir}/tmpl/*,${repo.dir}/libraries/*,${repo.dir}/build/*" />
<arg path="${repo.dir}" />
</exec>
</target>
</project>