--- /dev/null
+<?xml version="1.0"?>\r
+<!DOCTYPE project>\r
+\r
+<project name="build-common-plugin" xmlns:antelope="antlib:ise.antelope.tasks">\r
+ <import file="build-common.xml" />\r
+\r
+ <if>\r
+ <available file="docroot/WEB-INF/liferay-plugin-package.properties" />\r
+ <then>\r
+ <property file="docroot/WEB-INF/liferay-plugin-package.properties" prefix="plugin-package" />\r
+\r
+ <property name="plugin.version" value="${plugin-package.module-incremental-version}" />\r
+ <property name="plugin.jars" value="${plugin-package.portal-dependency-jars}" />\r
+ <property name="plugin.tlds" value="${plugin-package.portal-dependency-tlds}" />\r
+ </then>\r
+ </if>\r
+\r
+ <antelope:stringutil string="${basedir}" property="plugin.name.beginindex">\r
+ <antelope:lastindexof string="${file.separator}" />\r
+ </antelope:stringutil>\r
+\r
+ <antelope:math\r
+ datatype="int"\r
+ operand1="${plugin.name.beginindex}"\r
+ operand2="1"\r
+ operation="+"\r
+ result="plugin.name.beginindex"\r
+ />\r
+\r
+ <antelope:stringutil string="${basedir}" property="plugin.name">\r
+ <antelope:substring beginindex="${plugin.name.beginindex}" />\r
+ </antelope:stringutil>\r
+\r
+ <if>\r
+ <antelope:endswith string="${plugin.name}" with="-client" />\r
+ <then>\r
+ <property name="plugin.file" value="${project.dir}/dist/${plugin.name}-${lp.version}.${plugin.version}${lp.version.file.suffix}.jar" />\r
+ <property name="plugin.src.file" value="${project.dir}/dist/${plugin.name}-src-${lp.version}.${plugin.version}${lp.version.file.suffix}.zip" />\r
+ </then>\r
+ <else>\r
+ <property name="plugin.file" value="${project.dir}/dist/${plugin.name}-${lp.version}.${plugin.version}${lp.version.file.suffix}.war" />\r
+ <property name="plugin.src.file" value="${project.dir}/dist/${plugin.name}-src-${lp.version}.${plugin.version}${lp.version.file.suffix}.zip" />\r
+ </else>\r
+ </if>\r
+\r
+ <target name="all">\r
+ <antcall target="clean" />\r
+ <antcall target="deploy" />\r
+ </target>\r
+\r
+ <target name="build-client">\r
+ <property name="client.url" value="http://localhost:8080/${plugin.name}/api/axis" />\r
+\r
+ <echo message="Make sure the server is listening on ${client.url}." />\r
+ <echo message="" />\r
+\r
+ <mkdir dir="docroot/WEB-INF/client/src" />\r
+\r
+ <java\r
+ classname="com.liferay.portal.tools.PortalClientBuilder"\r
+ classpathref="portal.classpath"\r
+ failonerror="true"\r
+ fork="true"\r
+ newenvironment="true"\r
+ >\r
+ <jvmarg value="-Dexternal-properties=com/liferay/portal/tools/dependencies/portal-tools.properties" />\r
+ <arg value="docroot/WEB-INF/server-config.wsdd" />\r
+ <arg value="docroot/WEB-INF/client/src" />\r
+ <arg value="docroot/WEB-INF/client/namespace-mapping.properties" />\r
+ <arg value="${client.url}" />\r
+ </java>\r
+\r
+ <mkdir dir="docroot/WEB-INF/client/classes" />\r
+\r
+ <antcall target="compile-java">\r
+ <param name="javac.classpathref" value="portal.classpath" />\r
+ <param name="javac.destdir" value="docroot/WEB-INF/client/classes" />\r
+ <param name="javac.srcdir" value="docroot/WEB-INF/client/src" />\r
+ </antcall>\r
+\r
+ <zip destfile="docroot/WEB-INF/client/${plugin.name}-client.jar">\r
+ <fileset dir="docroot/WEB-INF/client/classes" />\r
+ <fileset dir="docroot/WEB-INF/client/src" />\r
+ </zip>\r
+\r
+ <delete dir="docroot/WEB-INF/client/classes" />\r
+ <delete dir="docroot/WEB-INF/client/src" />\r
+ </target>\r
+\r
+ <target name="build-db">\r
+ <java\r
+ classname="com.liferay.portal.tools.DBBuilder"\r
+ classpathref="portal.classpath"\r
+ fork="true"\r
+ maxmemory="384m"\r
+ newenvironment="true"\r
+ >\r
+ <arg value="-Dexternal-properties=com/liferay/portal/tools/dependencies/portal-tools.properties" />\r
+ <arg value="db.database.name=${database.name}" />\r
+ <arg value="db.database.types=${database.types}" />\r
+ <arg value="db.sql.dir=docroot/WEB-INF/sql" />\r
+ </java>\r
+\r
+ <delete file="velocity.log" quiet="true" />\r
+ </target>\r
+\r
+ <target name="build-lang">\r
+ <antcall target="build-lang-cmd">\r
+ <param name="lang.dir" value="docroot/WEB-INF/src/content" />\r
+ <param name="lang.file" value="Language" />\r
+ <param name="lang.translate" value="true" />\r
+ </antcall>\r
+ </target>\r
+\r
+ <target name="build-lang-cmd">\r
+ <java\r
+ classname="com.liferay.portal.tools.LangBuilder"\r
+ classpathref="portal.classpath"\r
+ fork="true"\r
+ newenvironment="true"\r
+ >\r
+ <jvmarg value="-Dexternal-properties=com/liferay/portal/tools/dependencies/portal-tools.properties" />\r
+ <jvmarg value="-Dfile.encoding=UTF-8" />\r
+ <jvmarg value="-Duser.country=US" />\r
+ <jvmarg value="-Duser.language=en" />\r
+ <arg value="lang.dir=${lang.dir}" />\r
+ <arg value="lang.file=${lang.file}" />\r
+ <arg value="lang.plugin=true" />\r
+ <arg value="lang.translate=${lang.translate}" />\r
+ </java>\r
+\r
+ <copy file="${lang.dir}/${lang.file}.properties" tofile="${lang.dir}/${lang.file}_en.properties" />\r
+ </target>\r
+\r
+ <target name="build-service">\r
+ <mkdir dir="docroot/WEB-INF/classes" />\r
+ <mkdir dir="docroot/WEB-INF/lib" />\r
+ <mkdir dir="docroot/WEB-INF/service" />\r
+ <mkdir dir="docroot/WEB-INF/sql" />\r
+ <mkdir dir="docroot/WEB-INF/src" />\r
+\r
+ <copy todir="docroot/WEB-INF/classes">\r
+ <fileset dir="docroot/WEB-INF/src" excludes="**/*.java" />\r
+ </copy>\r
+\r
+ <path id="service.classpath">\r
+ <path refid="lib.classpath" />\r
+ <path refid="portal.classpath" />\r
+ <fileset dir="${app.server.lib.portal.dir}" includes="commons-digester.jar,commons-lang.jar,easyconf.jar" />\r
+ <fileset dir="docroot/WEB-INF/lib" includes="*.jar" />\r
+ <pathelement location="docroot/WEB-INF/classes" />\r
+ </path>\r
+\r
+ <if>\r
+ <not>\r
+ <isset property="service.input.file" />\r
+ </not>\r
+ <then>\r
+ <property name="service.input.file" value="${basedir}/docroot/WEB-INF/service.xml" />\r
+ </then>\r
+ </if>\r
+\r
+ <java\r
+ classname="com.liferay.portal.tools.servicebuilder.ServiceBuilder"\r
+ classpathref="service.classpath"\r
+ fork="true"\r
+ newenvironment="true"\r
+ outputproperty="service.test.output"\r
+ >\r
+ <jvmarg value="-Xms512m" />\r
+ <jvmarg value="-Xmx1024m" />\r
+ <jvmarg value="-Xss2048k" />\r
+ <jvmarg value="-XX:MaxPermSize=512m" />\r
+ <arg value="-Dexternal-properties=com/liferay/portal/tools/dependencies/portal-tools.properties" />\r
+ <arg value="-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger" />\r
+ <arg value="service.input.file=${service.input.file}" />\r
+ <arg value="service.hbm.file=${basedir}/docroot/WEB-INF/src/META-INF/portlet-hbm.xml" />\r
+ <arg value="service.orm.file=${basedir}/docroot/WEB-INF/src/META-INF/portlet-orm.xml" />\r
+ <arg value="service.model.hints.file=${basedir}/docroot/WEB-INF/src/META-INF/portlet-model-hints.xml" />\r
+ <arg value="service.spring.file=${basedir}/docroot/WEB-INF/src/META-INF/portlet-spring.xml" />\r
+ <arg value="service.spring.base.file=${basedir}/docroot/WEB-INF/src/META-INF/base-spring.xml" />\r
+ <arg value="service.spring.cluster.file=${basedir}/docroot/WEB-INF/src/META-INF/cluster-spring.xml" />\r
+ <arg value="service.spring.dynamic.data.source.file=${basedir}/docroot/WEB-INF/src/META-INF/dynamic-data-source-spring.xml" />\r
+ <arg value="service.spring.hibernate.file=${basedir}/docroot/WEB-INF/src/META-INF/hibernate-spring.xml" />\r
+ <arg value="service.spring.infrastructure.file=${basedir}/docroot/WEB-INF/src/META-INF/infrastructure-spring.xml" />\r
+ <arg value="service.spring.shard.data.source.file=${basedir}/docroot/WEB-INF/src/META-INF/shard-data-source-spring.xml" />\r
+ <arg value="service.api.dir=${basedir}/docroot/WEB-INF/service" />\r
+ <arg value="service.impl.dir=${basedir}/docroot/WEB-INF/src" />\r
+ <arg value="service.json.file=${basedir}/docroot/js/service.js" />\r
+ <arg value="service.sql.dir=${basedir}/docroot/WEB-INF/sql" />\r
+ <arg value="service.sql.file=tables.sql" />\r
+ <arg value="service.sql.indexes.file=indexes.sql" />\r
+ <arg value="service.sql.indexes.properties.file=indexes.properties" />\r
+ <arg value="service.sql.sequences.file=sequences.sql" />\r
+ <arg value="service.auto.namespace.tables=true" />\r
+ <arg value="service.bean.locator.util=com.liferay.util.bean.PortletBeanLocatorUtil" />\r
+ <arg value="service.props.util=com.liferay.util.service.ServiceProps" />\r
+ <arg value="service.plugin.name=${plugin.name}" />\r
+ <arg value="service.target.entity.name=${service.target.entity.name}" />\r
+ </java>\r
+\r
+ <echo>${service.test.output}</echo>\r
+\r
+ <if>\r
+ <contains string="${service.test.output}" substring="Error" />\r
+ <then>\r
+ <fail>Service Builder generated exceptions.</fail>\r
+ </then>\r
+ </if>\r
+\r
+ <delete file="ServiceBuilder.temp" />\r
+\r
+ <mkdir dir="docroot/WEB-INF/service-classes" />\r
+\r
+ <path id="service.classpath">\r
+ <fileset dir="${app.server.lib.global.dir}" includes="*.jar" />\r
+ <fileset dir="${project.dir}/lib" includes="activation.jar,jsp-api.jar,mail.jar,servlet-api.jar" />\r
+ <fileset dir="docroot/WEB-INF/lib" excludes="${plugin.name}-service.jar" includes="*.jar" />\r
+ </path>\r
+\r
+ <antcall target="compile-java">\r
+ <param name="javac.classpathref" value="service.classpath" />\r
+ <param name="javac.destdir" value="docroot/WEB-INF/service-classes" />\r
+ <param name="javac.srcdir" value="docroot/WEB-INF/service" />\r
+ <reference refid="service.classpath" torefid="service.classpath" />\r
+ </antcall>\r
+\r
+ <zip\r
+ basedir="docroot/WEB-INF/service-classes"\r
+ destfile="docroot/WEB-INF/lib/${plugin.name}-service.jar"\r
+ />\r
+\r
+ <delete dir="docroot/WEB-INF/service-classes" />\r
+ </target>\r
+\r
+ <target name="build-wsdd" depends="compile">\r
+ <path id="wsdd.classpath">\r
+ <path refid="lib.classpath" />\r
+ <path refid="portal.classpath" />\r
+ <fileset dir="docroot/WEB-INF/lib" includes="*.jar" />\r
+ <pathelement location="docroot/WEB-INF/classes" />\r
+ </path>\r
+\r
+ <java\r
+ classname="com.liferay.portal.tools.WSDDBuilder"\r
+ classpathref="wsdd.classpath"\r
+ fork="true"\r
+ maxmemory="256m"\r
+ newenvironment="true"\r
+ >\r
+ <jvmarg value="-Dexternal-properties=com/liferay/portal/tools/dependencies/portal-tools.properties" />\r
+ <jvmarg value="-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger" />\r
+ <arg value="wsdd.input.file=docroot/WEB-INF/service.xml" />\r
+ <arg value="wsdd.server.config.file=docroot/WEB-INF/server-config.wsdd" />\r
+ <arg value="wsdd.service.namespace=Plugin" />\r
+ <arg value="wsdd.output.path=docroot/WEB-INF/src/" />\r
+ </java>\r
+ </target>\r
+\r
+ <target name="build-wsdl">\r
+ <for param="wsdl.full.path">\r
+ <path>\r
+ <fileset dir="." includes="docroot/WEB-INF/wsdl/*.wsdl" />\r
+ </path>\r
+ <sequential>\r
+ <tstamp>\r
+ <format property="tstamp.value" pattern="yyyyMMddkkmmssSSS" />\r
+ </tstamp>\r
+\r
+ <mkdir dir="${tstamp.value}" />\r
+\r
+ <taskdef classpathref="portal.classpath" resource="axis-tasks.properties" />\r
+\r
+ <axis-wsdl2java\r
+ output="${tstamp.value}"\r
+ url="@{wsdl.full.path}"\r
+ />\r
+\r
+ <path id="plugin-lib.classpath">\r
+ <fileset dir="docroot/WEB-INF/lib" includes="*.jar" />\r
+ <pathelement location="docroot/WEB-INF/classes" />\r
+ </path>\r
+\r
+ <antcall target="compile-java">\r
+ <param name="javac.classpathref" value="plugin.classpath" />\r
+ <param name="javac.destdir" value="${tstamp.value}" />\r
+ <param name="javac.srcdir" value="${tstamp.value}" />\r
+ <reference refid="plugin-lib.classpath" torefid="plugin-lib.classpath" />\r
+ </antcall>\r
+\r
+ <antelope:stringutil string="@{wsdl.full.path}" property="wsdl.name.beginindex">\r
+ <antelope:lastindexof string="${file.separator}" />\r
+ </antelope:stringutil>\r
+\r
+ <antelope:math\r
+ datatype="int"\r
+ operand1="${wsdl.name.beginindex}"\r
+ operand2="1"\r
+ operation="+"\r
+ result="wsdl.name.beginindex"\r
+ />\r
+\r
+ <antelope:stringutil string="@{wsdl.full.path}" property="wsdl.file">\r
+ <antelope:substring beginindex="${wsdl.name.beginindex}" />\r
+ </antelope:stringutil>\r
+\r
+ <antelope:stringutil string="@{wsdl.full.path}" property="wsdl.name.endindex">\r
+ <antelope:lastindexof string="." />\r
+ </antelope:stringutil>\r
+\r
+ <antelope:stringutil string="@{wsdl.full.path}" property="wsdl.name">\r
+ <antelope:substring beginindex="${wsdl.name.beginindex}" endindex="${wsdl.name.endindex}" />\r
+ </antelope:stringutil>\r
+\r
+ <jar\r
+ basedir="${tstamp.value}"\r
+ jarfile="docroot/WEB-INF/lib/${wsdl.name}-ws.jar"\r
+ />\r
+\r
+ <delete dir="${tstamp.value}" />\r
+ </sequential>\r
+ </for>\r
+ </target>\r
+\r
+ <target name="build-xsd">\r
+ <tstamp>\r
+ <format property="tstamp.value" pattern="yyyyMMddkkmmssSSS" />\r
+ </tstamp>\r
+\r
+ <mkdir dir="${tstamp.value}" />\r
+\r
+ <path id="plugin-lib.classpath">\r
+ <fileset dir="${app.server.lib.portal.dir}" includes="xbean.jar" />\r
+ <fileset dir="docroot/WEB-INF/lib" includes="*.jar" />\r
+ <pathelement location="docroot/WEB-INF/classes" />\r
+ </path>\r
+\r
+ <taskdef classname="org.apache.xmlbeans.impl.tool.XMLBean" classpathref="portal.classpath" name="xmlbean" />\r
+\r
+ <xmlbean\r
+ classgendir="${tstamp.value}"\r
+ classpathref="plugin-lib.classpath"\r
+ srcgendir="${tstamp.value}"\r
+ >\r
+ <fileset dir="docroot/WEB-INF/xsd" includes="**/*.*" />\r
+ </xmlbean>\r
+\r
+ <zip\r
+ basedir="${tstamp.value}"\r
+ destfile="docroot/WEB-INF/lib/${plugin.name}-xbean.jar"\r
+ />\r
+\r
+ <delete dir="${tstamp.value}" />\r
+ </target>\r
+\r
+ <target name="clean" description="clean">\r
+ <delete dir="docroot/WEB-INF/classes" />\r
+\r
+ <if>\r
+ <and>\r
+ <available file="docroot/WEB-INF/.gitignore" />\r
+ </and>\r
+ <then>\r
+ <loadfile property=".gitignore.content" srcFile="docroot/WEB-INF/.gitignore" />\r
+\r
+ <if>\r
+ <contains string="${.gitignore.content}" substring="/lib" />\r
+ <then>\r
+ <delete dir="docroot/WEB-INF/lib" />\r
+ </then>\r
+ </if>\r
+ </then>\r
+ </if>\r
+\r
+ <if>\r
+ <and>\r
+ <available file="docroot/WEB-INF/.svn" />\r
+ <not>\r
+ <available file="docroot/WEB-INF/lib/.svn" />\r
+ </not>\r
+ </and>\r
+ <then>\r
+ <delete dir="docroot/WEB-INF/lib" />\r
+ </then>\r
+ </if>\r
+\r
+ <delete dir="test-classes" />\r
+ <delete dir="test-results" />\r
+ <delete dir="tmp" />\r
+ <delete file="${plugin.file}" />\r
+ <delete file="${plugin.src.file}" />\r
+\r
+ <delete includeemptydirs="true">\r
+ <fileset dir="docroot" includes="**/.sass-cache/**" />\r
+ <fileset dir="docroot" includes="**/.sprite.png" />\r
+ <fileset dir="docroot" includes="**/.sprite.properties" />\r
+ <fileset dir="docroot" includes="**/Thumbs.db" />\r
+ </delete>\r
+\r
+ <antcall target="clean-portal-dependencies" />\r
+ </target>\r
+\r
+ <target name="clean-portal-dependencies">\r
+ <if>\r
+ <available file="docroot/WEB-INF/lib" />\r
+ <then>\r
+ <delete>\r
+ <fileset dir="docroot/WEB-INF/lib" includes="${required.portal.jars}" />\r
+ <fileset dir="docroot/WEB-INF/lib" includes="${plugin.jars}" />\r
+ </delete>\r
+ </then>\r
+ </if>\r
+\r
+ <if>\r
+ <available file="docroot/WEB-INF/tld" />\r
+ <then>\r
+ <delete>\r
+ <fileset dir="docroot/WEB-INF/tld" includes="${plugin.tlds}" />\r
+ </delete>\r
+ </then>\r
+ </if>\r
+\r
+ <if>\r
+ <available file="tmp/WEB-INF/lib" />\r
+ <then>\r
+ <delete>\r
+ <fileset dir="tmp/WEB-INF/lib" includes="${required.portal.jars}" />\r
+ <fileset dir="tmp/WEB-INF/lib" includes="${plugin.jars}" />\r
+ </delete>\r
+ </then>\r
+ </if>\r
+\r
+ <if>\r
+ <available file="tmp/WEB-INF/tld" />\r
+ <then>\r
+ <delete>\r
+ <fileset dir="tmp/WEB-INF/tld" includes="${plugin.tlds}" />\r
+ </delete>\r
+ </then>\r
+ </if>\r
+ </target>\r
+\r
+ <target name="compile">\r
+ <antcall target="merge" />\r
+\r
+ <mkdir dir="docroot/WEB-INF/classes" />\r
+ <mkdir dir="docroot/WEB-INF/lib" />\r
+\r
+ <copy todir="docroot/WEB-INF/lib">\r
+ <fileset dir="${app.server.lib.portal.dir}" includes="${plugin.jars}" />\r
+ </copy>\r
+\r
+ <if>\r
+ <isset property="plugin-package.required-deployment-contexts" />\r
+ <then>\r
+ <for list="${plugin-package.required-deployment-contexts}" param="required.deployment.context">\r
+ <sequential>\r
+ <if>\r
+ <available file="${project.dir}/hooks/@{required.deployment.context}/docroot/WEB-INF/lib/@{required.deployment.context}-service.jar" />\r
+ <then>\r
+ <copy\r
+ file="${project.dir}/hooks/@{required.deployment.context}/docroot/WEB-INF/lib/@{required.deployment.context}-service.jar"\r
+ todir="docroot/WEB-INF/lib"\r
+ overwrite="true"\r
+ />\r
+ </then>\r
+ <elseif>\r
+ <available file="${project.dir}/portlets/@{required.deployment.context}/docroot/WEB-INF/lib/@{required.deployment.context}-service.jar" />\r
+ <then>\r
+ <copy\r
+ file="${project.dir}/portlets/@{required.deployment.context}/docroot/WEB-INF/lib/@{required.deployment.context}-service.jar"\r
+ todir="docroot/WEB-INF/lib"\r
+ overwrite="true"\r
+ />\r
+ </then>\r
+ </elseif>\r
+ <elseif>\r
+ <available file="${project.dir}/webs/@{required.deployment.context}/docroot/WEB-INF/lib/@{required.deployment.context}-service.jar" />\r
+ <then>\r
+ <copy\r
+ file="${project.dir}/webs/@{required.deployment.context}/docroot/WEB-INF/lib/@{required.deployment.context}-service.jar"\r
+ todir="docroot/WEB-INF/lib"\r
+ overwrite="true"\r
+ />\r
+ </then>\r
+ </elseif>\r
+ </if>\r
+ </sequential>\r
+ </for>\r
+ </then>\r
+ </if>\r
+\r
+ <copy todir="docroot/WEB-INF/tld">\r
+ <fileset dir="${app.server.portal.dir}/WEB-INF/tld" includes="${plugin.tlds}" />\r
+ </copy>\r
+\r
+ <if>\r
+ <available file="docroot/WEB-INF/src" />\r
+ <then>\r
+ <if>\r
+ <available file="tmp" />\r
+ <then>\r
+ <path id="plugin-lib.classpath">\r
+ <fileset dir="docroot/WEB-INF/lib" includes="*.jar" />\r
+ <fileset dir="tmp/WEB-INF/lib" includes="*.jar" />\r
+ <pathelement location="docroot/WEB-INF/classes" />\r
+ <pathelement location="tmp/WEB-INF/classes" />\r
+ </path>\r
+ </then>\r
+ <else>\r
+ <path id="plugin-lib.classpath">\r
+ <fileset dir="docroot/WEB-INF/lib" includes="*.jar" />\r
+ <pathelement location="docroot/WEB-INF/classes" />\r
+ </path>\r
+ </else>\r
+ </if>\r
+\r
+ <copy todir="docroot/WEB-INF/lib">\r
+ <fileset dir="${app.server.lib.portal.dir}" includes="${required.portal.jars}" />\r
+ </copy>\r
+\r
+ <if>\r
+ <available file="docroot/WEB-INF/lib/portal-impl.jar" />\r
+ <then>\r
+ <fail>\r
+.\r
+\r
+Detected inclusion of portal-impl.jar in WEB-INF/lib.\r
+\r
+portal-impl.jar is designed with a large number of singleton classes which are\r
+instantiated on the basis that they will exist alone in the application server.\r
+\r
+While compile time issues may be resolved, portlets cannot be made to work by\r
+simply adding portal-impl.jar, because doing so violates the above assumption,\r
+and the resulting problems will be extremely difficult to debug.\r
+\r
+Please find a solution that does not require portal-impl.jar.\r
+ </fail>\r
+ </then>\r
+ </if>\r
+\r
+ <antcall target="compile-java">\r
+ <param name="javac.classpathref" value="plugin.classpath" />\r
+ <param name="javac.destdir" value="docroot/WEB-INF/classes" />\r
+ <param name="javac.srcdir" value="docroot/WEB-INF/src" />\r
+ <reference refid="plugin-lib.classpath" torefid="plugin-lib.classpath" />\r
+ </antcall>\r
+ </then>\r
+ </if>\r
+\r
+ <antcall target="merge" />\r
+ </target>\r
+\r
+ <target name="compile-test">\r
+ <antcall target="compile-test-integration" inheritall="false" />\r
+ <antcall target="compile-test-unit" inheritall="false" />\r
+ </target>\r
+\r
+ <target name="compile-test-cmd">\r
+ <if>\r
+ <available file="test/${test.type}" type="dir" />\r
+ <then>\r
+ <mkdir dir="test-classes/${test.type}" />\r
+ <mkdir dir="test-results/${test.type}" />\r
+\r
+ <copy todir="test-classes/${test.type}">\r
+ <fileset dir="test" includes="*.properties" />\r
+ <fileset dir="test/${test.type}" includes="**/*.png,**/*.properties,**/*.xml" />\r
+ </copy>\r
+\r
+ <if>\r
+ <available file="tmp" />\r
+ <then>\r
+ <path id="plugin-lib.classpath">\r
+ <fileset dir="docroot/WEB-INF/lib" includes="*.jar" />\r
+ <fileset dir="tmp/WEB-INF/lib" includes="*.jar" />\r
+ <pathelement location="docroot/WEB-INF/classes" />\r
+ <pathelement location="tmp/WEB-INF/classes" />\r
+ </path>\r
+ </then>\r
+ <else>\r
+ <path id="plugin-lib.classpath">\r
+ <fileset dir="docroot/WEB-INF/lib" includes="*.jar" />\r
+ <pathelement location="docroot/WEB-INF/classes" />\r
+ </path>\r
+ </else>\r
+ </if>\r
+\r
+ <antcall target="compile-java">\r
+ <param name="javac.classpathref" value="test.classpath" />\r
+ <param name="javac.destdir" value="test-classes/${test.type}" />\r
+ <param name="javac.srcdir" value="test/${test.type}" />\r
+ <reference refid="plugin-lib.classpath" torefid="plugin-lib.classpath" />\r
+ </antcall>\r
+ </then>\r
+ </if>\r
+ </target>\r
+\r
+ <target name="compile-test-integration">\r
+ <ant target="compile-test-cmd">\r
+ <property name="test.type" value="integration" />\r
+ </ant>\r
+ </target>\r
+\r
+ <target name="compile-test-unit">\r
+ <ant target="compile-test-cmd">\r
+ <property name="test.type" value="unit" />\r
+ </ant>\r
+ </target>\r
+\r
+ <target name="deploy" depends="war">\r
+ <copy file="${plugin.file}" todir="${auto.deploy.dir}" />\r
+ </target>\r
+\r
+ <target name="direct-deploy" depends="war">\r
+ <if>\r
+ <antelope:endswith string="${plugin.name}" with="-ext" />\r
+ <then>\r
+ <java\r
+ classname="com.liferay.portal.tools.deploy.ExtDeployer"\r
+ classpathref="portal.classpath"\r
+ fork="true"\r
+ newenvironment="true"\r
+ >\r
+\r
+ <!-- Required Arguments -->\r
+\r
+ <jvmarg value="-Dexternal-properties=com/liferay/portal/tools/dependencies/portal-tools.properties" />\r
+ <jvmarg value="-Dliferay.lib.portal.dir=${app.server.lib.portal.dir}" />\r
+ <jvmarg value="-Ddeployer.base.dir=${project.dir}/dist" />\r
+ <jvmarg value="-Ddeployer.dest.dir=${app.server.deploy.dir}" />\r
+ <jvmarg value="-Ddeployer.app.server.type=${app.server.type}" />\r
+ <jvmarg value="-Ddeployer.unpack.war=${auto.deploy.unpack.war}" />\r
+ <jvmarg value="-Ddeployer.file.pattern=${plugin.name}-*.war" />\r
+\r
+ <!-- Optional Arguments -->\r
+\r
+ <jvmarg value="-Ddeployer.tomcat.lib.dir=${app.server.tomcat.lib.global.dir}" />\r
+\r
+ <!-- Dependent Libraries -->\r
+\r
+ <arg value="${app.server.lib.portal.dir}/util-java.jar" />\r
+ </java>\r
+ </then>\r
+ <elseif>\r
+ <antelope:endswith string="${plugin.name}" with="-hook" />\r
+ <then>\r
+ <java\r
+ classname="com.liferay.portal.tools.deploy.HookDeployer"\r
+ classpathref="portal.classpath"\r
+ fork="true"\r
+ newenvironment="true"\r
+ >\r
+\r
+ <!-- Required Arguments -->\r
+\r
+ <jvmarg value="-Dexternal-properties=com/liferay/portal/tools/dependencies/portal-tools.properties" />\r
+ <jvmarg value="-Dliferay.lib.portal.dir=${app.server.lib.portal.dir}" />\r
+ <jvmarg value="-Ddeployer.base.dir=${project.dir}/dist" />\r
+ <jvmarg value="-Ddeployer.dest.dir=${app.server.deploy.dir}" />\r
+ <jvmarg value="-Ddeployer.app.server.type=${app.server.type}" />\r
+ <jvmarg value="-Ddeployer.unpack.war=${auto.deploy.unpack.war}" />\r
+ <jvmarg value="-Ddeployer.file.pattern=${plugin.name}-*.war" />\r
+\r
+ <!-- Optional Arguments -->\r
+\r
+ <jvmarg value="-Ddeployer.tomcat.lib.dir=${app.server.tomcat.lib.global.dir}" />\r
+\r
+ <!-- Dependent Libraries -->\r
+\r
+ <arg value="${app.server.lib.portal.dir}/util-java.jar" />\r
+ </java>\r
+ </then>\r
+ </elseif>\r
+ <elseif>\r
+ <antelope:endswith string="${plugin.name}" with="-layouttpl" />\r
+ <then>\r
+ <java\r
+ classname="com.liferay.portal.tools.deploy.LayoutTemplateDeployer"\r
+ classpathref="portal.classpath"\r
+ fork="true"\r
+ newenvironment="true"\r
+ >\r
+\r
+ <!-- Required Arguments -->\r
+\r
+ <jvmarg value="-Dexternal-properties=com/liferay/portal/tools/dependencies/portal-tools.properties" />\r
+ <jvmarg value="-Dliferay.lib.portal.dir=${app.server.lib.portal.dir}" />\r
+ <jvmarg value="-Ddeployer.base.dir=${project.dir}/dist" />\r
+ <jvmarg value="-Ddeployer.dest.dir=${app.server.deploy.dir}" />\r
+ <jvmarg value="-Ddeployer.app.server.type=${app.server.type}" />\r
+ <jvmarg value="-Ddeployer.unpack.war=${auto.deploy.unpack.war}" />\r
+ <jvmarg value="-Ddeployer.file.pattern=${plugin.name}-*.war" />\r
+ </java>\r
+ </then>\r
+ </elseif>\r
+ <elseif>\r
+ <antelope:endswith string="${plugin.name}" with="-portlet" />\r
+ <then>\r
+ <java\r
+ classname="com.liferay.portal.tools.deploy.PortletDeployer"\r
+ classpathref="portal.classpath"\r
+ fork="true"\r
+ newenvironment="true"\r
+ >\r
+\r
+ <!-- Required Arguments -->\r
+\r
+ <jvmarg value="-Dexternal-properties=com/liferay/portal/tools/dependencies/portal-tools.properties" />\r
+ <jvmarg value="-Dliferay.lib.portal.dir=${app.server.lib.portal.dir}" />\r
+ <jvmarg value="-Ddeployer.base.dir=${project.dir}/dist" />\r
+ <jvmarg value="-Ddeployer.dest.dir=${app.server.deploy.dir}" />\r
+ <jvmarg value="-Ddeployer.app.server.type=${app.server.type}" />\r
+ <jvmarg value="-Ddeployer.aui.taglib.dtd=${app.server.portal.dir}/WEB-INF/tld/aui.tld" />\r
+ <jvmarg value="-Ddeployer.portlet.taglib.dtd=${app.server.portal.dir}/WEB-INF/tld/liferay-portlet.tld" />\r
+ <jvmarg value="-Ddeployer.portlet-ext.taglib.dtd=${app.server.portal.dir}/WEB-INF/tld/liferay-portlet-ext.tld" />\r
+ <jvmarg value="-Ddeployer.security.taglib.dtd=${app.server.portal.dir}/WEB-INF/tld/liferay-security.tld" />\r
+ <jvmarg value="-Ddeployer.theme.taglib.dtd=${app.server.portal.dir}/WEB-INF/tld/liferay-theme.tld" />\r
+ <jvmarg value="-Ddeployer.ui.taglib.dtd=${app.server.portal.dir}/WEB-INF/tld/liferay-ui.tld" />\r
+ <jvmarg value="-Ddeployer.util.taglib.dtd=${app.server.portal.dir}/WEB-INF/tld/liferay-util.tld" />\r
+ <jvmarg value="-Ddeployer.unpack.war=${auto.deploy.unpack.war}" />\r
+ <jvmarg value="-Ddeployer.custom.portlet.xml=${auto.deploy.custom.portlet.xml}" />\r
+ <jvmarg value="-Ddeployer.file.pattern=${plugin.name}-*.war" />\r
+\r
+ <!-- Optional Arguments -->\r
+\r
+ <jvmarg value="-Ddeployer.tomcat.lib.dir=${app.server.tomcat.lib.global.dir}" />\r
+\r
+ <!-- Dependent Libraries -->\r
+\r
+ <arg value="${app.server.lib.portal.dir}/util-bridges.jar" />\r
+ <arg value="${app.server.lib.portal.dir}/util-java.jar" />\r
+ <arg value="${app.server.lib.portal.dir}/util-taglib.jar" />\r
+ </java>\r
+ </then>\r
+ </elseif>\r
+ <elseif>\r
+ <antelope:endswith string="${plugin.name}" with="-theme" />\r
+ <then>\r
+ <java\r
+ classname="com.liferay.portal.tools.deploy.ThemeDeployer"\r
+ classpathref="portal.classpath"\r
+ fork="true"\r
+ newenvironment="true"\r
+ >\r
+\r
+ <!-- Required Arguments -->\r
+\r
+ <jvmarg value="-Dexternal-properties=com/liferay/portal/tools/dependencies/portal-tools.properties" />\r
+ <jvmarg value="-Dliferay.lib.portal.dir=${app.server.lib.portal.dir}" />\r
+ <jvmarg value="-Ddeployer.base.dir=${project.dir}/dist" />\r
+ <jvmarg value="-Ddeployer.dest.dir=${app.server.deploy.dir}" />\r
+ <jvmarg value="-Ddeployer.app.server.type=${app.server.type}" />\r
+ <jvmarg value="-Ddeployer.theme.taglib.dtd=${app.server.portal.dir}/WEB-INF/tld/liferay-theme.tld" />\r
+ <jvmarg value="-Ddeployer.util.taglib.dtd=${app.server.portal.dir}/WEB-INF/tld/liferay-util.tld" />\r
+ <jvmarg value="-Ddeployer.unpack.war=${auto.deploy.unpack.war}" />\r
+ <jvmarg value="-Ddeployer.file.pattern=${plugin.name}-*.war" />\r
+\r
+ <!-- Optional Arguments -->\r
+\r
+ <jvmarg value="-Ddeployer.tomcat.lib.dir=${app.server.tomcat.lib.global.dir}" />\r
+\r
+ <!-- Dependent Libraries -->\r
+\r
+ <arg value="${app.server.lib.portal.dir}/util-java.jar" />\r
+ <arg value="${app.server.lib.portal.dir}/util-taglib.jar" />\r
+ </java>\r
+ </then>\r
+ </elseif>\r
+ </if>\r
+ </target>\r
+\r
+ <target name="format-wsdl">\r
+ <for param="wsdl.full.path">\r
+ <path>\r
+ <fileset\r
+ dir="."\r
+ includes="docroot/WEB-INF/wsdl/*.wsdl,docroot/WEB-INF/wsdl/**/*.wsdl"\r
+ />\r
+ </path>\r
+ <sequential>\r
+ <java\r
+ classname="com.liferay.portal.tools.XMLFormatter"\r
+ classpathref="portal.classpath"\r
+ fork="true"\r
+ newenvironment="true"\r
+ >\r
+ <jvmarg value="-Dexternal-properties=com/liferay/portal/tools/dependencies/portal-tools.properties" />\r
+ <jvmarg value="-Dxml.formatter.file=@{wsdl.full.path}" />\r
+ <jvmarg value="-Dxml.formatter.strip.comments=true" />\r
+ </java>\r
+ </sequential>\r
+ </for>\r
+ </target>\r
+\r
+ <target name="format-xsd">\r
+ <for param="xsd.full.path">\r
+ <path>\r
+ <fileset\r
+ dir="."\r
+ includes="docroot/WEB-INF/xsd/*.xsd,docroot/WEB-INF/xsd/**/*.xsd"\r
+ />\r
+ </path>\r
+ <sequential>\r
+ <java\r
+ classname="com.liferay.portal.tools.XMLFormatter"\r
+ classpathref="portal.classpath"\r
+ fork="true"\r
+ newenvironment="true"\r
+ >\r
+ <jvmarg value="-Dexternal-properties=com/liferay/portal/tools/dependencies/portal-tools.properties" />\r
+ <jvmarg value="-Dxml.formatter.file=@{xsd.full.path}" />\r
+ <jvmarg value="-Dxml.formatter.strip.comments=true" />\r
+ </java>\r
+ </sequential>\r
+ </for>\r
+ </target>\r
+\r
+ <target name="merge" if="original.war.file">\r
+ <if>\r
+ <not>\r
+ <uptodate srcfile="${original.war.file}" targetfile="tmp" />\r
+ </not>\r
+ <then>\r
+ <delete dir="tmp" />\r
+ <mkdir dir="tmp" />\r
+\r
+ <mkdir dir="tmp/WEB-INF/classes" />\r
+ <mkdir dir="tmp/WEB-INF/lib" />\r
+\r
+ <antcall target="merge-unzip" />\r
+\r
+ <copy todir="tmp" overwrite="true">\r
+ <fileset dir="docroot" />\r
+ </copy>\r
+ </then>\r
+ </if>\r
+\r
+ <copy todir="tmp">\r
+ <fileset dir="docroot" />\r
+ </copy>\r
+ </target>\r
+\r
+ <target name="merge-unzip">\r
+ <unzip dest="tmp" src="${original.war.file}" />\r
+ </target>\r
+\r
+ <target name="shrink-zip-cmd">\r
+ <tstamp>\r
+ <format property="tstamp.value" pattern="yyyyMMddkkmmssSSS" />\r
+ </tstamp>\r
+\r
+ <unzip\r
+ dest="${tstamp.value}"\r
+ src="${zip.file.name}"\r
+ >\r
+ <patternset\r
+ excludes="${zip.excludes}"\r
+ includes="${zip.includes}"\r
+ />\r
+ </unzip>\r
+\r
+ <zip\r
+ basedir="${tstamp.value}"\r
+ destfile="${zip.file.name}"\r
+ />\r
+\r
+ <delete dir="${tstamp.value}" />\r
+ </target>\r
+\r
+ <target name="test">\r
+ <delete dir="test-classes" />\r
+ <delete dir="test-results" />\r
+\r
+ <antcall target="compile" />\r
+ <antcall target="compile-test" />\r
+\r
+ <if>\r
+ <available file="tmp" />\r
+ <then>\r
+ <path id="plugin-lib.classpath">\r
+ <fileset dir="docroot/WEB-INF/lib" includes="*.jar" />\r
+ <fileset dir="tmp/WEB-INF/lib" includes="*.jar" />\r
+ <pathelement location="docroot/WEB-INF/classes" />\r
+ <pathelement location="tmp/WEB-INF/classes" />\r
+ </path>\r
+ </then>\r
+ <else>\r
+ <path id="plugin-lib.classpath">\r
+ <fileset dir="docroot/WEB-INF/lib" includes="*.jar" />\r
+ <pathelement location="docroot/WEB-INF/classes" />\r
+ </path>\r
+ </else>\r
+ </if>\r
+\r
+ <antcall target="test-integration" inheritrefs="true" />\r
+ <antcall target="test-unit" inheritrefs="true" />\r
+ </target>\r
+\r
+ <target name="test-class" depends="compile,compile-test">\r
+ <if>\r
+ <available file="test/integration" type="dir" />\r
+ <then>\r
+ <resourcecount property="test.integration.count">\r
+ <fileset dir="test-classes/integration" includes="**/${class}.class" />\r
+ </resourcecount>\r
+ </then>\r
+ </if>\r
+\r
+ <if>\r
+ <available file="test/unit" type="dir" />\r
+ <then>\r
+ <resourcecount property="test.unit.count">\r
+ <fileset dir="test-classes/unit" includes="**/${class}.class" />\r
+ </resourcecount>\r
+ </then>\r
+ </if>\r
+\r
+ <if>\r
+ <equals arg1="${test.integration.count}" arg2="1" />\r
+ <then>\r
+ <var name="test.type" value="integration" />\r
+ </then>\r
+ <elseif>\r
+ <equals arg1="${test.unit.count}" arg2="1" />\r
+ <then>\r
+ <var name="test.type" value="unit" />\r
+ </then>\r
+ </elseif>\r
+ <else>\r
+ <var name="test.type" value="" />\r
+ </else>\r
+ </if>\r
+\r
+ <ant target="test-cmd">\r
+ <property name="test.type" value="${test.type}" />\r
+ </ant>\r
+ </target>\r
+\r
+ <target name="test-cmd">\r
+ <if>\r
+ <available file="test/${test.type}" type="dir" />\r
+ <then>\r
+ <junit dir="${project.dir}" fork="on" forkmode="once" outputtoformatters="false" printsummary="on" showoutput="true">\r
+ <sysproperty key="net.sourceforge.cobertura.datafile" file="test-coverage/cobertura.ser" />\r
+ <jvmarg line="${junit.debug.jpda}" />\r
+ <jvmarg value="-Xmx1024m" />\r
+ <jvmarg value="-XX:MaxPermSize=256m" />\r
+ <jvmarg value="-Dexternal-properties=${test.properties}" />\r
+ <jvmarg value="-Dfile.encoding=UTF-8" />\r
+ <jvmarg value="-Djava.net.preferIPv4Stack=true" />\r
+ <jvmarg value="-Duser.timezone=GMT" />\r
+ <classpath location="test-coverage" />\r
+ <classpath refid="test.classpath" />\r
+ <formatter type="brief" usefile="false" />\r
+ <formatter type="xml" />\r
+ <batchtest todir="test-results/${test.type}">\r
+ <fileset dir="test-classes/${test.type}" includes="**/${class}.class" />\r
+ </batchtest>\r
+ </junit>\r
+ </then>\r
+ </if>\r
+ </target>\r
+\r
+ <target name="test-integration" depends="compile,compile-test-integration">\r
+ <property name="class" value="*Test" />\r
+\r
+ <ant target="test-cmd" inheritrefs="true">\r
+ <property name="test.type" value="integration" />\r
+ </ant>\r
+ </target>\r
+\r
+ <target name="test-unit" depends="compile,compile-test-unit">\r
+ <property name="class" value="*Test" />\r
+\r
+ <ant target="test-cmd" inheritrefs="true">\r
+ <property name="test.type" value="unit" />\r
+ </ant>\r
+ </target>\r
+\r
+ <target name="war" depends="compile">\r
+ <mkdir dir="${project.dir}/dist" />\r
+\r
+ <if>\r
+ <available file="tmp" />\r
+ <then>\r
+ <property name="docroot.dir" value="tmp" />\r
+ </then>\r
+ <else>\r
+ <property name="docroot.dir" value="docroot" />\r
+ </else>\r
+ </if>\r
+\r
+ <delete file="${plugin.file}" />\r
+\r
+ <antcall target="clean-portal-dependencies" />\r
+\r
+ <if>\r
+ <contains string="${app.server.dir}" substring="glassfish" />\r
+ <then>\r
+ <zip\r
+ basedir="${docroot.dir}"\r
+ destfile="${plugin.file}"\r
+ excludes="**/META-INF/context.xml,${plugins.war.excludes}"\r
+ />\r
+ </then>\r
+ <else>\r
+ <zip\r
+ basedir="${docroot.dir}"\r
+ destfile="${plugin.file}"\r
+ excludes="${plugins.war.excludes}"\r
+ />\r
+ </else>\r
+ </if>\r
+\r
+ <if>\r
+ <and>\r
+ <equals arg1="${plugins.src.zip.enabled}" arg2="true" />\r
+ </and>\r
+ <then>\r
+ <zip destfile="${plugin.src.file}">\r
+ <zipfileset\r
+ dir="${docroot.dir}"\r
+ prefix="${plugin.name}-src-${lp.version}.${plugin.version}${lp.version.file.suffix}"\r
+ />\r
+ </zip>\r
+ </then>\r
+ </if>\r
+ </target>\r
+</project>\r