4 <project name="build-common-ext">
5 <property name="project.dir" value="../.." />
7 <import file="../build-common-plugin.xml" />
9 <target name="build-db">
13 WARNING: Support for ServiceBuilder in EXT plugins will be deprecated in future
14 versions. EXT plugins are designed to override the portal's core code that
15 cannot be done with hooks, layout templates, portlets, or themes. EXT plugins
16 are not meant to contain new custom services. Please migrate your service.xml to
20 <antcall target="build-common-plugin.build-db" />
23 <target name="build-service">
24 <path id="service.classpath">
25 <path refid="lib.classpath" />
26 <path refid="portal.classpath" />
27 <fileset dir="${app.server.lib.portal.dir}" includes="commons-digester.jar,commons-lang.jar,easyconf.jar" />
28 <!--<fileset dir="docroot/WEB-INF/lib" includes="*.jar" />
29 <pathelement location="docroot/WEB-INF/classes" />-->
35 WARNING: Support for ServiceBuilder in EXT plugins will be deprecated in future
36 versions. EXT plugins are designed to override the portal's core code that
37 cannot be done with hooks, layout templates, portlets, or themes. EXT plugins
38 are not meant to contain new custom services. Please migrate your service.xml to
43 classname="com.liferay.portal.tools.servicebuilder.ServiceBuilder"
44 classpathref="service.classpath"
46 <arg value="-Dexternal-properties=com/liferay/portal/tools/dependencies/portal-tools.properties" />
47 <arg value="-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger" />
48 <arg value="service.input.file=${service.file}" />
49 <arg value="service.hbm.file=${basedir}/docroot/WEB-INF/ext-impl/src/META-INF/ext-hbm.xml" />
50 <arg value="service.orm.file=${basedir}/docroot/WEB-INF/ext-impl/src/META-INF/ext-orm.xml" />
51 <arg value="service.model.hints.file=${basedir}/docroot/WEB-INF/ext-impl/src/META-INF/ext-model-hints.xml" />
52 <arg value="service.spring.file=${basedir}/docroot/WEB-INF/ext-impl/src/META-INF/ext-spring.xml" />
53 <arg value="service.api.dir=${basedir}/docroot/WEB-INF/ext-service/src" />
54 <arg value="service.impl.dir=${basedir}/docroot/WEB-INF/ext-impl/src" />
55 <arg value="service.json.file=${basedir}/docroot/WEB-INF/ext-web/docroot/html/js/liferay/service.js" />
56 <arg value="service.remoting.file=${basedir}/docroot/WEB-INF/ext-web/docroot/WEB-INF/remoting-servlet-ext.xml" />
57 <arg value="service.sql.dir=${basedir}/docroot/WEB-INF/sql" />
58 <arg value="service.sql.file=portal-tables.sql" />
59 <arg value="service.sql.indexes.file=indexes.sql" />
60 <arg value="service.sql.indexes.properties.file=indexes.properties" />
61 <arg value="service.sql.sequences.file=sequences.sql" />
62 <arg value="service.bean.locator.util=com.liferay.portal.kernel.bean.PortalBeanLocatorUtil" />
63 <arg value="service.props.util=com.liferay.portal.util.PropsUtil" />
66 <delete file="ServiceBuilder.temp" />
69 <target name="check-ext-property">
72 <available file="${property.name}" />
78 ${property.name} does not exist!
80 The properties "app.server.dir", "app.server.zip.name", and "ext.work.dir" are
81 not properly specified.
83 The directory denoted by the property "ext.work.dir" will be deleted and the zip
84 file denoted by the property "app.server.zip.name" will be unzipped into this
85 directory. The property "app.server.dir" must point to the application server
86 directory that was unzipped into "ext.work.dir".
88 For example, if "ext.work.dir" points to "C:\ext-work", and
89 "app.server.zip.name" points to "C:\files\liferay-portal-tomcat-6.0-${lp.version}.zip",
90 then "app.server.dir" should point to
91 "C:\ext-work\liferay-portal-${lp.version}\tomcat-6.0.18".
98 <delete includeemptydirs="true">
99 <fileset dir="docroot/WEB-INF" includes="ext-*/classes/**,ext-*/ext-*.jar" />
102 <delete file="${plugin.file}" />
105 <target name="clean-app-server">
106 <antcall target="check-ext-property">
107 <param name="property.name" value="${app.server.zip.name}" />
110 <antcall target="check-ext-property">
111 <param name="property.name" value="${ext.work.dir}" />
114 <antcall target="clean" />
116 <delete dir="${app.server.dir}" />
118 <unzip src="${app.server.zip.name}" dest="${ext.work.dir}" />
121 <target name="compile">
122 <antcall target="compile-with-global-class-loader">
123 <param name="module.name" value="service" />
126 <antcall target="compile-with-portal-class-loader">
127 <param name="module.class.path" value="docroot/WEB-INF/ext-service/classes" />
128 <param name="module.name" value="util-bridges" />
131 <antcall target="compile-with-portal-class-loader">
132 <param name="module.class.path" value="docroot/WEB-INF/ext-service/classes;docroot/WEB-INF/ext-util-bridges/classes" />
133 <param name="module.name" value="util-java" />
136 <antcall target="compile-with-portal-class-loader">
137 <param name="module.class.path" value="docroot/WEB-INF/ext-service/classes;docroot/WEB-INF/ext-util-bridges/classes;docroot/WEB-INF/ext-util-java/classes" />
138 <param name="module.name" value="util-taglib" />
141 <antcall target="compile-with-portal-class-loader">
142 <param name="module.class.path" value="docroot/WEB-INF/ext-service/classes;docroot/WEB-INF/ext-util-bridges/classes;docroot/WEB-INF/ext-util-java/classes;docroot/WEB-INF/ext-util-taglib/classes" />
143 <param name="module.name" value="impl" />
147 <fileset dir="docroot/WEB-INF/ext-impl/classes" includes="portal-*.properties,system-*.properties" />
151 <available file="docroot/WEB-INF/ext-web/docroot/WEB-INF/lib" />
156 "docroot\WEB-INF\ext-web\docroot\WEB-INF\lib" must not exist. Put JAR files in
157 "docroot\WEB-INF\ext-lib\portal" that need to be accessible to the portal class
164 <target name="compile-with-global-class-loader">
165 <mkdir dir="docroot/WEB-INF/ext-lib/global" />
166 <mkdir dir="docroot/WEB-INF/ext-${module.name}/classes" />
168 <path id="plugin-lib.classpath">
169 <fileset dir="docroot/WEB-INF/ext-lib/global" includes="*.jar" />
170 <pathelement location="docroot/WEB-INF/ext-${module.name}/classes" />
173 <antcall target="compile-java">
174 <param name="javac.classpathref" value="plugin.classpath" />
175 <param name="javac.destdir" value="docroot/WEB-INF/ext-${module.name}/classes" />
176 <param name="javac.srcdir" value="docroot/WEB-INF/ext-${module.name}/src" />
177 <reference refid="plugin-lib.classpath" torefid="plugin-lib.classpath" />
181 <target name="compile-with-portal-class-loader">
182 <mkdir dir="docroot/WEB-INF/ext-lib/global" />
183 <mkdir dir="docroot/WEB-INF/ext-lib/portal" />
184 <mkdir dir="docroot/WEB-INF/ext-${module.name}/classes" />
185 <mkdir dir="docroot/WEB-INF/ext-${module.name}/src" />
187 <path id="plugin-lib.classpath">
188 <fileset dir="docroot/WEB-INF/ext-lib/global" includes="*.jar" />
189 <fileset dir="docroot/WEB-INF/ext-lib/portal" includes="*.jar" />
190 <pathelement path="${module.class.path}" />
191 <fileset dir="${app.server.lib.portal.dir}" includes="*.jar" />
194 <antcall target="compile-java">
195 <param name="javac.classpathref" value="plugin.classpath" />
196 <param name="javac.destdir" value="docroot/WEB-INF/ext-${module.name}/classes" />
197 <param name="javac.srcdir" value="docroot/WEB-INF/ext-${module.name}/src" />
198 <reference refid="plugin-lib.classpath" torefid="plugin-lib.classpath" />
202 <target name="deploy-properties">
203 <copy todir="${app.server.classes.portal.dir}" overwrite="true">
204 <fileset dir="docroot/WEB-INF/ext-impl/src" includes="portal-*.properties,system-*.properties" />
208 <target name="direct-deploy" depends="war">
209 <copy todir="${app.server.lib.global.dir}" overwrite="true">
210 <fileset dir="docroot/WEB-INF/ext-lib/global" includes="*.jar" />
214 file="docroot/WEB-INF/ext-service/ext-service.jar"
215 tofile="${app.server.lib.global.dir}/ext-${plugin.name}-service.jar"
219 <copy todir="${app.server.lib.portal.dir}" overwrite="true">
220 <fileset dir="docroot/WEB-INF/ext-lib/portal" includes="*.jar" />
224 file="docroot/WEB-INF/ext-impl/ext-impl.jar"
225 tofile="${app.server.lib.portal.dir}/ext-${plugin.name}-impl.jar"
230 file="docroot/WEB-INF/ext-util-bridges/ext-util-bridges.jar"
231 tofile="${app.server.lib.portal.dir}/ext-${plugin.name}-util-bridges.jar"
236 file="docroot/WEB-INF/ext-util-java/ext-util-java.jar"
237 tofile="${app.server.lib.portal.dir}/ext-${plugin.name}-util-java.jar"
242 file="docroot/WEB-INF/ext-util-taglib/ext-util-taglib.jar"
243 tofile="${app.server.lib.portal.dir}/ext-${plugin.name}-util-taglib.jar"
247 <copy todir="${app.server.portal.dir}" overwrite="true">
248 <fileset dir="docroot/WEB-INF/ext-web/docroot" excludes="WEB-INF/web.xml" />
252 <available file="docroot/WEB-INF/ext-web/docroot/WEB-INF/web.xml" />
255 classname="com.liferay.portal.tools.WebXMLBuilder"
256 classpathref="portal.classpath"
258 newenvironment="true"
260 <jvmarg value="-Dexternal-properties=com/liferay/portal/tools/dependencies/portal-tools.properties" />
261 <arg value="${app.server.portal.dir}/WEB-INF/web.xml" />
262 <arg value="docroot/WEB-INF/ext-web/docroot/WEB-INF/web.xml" />
263 <arg value="${app.server.portal.dir}/WEB-INF/web.xml.merged" />
266 <move file="${app.server.portal.dir}/WEB-INF/web.xml.merged" tofile="${app.server.portal.dir}/WEB-INF/web.xml" />
270 <unzip src="${plugin.file}" dest="${app.server.portal.dir}">
272 <include name="WEB-INF/ext-${plugin.name}.xml" />
276 <antcall target="deploy-properties" />
279 <target name="war" depends="compile">
281 basedir="docroot/WEB-INF/ext-service/classes"
282 destfile="docroot/WEB-INF/ext-service/ext-service.jar"
285 <antcall target="war-util">
286 <param name="util.suffix" value="bridges" />
289 <antcall target="war-util">
290 <param name="util.suffix" value="java" />
293 <antcall target="war-util">
294 <param name="util.suffix" value="taglib" />
298 basedir="docroot/WEB-INF/ext-impl/classes"
299 destfile="docroot/WEB-INF/ext-impl/ext-impl.jar"
300 excludes="portal-*.properties,system-*.properties"
304 classname="com.liferay.portal.tools.ExtInfoBuilder"
305 classpathref="portal.classpath"
308 newenvironment="true"
310 <arg line="docroot/WEB-INF docroot/WEB-INF ${plugin.name}" />
313 <mkdir dir="${project.dir}/dist" />
315 <delete file="${plugin.file}" />
317 <zip destfile="${plugin.file}">
320 excludes="build.xml,**/portal-*.properties,**/system-*.properties"
323 dir="docroot/WEB-INF/ext-impl/src"
324 includes="portal-*.properties,system-*.properties"
325 prefix="WEB-INF/ext-web/docroot/WEB-INF/classes"
329 <delete file="docroot/WEB-INF/ext-${plugin.name}.xml" />
332 <target name="war-util">
334 basedir="docroot/WEB-INF/ext-util-${util.suffix}/classes"
335 destfile="docroot/WEB-INF/ext-util-${util.suffix}/ext-util-${util.suffix}.jar"
339 file="docroot/WEB-INF/ext-util-${util.suffix}/ext-util-${util.suffix}.jar"
340 tofile="docroot/WEB-INF/ext-impl/classes/com/liferay/portal/deploy/dependencies/ext-${plugin.name}-util-${util.suffix}.jar"