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.
951 righe
26 KiB
951 righe
26 KiB
2 anni fa
|
<?xml version="1.0"?>
|
||
|
<!DOCTYPE project>
|
||
|
|
||
|
<project name="build-common-plugin" xmlns:antelope="antlib:ise.antelope.tasks">
|
||
|
<import file="build-common.xml" />
|
||
|
|
||
|
<property name="plugins.includes.path" value="${basedir}" />
|
||
|
|
||
|
<set-module-properties
|
||
|
module.dir="${basedir}"
|
||
|
/>
|
||
|
|
||
|
<macrodef name="build-service">
|
||
|
<attribute name="service.api.dir" />
|
||
|
<attribute name="service.auto.namespace.tables" default="true" />
|
||
|
<attribute name="service.hbm.file.name" default="portlet-hbm.xml" />
|
||
|
<attribute name="service.model.hints.file.name" default="portlet-model-hints.xml" />
|
||
|
<attribute name="service.props.util" default="com.liferay.util.service.ServiceProps" />
|
||
|
<attribute name="service.spring.file.name" default="portlet-spring.xml" />
|
||
|
<attribute name="service.sql.dir" />
|
||
|
<attribute name="service.test.dir" />
|
||
|
|
||
|
<sequential>
|
||
|
<if>
|
||
|
<available file="docroot" />
|
||
|
<then>
|
||
|
<var name="service.base.dir" value="docroot/WEB-INF" />
|
||
|
</then>
|
||
|
<else>
|
||
|
<var name="service.base.dir" value="." />
|
||
|
</else>
|
||
|
</if>
|
||
|
|
||
|
<if>
|
||
|
<available file="bnd.bnd" />
|
||
|
<then>
|
||
|
<var name="service.osgi.module" value="true" />
|
||
|
<var name="service.plugin.name" value="${plugin.name}" />
|
||
|
<var name="service.spring.namespaces" value="beans,osgi" />
|
||
|
</then>
|
||
|
<else>
|
||
|
<var name="service.osgi.module" value="false" />
|
||
|
<var name="service.plugin.name" value="${plugin.name}" />
|
||
|
<var name="service.spring.namespaces" value="beans" />
|
||
|
</else>
|
||
|
</if>
|
||
|
|
||
|
<mkdir dir="@{service.api.dir}" />
|
||
|
<mkdir dir="@{service.sql.dir}" />
|
||
|
|
||
|
<mkdir dir="${service.base.dir}/classes" />
|
||
|
<mkdir dir="${service.base.dir}/lib" />
|
||
|
<mkdir dir="${service.base.dir}/src" />
|
||
|
|
||
|
<copy todir="${service.base.dir}/classes">
|
||
|
<fileset dir="${service.base.dir}/src" excludes="**/*.java" />
|
||
|
</copy>
|
||
|
|
||
|
<path id="service.builder.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="${sdk.dir}/dependencies/org.freemarker/lib" includes="*.jar" />
|
||
|
<fileset dir="${service.base.dir}/lib" includes="*.jar" />
|
||
|
<pathelement location="${sdk.dir}/misc" />
|
||
|
<pathelement location="${service.base.dir}/classes" />
|
||
|
</path>
|
||
|
|
||
|
<if>
|
||
|
<os family="windows" />
|
||
|
<then>
|
||
|
<classpath-to-jar
|
||
|
classpathref="service.builder.classpath"
|
||
|
jarfile="service-builder-classpath.jar"
|
||
|
/>
|
||
|
</then>
|
||
|
</if>
|
||
|
|
||
|
<if>
|
||
|
<not>
|
||
|
<isset property="service.input.file" />
|
||
|
</not>
|
||
|
<then>
|
||
|
<property name="service.input.file" value="${basedir}/${service.base.dir}/service.xml" />
|
||
|
</then>
|
||
|
</if>
|
||
|
|
||
|
<java
|
||
|
classname="com.liferay.portal.tools.servicebuilder.ServiceBuilder"
|
||
|
classpathref="service.builder.classpath"
|
||
|
fork="true"
|
||
|
newenvironment="true"
|
||
|
outputproperty="build-service.output"
|
||
|
>
|
||
|
<jvmarg value="-Dfile.encoding=UTF-8" />
|
||
|
<jvmarg value="-Xms512m" />
|
||
|
<jvmarg value="-Xmx1024m" />
|
||
|
<jvmarg value="-Xss2048k" />
|
||
|
<jvmarg value="-XX:MaxPermSize=512m" />
|
||
|
<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.api.dir=@{service.api.dir}" />
|
||
|
<arg value="service.auto.namespace.tables=@{service.auto.namespace.tables}" />
|
||
|
<arg value="service.bean.locator.util=com.liferay.util.bean.PortletBeanLocatorUtil" />
|
||
|
<arg value="service.build.number=1" />
|
||
|
<arg value="service.build.number.increment=true" />
|
||
|
<arg value="service.hbm.file=${basedir}/${service.base.dir}/src/META-INF/@{service.hbm.file.name}" />
|
||
|
<arg value="service.impl.dir=${basedir}/${service.base.dir}/src" />
|
||
|
<arg value="service.input.file=${service.input.file}" />
|
||
|
<arg value="service.model.hints.file=${basedir}/${service.base.dir}/src/META-INF/@{service.model.hints.file.name}" />
|
||
|
<arg value="service.orm.file=${basedir}/${service.base.dir}/src/META-INF/portlet-orm.xml" />
|
||
|
<arg value="service.osgi.module=${service.osgi.module}" />
|
||
|
<arg value="service.plugin.name=${service.plugin.name}" />
|
||
|
<arg value="service.props.util=@{service.props.util}" />
|
||
|
<arg value="service.remoting.file=" />
|
||
|
<arg value="service.resources.dir=${basedir}/${service.base.dir}/src" />
|
||
|
<arg value="service.spring.base.file=${basedir}/${service.base.dir}/src/META-INF/base-spring.xml" />
|
||
|
<arg value="service.spring.cluster.file=${basedir}/${service.base.dir}/src/META-INF/cluster-spring.xml" />
|
||
|
<arg value="service.spring.dynamic.data.source.file=${basedir}/${service.base.dir}/src/META-INF/dynamic-data-source-spring.xml" />
|
||
|
<arg value="service.spring.file=${basedir}/${service.base.dir}/src/META-INF/@{service.spring.file.name}" />
|
||
|
<arg value="service.spring.hibernate.file=${basedir}/${service.base.dir}/src/META-INF/hibernate-spring.xml" />
|
||
|
<arg value="service.spring.infrastructure.file=${basedir}/${service.base.dir}/src/META-INF/infrastructure-spring.xml" />
|
||
|
<arg value="service.spring.shard.data.source.file=${basedir}/${service.base.dir}/src/META-INF/shard-data-source-spring.xml" />
|
||
|
<arg value="service.spring.namespaces=${service.spring.namespaces}" />
|
||
|
<arg value="service.sql.dir=@{service.sql.dir}" />
|
||
|
<arg value="service.sql.file=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.target.entity.name=${service.target.entity.name}" />
|
||
|
<arg value="service.test.dir=@{service.test.dir}" />
|
||
|
</java>
|
||
|
|
||
|
<if>
|
||
|
<os family="windows" />
|
||
|
<then>
|
||
|
<delete file="service-builder-classpath.jar" />
|
||
|
</then>
|
||
|
</if>
|
||
|
|
||
|
<delete file="ServiceBuilder.temp" />
|
||
|
|
||
|
<echo>${build-service.output}</echo>
|
||
|
|
||
|
<if>
|
||
|
<contains string="${build-service.output}" substring="Error" />
|
||
|
<then>
|
||
|
<fail>Service Builder generated exceptions.</fail>
|
||
|
</then>
|
||
|
</if>
|
||
|
</sequential>
|
||
|
</macrodef>
|
||
|
|
||
|
<macrodef name="classpath-to-jar">
|
||
|
<attribute name="classpathref" />
|
||
|
<attribute name="jarfile" />
|
||
|
|
||
|
<sequential>
|
||
|
|
||
|
<!--
|
||
|
Windows chokes if the classpath is longer than 32 kb. But the
|
||
|
workaround only works for Ant 1.8 and above. See LPS-29085.
|
||
|
-->
|
||
|
|
||
|
<if>
|
||
|
<and>
|
||
|
<not>
|
||
|
<contains string="${ant.version}" substring="1.6" />
|
||
|
</not>
|
||
|
<not>
|
||
|
<contains string="${ant.version}" substring="1.7" />
|
||
|
</not>
|
||
|
</and>
|
||
|
<then>
|
||
|
<manifestclasspath
|
||
|
jarfile="@{jarfile}"
|
||
|
maxParentLevels="99"
|
||
|
property="manifest.classpath"
|
||
|
>
|
||
|
<classpath refid="@{classpathref}" />
|
||
|
</manifestclasspath>
|
||
|
|
||
|
<manifest file="@{jarfile}.manifest">
|
||
|
<attribute name="Class-Path" value="${manifest.classpath}" />
|
||
|
</manifest>
|
||
|
|
||
|
<jar
|
||
|
destfile="@{jarfile}"
|
||
|
manifest="@{jarfile}.manifest"
|
||
|
/>
|
||
|
|
||
|
<delete file="@{jarfile}.manifest" />
|
||
|
|
||
|
<var name="manifest.classpath" unset="true" />
|
||
|
|
||
|
<path id="@{classpathref}">
|
||
|
<fileset file="@{jarfile}" />
|
||
|
</path>
|
||
|
</then>
|
||
|
</if>
|
||
|
</sequential>
|
||
|
</macrodef>
|
||
|
|
||
|
<macrodef name="compile-jsp">
|
||
|
<attribute name="compile.jsp.delete.generated.files" default="true" />
|
||
|
<attribute name="compile.jsp.docroot.dir" />
|
||
|
<attribute name="compile.jsp.temp.dir" default="" />
|
||
|
|
||
|
<sequential>
|
||
|
<if>
|
||
|
<not>
|
||
|
<equals arg1="${app.server.type}" arg2="tomcat" />
|
||
|
</not>
|
||
|
<then>
|
||
|
<fail>Compiling JSPs with ${app.server.type} is not supported.</fail>
|
||
|
</then>
|
||
|
</if>
|
||
|
|
||
|
<if>
|
||
|
<available file="@{compile.jsp.docroot.dir}" />
|
||
|
<then>
|
||
|
<path id="jspc.classpath.common">
|
||
|
<pathelement location="${env.JAVA_HOME}/jre/lib/rt.jar" />
|
||
|
<fileset dir="${app.server.lib.global.dir}" includes="*.jar" />
|
||
|
<fileset dir="${sdk.dir}/dependencies/com.liferay.jasper.jspc/lib" includes="*.jar" />
|
||
|
<pathelement location="${app.server.lib.portal.dir}/ant.jar" />
|
||
|
<fileset dir="${basedir}" includes="lib/*.jar" />
|
||
|
<fileset dir="${basedir}" includes="docroot/WEB-INF/lib/*.jar" />
|
||
|
<fileset dir="@{compile.jsp.docroot.dir}" includes="WEB-INF/lib/*.jar" />
|
||
|
</path>
|
||
|
|
||
|
<local name="jspc.module.web" />
|
||
|
|
||
|
<if>
|
||
|
<equals arg1="@{compile.jsp.temp.dir}" arg2="" />
|
||
|
<then>
|
||
|
<path id="jspc.classpath">
|
||
|
<path refid="jspc.classpath.common" />
|
||
|
<pathelement location="@{compile.jsp.docroot.dir}/WEB-INF/classes" />
|
||
|
</path>
|
||
|
|
||
|
<property name="jspc.module.web" value="false" />
|
||
|
</then>
|
||
|
<else>
|
||
|
<path id="jspc.classpath.module.common">
|
||
|
<path refid="jspc.classpath.common" />
|
||
|
<fileset dir="${app.server.lib.portal.dir}" includes="*.jar" />
|
||
|
<fileset dir="${module.framework.base.dir}/modules" includes="*.jar" />
|
||
|
<pathelement location="@{compile.jsp.temp.dir}" />
|
||
|
</path>
|
||
|
|
||
|
<if>
|
||
|
<available file="@{compile.jsp.docroot.dir}/WEB-INF" type="dir" />
|
||
|
<then>
|
||
|
<path id="jspc.classpath">
|
||
|
<path refid="jspc.classpath.module.common" />
|
||
|
<pathelement location="@{compile.jsp.docroot.dir}/WEB-INF/classes" />
|
||
|
</path>
|
||
|
</then>
|
||
|
<else>
|
||
|
<path id="jspc.classpath">
|
||
|
<path refid="jspc.classpath.module.common" />
|
||
|
</path>
|
||
|
</else>
|
||
|
</if>
|
||
|
|
||
|
<property name="jspc.module.web" value="true" />
|
||
|
</else>
|
||
|
</if>
|
||
|
|
||
|
<tstamp>
|
||
|
<format property="tstamp.value" pattern="yyyyMMddkkmmssSSS" />
|
||
|
</tstamp>
|
||
|
|
||
|
<var name="compile.jsp.jspc.dir" value="${tstamp.value}" />
|
||
|
|
||
|
<mkdir dir="${compile.jsp.jspc.dir}" />
|
||
|
|
||
|
<java
|
||
|
classname="com.liferay.jasper.jspc.JspC"
|
||
|
classpathref="jspc.classpath"
|
||
|
fork="true"
|
||
|
jvm="${env.JAVA_HOME}/bin/java"
|
||
|
newenvironment="true"
|
||
|
outputproperty="jspc.output"
|
||
|
>
|
||
|
<sysproperty key="jspc.module.web" value="${jspc.module.web}" />
|
||
|
<sysproperty key="jspc.portal.dir" value="${app.server.portal.dir}" />
|
||
|
<arg line="-d ${compile.jsp.jspc.dir}/src -webapp @{compile.jsp.docroot.dir}" />
|
||
|
</java>
|
||
|
|
||
|
<echo>${jspc.output}</echo>
|
||
|
|
||
|
<if>
|
||
|
<contains string="${jspc.output}" substring="JasperException" />
|
||
|
<then>
|
||
|
<delete dir="${compile.jsp.jspc.dir}/src" quiet="true" />
|
||
|
|
||
|
<fail>JSPs failed to compile.</fail>
|
||
|
</then>
|
||
|
</if>
|
||
|
|
||
|
<if>
|
||
|
<available file="${compile.jsp.jspc.dir}/src" type="dir" />
|
||
|
<then>
|
||
|
<mkdir dir="${compile.jsp.jspc.dir}/classes" />
|
||
|
|
||
|
<javac
|
||
|
classpathref="jspc.classpath"
|
||
|
compiler="${javac.compiler}"
|
||
|
deprecation="${javac.deprecation}"
|
||
|
destdir="${compile.jsp.jspc.dir}/classes"
|
||
|
encoding="${javac.encoding}"
|
||
|
errorProperty="jspc.javac.fail"
|
||
|
failonerror="false"
|
||
|
includeAntRuntime="false"
|
||
|
nowarn="on"
|
||
|
srcdir="${compile.jsp.jspc.dir}/src"
|
||
|
/>
|
||
|
|
||
|
<if>
|
||
|
<istrue value="@{compile.jsp.delete.generated.files}" />
|
||
|
<then>
|
||
|
<delete dir="${compile.jsp.jspc.dir}" quiet="true" />
|
||
|
</then>
|
||
|
</if>
|
||
|
</then>
|
||
|
</if>
|
||
|
|
||
|
<if>
|
||
|
<istrue value="${jspc.javac.fail}" />
|
||
|
<then>
|
||
|
<fail>JSPs failed to compile.</fail>
|
||
|
</then>
|
||
|
</if>
|
||
|
</then>
|
||
|
</if>
|
||
|
</sequential>
|
||
|
</macrodef>
|
||
|
|
||
|
<target name="all">
|
||
|
<antcall target="clean" />
|
||
|
<antcall target="deploy" />
|
||
|
</target>
|
||
|
|
||
|
<target name="build-client">
|
||
|
<property name="client.url" value="http://localhost:8080/${plugin.name}/api/axis" />
|
||
|
|
||
|
<echo message="Make sure the server is listening on ${client.url}." />
|
||
|
<echo message="" />
|
||
|
|
||
|
<mkdir dir="docroot/WEB-INF/client/src" />
|
||
|
|
||
|
<java
|
||
|
classname="com.liferay.portal.tools.PortalClientBuilder"
|
||
|
classpathref="portal.classpath"
|
||
|
failonerror="true"
|
||
|
fork="true"
|
||
|
newenvironment="true"
|
||
|
>
|
||
|
<jvmarg value="-Dexternal-properties=com/liferay/portal/tools/dependencies/portal-tools.properties" />
|
||
|
<arg value="docroot/WEB-INF/server-config.wsdd" />
|
||
|
<arg value="docroot/WEB-INF/client/src" />
|
||
|
<arg value="docroot/WEB-INF/client/namespace-mapping.properties" />
|
||
|
<arg value="${client.url}" />
|
||
|
</java>
|
||
|
|
||
|
<mkdir dir="docroot/WEB-INF/client/classes" />
|
||
|
|
||
|
<compile-java
|
||
|
javac.classpathref="portal.classpath"
|
||
|
javac.destdir="docroot/WEB-INF/client/classes"
|
||
|
javac.srcdir="docroot/WEB-INF/client/src"
|
||
|
/>
|
||
|
|
||
|
<zip destfile="docroot/WEB-INF/client/${plugin.name}-client.jar">
|
||
|
<fileset dir="docroot/WEB-INF/client/classes" />
|
||
|
<fileset dir="docroot/WEB-INF/client/src" />
|
||
|
</zip>
|
||
|
|
||
|
<delete dir="docroot/WEB-INF/client/classes" />
|
||
|
<delete dir="docroot/WEB-INF/client/src" />
|
||
|
</target>
|
||
|
|
||
|
<target name="build-lang">
|
||
|
<if>
|
||
|
<available file="docroot/WEB-INF/src/content" />
|
||
|
<then>
|
||
|
<antcall target="build-lang-cmd">
|
||
|
<param name="lang.dir" value="docroot/WEB-INF/src/content" />
|
||
|
<param name="lang.file" value="Language" />
|
||
|
<param name="lang.translate" value="true" />
|
||
|
</antcall>
|
||
|
</then>
|
||
|
</if>
|
||
|
|
||
|
<if>
|
||
|
<available file="src/content" />
|
||
|
<then>
|
||
|
<antcall target="build-lang-cmd">
|
||
|
<param name="lang.dir" value="src/content" />
|
||
|
<param name="lang.file" value="Language" />
|
||
|
<param name="lang.translate" value="true" />
|
||
|
</antcall>
|
||
|
</then>
|
||
|
</if>
|
||
|
</target>
|
||
|
|
||
|
<target name="build-lang-cmd">
|
||
|
<java
|
||
|
classname="com.liferay.portal.tools.LangBuilder"
|
||
|
classpathref="portal.classpath"
|
||
|
fork="true"
|
||
|
newenvironment="true"
|
||
|
>
|
||
|
<jvmarg value="-Dexternal-properties=com/liferay/portal/tools/dependencies/portal-tools.properties" />
|
||
|
<jvmarg value="-Dfile.encoding=UTF-8" />
|
||
|
<jvmarg value="-Duser.country=US" />
|
||
|
<jvmarg value="-Duser.language=en" />
|
||
|
<arg value="lang.dir=${lang.dir}" />
|
||
|
<arg value="lang.file=${lang.file}" />
|
||
|
<arg value="lang.plugin=true" />
|
||
|
<arg value="lang.translate=${lang.translate}" />
|
||
|
</java>
|
||
|
|
||
|
<copy file="${lang.dir}/${lang.file}.properties" tofile="${lang.dir}/${lang.file}_en.properties" />
|
||
|
</target>
|
||
|
|
||
|
<target name="build-service">
|
||
|
<if>
|
||
|
<available file="docroot" />
|
||
|
<then>
|
||
|
<var name="service.base.dir" value="docroot/WEB-INF" />
|
||
|
</then>
|
||
|
<else>
|
||
|
<var name="service.base.dir" value="." />
|
||
|
</else>
|
||
|
</if>
|
||
|
|
||
|
<build-service
|
||
|
service.api.dir="${basedir}/${service.base.dir}/service"
|
||
|
service.sql.dir="${basedir}/${service.base.dir}/sql"
|
||
|
service.test.dir=""
|
||
|
/>
|
||
|
|
||
|
<mkdir dir="${service.base.dir}/service-classes" />
|
||
|
|
||
|
<path id="service.classpath">
|
||
|
<path refid="lib.classpath" />
|
||
|
<fileset dir="${app.server.lib.global.dir}" includes="*.jar" />
|
||
|
<fileset dir="${sdk.dir}/dependencies/aQute.bnd/lib" includes="*.jar" />
|
||
|
<fileset dir="${service.base.dir}/lib" excludes="${plugin.name}-service.jar" includes="*.jar" />
|
||
|
</path>
|
||
|
|
||
|
<compile-java
|
||
|
javac.classpathref="service.classpath"
|
||
|
javac.destdir="${service.base.dir}/service-classes"
|
||
|
javac.srcdir="${service.base.dir}/service"
|
||
|
/>
|
||
|
|
||
|
<jar
|
||
|
basedir="${service.base.dir}/service-classes"
|
||
|
destfile="${service.base.dir}/lib/${plugin.name}-service.jar"
|
||
|
/>
|
||
|
|
||
|
<delete dir="${service.base.dir}/service-classes" />
|
||
|
</target>
|
||
|
|
||
|
<target name="build-wsdd">
|
||
|
<loop-macrodef-or-target
|
||
|
module.dirs="${basedir}"
|
||
|
target.name="compile"
|
||
|
/>
|
||
|
|
||
|
<path id="wsdd.builder.classpath">
|
||
|
<path refid="lib.classpath" />
|
||
|
<path refid="portal.classpath" />
|
||
|
<fileset dir="${plugin.lib.dir}" includes="*.jar" />
|
||
|
<pathelement location="${plugin.classes.dir}" />
|
||
|
</path>
|
||
|
|
||
|
<if>
|
||
|
<os family="windows" />
|
||
|
<then>
|
||
|
<classpath-to-jar
|
||
|
classpathref="wsdd.builder.classpath"
|
||
|
jarfile="wsdd-builder-classpath.jar"
|
||
|
/>
|
||
|
</then>
|
||
|
</if>
|
||
|
|
||
|
<java
|
||
|
classname="com.liferay.portal.tools.WSDDBuilder"
|
||
|
classpathref="wsdd.builder.classpath"
|
||
|
fork="true"
|
||
|
maxmemory="256m"
|
||
|
newenvironment="true"
|
||
|
outputproperty="build-wsdd.output"
|
||
|
>
|
||
|
<jvmarg value="-Dexternal-properties=com/liferay/portal/tools/dependencies/portal-tools.properties" />
|
||
|
<jvmarg value="-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger" />
|
||
|
<arg value="wsdd.input.file=${plugin.source.dir}/../service.xml" />
|
||
|
<arg value="wsdd.server.config.file=${plugin.source.dir}/../server-config.wsdd" />
|
||
|
<arg value="wsdd.service.namespace=Plugin" />
|
||
|
<arg value="wsdd.output.path=${plugin.source.dir}/" />
|
||
|
</java>
|
||
|
|
||
|
<if>
|
||
|
<os family="windows" />
|
||
|
<then>
|
||
|
<delete file="wsdd-builder-classpath.jar" />
|
||
|
</then>
|
||
|
</if>
|
||
|
|
||
|
<echo>${build-wsdd.output}</echo>
|
||
|
|
||
|
<if>
|
||
|
<contains string="${build-wsdd.output}" substring="IOException" />
|
||
|
<then>
|
||
|
<fail>WSDD Builder generated exceptions.</fail>
|
||
|
</then>
|
||
|
</if>
|
||
|
|
||
|
<if>
|
||
|
<available file="bnd.bnd" />
|
||
|
<then>
|
||
|
<property file="bnd.bnd" prefix="bnd." />
|
||
|
|
||
|
<echo file="${plugin.name}-wsdd.bnd">Bundle-SymbolicName: ${bnd.Bundle-SymbolicName}.wsdd
|
||
|
Bundle-Name: ${bnd.Bundle-Name} WSDD descriptors
|
||
|
Bundle-Version: ${bnd.Bundle-Version}
|
||
|
Fragment-Host: ${bnd.Bundle-SymbolicName}
|
||
|
Import-Package: javax.servlet,javax.servlet.http
|
||
|
Include-Resource: WEB-INF/=server-config.wsdd,classes;filter:=*.wsdd
|
||
|
</echo>
|
||
|
|
||
|
<manifest-helper />
|
||
|
|
||
|
<bndexpand propertyfile="${sdk.dir}/common.bnd" />
|
||
|
|
||
|
<bnd eclipse="false" exceptions="true" failok="false" inherit="true" output="${plugin.wsdd.file}">
|
||
|
<bndfiles>
|
||
|
<fileset dir="${basedir}">
|
||
|
<include name="${plugin.name}-wsdd.bnd" />
|
||
|
</fileset>
|
||
|
</bndfiles>
|
||
|
<classpath>
|
||
|
<pathelement location="${plugin.classes.dir}" />
|
||
|
</classpath>
|
||
|
<property name="-sourcepath" value="${basedir}" />
|
||
|
</bnd>
|
||
|
|
||
|
<delete file="${basedir}/${plugin.name}-wsdd.bnd" failonerror="false" />
|
||
|
</then>
|
||
|
</if>
|
||
|
</target>
|
||
|
|
||
|
<target name="compile-import-shared">
|
||
|
<compile-import-shared
|
||
|
module.dir="${basedir}"
|
||
|
/>
|
||
|
</target>
|
||
|
|
||
|
<target name="compile-jsp">
|
||
|
<if>
|
||
|
<resourcecount count="0" when="gt">
|
||
|
<fileset
|
||
|
dir="${basedir}"
|
||
|
excludes="**/custom_jsps/**/*,**/dependencies/**/*"
|
||
|
includes="docroot/**/*.jsp,src/META-INF/resources/**/*.jsp,tmp/**/*.jsp"
|
||
|
/>
|
||
|
</resourcecount>
|
||
|
<then>
|
||
|
<set-module-properties
|
||
|
module.dir="${basedir}"
|
||
|
/>
|
||
|
|
||
|
<if>
|
||
|
<isset property="compile.jsp.docroot.dir" />
|
||
|
<then>
|
||
|
<compile
|
||
|
module.dir="${basedir}"
|
||
|
/>
|
||
|
|
||
|
<compile-jsp
|
||
|
compile.jsp.docroot.dir="${compile.jsp.docroot.dir}"
|
||
|
/>
|
||
|
</then>
|
||
|
<elseif>
|
||
|
<available file="bnd.bnd" type="file" />
|
||
|
<then>
|
||
|
<antcall target="jar">
|
||
|
<param name="plugins.includes.path" value="${basedir}" />
|
||
|
</antcall>
|
||
|
|
||
|
<tstamp>
|
||
|
<format property="tstamp.value" pattern="yyyyMMddkkmmssSSS" />
|
||
|
</tstamp>
|
||
|
|
||
|
<unzip dest="${tstamp.value}" src="${plugin.file}" />
|
||
|
|
||
|
<if>
|
||
|
<available file="${tstamp.value}/META-INF/resources" type="dir" />
|
||
|
<then>
|
||
|
<compile-jsp
|
||
|
compile.jsp.docroot.dir="${tstamp.value}/META-INF/resources"
|
||
|
compile.jsp.temp.dir="${tstamp.value}"
|
||
|
/>
|
||
|
</then>
|
||
|
<else>
|
||
|
<compile-jsp
|
||
|
compile.jsp.docroot.dir="${tstamp.value}"
|
||
|
compile.jsp.temp.dir="${tstamp.value}"
|
||
|
/>
|
||
|
</else>
|
||
|
</if>
|
||
|
|
||
|
<delete dir="${tstamp.value}" />
|
||
|
</then>
|
||
|
</elseif>
|
||
|
<else>
|
||
|
<loop-macrodef-or-target
|
||
|
module.dirs="${basedir}"
|
||
|
target.name="compile"
|
||
|
/>
|
||
|
|
||
|
<compile-jsp
|
||
|
compile.jsp.docroot.dir="docroot"
|
||
|
/>
|
||
|
</else>
|
||
|
</if>
|
||
|
</then>
|
||
|
</if>
|
||
|
</target>
|
||
|
|
||
|
<target name="compile-test">
|
||
|
<compile-test
|
||
|
module.dir="${basedir}"
|
||
|
/>
|
||
|
</target>
|
||
|
|
||
|
<target name="compile-test-integration">
|
||
|
<compile-test-integration
|
||
|
module.dir="${basedir}"
|
||
|
/>
|
||
|
</target>
|
||
|
|
||
|
<target name="compile-test-unit">
|
||
|
<compile-test-unit
|
||
|
module.dir="${basedir}"
|
||
|
/>
|
||
|
</target>
|
||
|
|
||
|
<target name="format-wsdl">
|
||
|
<for param="wsdl.full.path">
|
||
|
<path>
|
||
|
<fileset
|
||
|
dir="."
|
||
|
includes="docroot/WEB-INF/wsdl/*.wsdl,docroot/WEB-INF/wsdl/**/*.wsdl"
|
||
|
/>
|
||
|
</path>
|
||
|
<sequential>
|
||
|
<java
|
||
|
classname="com.liferay.portal.tools.XMLFormatter"
|
||
|
classpathref="portal.classpath"
|
||
|
fork="true"
|
||
|
newenvironment="true"
|
||
|
>
|
||
|
<jvmarg value="-Dexternal-properties=com/liferay/portal/tools/dependencies/portal-tools.properties" />
|
||
|
<jvmarg value="-Dxml.formatter.file=@{wsdl.full.path}" />
|
||
|
<jvmarg value="-Dxml.formatter.strip.comments=true" />
|
||
|
</java>
|
||
|
</sequential>
|
||
|
</for>
|
||
|
</target>
|
||
|
|
||
|
<target name="format-xsd">
|
||
|
<for param="xsd.full.path">
|
||
|
<path>
|
||
|
<fileset
|
||
|
dir="."
|
||
|
includes="docroot/WEB-INF/xsd/*.xsd,docroot/WEB-INF/xsd/**/*.xsd"
|
||
|
/>
|
||
|
</path>
|
||
|
<sequential>
|
||
|
<java
|
||
|
classname="com.liferay.portal.tools.XMLFormatter"
|
||
|
classpathref="portal.classpath"
|
||
|
fork="true"
|
||
|
newenvironment="true"
|
||
|
>
|
||
|
<jvmarg value="-Dexternal-properties=com/liferay/portal/tools/dependencies/portal-tools.properties" />
|
||
|
<jvmarg value="-Dxml.formatter.file=@{xsd.full.path}" />
|
||
|
<jvmarg value="-Dxml.formatter.strip.comments=true" />
|
||
|
</java>
|
||
|
</sequential>
|
||
|
</for>
|
||
|
</target>
|
||
|
|
||
|
<target name="install" depends="publish-local-m2-release" />
|
||
|
|
||
|
<target name="jar-javadoc" depends="javadoc">
|
||
|
<jar-javadoc
|
||
|
module.dir="${basedir}"
|
||
|
/>
|
||
|
</target>
|
||
|
|
||
|
<target name="jar-source">
|
||
|
<jar-source
|
||
|
module.dir="${basedir}"
|
||
|
/>
|
||
|
</target>
|
||
|
|
||
|
<target name="javadoc">
|
||
|
<javadoc-macro
|
||
|
module.dir="${basedir}"
|
||
|
/>
|
||
|
</target>
|
||
|
|
||
|
<target name="merge">
|
||
|
<merge
|
||
|
module.dir="${basedir}"
|
||
|
/>
|
||
|
</target>
|
||
|
|
||
|
<target name="merge-unzip">
|
||
|
<merge-unzip
|
||
|
module.dir="${basedir}"
|
||
|
/>
|
||
|
</target>
|
||
|
|
||
|
<target name="patch">
|
||
|
<var name="patched.file.available" value="false" />
|
||
|
|
||
|
<for param="patched.file">
|
||
|
<path>
|
||
|
<fileset
|
||
|
dir="${plugin.source.dir}"
|
||
|
includes="${patch.destination}"
|
||
|
/>
|
||
|
</path>
|
||
|
<sequential>
|
||
|
<var name="patched.file.available" value="true" />
|
||
|
</sequential>
|
||
|
</for>
|
||
|
|
||
|
<if>
|
||
|
<equals arg1="${patched.file.available}" arg2="false" />
|
||
|
<then>
|
||
|
<mirrors-get
|
||
|
dest="${patch.original.lib.name}-sources.jar"
|
||
|
src="${patch.original.lib.url}/${patch.original.lib.name}/${patch.original.lib.version}/${patch.original.lib.name}-${patch.original.lib.version}-sources.jar"
|
||
|
/>
|
||
|
|
||
|
<unjar
|
||
|
dest="${plugin.source.dir}"
|
||
|
src="${patch.original.lib.name}-sources.jar"
|
||
|
>
|
||
|
<mapper
|
||
|
type="glob"
|
||
|
from="${patch.original.lib.source.dir}/*"
|
||
|
to="*"
|
||
|
/>
|
||
|
<patternset includes="${patch.destination}" />
|
||
|
</unjar>
|
||
|
|
||
|
<delete file="${patch.original.lib.name}-sources.jar" />
|
||
|
|
||
|
<if>
|
||
|
<available file="${patch.source}" type="dir" />
|
||
|
<then>
|
||
|
<pathconvert property="patch.files">
|
||
|
<path>
|
||
|
<fileset dir="${patch.source}" />
|
||
|
</path>
|
||
|
</pathconvert>
|
||
|
</then>
|
||
|
<else>
|
||
|
<pathconvert property="patch.files">
|
||
|
<path>
|
||
|
<fileset file="${patch.source}" />
|
||
|
</path>
|
||
|
</pathconvert>
|
||
|
</else>
|
||
|
</if>
|
||
|
|
||
|
<for delimiter="${path.separator}" list="${patch.files}" param="patch.file">
|
||
|
<sequential>
|
||
|
<echo>Applying patch @{patch.file}.</echo>
|
||
|
|
||
|
<patch dir="${plugin.source.dir}" patchfile="@{patch.file}" strip="1" />
|
||
|
</sequential>
|
||
|
</for>
|
||
|
</then>
|
||
|
</if>
|
||
|
|
||
|
<var name="patched.file.available" unset="true" />
|
||
|
</target>
|
||
|
|
||
|
<target name="shrink-zip-cmd">
|
||
|
<tstamp>
|
||
|
<format property="tstamp.value" pattern="yyyyMMddkkmmssSSS" />
|
||
|
</tstamp>
|
||
|
|
||
|
<unzip
|
||
|
dest="${tstamp.value}"
|
||
|
src="${zip.file.name}"
|
||
|
>
|
||
|
<patternset
|
||
|
excludes="${zip.excludes}"
|
||
|
includes="${zip.includes}"
|
||
|
/>
|
||
|
</unzip>
|
||
|
|
||
|
<zip
|
||
|
basedir="${tstamp.value}"
|
||
|
destfile="${zip.file.name}"
|
||
|
/>
|
||
|
|
||
|
<delete dir="${tstamp.value}" />
|
||
|
</target>
|
||
|
|
||
|
<target name="test-class">
|
||
|
<test-class
|
||
|
module.dir="${basedir}"
|
||
|
test.class="${test.class}"
|
||
|
/>
|
||
|
|
||
|
<stop-test-app-server />
|
||
|
</target>
|
||
|
|
||
|
<target name="test-class-group">
|
||
|
<if>
|
||
|
<not>
|
||
|
<isset property="test.class.group.index" />
|
||
|
</not>
|
||
|
<then>
|
||
|
<fail>Use "ant test-class-group -Dtest.class.group.index=0".</fail>
|
||
|
</then>
|
||
|
</if>
|
||
|
|
||
|
<if>
|
||
|
<available file="${basedir}/test" type="dir" />
|
||
|
<then>
|
||
|
<property file="${lp.portal.project.dir}/test.class.file.names.properties" />
|
||
|
|
||
|
<propertycopy from="TEST_CLASS_GROUP_${test.class.group.index}" name="test.classes" />
|
||
|
|
||
|
<propertyregex property="test.java.classes"
|
||
|
global="true"
|
||
|
input="${test.classes}"
|
||
|
regexp="\.class"
|
||
|
replace=".java"
|
||
|
/>
|
||
|
|
||
|
<if>
|
||
|
<and>
|
||
|
<or>
|
||
|
<not>
|
||
|
<isset property="test.type" />
|
||
|
</not>
|
||
|
<equals arg1="${test.type}" arg2="unit" />
|
||
|
</or>
|
||
|
<resourcecount count="0" when="gt">
|
||
|
<fileset dir="${basedir}/test/unit" erroronmissingdir="false" includes="${test.java.classes}" />
|
||
|
</resourcecount>
|
||
|
</and>
|
||
|
<then>
|
||
|
<test-cmd
|
||
|
module.dir="${basedir}"
|
||
|
junit.forkmode="perTest"
|
||
|
test.class="${test.classes}"
|
||
|
test.type="unit"
|
||
|
/>
|
||
|
</then>
|
||
|
</if>
|
||
|
|
||
|
<if>
|
||
|
<and>
|
||
|
<or>
|
||
|
<not>
|
||
|
<isset property="test.type" />
|
||
|
</not>
|
||
|
<equals arg1="${test.type}" arg2="integration" />
|
||
|
</or>
|
||
|
<resourcecount count="0" when="gt">
|
||
|
<fileset dir="${basedir}/test/integration" erroronmissingdir="false" includes="${test.java.classes}" />
|
||
|
</resourcecount>
|
||
|
</and>
|
||
|
<then>
|
||
|
<test-cmd
|
||
|
module.dir="${basedir}"
|
||
|
junit.forkmode="once"
|
||
|
test.class="${test.classes}"
|
||
|
test.type="integration"
|
||
|
/>
|
||
|
</then>
|
||
|
</if>
|
||
|
</then>
|
||
|
</if>
|
||
|
|
||
|
<if>
|
||
|
<and>
|
||
|
<or>
|
||
|
<not>
|
||
|
<isset property="test.type" />
|
||
|
</not>
|
||
|
<equals arg1="${test.type}" arg2="unit" />
|
||
|
</or>
|
||
|
<equals arg1="${test.class.group.index}" arg2="0" />
|
||
|
</and>
|
||
|
<then>
|
||
|
<antcall target="compile-jsp" />
|
||
|
</then>
|
||
|
</if>
|
||
|
</target>
|
||
|
|
||
|
<target name="test-package">
|
||
|
<if>
|
||
|
<not>
|
||
|
<isset property="test.package" />
|
||
|
</not>
|
||
|
<then>
|
||
|
<fail>Use "ant test-package -Dtest.package=com.liferay.portal.kernel.util".</fail>
|
||
|
</then>
|
||
|
</if>
|
||
|
|
||
|
<propertyregex
|
||
|
global="true"
|
||
|
input="${test.package}"
|
||
|
property="test.package.dir"
|
||
|
regexp="\."
|
||
|
replace="/"
|
||
|
/>
|
||
|
|
||
|
<test-cmd
|
||
|
module.dir="${basedir}"
|
||
|
junit.forkmode="once"
|
||
|
test.class="**/${test.package.dir}/*Test.class"
|
||
|
test.type="integration"
|
||
|
/>
|
||
|
|
||
|
<test-cmd
|
||
|
module.dir="${basedir}"
|
||
|
junit.forkmode="perTest"
|
||
|
test.class="**/${test.package.dir}/*Test.class"
|
||
|
test.type="unit"
|
||
|
/>
|
||
|
</target>
|
||
|
</project>
|