Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
987 lines (822 sloc) 28.2 KB
<?xml version="1.0"?>
<project name="portal" basedir="." default="compile" xmlns:antelope="antlib:ise.antelope.tasks" xmlns:artifact="antlib:org.apache.maven.artifact.ant">
<import file="build-common.xml" />
<macrodef name="setup-jrebel">
<sequential>
<echo file="${app.server.lib.global.dir}/rebel.xml"><![CDATA[<?xml version="1.0"?>
<application
xmlns="http://www.zeroturnaround.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.zeroturnaround.com http://www.zeroturnaround.com/alderaan/rebel-2_0.xsd"
>
<classpath>
<dir name="${basedir}/portal-service/classes" />
</classpath>
</application>]]></echo>
<echo file="${app.server.classes.portal.dir}/rebel.xml"><![CDATA[<?xml version="1.0"?>
<application
xmlns="http://www.zeroturnaround.com"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.zeroturnaround.com http://www.zeroturnaround.com/alderaan/rebel-2_0.xsd"
>
<classpath>
<dir name="${basedir}/portal-impl/classes" />
<dir name="${basedir}/util-java/classes" />
<dir name="${basedir}/util-bridges/classes" />
<dir name="${basedir}/util-taglib/classes" />
<dir name="${basedir}/util-slf4j/classes" />
</classpath>
<web>
<link target="/">
<dir name="${basedir}/portal-web/docroot/" />
</link>
</web>
</application>]]></echo>
<if>
<not>
<resourcecontains
resource="portal-impl/src/system-ext.properties"
substring="liferay.lib.portal.dir"
/>
</not>
<then>
<echo
append="true"
file="portal-impl/src/system-ext.properties"
>
liferay.lib.portal.dir=${app.server.lib.portal.dir}
</echo>
<copy
file="portal-impl/src/system-ext.properties"
overwrite="true"
tofile="portal-impl/classes/system-ext.properties"
/>
</then>
</if>
</sequential>
</macrodef>
<target name="all">
<antcall target="clean" />
<antcall target="compile" />
<antcall target="deploy" />
</target>
<target name="clean">
<parallel failonany="true" threadcount="${parallel.thread.count}">
<ant dir="benchmarks" target="clean" inheritAll="false" />
<ant dir="classes" target="clean" inheritAll="false" />
<ant dir="portal-service" target="clean" inheritAll="false" />
<ant dir="util-bridges" target="clean" inheritAll="false" />
<ant dir="util-java" target="clean" inheritAll="false" />
<ant dir="util-slf4j" target="clean" inheritAll="false" />
<ant dir="util-taglib" target="clean" inheritAll="false" />
<ant dir="portal-impl" target="clean" inheritAll="false" />
<ant dir="portal-test" target="clean" inheritAll="false" />
<ant dir="portal-test-internal" target="clean" inheritAll="false" />
<ant dir="sql" target="clean" inheritAll="false" />
<sequential>
<delete dir="${sdk.dir}" />
<setup-sdk />
<gradle-execute dir="${project.dir}/modules" task="clean">
<arg value="-Dportal.build=true" />
</gradle-execute>
</sequential>
<delete dir="${doc.dir}" />
<delete>
<fileset dir="." includes="*.ear,*.jar,*.war,*.zip" />
</delete>
<delete failonerror="false" includeemptydirs="true">
<fileset
dir="${app.server.bin.dir}"
includes="*.log*"
/>
</delete>
<delete dir="${liferay.home}/data/elasticsearch" />
<delete failonerror="false">
<fileset
dir="${liferay.home}/data/hypersonic"
includes="${database.name}.*"
/>
</delete>
<delete dir="${liferay.home}/osgi" failonerror="false" />
<delete dir="${liferay.home}/work" failonerror="false" />
<delete dir="test-coverage" />
<delete dir="test-results" />
<if>
<available file="support-${app.server.type}" />
<then>
<ant dir="support-${app.server.type}" target="clean" inheritAll="false" />
</then>
</if>
<delete failonerror="false">
<fileset
dir="${app.server.classes.portal.dir}"
includes="portal-*.properties,system-*.properties"
/>
</delete>
<delete failonerror="false" includeemptydirs="true">
<fileset
dir="${app.server.deploy.dir}"
includes="*-ext/**,*-ext.war/**,*-hook/**,*-hook.war/**,*-layouttpl/**,*-layouttpl.war/**,*-portlet/**,*-portlet.war/**,*-theme/**,*-theme.war/**,*-web/**,*-web.war/**"
/>
</delete>
<delete failonerror="false">
<fileset
dir="${app.server.lib.global.dir}"
excludes="${jdbc.drivers}"
/>
</delete>
<if>
<equals arg1="${clean.log.dir}" arg2="true" />
<then>
<delete dir="${app.server.log.dir}" />
</then>
</if>
<if>
<not>
<and>
<equals arg1="${app.server.type}" arg2="tomcat" />
<antelope:endswith string="${app.server.portal.dir}" with="/portal-web/docroot" />
</and>
</not>
<then>
<delete dir="${app.server.portal.dir}" failonerror="false" />
<delete file="${app.server.portal.dir}" failonerror="false" />
</then>
<else>
<delete failonerror="false">
<fileset
dir="${app.server.lib.portal.dir}"
excludes="${jdbc.drivers}"
/>
</delete>
</else>
</if>
<if>
<equals arg1="${clean.temp.dir}" arg2="true" />
<then>
<delete dir="${app.server.temp.dir}" />
</then>
</if>
<if>
<equals arg1="${clean.work.dir}" arg2="true" />
<then>
<delete dir="${app.server.work.dir}" />
</then>
</if>
</parallel>
<ant dir="portal-web" target="clean" inheritAll="false" />
<print-current-time />
</target>
<target name="compile">
<setup-sdk />
<delete file="javac.output.txt" />
<gradle-execute dir="modules/core/registry-api" task="classes">
<arg value="--parallel" />
</gradle-execute>
<ant dir="portal-service" target="compile" inheritAll="false" />
<parallel failonany="true" threadcount="${parallel.thread.count}">
<ant dir="portal-test" target="compile" inheritAll="false" />
<ant dir="support-tomcat" target="compile" inheritAll="false" />
<ant dir="util-bridges" target="compile" inheritAll="false" />
<sequential>
<ant dir="util-java" target="compile" inheritAll="false" />
<ant dir="util-taglib" target="compile" inheritAll="false" />
</sequential>
<ant dir="util-slf4j" target="compile" inheritAll="false" />
</parallel>
<ant dir="portal-impl" target="compile" inheritAll="false" />
<parallel failonany="true" threadcount="${parallel.thread.count}">
<ant dir="portal-test-internal" target="compile" inheritAll="false" />
<sequential>
<ant dir="sql" target="build-db" inheritAll="false" />
<ant dir="sql" target="rebuild-hypersonic" inheritAll="false" />
</sequential>
</parallel>
<if>
<available file="javac.output.txt" />
<then>
<fail message="Deprecated APIs detected. Please see javac.output.txt for details." />
</then>
</if>
<print-current-time />
</target>
<target name="compile-test">
<ant dir="portal-impl" target="compile-test" inheritAll="false" />
<ant dir="portal-service" target="compile-test" inheritAll="false" />
<ant dir="portal-web" target="compile-test" inheritAll="false" />
<ant dir="util-java" target="compile-test" inheritAll="false" />
</target>
<target name="deploy">
<setup-sdk />
<if>
<or>
<equals arg1="${app.server.type}" arg2="glassfish" />
<equals arg1="${app.server.type}" arg2="websphere" />
</or>
<then>
<delete file="${app.server.portal.war.name}" />
</then>
</if>
<if>
<and>
<equals arg1="${app.server.type}" arg2="tomcat" />
<not>
<available file="${app.server.tomcat.classes.global.dir}/catalina.jar" />
</not>
</and>
<then>
<ant antfile="build-dist.xml" target="unzip-tomcat" />
</then>
</if>
<ant dir="portal-service" target="deploy" inheritAll="false" />
<ant dir="util-bridges" target="deploy" inheritAll="false" />
<ant dir="util-java" target="deploy" inheritAll="false" />
<ant dir="util-slf4j" target="deploy" inheritAll="false" />
<ant dir="util-taglib" target="deploy" inheritAll="false" />
<ant dir="portal-impl" target="deploy" inheritAll="false" />
<ant dir="portal-test" target="deploy" inheritAll="false" />
<ant dir="portal-test-internal" target="deploy" inheritAll="false" />
<ant dir="portal-web" target="deploy" inheritAll="false" />
<copy todir="${liferay.home}/data/hypersonic">
<fileset dir="sql">
<include name="${database.name}.properties" />
<include name="${database.name}.script" />
</fileset>
</copy>
<deploy-properties />
<antcall target="deploy-additional-jars" />
<antcall target="update-app-server-scripts" />
<mkdir dir="${app.server.log.dir}" />
<mkdir dir="${app.server.temp.dir}" />
<mkdir dir="${app.server.work.dir}" />
<if>
<and>
<equals arg1="${app.server.type}" arg2="glassfish" />
<not>
<available file="${app.server.portal.dir}" type="dir" />
</not>
</and>
<then>
<move file="${app.server.portal.war.name}" tofile="${app.server.portal.war.name}-tmp" />
<mkdir dir="${app.server.portal.dir}" />
<unzip src="${app.server.portal.war.name}-tmp" dest="${app.server.portal.dir}" />
</then>
</if>
<ant dir="portal-web" target="war" inheritAll="false" />
<antcall target="install-portal-snapshots" />
<stopwatch name="modules.stopwatch" />
<gradle-execute dir="${project.dir}/modules/core/registry-api" task="deploy">
<arg value="--parallel" />
</gradle-execute>
<if>
<equals arg1="${jsp.precompile}" arg2="on" />
<then>
<if>
<equals arg1="${jsp.precompile.parallel}" arg2="on" />
<then>
<gradle-execute dir="${project.dir}/modules" task="compileJSP">
<arg value="deploy" />
<arg value="--parallel" />
<arg value="-Dportal.build=true" />
<env key="WAS_HOME" value="${app.server.websphere.dir}" />
</gradle-execute>
</then>
<else>
<gradle-execute dir="${project.dir}/modules" task="deploy">
<arg value="--parallel" />
<arg value="-Dportal.build=true" />
<env key="WAS_HOME" value="${app.server.websphere.dir}" />
</gradle-execute>
<gradle-execute dir="${project.dir}/modules" task="compileJSP" />
</else>
</if>
</then>
<else>
<gradle-execute dir="${project.dir}/modules" task="deploy">
<arg value="--parallel" />
<arg value="-Dportal.build=true" />
<env key="WAS_HOME" value="${app.server.websphere.dir}" />
</gradle-execute>
</else>
</if>
<stopwatch action="elapsed" name="modules.stopwatch" />
<if>
<and>
<available file="${app.server.portal.dir}" type="dir" />
<available file="${app.server.portal.war.name}-tmp" type="file" />
<equals arg1="${app.server.type}" arg2="glassfish" />
</and>
<then>
<delete dir="${app.server.portal.dir}" />
<move file="${app.server.portal.war.name}-tmp" tofile="${app.server.portal.war.name}" />
</then>
</if>
<print-current-time />
</target>
<target name="deploy-additional-jars">
<copy todir="${app.server.lib.global.dir}">
<fileset dir="lib/development" includes="hsql.jar,mysql.jar,postgresql.jar" />
<fileset dir="lib/global" />
</copy>
<if>
<isset property="jdbc.drivers.optional.dir" />
<then>
<copy todir="${app.server.lib.global.dir}">
<fileset
dir="${jdbc.drivers.optional.dir}"
includes="${jdbc.drivers}"
/>
</copy>
</then>
</if>
<copy todir="${app.server.lib.portal.dir}">
<fileset dir="lib/portal" />
</copy>
<if>
<equals arg1="${app.server.type}" arg2="jetty" />
<then>
<copy todir="${app.server.lib.global.dir}">
<fileset
dir="lib/development"
includes="activation.jar,jta.jar,mail.jar,persistence.jar"
/>
</copy>
</then>
</if>
<if>
<equals arg1="${app.server.type}" arg2="jonas" />
<then>
<delete>
<fileset
dir="${app.server.lib.portal.dir}"
includes="equinox.jar,osgi.core.jar,xalan.jar,xercesImpl.jar,xml-apis.jar"
/>
</delete>
</then>
</if>
<if>
<equals arg1="${app.server.type}" arg2="resin" />
<then>
<ant dir="support-resin" target="deploy" inheritAll="false" />
<copy todir="${app.server.lib.global.dir}">
<fileset
dir="lib/development"
includes="saxpath.jar"
/>
</copy>
</then>
</if>
<if>
<or>
<equals arg1="${app.server.type}" arg2="tcserver" />
<equals arg1="${app.server.type}" arg2="tomcat" />
</or>
<then>
<if>
<equals arg1="${app.server.type}" arg2="tomcat" />
<then>
<ant dir="support-tomcat" target="deploy" inheritAll="false" />
</then>
</if>
<copy todir="${app.server.lib.endorsed.dir}" flatten="true">
<fileset
dir="lib"
includes="${endorsed.libraries}"
/>
</copy>
<if>
<not>
<equals arg1="${app.server.lib.portal.dir}" arg2="${app.server.lib.global.dir}" />
</not>
<then>
<delete failonerror="false">
<fileset
dir="${app.server.lib.portal.dir}"
includes="ccpp.jar"
/>
</delete>
</then>
</if>
<copy todir="${app.server.lib.global.dir}">
<fileset
dir="lib/development"
includes="activation.jar,jms.jar,jta.jar,mail.jar,persistence.jar"
/>
</copy>
<copy todir="${app.server.temp.dir}/liferay/com/liferay/portal/deploy/dependencies">
<fileset
dir="lib/development"
includes="resin.jar,script-10.jar"
/>
</copy>
<if>
<equals arg1="${app.server.type}" arg2="tomcat" />
<then>
<delete>
<fileset
dir="${app.server.lib.portal.dir}"
includes="tomcat-juli.jar"
/>
</delete>
</then>
</if>
</then>
</if>
<if>
<or>
<equals arg1="${app.server.type}" arg2="glassfish" />
<equals arg1="${app.server.type}" arg2="websphere" />
</or>
<then>
<tstamp>
<format property="tstamp.value" pattern="yyyyMMddkkmmssSSS" />
</tstamp>
<jar
basedir="${app.server.portal.dir}"
jarfile="${tstamp.value}"
/>
<delete dir="${app.server.portal.dir}" />
<move file="${tstamp.value}" tofile="${app.server.portal.war.name}" />
</then>
</if>
<if>
<equals arg1="${app.server.type}" arg2="websphere" />
<then>
<ant dir="support-websphere" target="deploy" inheritAll="false" />
</then>
</if>
</target>
<target name="dist">
<ant antfile="build-dist.xml" target="dist" inheritAll="false" />
</target>
<target name="doc">
<antcall target="dtddoc" />
<antcall target="javadoc" />
<antcall target="javadoc-all" />
<antcall target="propertiesdoc" />
<ant dir="util-taglib" target="taglibdoc" inheritAll="false" />
</target>
<target name="dtddoc">
<taskdef classname="DTDDoc.DTDDocTask" classpathref="lib.classpath" name="DTDDoc" />
<!--<antelope:stringutil string="${lp.version}" property="lp.version.dtd">
<replace regex="\." replacement="_" />
</antelope:stringutil>-->
<property name="doc.definitions.dir" value="${doc.dir}/definitions" />
<DTDDoc
destDir="${doc.definitions.dir}"
docTitle = "Liferay ${lp.version} Definitions"
showFixmeTags="false"
showHiddenTags="false"
sourceDir="${definitions.dir}"
>
<include name="liferay-*${lp.version.dtd}.dtd" />
</DTDDoc>
</target>
<target name="install-portal-snapshots">
<install-portal-snapshot artifact.dir="portal-impl" artifact.name="portal-impl" />
<install-portal-snapshot artifact.dir="portal-service" artifact.name="portal-service" />
<install-portal-snapshot artifact.dir="portal-test" artifact.name="portal-test" />
<install-portal-snapshot artifact.dir="portal-test-internal" artifact.name="portal-test-internal" />
<install-portal-snapshot artifact.dir="portal-web" artifact.name="portal-web" />
<install-portal-snapshot artifact.dir="util-bridges" artifact.name="util-bridges" />
<install-portal-snapshot artifact.dir="util-java" artifact.name="util-java" />
<install-portal-snapshot artifact.dir="util-slf4j" artifact.name="util-slf4j" />
<install-portal-snapshot artifact.dir="util-taglib" artifact.name="util-taglib" />
</target>
<target name="jar">
<ant dir="portal-service" target="jar" inheritAll="false" />
<ant dir="util-bridges" target="jar" inheritAll="false" />
<ant dir="util-java" target="jar" inheritAll="false" />
<ant dir="util-slf4j" target="jar" inheritAll="false" />
<ant dir="util-taglib" target="jar" inheritAll="false" />
<ant dir="portal-impl" target="jar" inheritAll="false" />
<ant dir="portal-test" target="jar" inheritAll="false" />
<ant dir="portal-test-internal" target="jar" inheritAll="false" />
<ant dir="portal-web" target="war" inheritAll="false" />
<ant dir="support-tomcat" target="jar" inheritAll="false" />
</target>
<target name="javadoc">
<property name="doc.java.dir" value="${doc.dir}/javadocs" />
<mkdir dir="${doc.java.dir}" />
<javadoc
breakiterator="yes"
classpathref="project.classpath"
destdir="${doc.java.dir}"
doctitle="Liferay ${lp.version} Public API Documentation"
encoding="UTF-8"
header="&lt;b&gt;Liferay ${lp.version}&lt;/b&gt;"
maxmemory="2048m"
noqualifier="java.*"
overview="portal-service/src/portal-service-overview.html"
stylesheetfile="${project.dir}/tools/javadoc.css"
useexternalfile="yes"
use="yes"
windowtitle="Liferay ${lp.version} API"
>
<doclet name="com.liferay.tools.doclets.standard.Standard" path="${project.dir}/lib/development/liferay-doclet.jar">
<param name="-linksource" />
</doclet>
<group title="Portal Services" packages="com.liferay.portal*:com.liferay.counter*:com.liferay.documentlibrary*:com.liferay.mail*" />
<group title="Portal Kernel" packages="com.liferay.portal.kernel*" />
<group title="Portlet Services" packages="com.liferay.portlet*" />
<group title="Portlet Bridges" packages="com.liferay.util.bridges*" />
<link href="http://docs.liferay.com/portlet-api/2.0/javadocs" />
<link href="http://java.sun.com/javase/6/docs/api" />
<link href="http://docs.liferay.com/portal/${lp.version.major}/javadocs" />
<packageset dir="portal-service/src" />
<packageset dir="portal-test/src" />
<packageset dir="portal-test-internal/src" />
<packageset dir="util-bridges/src" />
<packageset dir="util-java/src" />
<packageset dir="util-slf4j/src" />
<tag name="generated" description="" />
</javadoc>
</target>
<target name="javadoc-all">
<property name="doc.java.dir" value="${doc.dir}/javadocs-all" />
<mkdir dir="${doc.java.dir}" />
<javadoc
breakiterator="yes"
classpathref="project.classpath"
destdir="${doc.java.dir}"
doctitle="Liferay ${lp.version} Internal API Documentation"
encoding="UTF-8"
header="&lt;b&gt;Liferay ${lp.version}&lt;/b&gt;"
maxmemory="2048m"
noqualifier="java.*"
overview="portal-impl/src/portal-impl-overview.html"
stylesheetfile="${project.dir}/tools/javadoc.css"
useexternalfile="yes"
use="yes"
windowtitle="Liferay ${lp.version} Internal API"
>
<doclet name="com.liferay.tools.doclets.standard.Standard" path="${project.dir}/lib/development/liferay-doclet.jar">
<param name="-linksource" />
</doclet>
<group title="Portal Services" packages="com.liferay.portal.service*" />
<group title="Portlet Services" packages="com.liferay.portlet*" />
<link href="http://docs.liferay.com/portlet-api/2.0/javadocs" />
<link href="http://java.sun.com/javase/6/docs/api" />
<packageset dir="portal-impl/src" />
<packageset dir="portal-service/src" />
<packageset dir="portal-test/src" />
<packageset dir="portal-test-internal/src" />
<packageset dir="util-bridges/src" />
<packageset dir="util-java/src" />
<packageset dir="util-slf4j/src" />
<packageset dir="util-taglib/src" />
<tag name="generated" description="ServiceBuilder generated this class. Modifications in this class will be overwritten the next time it is generated." />
</javadoc>
</target>
<target name="prepare-generated-files">
<ant antfile="build-dist.xml" target="prepare-generated-files" inheritAll="false" />
</target>
<target name="propertiesdoc">
<property name="properties.dest.dir" value="${doc.dir}/propertiesdoc" />
<remake-dir dir="${properties.dest.dir}" />
<antcall target="propertiesdoc-cmd">
<param name="properties.dest.dir" value="${properties.dest.dir}" />
<param name="properties.file" value="definitions/liferay-plugin-package_6_1_0.properties" />
<param name="properties.title" value="Liferay Plugin Package 6.1 Properties" />
<param name="properties.toc" value="true" />
</antcall>
<antcall target="propertiesdoc-cmd">
<param name="properties.dest.dir" value="${properties.dest.dir}" />
<param name="properties.file" value="definitions/liferay-plugin-package_6_2_0.properties" />
<param name="properties.title" value="Liferay Plugin Package 6.2 Properties" />
<param name="properties.toc" value="true" />
</antcall>
<antcall target="propertiesdoc-cmd">
<param name="properties.dest.dir" value="${properties.dest.dir}" />
<param name="properties.file" value="definitions/liferay-plugin-package_7_0_0.properties" />
<param name="properties.title" value="Liferay Plugin Package 7.0 Properties" />
<param name="properties.toc" value="true" />
</antcall>
<antcall target="propertiesdoc-cmd">
<param name="properties.dest.dir" value="${properties.dest.dir}" />
<param name="properties.file" value="portal-impl/src/portal.properties" />
<param name="properties.title" value="Portal Properties" />
<param name="properties.toc" value="true" />
</antcall>
<antcall target="propertiesdoc-cmd">
<param name="properties.dest.dir" value="${properties.dest.dir}" />
<param name="properties.file" value="portal-impl/src/system.properties" />
<param name="properties.title" value="System Properties" />
<param name="properties.toc" value="true" />
</antcall>
<java
classname="com.liferay.portal.tools.propertiesdoc.PropertiesDocIndexBuilder"
classpathref="project.classpath"
fork="true"
newenvironment="true"
>
<arg value="properties.dir=${doc.dir}/propertiesdoc" />
</java>
</target>
<target name="propertiesdoc-cmd">
<java
classname="com.liferay.portal.tools.propertiesdoc.PropertiesDocBuilder"
classpathref="project.classpath"
fork="true"
newenvironment="true"
>
<arg value="properties.dest.dir=${properties.dest.dir}" />
<arg value="properties.file=${properties.file}" />
<arg value="properties.title=${properties.title}" />
<arg value="properties.toc=${properties.toc}" />
</java>
</target>
<target name="setup-jrebel">
<setup-jrebel />
</target>
<target name="setup-sdk">
<setup-sdk />
</target>
<target name="sort-xml-attributes">
<path id="source.formatter.classpath">
<fileset dir="${portal.tools.dir}/source-formatter" includes="*.jar" />
</path>
<java
classname="com.liferay.source.formatter.XMLAttributesSorter"
classpathref="source.formatter.classpath"
fork="true"
newenvironment="true"
>
<jvmarg value="-Xmx512m" />
<jvmarg value="-Xss2048k" />
<arg value="sort.xml.file.name=${sort.xml.file.name}" />
</java>
</target>
<target name="start">
<antcall target="compile" />
<echo>The "start" target is now deprecated. Please use the "compile" target instead.</echo>
</target>
<target name="test-integration">
<ant antfile="build-test.xml" target="test-integration" inheritAll="false" />
</target>
<target name="test-package">
<ant antfile="build-test.xml" target="test-package" inheritAll="false" />
</target>
<target name="test-unit">
<ant antfile="build-test.xml" target="test-unit" inheritAll="false" />
</target>
<target name="update-app-server-scripts">
<if>
<or>
<equals arg1="${app.server.type}" arg2="jboss" />
<equals arg1="${app.server.type}" arg2="wildfly" />
</or>
<then>
<if>
<not>
<available file="${app.server.lib.global.dir}/module.xml" />
</not>
<then>
<copy
file="tools/servers/jboss/modules/module.xml"
tofile="${app.server.lib.global.dir}/module.xml"
/>
</then>
</if>
</then>
</if>
<if>
<equals arg1="${app.server.type}" arg2="jetty" />
<then>
<if>
<not>
<available file="${app.server.dir}/contexts/root.xml" />
</not>
<then>
<copy
file="tools/servers/jetty/contexts/root.xml"
tofile="${app.server.dir}/contexts/root.xml"
/>
</then>
</if>
</then>
</if>
<if>
<equals arg1="${app.server.type}" arg2="tomcat" />
<then>
<if>
<not>
<available file="${app.server.dir}/conf/Catalina/localhost/${app.server.tomcat.portal.context}.xml" />
</not>
<then>
<copy
file="tools/servers/tomcat/conf/Catalina/localhost/ROOT.xml"
tofile="${app.server.dir}/conf/Catalina/localhost/${app.server.tomcat.portal.context}.xml"
overwrite="true"
/>
</then>
</if>
</then>
</if>
<if>
<equals arg1="${app.server.type}" arg2="websphere" />
<then>
<if>
<os family="unix" />
<then>
<chmod file="${app.server.websphere.bin.dir}/startServer.sh" perm="a+x" />
<exec dir="${app.server.websphere.bin.dir}" executable="/bin/sh">
<arg value="-c" />
<arg value="./startServer.sh server1" />
</exec>
</then>
<elseif>
<os family="windows" />
<then>
<exec dir="${app.server.websphere.bin.dir}" executable="cmd.exe">
<arg value="/c" />
<arg value="startServer.bat server1" />
</exec>
</then>
</elseif>
</if>
<echo>Installing liferay-portal.war.</echo>
<echo file="wsadmin.py">
def isAppInstalled(appName):
appNames = AdminApp.list()
if len(appNames) > 0:
for curAppName in appNames.split('\n'):
curAppName = curAppName.rstrip()
if curAppName.find(appName) >= 0:
return 1
return 0
if isAppInstalled('DefaultApplication'):
print AdminApp.uninstall('DefaultApplication')
print AdminConfig.save()
appManager = AdminControl.queryNames('type=ApplicationManager,process=server1,*')
if isAppInstalled('liferay-portal'):
print AdminControl.invoke(appManager, 'stopApplication', 'liferay-portal')
print AdminApp.update('liferay-portal', 'app', '[-contents ${app.server.websphere.instance.dir}/wsadmin-deploy/liferay-portal.war -contextroot / -operation update]')
else:
print AdminApp.install('${app.server.websphere.instance.dir}/wsadmin-deploy/liferay-portal.war', '[-appname liferay-portal -contextroot /]')
print AdminConfig.save()
print AdminControl.invoke(appManager, 'startApplication', 'liferay-portal')
</echo>
<if>
<os family="unix" />
<then>
<exec dir="${app.server.websphere.bin.dir}" executable="/bin/sh">
<arg value="-c" />
<arg value="./wsadmin.sh -f ${basedir}/wsadmin.py" />
</exec>
<exec dir="${app.server.websphere.bin.dir}" executable="/bin/sh">
<arg value="-c" />
<arg value="./stopServer.sh server1" />
</exec>
</then>
<elseif>
<os family="windows" />
<then>
<exec dir="${app.server.websphere.bin.dir}" executable="cmd.exe">
<arg value="/c" />
<arg value="wsadmin.bat -f ${basedir}\wsadmin.py" />
</exec>
<exec dir="${app.server.websphere.bin.dir}" executable="cmd.exe">
<arg value="/c" />
<arg value="stopServer.bat server1" />
</exec>
</then>
</elseif>
</if>
<delete file="wsadmin.py" />
</then>
</if>
</target>
<target name="update-gradle-cache">
<execute>
git reset --hard HEAD
git clean -d -f
</execute>
<delete dir="${basedir}/.gradle" />
<setup-sdk />
<gradle-execute dir="modules" forcedcacheenabled="false" task="clean">
<arg value="-Dmaven.local.ignore=true" />
</gradle-execute>
<gradle-execute dir="modules/core/registry-api" forcedcacheenabled="false" task="deploy">
<arg value="-Dmaven.local.ignore=true" />
</gradle-execute>
<gradle-execute dir="modules" forcedcacheenabled="false" task="classes">
<arg value="-Dmaven.local.ignore=true" />
<arg value="testClasses" />
<arg value="testIntegrationClasses" />
</gradle-execute>
<gradle-execute dir="modules/sdk/gradle-util" failonerror="false" forcedcacheenabled="false" task="findbugsMain">
<arg value="-Dmaven.local.ignore=true" />
</gradle-execute>
<ant dir="portal-web" target="update-gradle-cache" inheritAll="false" />
</target>
<target name="validate-xml">
<xmlvalidate failonerror="no">
<fileset dir="${project.dir}"
excludes="**/dependencies/**,**/ehcache/**"
includes="**/liferay-*.xml,**/web.xml"
/>
<xmlcatalog refid="dtd.catalog" />
</xmlvalidate>
</target>
</project>
Jump to Line
Something went wrong with that request. Please try again.