sito per le richieste......
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.

348 righe
11 KiB

5 anni fa
<?xml version="1.0"?>
<!DOCTYPE project>
<project name="build-common-ext">
<import file="../build-common-plugin.xml" />
<target name="build-db">
<echo>
.
WARNING: Support for ServiceBuilder in EXT plugins will be deprecated in future
versions. EXT plugins are designed to override the portal's core code that
cannot be done with hooks, layout templates, portlets, or themes. EXT plugins
are not meant to contain new custom services. Please migrate your service.xml to
a portlet plugin.
</echo>
<antcall target="build-common-plugin.build-db" />
</target>
<target name="build-service">
<path id="service.classpath">
<path refid="lib.classpath" />
<path refid="portal.classpath" />
<fileset dir="${app.server.lib.portal.dir}" includes="commons-digester.jar,commons-lang.jar,easyconf.jar" />
<!--<fileset dir="docroot/WEB-INF/lib" includes="*.jar" />
<pathelement location="docroot/WEB-INF/classes" />-->
</path>
<echo>
.
WARNING: Support for ServiceBuilder in EXT plugins will be deprecated in future
versions. EXT plugins are designed to override the portal's core code that
cannot be done with hooks, layout templates, portlets, or themes. EXT plugins
are not meant to contain new custom services. Please migrate your service.xml to
a portlet plugin.
</echo>
<java
classname="com.liferay.portal.tools.servicebuilder.ServiceBuilder"
classpathref="service.classpath"
>
<arg value="-Dexternal-properties=com/liferay/portal/tools/dependencies/portal-tools.properties" />
<arg value="-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger" />
<arg value="service.input.file=${service.file}" />
<arg value="service.hbm.file=${basedir}/docroot/WEB-INF/ext-impl/src/META-INF/ext-hbm.xml" />
<arg value="service.orm.file=${basedir}/docroot/WEB-INF/ext-impl/src/META-INF/ext-orm.xml" />
<arg value="service.model.hints.file=${basedir}/docroot/WEB-INF/ext-impl/src/META-INF/ext-model-hints.xml" />
<arg value="service.spring.file=${basedir}/docroot/WEB-INF/ext-impl/src/META-INF/ext-spring.xml" />
<arg value="service.api.dir=${basedir}/docroot/WEB-INF/ext-service/src" />
<arg value="service.impl.dir=${basedir}/docroot/WEB-INF/ext-impl/src" />
<arg value="service.remoting.file=${basedir}/docroot/WEB-INF/ext-web/docroot/WEB-INF/remoting-servlet-ext.xml" />
<arg value="service.sql.dir=${basedir}/docroot/WEB-INF/sql" />
<arg value="service.sql.file=portal-tables.sql" />
<arg value="service.sql.indexes.file=indexes.sql" />
<arg value="service.sql.indexes.properties.file=indexes.properties" />
<arg value="service.sql.sequences.file=sequences.sql" />
<arg value="service.bean.locator.util=com.liferay.portal.kernel.bean.PortalBeanLocatorUtil" />
<arg value="service.props.util=com.liferay.portal.util.PropsUtil" />
</java>
<delete file="ServiceBuilder.temp" />
</target>
<target name="check-ext-property">
<if>
<not>
<available file="${property.name}" />
</not>
<then>
<fail>
.
${property.name} does not exist!
The properties "app.server.dir", "app.server.zip.name", and "ext.work.dir" are
not properly specified.
The directory denoted by the property "ext.work.dir" will be deleted and the zip
file denoted by the property "app.server.zip.name" will be unzipped into this
directory. The property "app.server.dir" must point to the application server
directory that was unzipped into "ext.work.dir".
For example, if "ext.work.dir" points to "C:\ext-work", and
"app.server.zip.name" points to "C:\files\liferay-portal-tomcat-6.0-${lp.version}.zip",
then "app.server.dir" should point to
"C:\ext-work\liferay-portal-${lp.version}\tomcat-6.0.18".
</fail>
</then>
</if>
</target>
<target name="clean">
<delete includeemptydirs="true">
<fileset dir="docroot/WEB-INF" includes="ext-*/classes/**,ext-*/ext-*.jar" />
</delete>
<delete file="${plugin.file}" />
</target>
<target name="clean-app-server">
<antcall target="check-ext-property">
<param name="property.name" value="${app.server.zip.name}" />
</antcall>
<antcall target="check-ext-property">
<param name="property.name" value="${ext.work.dir}" />
</antcall>
<antcall target="clean" />
<delete dir="${app.server.dir}" />
<unzip src="${app.server.zip.name}" dest="${ext.work.dir}" />
</target>
<target name="compile">
<antcall target="compile-with-global-class-loader">
<param name="module.name" value="service" />
</antcall>
<antcall target="compile-with-portal-class-loader">
<param name="module.class.path" value="docroot/WEB-INF/ext-service/classes" />
<param name="module.name" value="util-bridges" />
</antcall>
<antcall target="compile-with-portal-class-loader">
<param name="module.class.path" value="docroot/WEB-INF/ext-service/classes;docroot/WEB-INF/ext-util-bridges/classes" />
<param name="module.name" value="util-java" />
</antcall>
<antcall target="compile-with-portal-class-loader">
<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" />
<param name="module.name" value="util-taglib" />
</antcall>
<antcall target="compile-with-portal-class-loader">
<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" />
<param name="module.name" value="impl" />
</antcall>
<delete>
<fileset dir="docroot/WEB-INF/ext-impl/classes" includes="portal-*.properties,system-*.properties" />
</delete>
<if>
<available file="docroot/WEB-INF/ext-web/docroot/WEB-INF/lib" />
<then>
<fail>
.
"docroot\WEB-INF\ext-web\docroot\WEB-INF\lib" must not exist. Put JAR files in
"docroot\WEB-INF\ext-lib\portal" that need to be accessible to the portal class
loader.
</fail>
</then>
</if>
</target>
<target name="compile-with-global-class-loader">
<mkdir dir="docroot/WEB-INF/ext-lib/global" />
<mkdir dir="docroot/WEB-INF/ext-${module.name}/classes" />
<if>
<available file="docroot/WEB-INF/ext-${module.name}/src" />
<then>
<path id="plugin-lib.classpath">
<fileset dir="docroot/WEB-INF/ext-lib/global" includes="*.jar" />
<pathelement location="docroot/WEB-INF/ext-${module.name}/classes" />
</path>
<compile-java
javac.classpathref="plugin.classpath"
javac.destdir="docroot/WEB-INF/ext-${module.name}/classes"
javac.srcdir="docroot/WEB-INF/ext-${module.name}/src"
/>
</then>
</if>
</target>
<target name="compile-with-portal-class-loader">
<mkdir dir="docroot/WEB-INF/ext-lib/global" />
<mkdir dir="docroot/WEB-INF/ext-lib/portal" />
<mkdir dir="docroot/WEB-INF/ext-${module.name}/classes" />
<mkdir dir="docroot/WEB-INF/ext-${module.name}/src" />
<path id="plugin-lib.classpath">
<fileset dir="docroot/WEB-INF/ext-lib/global" includes="*.jar" />
<fileset dir="docroot/WEB-INF/ext-lib/portal" includes="*.jar" />
<pathelement path="${module.class.path}" />
<fileset dir="${app.server.lib.portal.dir}" includes="*.jar" />
</path>
<compile-java
javac.classpathref="plugin.classpath"
javac.destdir="docroot/WEB-INF/ext-${module.name}/classes"
javac.srcdir="docroot/WEB-INF/ext-${module.name}/src"
/>
</target>
<target name="deploy-properties">
<copy todir="${app.server.classes.portal.dir}" overwrite="true">
<fileset dir="docroot/WEB-INF/ext-impl/src" includes="portal-*.properties,system-*.properties" />
</copy>
</target>
<target name="direct-deploy" depends="war">
<copy todir="${app.server.lib.global.dir}" overwrite="true">
<fileset dir="docroot/WEB-INF/ext-lib/global" includes="*.jar" />
</copy>
<copy
file="docroot/WEB-INF/ext-service/ext-service.jar"
tofile="${app.server.lib.global.dir}/ext-${plugin.name}-service.jar"
overwrite="true"
/>
<copy todir="${app.server.lib.portal.dir}" overwrite="true">
<fileset dir="docroot/WEB-INF/ext-lib/portal" includes="*.jar" />
</copy>
<copy
file="docroot/WEB-INF/ext-impl/ext-impl.jar"
tofile="${app.server.lib.portal.dir}/ext-${plugin.name}-impl.jar"
overwrite="true"
/>
<copy
file="docroot/WEB-INF/ext-util-bridges/ext-util-bridges.jar"
tofile="${app.server.lib.portal.dir}/ext-${plugin.name}-util-bridges.jar"
overwrite="true"
/>
<copy
file="docroot/WEB-INF/ext-util-java/ext-util-java.jar"
tofile="${app.server.lib.portal.dir}/ext-${plugin.name}-util-java.jar"
overwrite="true"
/>
<copy
file="docroot/WEB-INF/ext-util-taglib/ext-util-taglib.jar"
tofile="${app.server.lib.portal.dir}/ext-${plugin.name}-util-taglib.jar"
overwrite="true"
/>
<if>
<available file="docroot/WEB-INF/ext-web/docroot" />
<then>
<copy todir="${app.server.portal.dir}" overwrite="true">
<fileset dir="docroot/WEB-INF/ext-web/docroot" excludes="WEB-INF/web.xml" />
</copy>
</then>
</if>
<if>
<available file="docroot/WEB-INF/ext-web/docroot/WEB-INF/web.xml" />
<then>
<java
classname="com.liferay.portal.tools.WebXMLBuilder"
classpathref="portal.classpath"
fork="true"
newenvironment="true"
>
<jvmarg value="-Dexternal-properties=com/liferay/portal/tools/dependencies/portal-tools.properties" />
<arg value="${app.server.portal.dir}/WEB-INF/web.xml" />
<arg value="docroot/WEB-INF/ext-web/docroot/WEB-INF/web.xml" />
<arg value="${app.server.portal.dir}/WEB-INF/web.xml.merged" />
</java>
<move file="${app.server.portal.dir}/WEB-INF/web.xml.merged" tofile="${app.server.portal.dir}/WEB-INF/web.xml" />
</then>
</if>
<unzip src="${plugin.file}" dest="${app.server.portal.dir}">
<patternset>
<include name="WEB-INF/ext-${plugin.name}.xml" />
</patternset>
</unzip>
<antcall target="deploy-properties" />
</target>
<target name="war" depends="compile">
<jar
basedir="docroot/WEB-INF/ext-service/classes"
destfile="docroot/WEB-INF/ext-service/ext-service.jar"
/>
<antcall target="war-util">
<param name="util.suffix" value="bridges" />
</antcall>
<antcall target="war-util">
<param name="util.suffix" value="java" />
</antcall>
<antcall target="war-util">
<param name="util.suffix" value="taglib" />
</antcall>
<jar
basedir="docroot/WEB-INF/ext-impl/classes"
destfile="docroot/WEB-INF/ext-impl/ext-impl.jar"
excludes="portal-*.properties,system-*.properties"
/>
<java
classname="com.liferay.portal.tools.ExtInfoBuilder"
classpathref="portal.classpath"
fork="true"
maxmemory="256m"
newenvironment="true"
>
<arg line="docroot/WEB-INF docroot/WEB-INF ${plugin.name}" />
</java>
<mkdir dir="${sdk.dir}/dist" />
<delete file="${plugin.file}" />
<zip destfile="${plugin.file}">
<zipfileset
dir="docroot"
excludes="build.xml,**/portal-*.properties,**/system-*.properties"
/>
<zipfileset
dir="docroot/WEB-INF/ext-impl/src"
includes="portal-*.properties,system-*.properties"
prefix="WEB-INF/ext-web/docroot/WEB-INF/classes"
/>
</zip>
<delete file="docroot/WEB-INF/ext-${plugin.name}.xml" />
</target>
<target name="war-util">
<jar
basedir="docroot/WEB-INF/ext-util-${util.suffix}/classes"
destfile="docroot/WEB-INF/ext-util-${util.suffix}/ext-util-${util.suffix}.jar"
/>
<copy
file="docroot/WEB-INF/ext-util-${util.suffix}/ext-util-${util.suffix}.jar"
tofile="docroot/WEB-INF/ext-impl/classes/com/liferay/portal/deploy/dependencies/ext-${plugin.name}-util-${util.suffix}.jar"
/>
</target>
</project>