-
Notifications
You must be signed in to change notification settings - Fork 5
/
build.xml
234 lines (206 loc) · 9.84 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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
<?xml version="1.0" encoding="UTF-8"?>
<project name="Flexforms" default="dist">
<!-- ============================================ -->
<!-- Target: prepare -->
<!-- ============================================ -->
<target name="prepare">
<echo msg="Making directory ./build" />
<mkdir dir="./build" />
<echo msg="Making current timestamp" />
<tstamp>
<format property="zipstamp" pattern="%d%m%y%H%M%S" locale="de-DE" />
</tstamp>
<tstamp>
<format property="xmlstamp" pattern="%d.%m.%y" locale="de-DE" />
</tstamp>
<echo msg="fetching current versions" />
<xmlproperty file="./src/administrator/manifests/packages/pkg_flexforms.xml" prefix="pkg"/>
</target>
<!-- ============================================ -->
<!-- Target: build -->
<!-- ============================================ -->
<target name="build" depends="prepare">
<echo msg="Deleting files from build directory" />
<delete dir="./build/com" />
<delete dir="./build/plgs" />
<delete dir="./build/plgc" />
<delete file="./build/pkg_flexforms.xml" />
<echo msg="Copying files to build directory..." />
<echo msg="Copying admin folder" />
<copy todir="./build/com/admin">
<fileset dir="./src/administrator/components/com_flexforms">
<exclude name="flexforms.xml"/>
</fileset>
<filterchain>
<replacetokens begintoken="%%" endtoken="%%">
<token key="COMPONENTVERSION" value="${com.extension.version}" />
</replacetokens>
</filterchain>
</copy>
<echo msg="Copying site folder" />
<copy todir="./build/com/site">
<fileset dir="./src/components/com_flexforms">
</fileset>
<filterchain>
<replacetokens begintoken="%%" endtoken="%%">
<token key="COMPONENTVERSION" value="${pkg.extension.version}" />
</replacetokens>
</filterchain>
</copy>
<echo msg="Copying media folder" />
<copy todir="./build/com/media">
<fileset dir="./src/media/com_flexforms">
</fileset>
<filterchain>
<replacetokens begintoken="%%" endtoken="%%">
<token key="COMPONENTVERSION" value="${pkg.extension.version}" />
</replacetokens>
</filterchain>
</copy>
<echo msg="Copying admin language folder" />
<copy todir="./build/com/admin/language">
<fileset dir="./src/administrator/language">
<exclude name="de-DE/plg_content_flexforms.ini"/>
<exclude name="de-DE/plg_content_flexforms.sys.ini"/>
<exclude name="de-DE/plg_system_flexforms.ini"/>
<exclude name="de-DE/plg_system_flexforms.sys.ini"/>
<exclude name="en-GB/plg_content_flexforms.ini"/>
<exclude name="en-GB/plg_content_flexforms.sys.ini"/>
<exclude name="en-GB/plg_system_flexforms.ini"/>
<exclude name="en-GB/plg_system_flexforms.sys.ini"/>
</fileset>
<filterchain>
<replacetokens begintoken="%%" endtoken="%%">
<token key="COMPONENTVERSION" value="${pkg.extension.version}" />
</replacetokens>
</filterchain>
</copy>
<echo msg="Copying site language folder" />
<copy todir="./build/com/site/language">
<fileset dir="./src/language">
</fileset>
<filterchain>
<replacetokens begintoken="%%" endtoken="%%">
<token key="COMPONENTVERSION" value="${pkg.extension.version}" />
</replacetokens>
</filterchain>
</copy>
<echo msg="Copying manifest" />
<copy tofile="./build/com/flexforms.xml" file="./src/administrator/components/com_flexforms/flexforms.xml">
<filterchain>
<replacetokens begintoken="%%" endtoken="%%">
<token key="CURRENTDATE" value="${xmlstamp}" />
</replacetokens>
</filterchain>
</copy>
<echo msg="Copying content plugin files" />
<copy todir="./build/plgc">
<fileset dir="./src/plugins/content/flexforms">
</fileset>
<filterchain>
<replacetokens begintoken="%%" endtoken="%%">
<token key="PLUGINVERSION" value="${pkg.extension.version}" />
<token key="CURRENTDATE" value="${xmlstamp}" />
</replacetokens>
</filterchain>
</copy>
<echo msg="Copying content plugin language files" />
<copy todir="./build/plgc/language">
<fileset dir="./src/administrator/language">
<exclude name="de-DE/com_flexforms.ini"/>
<exclude name="de-DE/com_flexforms.sys.ini"/>
<exclude name="de-DE/plg_system_flexforms.ini"/>
<exclude name="de-DE/plg_system_flexforms.sys.ini"/>
<exclude name="en-GB/com_flexforms.ini"/>
<exclude name="en-GB/com_flexforms.sys.ini"/>
<exclude name="en-GB/plg_system_flexforms.ini"/>
<exclude name="en-GB/plg_system_flexforms.sys.ini"/>
</fileset>
<filterchain>
<replacetokens begintoken="%%" endtoken="%%">
<token key="PLUGINVERSION" value="${pkg.extension.version}" />
</replacetokens>
</filterchain>
</copy>
<echo msg="Copying system plugin files" />
<copy todir="./build/plgs">
<fileset dir="./src/plugins/system/flexforms">
</fileset>
<filterchain>
<replacetokens begintoken="%%" endtoken="%%">
<token key="PLUGINVERSION" value="${pkg.extension.version}" />
<token key="CURRENTDATE" value="${xmlstamp}" />
</replacetokens>
</filterchain>
</copy>
<echo msg="Copying content plugin language files" />
<copy todir="./build/plgs/language">
<fileset dir="./src/administrator/language">
<exclude name="de-DE/com_flexforms.ini"/>
<exclude name="de-DE/com_flexforms.sys.ini"/>
<exclude name="de-DE/plg_content_flexforms.ini"/>
<exclude name="de-DE/plg_content_flexforms.sys.ini"/>
<exclude name="en-GB/com_flexforms.ini"/>
<exclude name="en-GB/com_flexforms.sys.ini"/>
<exclude name="en-GB/plg_content_flexforms.ini"/>
<exclude name="en-GB/plg_content_flexforms.sys.ini"/>
</fileset>
<filterchain>
<replacetokens begintoken="%%" endtoken="%%">
<token key="PLUGINVERSION" value="${pkg.extension.version}" />
</replacetokens>
</filterchain>
</copy>
<echo msg="Copying package installscript" />
<copy tofile="./build/script.flexforms.php" file="./src/administrator/manifests/packages/script.flexforms.php">
</copy>
<echo msg="Copying package manifest" />
<copy tofile="./build/pkg_flexforms.xml" file="./src/administrator/manifests/packages/pkg_flexforms.xml">
<filterchain>
<replacetokens begintoken="%%" endtoken="%%">
<token key="PLG_CONTENT_ZIPNAME" value="plg_content_flexforms_${pkg.extension.version}_${zipstamp}.zip" />
<token key="PLG_SYSTEM_ZIPNAME" value="plg_system_flexforms_${pkg.extension.version}_${zipstamp}.zip" />
<token key="COM_ZIPNAME" value="com_flexforms_${pkg.extension.version}_${zipstamp}.zip" />
<token key="CURRENTDATE" value="${xmlstamp}" />
</replacetokens>
</filterchain>
</copy>
</target>
<!-- ============================================ -->
<!-- (DEFAULT) Target: dist -->
<!-- ============================================ -->
<target name="dist" depends="build">
<echo msg="Creating component archive..." />
<zip destfile="./build/com_flexforms_${pkg.extension.version}_${zipstamp}.zip">
<fileset dir="./build/com">
<include name="*" />
<include name="**/*" />
</fileset>
</zip>
<echo msg="Creating content plugin archive..." />
<zip destfile="./build/plg_content_flexforms_${pkg.extension.version}_${zipstamp}.zip">
<fileset dir="./build/plgc">
<include name="*" />
<include name="**/*" />
</fileset>
</zip>
<echo msg="Creating system plugin archive..." />
<zip destfile="./build/plg_system_flexforms_${pkg.extension.version}_${zipstamp}.zip">
<fileset dir="./build/plgs">
<include name="*" />
<include name="**/*" />
</fileset>
</zip>
<echo msg="Creating package archive..." />
<zip destfile="./build/pkg_flexforms_${pkg.extension.version}_${zipstamp}.zip">
<fileset dir="./build">
<include name="com_flexforms_${pkg.extension.version}_${zipstamp}.zip" />
<include name="plg_system_flexforms_${pkg.extension.version}_${zipstamp}.zip" />
<include name="plg_content_flexforms_${pkg.extension.version}_${zipstamp}.zip" />
<include name="pkg_flexforms.xml" />
<include name="script.flexforms.php" />
</fileset>
</zip>
<echo msg="Files copied and compressed in build directory OK!" />
</target>
</project>