forked from BabDev/Tweet-Display-Back
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
126 lines (125 loc) · 4.13 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="tweetdisplayback" default="dev_head" basedir=".">
<!-- Project properties -->
<property file="./build.properties" />
<property name="repo.dir" value="." />
<resolvepath propertyName="repo.dir.resolved" file="${repo.dir}" />
<property name="version" value="2.2.beta" />
<tstamp>
<format property="build.date" pattern="%Y-%m-%d" />
</tstamp>
<target
name="dev_head"
description="Builds test packages based on the development head"
depends="phpcs,rebuild-packages,common-files,25-package"
>
<echo msg="Deleting old master build" />
<delete quiet="yes" includeemptydirs="true">
<fileset dir="*">
<include name="releases/mod_tweetdisplayback_master.zip" />
</fileset>
</delete>
<echo msg="Build 2.5 package" />
<zip destfile="releases/mod_tweetdisplayback_master.zip">
<fileset dir="packages/2.5">
<include name="**" />
</fileset>
<fileset dir="packages/common">
<include name="**" />
</fileset>
</zip>
</target>
<target
name="release"
description="Builds release packages based on the development head"
depends="rebuild-packages,common-files,25-package"
>
<echo msg="Build 2.5 package" />
<zip destfile="releases/mod_tweetdisplayback_${version}.zip">
<fileset dir="packages/2.5">
<include name="**" />
</fileset>
<fileset dir="packages/common">
<include name="**" />
</fileset>
</zip>
<echo msg="Creating Git tag" />
<gittag repository="${repo.dir.resolved}" name="${version}" gitPath="${localgit}" />
<echo msg="Pushing Version commit and tag to GitHub" />
<gitpush repository="${repo.dir.resolved}" gitPath="${localgit}" />
<gitpush repository="${repo.dir.resolved}" tags="true" gitPath="${localgit}" />
</target>
<target name="common-files" description="Stages the common files" depends="rebuild-packages">
<echo msg="Create temp folder" />
<mkdir dir="packages/common" />
<echo msg="Copy files" />
<copy todir="packages/common/media">
<fileset dir="media" />
</copy>
<copy todir="packages/common/tmpl">
<fileset dir="tmpl" />
</copy>
<copy todir="packages/common">
<fileset dir=".">
<include name="CHANGELOG" />
<include name="helper.php" />
<include name="index.html" />
<include name="mod_tweetdisplayback.php" />
</fileset>
</copy>
</target>
<target name="25-package" description="Builds the 2.5 package" depends="rebuild-packages">
<echo msg="Create 2.5 temp folder" />
<mkdir dir="packages/2.5" />
<echo msg="Create 2.5 language folder" />
<copy todir="packages/2.5/language">
<fileset dir="language/2.5" />
</copy>
<echo msg="Create 2.5 fields folder" />
<copy todir="packages/2.5/fields">
<fileset dir="fields" />
</copy>
<echo msg="Copy 2.5 manifest" />
<copy
file="mod_tweetdisplayback.xml"
tofile="packages/2.5/mod_tweetdisplayback.xml"
overwrite="true">
<filterchain>
<replacetokens begintoken="##" endtoken="##">
<token key="DATE" value="${build.date}" />
<token key="VERSION" value="${version}" />
</replacetokens>
</filterchain>
</copy>
</target>
<target name="rebuild-packages" description="Delete old packages">
<echo msg="Deleting packages dir" />
<delete quiet="yes" includeemptydirs="true">
<fileset dir="*">
<include name="packages" />
</fileset>
</delete>
<echo msg="Creating packages dir" />
<mkdir dir="packages" />
</target>
<target name="phpcs" description="Generate codestyle report using PHP_CodeSniffer">
<echo msg="Remove previous codestyle report" />
<delete quiet="yes" includeemptydirs="true">
<fileset dir=".">
<include name="build/codesniff.txt" />
<include name="build/checkstyle.xml" />
</fileset>
</delete>
<echo msg="Running phpcs with Joomla! Platform standards" />
<phpcodesniffer
standard="${platform.dir}/build/phpcs/Joomla"
format="full"
ignorePatterns="packages/*,releases/*,tmpl/*"
file="${repo.dir}"
allowedFileExtensions="php"
verbosity="1">
<formatter type="full" outfile="${repo.dir}/build/codesniff.txt" />
<formatter type="checkstyle" outfile="${repo.dir}/build/checkstyle.xml" />
</phpcodesniffer>
</target>
</project>