Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
668 lines (615 sloc) 27.9 KB
<?xml version="1.0" encoding="UTF-8"?>
<!--
** @author Matthias L. Jugel
** @version $Id$
-->
<project basedir="." default="all" name="SnipSnap">
<property file="conf/build.properties"/>
<property file="conf/libs.properties"/>
<property file="conf/snipsnap.conf"/>
<path id="server.classpath">
<pathelement location="${dir.libs}/javax.servlet.jar"/>
<pathelement location="${dir.libs}/org.apache.jasper.jar"/>
<pathelement location="${dir.libs}/org.apache.crimson.jar"/>
<pathelement location="${dir.libs}/org.mortbay.jetty.jar"/>
<pathelement location="${dir.libs}/mckoidb.jar"/>
<pathelement location="${dir.libs}/commons-codec-1.3.jar"/>
<pathelement location="${dir.libs}/commons-logging.jar"/>
<pathelement location="${dir.libs}/httpclient-3.0-rc3.jar"/>
<pathelement location="${dir.libs}/${xmlrpc.jar}"/>
<pathelement location="${dir.libs}/jdic.jar"/>
</path>
<path id="snipsnap.test">
<pathelement location="${dir.src}/apps/default/WEB-INF/lib/snipsnap-servlets.jar"/>
</path>
<!-- the overall class path -->
<path id="app.classpath">
<pathelement location="${dir.libs}/${jdbcstorage.jar}"/>
<pathelement location="${dir.libs}/${rss-ng.jar}"/>
<pathelement location="${dir.libs}/${search-ng.jar}"/>
<pathelement location="${dir.libs}/gabriel.jar"/>
<pathelement location="${dir.libs}/jmdns.jar"/>
<pathelement location="${dir.libs}/${rome.jar}"/>
<pathelement location="${dir.libs}/${jdom.jar}"/>
<pathelement location="${dir.libs}/${spring-core.jar}"/>
<pathelement location="${dir.libs}/${spring-beans.jar}"/>
<pathelement location="${dir.libs}/asm-1.4.1.jar"/>
<pathelement location="${dir.libs}/dynaop-1.0-beta.jar"/>
<pathelement location="${dir.libs}/cglib-asm-1.0.jar"/>
<pathelement location="${dir.libs}/groovy-1.0-beta-6.jar"/>
<pathelement location="${dir.libs}/graph-snipsnap.jar"/>
<pathelement location="${dir.libs}/radeox.jar"/>
<pathelement location="${dir.libs}/jena.jar"/>
<pathelement location="${dir.libs}/commons-logging.jar"/>
<pathelement location="${dir.libs}/commons-dbcp-1.1.jar"/>
<pathelement location="${dir.libs}/commons-pool-1.1.jar"/>
<pathelement location="${dir.libs}/commons-collections.jar"/>
<pathelement location="${dir.libs}/commons-codec-1.3.jar"/>
<pathelement location="${dir.libs}/commons-httpclient-3.0-rc3.jar"/>
<pathelement location="${dir.libs}/${xmlrpc.jar}"/>
<pathelement location="${dir.libs}/lucene-1.4.1.jar"/>
<pathelement location="${dir.libs}/jython.jar"/>
<pathelement location="${dir.libs}/smack.jar"/>
<pathelement location="${dir.libs}/aspectjrt.jar"/>
<pathelement location="${dir.libs}/dom4j.jar"/>
<pathelement location="${dir.src}/apps/default/WEB-INF/lib/jstl.jar"/>
<pathelement location="${dir.src}/apps/default/WEB-INF/lib/standard.jar"/>
<pathelement location="${dir.libs}/activation.jar"/>
<pathelement location="${dir.libs}/mail.jar"/>
<pathelement location="${dir.libs}/cvslib.jar"/>
<pathelement location="${dir.libs}/j2h.jar"/>
<pathelement location="${dir.libs}/picocontainer-1.0.jar"/>
<pathelement location="${dir.libs}/nanocontainer-1.0.jar"/>
<pathelement location="${dir.libs}/nanocontainer-dynaop-1.0-beta-1-SNAPSHOT.jar"/>
<pathelement location="${dir.libs}/jmock-1.0.0.jar"/>
</path>
<path id="all.classpath">
<path refid="server.classpath"/>
<path refid="app.classpath"/>
</path>
<path id="test.classpath">
<path refid="all.classpath"/>
<pathelement location="${dir.libs}/junit.jar"/>
</path>
<!-- build distribution -->
<target depends="tar-source, tar-binary" name="dist" description="tar complete distribution"/>
<!-- build binary distribution package -->
<target depends="clean" description="tar source package" name="tar-source">
<tstamp/>
<tar destfile="../${appname}-${snipsnap.server.version}-${DSTAMP}-src.tgz" compression="gzip">
<tarfileset dir="." prefix="${appname}-${snipsnap.server.version}" mode="700">
<include name="run.sh"/>
<include name="run.bat"/>
<include name="db.sh"/>
<include name="dbexport.sh"/>
<include name="dbimport.sh"/>
<include name="dbrepair.sh"/>
<include name="exportall.sh"/>
<include name="devlinks.sh"/>
<include name="renimg.sh"/>
</tarfileset>
<tarfileset dir="." prefix="${appname}-${snipsnap.server.version}">
<include name="**"/>
<exclude name="**/CVS"/>
<exclude name="applications"/>
<exclude name="run.sh"/>
<exclude name="run.bat"/>
<exclude name="db.sh"/>
<exclude name="dbexport.sh"/>
<exclude name="dbimport.sh"/>
<exclude name="dbrepair.sh"/>
<exclude name="exportall.sh"/>
<exclude name="devlinks.sh"/>
<exclude name="renimg.sh"/>
<exclude name="src/theme/drrockit/"/>
<exclude name="src/theme/javangelist/"/>
<exclude name="src/theme/sib/"/>
</tarfileset>
</tar>
</target>
<target depends="all" description="tar binary package" name="tar-binary">
<tstamp/>
<tar destfile="../${appname}-${snipsnap.server.version}-${DSTAMP}.tgz" compression="gzip">
<tarfileset dir="${basedir}" prefix="${appname}-${snipsnap.server.version}" mode="700">
<include name="run.sh"/>
<include name="run.bat"/>
</tarfileset>
<tarfileset dir="${basedir}" prefix="${appname}-${snipsnap.server.version}">
<include name="lib/${appname}.jar"/>
<include name="lib/${appname}.war"/>
<include name="lib/${appname}-server.jar"/>
<!-- <include name="lib/${appname}-theme-*.jar"/>-->
<include name="lib/${appname}-installer.war"/>
<include name="lib/${appname}-utils.jar"/>
<include name="lib/gabriel.jar"/>
<include name="lib/jmdns.jar"/>
<include name="lib/${rome.jar}"/>
<include name="lib/${jdom.jar}"/>
<include name="lib/${spring-core.jar}"/>
<include name="lib/${spring-beans.jar}"/>
<include name="lib/jdom-b10.jar"/>
<include name="lib/asm-1.4.1.jar"/>
<include name="lib/dynaop-1.0-beta.jar"/>
<include name="lib/cglib-asm-1.0.jar"/>
<include name="lib/asm-util-1.4.1.jar"/>
<include name="lib/groovy-1.0-rc1-snapshot.jar"/>
<include name="lib/org.apache.jasper.jar"/>
<include name="lib/org.apache.crimson.jar"/>
<include name="lib/org.mortbay.jetty.jar"/>
<include name="lib/javax.servlet.jar"/>
<include name="lib/commons-codec-1.3.jar"/>
<include name="lib/commons-logging.jar"/>
<include name="lib/commons-httpclient-3.0-rc3.jar"/>
<include name="lib/javax.servlet.jar"/>
<include name="lib/${xmlrpc.jar}"/>
<include name="lib/mckoidb.jar"/>
<include name="lib/dom4j.jar"/>
<include name="lib/mysql-connector.jar"/>
<include name="lib/postgres-jdbc.jar"/>
<include name="conf/jetty.conf"/>
<include name="license.txt"/>
<include name="validate.xsl"/>
<include name="README"/>
<exclude name="**/CVS"/>
<exclude name="run.sh"/>
<exclude name="run.bat"/>
<exclude name="db.sh"/>
<exclude name="dbrepair.sh"/>
</tarfileset>
</tar>
</target>
<!-- delete compiled class files and created jar/war archives -->
<target description="clean up compiled code" name="clean">
<delete failonerror="false" includeEmptyDirs="true">
<fileset dir="${dir.out}" includes="**" excludes="CVS"/>
</delete>
<delete failonerror="false">
<fileset dir="${dir.libs}" includes="${appname}*.jar"/>
<fileset dir="${dir.libs}" includes="${appname}*.war"/>
<fileset dir="${dir.src}/apps/default/WEB-INF/lib" includes="${appname}-servlets.jar"/>
<fileset dir="${dir.src}/apps/installer/WEB-INF/lib" includes="installer-servlets.jar"/>
<fileset dir="${dir.src}/org/snipsnap/config" includes="Options.java"/>
</delete>
</target>
<!-- create all archives -->
<target depends="jar-server,jar-util,snipsnap-war" description="create all" name="all"/>
<target name="buildtask">
<mkdir dir="${dir.out}/ant"/>
<javac deprecation="false" debug="false"
srcdir="${dir.src}" destdir="${dir.out}/ant">
<include name="org/snipsnap/util/PropertyConstantBuilder.java"/>
</javac>
</target>
<target depends="buildtask" name="declaretask">
<taskdef name="constants"
classname="org.snipsnap.util.PropertyConstantBuilder"
classpath="${dir.out}/ant"/>
</target>
<!-- prepare special generated classes -->
<target depends="declaretask" name="generate">
<constants
properties="${dir.src}/org/snipsnap/config/defaults.conf"
file="${dir.out}/ant/config.stub" prefix="app."
/>
<loadfile property="config-stub" srcfile="${dir.out}/ant/config.stub" failonerror="false"/>
<copy file="${dir.src}/org/snipsnap/config/Configuration.java.tmpl"
tofile="${dir.src}/snipsnap/api/config/Configuration.java" filtering="true" overwrite="true">
<filterset>
<filter token="DEFAULTS" value="${config-stub}"/>
</filterset>
</copy>
<constants
properties="${dir.src}/org/snipsnap/config/globals.conf"
file="${dir.out}/ant/globals.stub" prefix="app."
/>
<loadfile property="globals-stub" srcfile="${dir.out}/ant/globals.stub" failonerror="false"/>
<copy file="${dir.src}/org/snipsnap/config/Globals.java.tmpl"
tofile="${dir.src}/org/snipsnap/config/Globals.java" filtering="true" overwrite="true">
<filterset>
<filter token="DEFAULTS" value="${globals-stub}"/>
</filterset>
</copy>
</target>
<target depends="compile-api" description="create api jar" name="jar-api">
<jar destfile="${dir.libs}/snipsnap-api.jar">
<fileset dir="${dir.out}/api/" includes="snipsnap/api/**"/>
</jar>
</target>
<target description="compile api code" name="compile-api">
<mkdir dir="${dir.out}/api"/>
<javac deprecation="${deprecation}" debug="${debug}"
srcdir="${dir.src}"
destdir="${dir.out}/api"
classpathref="all.classpath">
<include name="snipsnap/api/**"/>
</javac>
</target>
<target description="compile implementation code" name="compile-impl">
<mkdir dir="${dir.out}/impl"/>
<javac deprecation="${deprecation}" debug="${debug}"
srcdir="${dir.src}"
destdir="${dir.out}/impl"
classpathref="all.classpath">
<include name="org/snipsnap/util/ApplicationAwareMap.java"/>
<include name="org/snipsnap/interceptor/Aspects.java"/>
<include name="org/snipsnap/snip/SnipFactory.java"/>
<include name="org/snipsnap/versioning/VersionInfo.java"/>
<include name="org/snipsnap/user/Security.java"/>
<include name="org/snipsnap/snip/storage/query/*.java"/>
<include name="org/snipsnap/render/PlainTextRenderEngine.java"/>
</javac>
</target>
<target depends="compile-impl" description="create implementation jar" name="jar-impl">
<jar destfile="${dir.libs}/snipsnap-impl.jar">
<fileset dir="${dir.out}/impl/" includes="**"/>
</jar>
</target>
<!-- create server code -->
<target depends="compile-jsp, compile-server,installer-war,snipsnap-war" description="create server jar"
name="jar-server">
<copy file="conf/copyright.txt" tofile="${dir.out}/server/conf/copyright.txt" filtering="true">
<filterset>
<filter token="VERSION" value="${snipsnap.server.version}"/>
</filterset>
</copy>
<jar destfile="${dir.libs}/${appname}-server.jar" excludes="**/CVS, org/snipsnap/server/*Launcher*"
manifest="conf/manifest">
<fileset dir="${dir.out}/server" includes="**">
<exclude name="org/snipsnap/server/*Launcher*"/>
</fileset>
<fileset dir=".">
<include name="conf/gabriel/access.acl"/>
<include name="conf/gabriel/methods.acl"/>
<include name="conf/snipsnap.conf"/>
<include name="conf/snipsnap.conf"/>
<include name="conf/jetty.conf"/>
</fileset>
<fileset dir="${dir.src}" includes="org/snipsnap/config/globals.conf"/>
<fileset dir="${dir.src}" includes="org/snipsnap/config/defaults.conf"/>
<fileset dir="${dir.src}" includes="org/snipsnap/config/transpose.map"/>
</jar>
<jar destfile="${dir.libs}/${appname}.jar" excludes="**/CVS" manifest="conf/launcher.manifest">
<fileset dir="${dir.out}/server" includes="org/snipsnap/server/*Launcher*"/>
<fileset dir="${dir.libs}">
<include name="jdic.jar"/>
<include name="snipsnap-server.jar"/>
<include name="org.mortbay.jetty.jar"/>
<include name="javax.servlet.jar"/>
<include name="org.apache.crimson.jar"/>
<include name="org.apache.jasper.jar"/>
<include name="commons-codec-1.3.jar"/>
<include name="commons-logging.jar"/>
<include name="commons-httpclient-3.0-rc3.jar"/>
<include name="${xmlrpc.jar}"/>
<include name="mckoidb.jar"/>
<include name="mysql-connector.jar"/>
<include name="postgres-jdbc.jar"/>
<include name="snipsnap-server.jar"/>
<include name="snipsnap-installer.war"/>
<include name="snipsnap.war"/>
</fileset>
</jar>
</target>
<target depends="generate" description="compile server code" name="compile-server">
<mkdir dir="${dir.out}/server"/>
<javac deprecation="${deprecation}" debug="${debug}"
srcdir="${dir.src}"
destdir="${dir.out}/server"
classpathref="server.classpath">
<include name="org/snipsnap/server/**"/>
<exclude name="org/snipsnap/server/Admin*"/>
</javac>
</target>
<!-- create utility code -->
<target depends="compile-util" description="build util jar" name="jar-util">
<jar destfile="${dir.libs}/${appname}-utils.jar" excludes="**/CVS" manifest="conf/utils.manifest">
<fileset dir="${dir.out}/util" includes="**"/>
<fileset dir="." includes="conf/snipsnap.conf"/>
<fileset dir="." includes="conf/copyright.txt"/>
<fileset dir="${dir.src}" includes="org/snipsnap/config/defaults.conf"/>
<fileset dir="${dir.src}" includes="org/snipsnap/config/transpose.map"/>
</jar>
</target>
<target depends="generate" description="compile util code" name="compile-util">
<mkdir dir="${dir.out}/util"/>
<javac deprecation="${deprecation}" debug="${debug}"
srcdir="${dir.src}"
classpathref="all.classpath"
destdir="${dir.out}/util">
<include name="org/snipsnap/util/Test*"/>
<include name="org/snipsnap/util/*Util.java"/>
<include name="org/snipsnap/util/DB*.java"/>
<include name="org/snipsnap/util/*JDBC*.java"/>
<include name="org/snipsnap/util/mail/**"/>
<include name="org/snipsnap/util/*Test.java"/>
<include name="org/snipsnap/server/AdminClient.java"/>
<include name="org/snipsnap/util/XMLSnipRepair.java"/>
<include name="org/snipsnap/util/LocaleComparator.java"/>
</javac>
</target>
<target name="checkstyle">
<taskdef name="pmd" classname="net.sourceforge.pmd.ant.PMDTask"/>
<pmd rulesetfiles="${check_rules}" shortFilenames="true" printToConsole="true">
<!-- <pmd rulesetfiles="rulesets/coupling.xml,rulesets/unusedcode.xml,rulesets/basic.xml,rulesets/imports.xml" shortFilenames="true" printToConsole="true"> -->
<formatter type="html" toFile="pmd_report.html"/>
<fileset dir="./src">
<include name="**/*.java"/>
</fileset>
</pmd>
</target>
<target depends="generate" description="compile test code" name="compile-test">
<mkdir dir="${dir.out}/test"/>
<javac deprecation="${deprecation}" debug="${debug}"
srcdir="${dir.src}"
classpathref="test.classpath"
destdir="${dir.out}/test"
includes="org/snipsnap/test/**"/>
</target>
<target depends="generate" description="compile template application code" name="compile-servlets">
<mkdir dir="${dir.out}/default/WEB-INF/classes"/>
<!-- fix, why junit to compile servlets? -->
<javac deprecation="${deprecation}" debug="${debug}"
srcdir="${dir.src}"
classpathref="test.classpath"
destdir="${dir.out}/default/WEB-INF/classes"
excludes="org/snipsnap/admin/**, org/snipsnap/server/**">
<src path="${dir.src}"/>
<include name="org/snipsnap/**"/>
</javac>
</target>
<target depends="compile-servlets" name="servlets-jar">
<copy todir="${dir.out}/default/WEB-INF/classes" filtering="true" overwrite="true">
<filterset>
<filter token="VERSION" value="${snipsnap.server.version}"/>
</filterset>
<fileset dir="${dir.src}" includes="org/snipsnap/net/dispatcher.conf"/>
<fileset dir="${dir.src}" includes="org/snipsnap/config/globals.conf"/>
<fileset dir="${dir.src}" includes="org/snipsnap/config/defaults.conf"/>
<fileset dir="${dir.src}" includes="org/snipsnap/config/transpose.map"/>
<fileset dir="${dir.src}" includes="org/snipsnap/snip/storage/SnipSerializer.properties"/>
<fileset dir="${dir.src}" includes="org/snipsnap/net/handler/*.gsp"/>
</copy>
<jar destfile="${dir.src}/apps/default/WEB-INF/lib/snipsnap-servlets.jar" excludes="**/CVS">
<fileset dir="${dir.out}/default/WEB-INF/classes" includes="**"/>
<fileset dir="${dir.src}" includes="META-INF/**"/>
<fileset dir="./conf/" includes="gabriel/**"/>
</jar>
</target>
<target if="precompile.jsp" depends="servlets-jar" name="compile-jsp" description="compile jsp files">
<mkdir dir="${dir.out}/jsp/source"/>
<mkdir dir="${dir.out}/jsp/classes"/>
<jspc destdir="${dir.out}/jsp/source"
verbose="1" srcdir="${dir.src}/apps/default"
classpathref="all.classpath"
webinc="${dir.out}/jsp/web.inc">
<include name="**/*.jsp"/>
<webapp basedir="${dir.src}/apps/default"/>
</jspc>
<depend
srcdir="${dir.out}/jsp/source"
destdir="${dir.out}/jsp/classes"
cache="${dir.out}/jsp/dependencies"
classpathref="all.classpath"/>
<javac deprecation="${deprecation}" debug="${debug}"
srcdir="${dir.out}/jsp/source"
classpath="${dir.src}/apps/default/WEB-INF/lib/snipsnap-servlets.jar"
classpathref="all.classpath"
destdir="${dir.out}/jsp/classes">
<include name="**"/>
</javac>
</target>
<target name="make-edittest-jsp">
<mkdir dir="${dir.out}/jsp/source"/>
<mkdir dir="${dir.out}/jsp/classes"/>
<jspc destdir="${dir.out}/jsp/source"
verbose="1" srcdir="${dir.src}"
package="org.snipsnap.jsp"
classpathref="all.classpath">
<include name="**/EditTest.jsp"/>
</jspc>
<depend
srcdir="${dir.out}/jsp/source"
destdir="${dir.out}/jsp/classes"
cache="${dir.out}/jsp/dependencies"
classpathref="all.classpath"/>
<javac deprecation="${deprecation}" debug="${debug}"
srcdir="${dir.out}/jsp/source"
classpath="${dir.src}/apps/default/WEB-INF/lib/snipsnap-servlets.jar"
classpathref="all.classpath"
destdir="${dir.out}/jsp/classes">
<include name="**"/>
</javac>
<jar destfile="${dir.src}/apps/default/WEB-INF/lib/edittest.jar" excludes="**/CVS">
<fileset dir="${dir.out}/jsp/classes" includes="**"/>
<!-- <fileset dir="${dir.src}" includesfile="META-INF/services/javax.servlet.HttpServlet"/> -->
</jar>
</target>
<target if="precompile.jsp" depends="compile-jsp" name="jsp-jar" description="package precompiled jsp files">
<jar destfile="${dir.src}/apps/default/WEB-INF/lib/snipsnap-jsp.jar" excludes="**/CVS">
<fileset dir="${dir.out}/jsp/classes" includes="**"/>
</jar>
</target>
<!-- create web archive of the template application -->
<target depends="jsp-jar,jar-api" description="build template war" name="snipsnap-war">
<mkdir dir="${dir.out}/webapp"/>
<copy todir="${dir.out}/webapp">
<fileset dir="${dir.src}/apps/default">
<exclude name="**/CVS"/>
<exclude name="**/*.jsp" if="precompile.jsp"/>
<exclude name="WEB-INF/web-xml.tmpl"/>
</fileset>
</copy>
<copy tofile="${dir.out}/webapp/WEB-INF/classes/i18n/messages.properties"
file="${dir.src}/apps/default/WEB-INF/classes/i18n/messages_en.properties"/>
<loadfile property="web.inc" srcfile="${dir.out}/jsp/web.inc" failonerror="false"/>
<condition property="web.inc" value="">
<not>
<isset property="${web.inc}"/>
</not>
</condition>
<!-- copy with filter if web.inc is available -->
<copy
tofile="${dir.out}/webapp/WEB-INF/web.xml"
file="${dir.src}/apps/default/WEB-INF/web-xml.tmpl" overwrite="true">
<filterset>
<filter token="VERSION" value="${snipsnap.server.version}"/>
<filter token="PRECOMPILED-JSP" value="${web.inc}"/>
</filterset>
</copy>
<copy file="${dir.src}/apps/default/index.jsp" tofile="${dir.out}/webapp/index.jsp"/>
<copy file="conf/copyright.txt" filtering="true"
todir="${dir.out}/webapp/WEB-INF/classes/defaults">
<filterset>
<filter token="VERSION" value="${snipsnap.server.version}"/>
</filterset>
</copy>
<copy todir="${dir.out}/webapp/WEB-INF/lib">
<fileset dir="${dir.libs}">
<include name="asm-1.4.1.jar"/>
<include name="gabriel.jar"/>
<include name="jmdns.jar"/>
<include name="${rome.jar}"/>
<include name="${jdom.jar}"/>
<include name="${spring-core.jar}"/>
<include name="${spring-beans.jar}"/>
<include name="dynaop-1.0-beta.jar"/>
<include name="cglib-asm-1.0.jar"/>
<include name="asm-util-1.4.1.jar"/>
<include name="groovy-1.0-beta-6.jar"/>
<include name="graph-snipsnap.jar"/>
<include name="radeox.jar"/>
<include name="jena.jar"/>
<include name="commons-logging.jar"/>
<include name="commons-dbcp-1.1.jar"/>
<include name="commons-pool-1.1.jar"/>
<include name="commons-collections.jar"/>
<include name="lucene-1.4.1.jar"/>
<include name="commons-codec-1.3.jar"/>
<include name="commons-httpclient-3.0-rc3.jar"/>
<include name="${xmlrpc.jar}"/>
<include name="dom4j.jar"/>
<include name="smack.jar"/>
<include name="aspectjrt.jar"/>
<include name="jython.jar"/>
<include name="mail.jar"/>
<include name="activation.jar"/>
<include name="j2h.jar"/>
<include name="picocontainer-1.0.jar"/>
<include name="nanocontainer-1.0.jar"/>
<include name="nanocontainer-dynaop-1.0-beta-1-SNAPSHOT.jar"/>
<include name="rss-ng-1.0-alpha-1.jar"/>
<include name="${search-ng.jar}"/>
<include name="jdbcstorage-1.0-alpha-1.jar"/>
<include name="snipsnap-api.jar"/>
</fileset>
</copy>
<jar destfile="${dir.libs}/${appname}.war">
<fileset dir="${dir.out}/webapp" includes="**"/>
</jar>
</target>
<target if="precompile.jsp" depends="installer-servlets-jar" name="compile-installer-jsp"
description="compile installer jsp files">
<mkdir dir="${dir.out}/installer/jsp/source"/>
<mkdir dir="${dir.out}/installer/jsp/classes"/>
<jspc destdir="${dir.out}/installer/jsp/source"
verbose="1"
classpathref="all.classpath"
webinc="${dir.out}/installer/jsp/web.inc">
<include name="**/*.jsp"/>
<webapp basedir="${dir.src}/apps/installer"/>
</jspc>
<depend
srcdir="${dir.out}/installer/jsp/source"
destdir="${dir.out}/installer/jsp/classes"
cache="${dir.out}/installer/jsp/dependencies"
classpathref="all.classpath"/>
<javac deprecation="${deprecation}" debug="${debug}"
srcdir="${dir.out}/installer/jsp/source"
classpath="${dir.out}/installer/webapp/WEB-INF/lib/installer-servlets.jar"
classpathref="all.classpath"
destdir="${dir.out}/installer/jsp/classes">
<include name="**"/>
</javac>
</target>
<target description="compile installer application code" name="compile-installer">
<mkdir dir="${dir.out}/installer/servlets"/>
<javac deprecation="${deprecation}" debug="${debug}"
srcdir="${dir.src}"
classpathref="all.classpath"
destdir="${dir.out}/installer/servlets">
<include name="org/snipsnap/admin/AdminInitFilter.java"/>
<include name="org/snipsnap/admin/Installer.java"/>
</javac>
</target>
<target if="precompile.jsp" depends="compile-installer-jsp" name="installer-jsp-jar"
description="package precompiled installer jsp files">
<mkdir dir="${dir.out}/installer/webapp/WEB-INF/lib"/>
<jar destfile="${dir.out}/installer/webapp/WEB-INF/lib/installer-jsp.jar" excludes="**/CVS">
<fileset dir="${dir.out}/installer/jsp/classes" includes="**"/>
</jar>
</target>
<target depends="compile-installer" description="package installer servlets" name="installer-servlets-jar">
<mkdir dir="${dir.out}/installer/webapp/WEB-INF/lib"/>
<jar destfile="${dir.out}/installer/webapp/WEB-INF/lib/installer-servlets.jar" excludes="**/CVS">
<fileset dir="${dir.out}/installer/servlets" includes="**"/>
<fileset dir="." includes="conf/snipsnap.conf"/>
<fileset dir="${dir.src}" includes="org/snipsnap/config/defaults.conf"/>
<fileset dir="${dir.src}" includes="org/snipsnap/config/globals.conf"/>
</jar>
</target>
<!-- create web archive of the installer web application -->
<target depends="installer-jsp-jar" description="build installer war" name="installer-war">
<mkdir dir="${dir.out}/installer/webapp"/>
<copy todir="${dir.out}/installer/webapp">
<fileset dir="${dir.src}/apps/installer">
<exclude name="**/CVS"/>
<exclude name="**/*.jsp" if="precompile.jsp"/>
<exclude name="WEB-INF/web-xml.tmpl"/>
</fileset>
<fileset dir="${dir.src}/apps/default">
<include name="WEB-INF/lib/standard.jar"/>
<include name="WEB-INF/lib/jstl.jar"/>
</fileset>
</copy>
<copy file="${dir.src}/apps/default/admin/css/config.css" tofile="${dir.out}/installer/webapp/default.css"/>
<copy file="${dir.src}/apps/installer/index.jsp" tofile="${dir.out}/installer/webapp/index.jsp"/>
<!-- copy if installer-web.inc is available -->
<loadfile property="installer-web.inc" srcfile="${dir.out}/installer/jsp/web.inc" failonerror="false"/>
<condition property="installer-web.inc" value="">
<not>
<isset property="${installer-web.inc}"/>
</not>
</condition>
<copy
tofile="${dir.out}/installer/webapp/WEB-INF/web.xml"
file="${dir.src}/apps/installer/WEB-INF/web-xml.tmpl" overwrite="true">
<filterset>
<filter token="PRECOMPILED-JSP" value="${installer-web.inc}"/>
</filterset>
</copy>
<jar destfile="${dir.libs}/${appname}-installer.war">
<fileset dir="${dir.out}/installer/webapp" includes="**"/>
</jar>
</target>
<import file="build.test.xml"/>
<target description="generation javadocs" name="javadoc">
<javadoc packagenames="org.snipsnap.*"
sourcepath="src"
excludepackagenames="org.snipsnap.test.*"
defaultexcludes="yes"
destdir="docs/api"
author="true"
version="true"
use="true"
windowtitle="SnipSnap API">
<doctitle><![CDATA[<h1>SnipSnap</h1>]]></doctitle>
<bottom><![CDATA[<i>Copyright &#169; 2001-2006 Matthias L. Jugel, Stephan J. Schmidt. All Rights Reserved
.</i>]]></bottom>
<!-- <tag name="todo" scope="all" description="To do:" />
<group title="Group 1 Packages" packages="com.dummy.test.a*"/>
<group title="Group 2 Packages" packages="com.dummy.test.b*:com.dummy.test.c*"/>
-->
<link href="http://java.sun.com/j2se/1.4/docs/api/package-list"/>
</javadoc>
</target>
</project>