-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.xml
261 lines (219 loc) · 7.95 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
<?xml version="1.0"?>
<!DOCTYPE project>
<project name="plugins" basedir="." default="all" xmlns:antelope="antlib:ise.antelope.tasks">
<property name="project.dir" value="." />
<import file="build-common.xml" />
<target name="all">
<antcall target="clean" />
<antcall target="deploy" />
</target>
<target name="build-service">
<ant dir="portlets" target="build-service" inheritAll="false" />
<ant dir="webs" target="build-service" inheritAll="false" />
</target>
<target name="build-summary">
<java
classname="com.liferay.portal.tools.PluginsSummaryBuilder"
classpathref="portal.classpath"
fork="true"
newenvironment="true"
>
<jvmarg value="-Dexternal-properties=com/liferay/portal/tools/dependencies/portal-tools.properties" />
<jvmarg value="-Dplugins.dir=${project.dir}" />
</java>
<java
classname="com.liferay.portal.tools.XSLTBuilder"
classpathref="portal.classpath"
fork="true"
newenvironment="true"
>
<jvmarg value="-Dexternal-properties=com/liferay/portal/tools/dependencies/portal-tools.properties" />
<arg value="${project.dir}/summary.xml" />
<arg value="${project.dir}/summary.xsl" />
<arg value="${project.dir}/summary.html" />
</java>
</target>
<target name="clean">
<ant dir="hooks" target="clean" inheritAll="false" />
<ant dir="layouttpl" target="clean" inheritAll="false" />
<ant dir="portlets" target="clean" inheritAll="false" />
<ant dir="themes" target="clean" inheritAll="false" />
<ant dir="webs" target="clean" inheritAll="false" />
</target>
<target name="compile">
<ant dir="hooks" target="compile" inheritAll="false" />
<ant dir="layouttpl" target="compile" inheritAll="false" />
<ant dir="portlets" target="compile" inheritAll="false" />
<ant dir="themes" target="compile" inheritAll="false" />
<ant dir="webs" target="compile" inheritAll="false" />
</target>
<target name="deploy">
<ant dir="hooks" target="deploy" inheritAll="false" />
<ant dir="layouttpl" target="deploy" inheritAll="false" />
<ant dir="portlets" target="deploy" inheritAll="false" />
<ant dir="themes" target="deploy" inheritAll="false" />
<ant dir="webs" target="deploy" inheritAll="false" />
</target>
<target name="direct-deploy">
<ant dir="hooks" target="direct-deploy" inheritAll="false" />
<ant dir="layouttpl" target="direct-deploy" inheritAll="false" />
<ant dir="portlets" target="direct-deploy" inheritAll="false" />
<ant dir="themes" target="direct-deploy" inheritAll="false" />
<ant dir="webs" target="direct-deploy" inheritAll="false" />
</target>
<target name="ear">
<delete dir="dist/liferay-portal.ear" />
<delete dir="dist/modules" />
<copy todir="dist" overwrite="yes">
<fileset
dir="${project.dir}/tools/ear_tmpl"
/>
</copy>
<copy todir="dist/modules/APP-INF/lib">
<fileset dir="${app.server.lib.global.dir}">
<include name="*.jar" />
</fileset>
</copy>
<fileset dir="dist/modules" id="ear.dependency.libraries">
<include name="APP-INF/lib/*.jar" />
</fileset>
<pathconvert pathsep=" " property="ear.dependency.libraries.converted" refid="ear.dependency.libraries">
<mapper>
<chainedmapper>
<flattenmapper />
<globmapper from="*.jar" to="APP-INF/lib/*.jar" />
</chainedmapper>
</mapper>
</pathconvert>
<war
basedir="${app.server.portal.dir}"
destfile="dist/modules/liferay-portal.war"
>
<manifest>
<attribute name="Class-Path" value="${ear.dependency.libraries.converted}" />
</manifest>
</war>
<for param="module.full.path">
<path>
<dirset
dir="${app.server.deploy.dir}"
excludes="${plugins.ear.excludes}"
includes="${plugins.ear.includes}"
/>
</path>
<sequential>
<antelope:stringutil string="@{module.full.path}" property="module.full.path.unix">
<antelope:replace regex="\\" replacement="/" />
</antelope:stringutil>
<antelope:grep in="${module.full.path.unix}" regex="(.*/)(.*)" group="2" property="module.name" />
<war
basedir="@{module.full.path}"
destfile="dist/modules/${module.name}.war"
/>
</sequential>
</for>
<fileset dir="dist/modules" id="ear.modules">
<include name="*.war" />
</fileset>
<pathconvert pathsep="," property="ear.modules.converted" refid="ear.modules">
<mapper>
<chainedmapper>
<flattenmapper />
</chainedmapper>
</mapper>
</pathconvert>
<java
classname="com.liferay.portal.tools.EARBuilder"
classpathref="portal.classpath"
fork="true"
newenvironment="true"
>
<jvmarg value="-Dexternal-properties=com/liferay/portal/tools/dependencies/portal-tools.properties" />
<arg value="${basedir}/dist/modules/META-INF/application.xml" />
<arg value="${ear.modules.converted}" />
</java>
<ear
appxml="dist/modules/META-INF/application.xml"
basedir="dist/modules"
destfile="dist/liferay-portal.ear"
excludes="META-INF/application.xml"
includes="**/*.jar,*.war,META-INF/*.xml"
/>
<delete dir="dist/modules" />
</target>
<target name="extract-plugins-sdk">
<mkdir dir="dist" />
<delete file="dist/liferay-plugins-sdk-${lp.version}.zip" />
<zip
basedir="."
destfile="dist/liferay-plugins-sdk-${lp.version}.zip"
excludes=".git/**,build.*.properties,dist/**,clients/*-client/**,ext/*-ext/**,hooks/*-hook/**,layouttpl/*-layouttpl/**,portlets/*-portlet/**,private-plugins.txt,themes/*-theme/**,webs/*-web/**"
/>
</target>
<target name="format-javadoc">
<ant dir="hooks" target="format-javadoc" inheritAll="false" />
<ant dir="layouttpl" target="format-javadoc" inheritAll="false" />
<ant dir="portlets" target="format-javadoc" inheritAll="false" />
<ant dir="themes" target="format-javadoc" inheritAll="false" />
<ant dir="webs" target="format-javadoc" inheritAll="false" />
</target>
<target name="setup-eclipse">
<ant dir="hooks" target="clean" inheritAll="false" />
<ant dir="portlets" target="clean" inheritAll="false" />
<ant dir="webs" target="clean" inheritAll="false" />
<ant dir="hooks" target="compile" inheritAll="false" />
<ant dir="portlets" target="compile" inheritAll="false" />
<ant dir="webs" target="compile" inheritAll="false" />
<ant dir="hooks" target="setup-eclipse" inheritAll="false" />
<ant dir="portlets" target="setup-eclipse" inheritAll="false" />
<ant dir="webs" target="setup-eclipse" inheritAll="false" />
</target>
<target name="war">
<ant dir="hooks" target="war" inheritAll="false" />
<ant dir="layouttpl" target="war" inheritAll="false" />
<ant dir="portlets" target="war" inheritAll="false" />
<ant dir="themes" target="war" inheritAll="false" />
<ant dir="webs" target="war" inheritAll="false" />
</target>
<target name="zip-portal">
<if>
<not>
<equals arg1="${app.server.type}" arg2="tomcat" />
</not>
<then>
<fail>
.
This task only works when the property "app.server.type" is "tomcat". However,
the outputted files will work in any supported application server.
</fail>
</then>
</if>
<tstamp>
<format property="tstamp.value" pattern="yyyyMMddkkmmssSSS" />
</tstamp>
<zip destfile="dist/liferay-portal-dependencies-${tstamp.value}.zip">
<zipfileset
dir="${app.server.lib.global.dir}"
prefix="liferay-portal-dependencies-${tstamp.value}"
/>
</zip>
<delete file="dist/liferay-portal-${lp.version}.war" failonerror="false" />
<zip
basedir="${app.server.portal.dir}"
destfile="dist/liferay-portal-${tstamp.value}.war"
excludes="html/js/editor/_fckeditor/**,html/js/editor/fckeditor/_samples/**"
/>
<copy todir="${tstamp.value}/WEB-INF/lib">
<fileset
dir="lib"
includes="ccpp.jar"
/>
</copy>
<zip
basedir="${tstamp.value}"
destfile="dist/liferay-portal-${tstamp.value}.war"
update="yes"
/>
<delete dir="${tstamp.value}" />
</target>
</project>