forked from liferay/liferay-portal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-test-plugins.xml
247 lines (207 loc) · 6.54 KB
/
build-test-plugins.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
<?xml version="1.0"?>
<project name="portal-test-plugins" basedir="." default="test" xmlns:antelope="antlib:ise.antelope.tasks">
<import file="build-test.xml" />
<target name="deploy-extra-apps">
<fail message="Please set the property ${extra.apps.zip.file.name}" unless="extra.apps.zip.file.name" />
<get-auto-deploy-dir />
<unzip
dest="${auto.deploy.dir}"
src="${extra.apps.zip.file.name}"
/>
</target>
<target name="deploy-simple-server-plugins">
<get-auto-deploy-dir />
<if>
<equals arg1="${app.server.type}" arg2="jboss" />
<then>
<echo file="${lp.plugins.dir}/build.${user.name}.properties">app.server.parent.dir=${app.server.parent.dir}
app.server.type=${app.server.type}
app.server.jboss.dir=${app.server.dir}
auto.deploy.dir=${auto.deploy.dir}
plugins.includes=${plugins.includes}</echo>
</then>
<else>
<echo file="${lp.plugins.dir}/build.${user.name}.properties">app.server.parent.dir=${app.server.parent.dir}
app.server.type=${app.server.type}
auto.deploy.dir=${auto.deploy.dir}
plugins.includes=${plugins.includes}</echo>
</else>
</if>
<if>
<equals arg1="${java.security}" arg2="true" />
<then>
<if>
<not>
<resourcecontains
resource="${lp.plugins.dir}/${plugin.types}/${portlet.plugins.includes}/docroot/WEB-INF/liferay-plugin-package.properties"
substring="security-manager-enabled=true"
/>
</not>
<then>
<echo append="true" file="${lp.plugins.dir}/${plugin.types}/${portlet.plugins.includes}/docroot/WEB-INF/liferay-plugin-package.properties">
security-manager-enabled=true</echo>
</then>
</if>
</then>
</if>
<if>
<equals arg1="${liferay.portal.bundle}" arg2="6.1.20" />
<then>
<echo file="${lp.plugins.dir}/build.${user.name}.properties" append="true">
app.server.tomcat.dir=${app.server.parent.dir}/tomcat-7.0.27</echo>
</then>
</if>
<if>
<or>
<contains string="${liferay.portal.bundle}" substring="6.2.10" />
<equals arg1="${liferay.portal.bundle}" arg2="6.2.2" />
<equals arg1="${liferay.portal.bundle}" arg2="6.2.3" />
</or>
<then>
<echo file="${lp.plugins.dir}/build.${user.name}.properties" append="true">
app.server.tomcat.dir=${app.server.parent.dir}/tomcat-7.0.42</echo>
</then>
</if>
<for list="${plugins.includes}" param="plugin">
<sequential>
<get-testcase-property property.name="portlet.properties.@{plugin}" />
<if>
<isset property="portlet.properties.@{plugin}" />
<then>
<propertycopy
from="portlet.properties.@{plugin}"
name="portlet.properties"
override="true"
/>
<echo file="${lp.plugins.dir}/${plugin.types}/@{plugin}/docroot/WEB-INF/src/portlet-ext.properties">${portlet.properties}</echo>
</then>
<else>
<delete file="${lp.plugins.dir}/${plugin.types}/@{plugin}/docroot/WEB-INF/src/portlet-ext.properties" />
</else>
</if>
<if>
<equals arg1="@{plugin}" arg2="so-portlet" />
<then>
<echo file="${lp.plugins.dir}/${plugin.types}/@{plugin}/overwrite/META-INF/custom_jsps/html/portlet/dockbar/license_warning.jsp" />
</then>
</if>
</sequential>
</for>
<if>
<matches pattern="http" string="${test.build.plugins.war.zip.url}" />
<then>
<for list="${plugins.includes}" param="plugin.includes">
<sequential>
<pathconvert pathsep="," property="plugin.war" setonempty="false">
<path>
<fileset
dir="plugins"
includes="@{plugin.includes}*.war"
/>
</path>
</pathconvert>
<propertyregex
input="${plugin.war}"
override="true"
property="plugin.war"
regexp=",.*"
replace=""
/>
<if>
<isset property="plugin.war" />
<then>
<get-auto-deploy-dir />
<copy file="${plugin.war}" todir="${auto.deploy.dir}" />
<var name="plugin.war" unset="true" />
</then>
<else>
<ant dir="${lp.plugins.dir}/${plugin.types}/@{plugin.includes}" inheritAll="false">
<target name="clean" />
<target name="deploy" />
</ant>
</else>
</if>
</sequential>
</for>
</then>
<else>
<if>
<isset property="plugin.types" />
<then>
<ant dir="${lp.plugins.dir}/${plugin.types}" target="clean" inheritAll="false" />
<ant dir="${lp.plugins.dir}/${plugin.types}" target="deploy" inheritAll="false" />
</then>
<else>
<ant dir="${lp.plugins.dir}" target="clean" inheritAll="false" />
<ant dir="${lp.plugins.dir}" target="deploy" inheritAll="false" />
</else>
</if>
</else>
</if>
<delete dir="${lp.plugins.dir}/dist" />
<mkdir dir="${lp.plugins.dir}/dist" />
</target>
<target name="test-plugin">
<if>
<or>
<contains string="${test.plugin}" substring="layouttpl" />
<contains string="${test.plugin}" substring="shared" />
</or>
<then>
<var name="select" value="\2" />
</then>
<else>
<var name="select" value="\2s" />
</else>
</if>
<if>
<equals arg1="${test.plugin}" arg2="portal-http-service" />
<then>
<var name="test.plugin.type" value="shared" />
</then>
<else>
<propertyregex
input="${test.plugin}"
override="true"
property="test.plugin.type"
regexp="(\w+-)+(\w+)"
select="${select}"
/>
</else>
</if>
<get-auto-deploy-dir />
<echo file="${lp.plugins.dir}/build.${user.name}.properties">app.server.parent.dir=${app.server.parent.dir}
app.server.type=${app.server.type}
auto.deploy.dir=${auto.deploy.dir}
plugins.includes=${test.plugin}</echo>
<ant dir="${lp.plugins.dir}/${test.plugin.type}/${test.plugin}" target="clean" inheritAll="false" />
<if>
<contains string="${test.plugin}" substring="portlet" />
<then>
<ant dir="${lp.plugins.dir}/${test.plugin.type}/${test.plugin}" target="compile-jsp" inheritAll="false" />
</then>
<else>
<ant dir="${lp.plugins.dir}/${test.plugin.type}/${test.plugin}" target="compile" inheritAll="false" />
</else>
</if>
</target>
<target name="test-plugin-group">
<if>
<not>
<isset property="test.plugin.group.index" />
</not>
<then>
<fail>Use "ant test-plugin-group -Dtest.plugin.group.index=0".</fail>
</then>
</if>
<property file="${project.dir}/test.plugin.names.properties" />
<propertycopy from="TEST_PLUGIN_GROUP_${test.plugin.group.index}" name="test.plugins" />
<for list="${test.plugins}" param="test.plugin">
<sequential>
<antcall target="test-plugin">
<param name="test.plugin" value="@{test.plugin}" />
</antcall>
</sequential>
</for>
</target>
</project>