forked from Sergey-Orlov/patch_management_system
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
executable file
·293 lines (240 loc) · 10.4 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
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
<?xml version="1.0" encoding="UTF-8"?>
<project name="main" default="install">
<!--
Profile property define file contains properties for current build.
It is usefull for different developers that have different systems and needs different configs.
If profile is not defined use default.
-->
<condition property="profile" value="default">
<not>
<isset property="profile"/>
</not>
</condition>
<!-- Load profile specified properties -->
<property name="build" value="build"/>
<!-- Load profile specified properties -->
<property file="${build}/properties/${profile}.prop"/>
<!-- Load project specified properties -->
<property file="${build}/properties/project.prop"/>
<!-- SVN structure dependent settings -->
<resolvepath propertyName="struct.root" file="."/>
<property name="struct.build" value="${struct.root}/${build}"/>
<property name="struct.build.submodules" value="${struct.build}/submodules"/>
<property name="struct.build.templates" value="${struct.build}${project.build.templates.dir}"/>
<property name="struct.code" value="${struct.root}${project.code.dir}"/>
<property name="struct.tmp" value="${struct.root}${project.tmp.dir}"/>
<property name="struct.report" value="${struct.root}${project.report.dir}"/>
<property name="struct.report.tests" value="${struct.report}/${project.report.tests.dir}"/>
<property name="struct.report.phplint" value="${struct.report}/${project.report.phplint.dir}"/>
<property name="struct.report.jslint" value="${struct.report}/${project.report.jslint.dir}"/>
<property name="struct.report.phpcs" value="${struct.report}/${project.report.phpcs.dir}"/>
<property name="struct.report.pmd" value="${struct.report}/${project.report.pmd.dir}"/>
<property name="struct.report.cpd" value="${struct.report}/${project.report.cpd.dir}"/>
<property name="struct.report.depend" value="${struct.report}/${project.report.depend.dir}"/>
<property name="struct.logs" value="${struct.root}${project.logs.dir}"/>
<property name="struct.tools" value="${struct.root}${project.tools.dir}"/>
<property name="struct.custom" value="${struct.root}${project.custom}"/>
<property name="struct.custom.modules" value="${struct.root}${project.custom.modules}"/>
<property name="struct.custom.themes" value="${struct.root}${project.custom.themes}"/>
<property name="struct.files" value="${struct.root}/${project.drupal.files.dir}"/>
<property name="struct.drake.scripts.dir" value="${struct.root}${project.drake.scripts.dir}"/>
<property name="struct.deploy.package.dir" value="${struct.root}${project.deploy.package.dir}"/>
<if>
<equals arg1="${project.settings.use_default_dir}" arg2="true" casesensitive="false" trim="true"/>
<then>
<property name="drupal.site.subdir" value="default"/>
</then>
<else>
<property name="drupal.site.subdir" value="${env.host.name}"/>
</else>
</if>
<property name="struct.build.templates.server" value="${struct.build.templates}/${env.server}"/>
<property name="drupal.files.dir" value="/sites/${drupal.site.subdir}/files"/>
<condition property="env.proxy" value="">
<not>
<isset property="env.proxy"/>
</not>
</condition>
<import file="${struct.build.submodules}/drush/build.xml"/>
<import file="${struct.build.submodules}/vhosts/build.xml"/>
<import file="${struct.build.submodules}/drupal/build.xml"/>
<import file="${struct.build.submodules}/deploy/build.xml"/>
<import file="${struct.build.submodules}/lint/build.xml"/>
<import file="${struct.build.submodules}/pmd/build.xml"/>
<import file="${struct.build.submodules}/cpd/build.xml"/>
<import file="${struct.build.submodules}/depend/build.xml"/>
<import file="${struct.build.submodules}/test/build.xml"/>
<import file="${struct.build.submodules}/codestyle/build.xml"/>
<import file="${struct.build.submodules}/project/build.xml"/>
<import file="${struct.build.submodules}/env/build.xml"/>
<import file="${struct.build.submodules}/selenium/build.xml"/>
<import file="${struct.build.submodules}/solr/build.xml"/>
<import file="${struct.build.submodules}/db/build.xml"/>
<import file="${struct.build.submodules}/memcache/build.xml"/>
<import file="${struct.build.submodules}/cdn/build.xml"/>
<target name="install" depends="clear" description="Install site">
<phingcall target="solr-run"/>
<phingcall target="drupal.install"/>
</target>
<target name="make" depends="clear" description="Install site">
<phingcall target="drupal.make"/>
<phingcall target="project.make"/>
</target>
<target name="remake" depends="clear" description="Install site">
<phingcall target="make"/>
<phingcall target="settings.create"/>
</target>
<target name="reinstall" depends="clear" description="Install site">
<phingcall target="remake"/>
<phingcall target="solr-run"/>
<phingcall target="solution.install"/>
</target>
<target name="update" description="Update site">
<phingcall target="settings.create"/>
<phingcall target="solr-run"/>
<phingcall target="solution.install"/>
</target>
<target name="verify" description="Verify code" depends="clear"/>
<target name="clear" description="Clear dirs">
<phingcall target="drupal.clear"/>
<phingcall target="dir.clear">
<property name="dir" value="${struct.code}" override="TRUE"/>
</phingcall>
<phingcall target="dir.clear">
<property name="dir" value="${struct.tmp}" override="TRUE"/>
</phingcall>
<echo>Cleaned directory</echo>
</target>
<target name="dependences.clear" description="Clear dirs">
<delete dir="${struct.tools}" includeemptydirs="true" failonerror="true"/>
<echo>Cleaned directory</echo>
</target>
<target name="test" description="Runs unit tests">
<phingcall target="selenium-run"/>
<phingcall target="run"/>
<phingcall target="selenium-stop"/>
</target>
<target name="dir.clear">
<if>
<available file="${dir}" property="dir_exists"/>
<then>
<delete dir="${dir}" includeemptydirs="true" failonerror="true"/>
</then>
</if>
</target>
<!-- ### Setup file sets
Setup file sets - patterns for different aspects of the source code.
These are used in other targets.
This is part of the initialization of the build. This target should only be
called from `init` target. -->
<target name="setup-filesets">
<!-- Define pattern sets for future reference -->
<!-- PHP files -->
<patternset id="php">
<include name="**/*.php"/>
<include name="**/*.module"/>
<include name="**/*.install"/>
<include name="**/*.inc"/>
<include name="**/*.profile"/>
<include name="**/*.test"/>
</patternset>
<!-- Javascript files -->
<patternset id="js">
<include name="**/*.js"/>
<!-- Minimized JavaScript files should not be analyzed.
In their optimized state they can not be expexted
to conform to coding standards. -->
<exclude name="**/*.min.js"/>
</patternset>
<!-- CSS files -->
<patternset id="css">
<include name="**/*.css"/>
</patternset>
<!-- Directories for community contributed code. We exclude these from
code analysis as we cannot be held responsible for any problems
here. -->
<patternset id="contrib">
<exclude name="**/contrib/**/*.*"/>
<exclude name="**/libraries/**/*.*"/>
</patternset>
<patternset id="custom">
<include name="**/custom/**/*.*"/>
</patternset>
<!-- We exclude generated files from We exclude these from code analysis
as we cannot be held responsible for any problems here. -->
<patternset id="generated">
<exclude name="**/*.features.*"/>
<exclude name="**/*.field_group.inc"/>
<exclude name="**/*.layouts.inc"/>
<exclude name="**/*.pages_default.inc"/>
<exclude name="**/*.panels_default.inc"/>
<exclude name="**/*.strongarm.inc"/>
<exclude name="**/*.views_default.inc"/>
</patternset>
<!-- Define file sets for future reference -->
<!-- All PHP files -->
<fileset id="src.php" dir="${struct.code}">
<patternset refid="php"/>
</fileset>
<!-- Custom PHP files -->
<fileset id="src.php.custom" dir="${struct.custom}">
<patternset refid="php"/>
<patternset refid="generated"/>
</fileset>
<!-- All Javascript files -->
<fileset id="src.js" dir="${struct.code}">
<patternset refid="js"/>
</fileset>
<!-- Custom Javascript files -->
<fileset id="src.js.custom" dir="${struct.code}">
<patternset refid="js"/>
</fileset>
<!-- All CSS files -->
<fileset id="src.css" dir="${struct.code}">
<patternset refid="css"/>
</fileset>
<!-- Custom CSS files -->
<fileset id="src.css.custom" dir="${struct.code}">
<patternset refid="css"/>
<patternset refid="contrib"/>
</fileset>
</target>
<target name="test-forks" description="Check if project contains forks" depends="clear">
<drush command="pm-refresh" bin="${project.drush.bin}">
<option name="root">"${struct.code}"</option>
</drush>
<delete dir="${struct.tmp}/code" includeemptydirs="true" failonerror="true"/>
<delete file="${struct.report.tests}/${project.report.fork.file}"/>
<mkdir dir="${struct.report.tests}"/>
<echo>Check for forks starts</echo>
<if>
<istrue value="${project.make.no.patches.txt}"/>
<then>
<drush command="make" assume="yes" bin="${project.drush.bin}">
<param>'${project.make.file}'</param>
<param>'${struct.tmp}/code'</param>
<option name="no-patch-txt"/>
</drush>
</then>
<else>
<drush command="make" assume="yes" bin="${project.drush.bin}">
<param>'${project.make.file}'</param>
<param>'${struct.tmp}/code"</param>
</drush>
</else>
</if>
<phingcall target="cache.clear"/>
<drush command="pm-enable" assume="yes" bin="${project.drush.bin}">
<param>'hacked_make'</param>
<option name="root">'${struct.code}'</option>
</drush>
<drush command="hacked-make-list-projects" bin="${project.drush.bin}">
<param>'${struct.tmp}/code'</param>
<option name="force-rebuild"/>
<option name="root">'${struct.code}'</option>
<option name="xml">'${struct.report.tests}/${project.report.fork.file}'</option>
<option name="exclude">'${project.report.fork.exclude}'</option>
</drush>
<echo>Check for forks finished</echo>
</target>
</project>