Subversion Repositories general

Rev

Rev 925 | Blame | Last modification | View Log | RSS feed

<project name="hostadmiral" default="deploy" basedir=".">

        <property name="build.compiler" value="jikes" />

        <property name="src"            location="src" />
        <property name="classes"        location="classes" />
        <property name="app.web-inf"    location="webapp/WEB-INF" />
        <property name="classes.deploy" location="${app.web-inf}/classes" />
        <property name="conf"           location="conf" />
        <property name="lib"            location="lib" />
        <property name="lib.ant"        location="lib/ant" />
        <property name="lib.deploy"     location="${app.web-inf}/lib" />
        <property name="classpath"      value="" />

        <path id="classpath.general">
                <pathelement path="${classpath}" />
                <fileset dir="${lib.deploy}">
                        <include name="*.jar" />
                </fileset>
        </path>

        <path id="classpath.test">
                <path refid="classpath.general" />
                <pathelement location="${classes.deploy}" />
        </path>

        <path id="classpath.compile">
                <path refid="classpath.general" />
                <pathelement location="${classes}" />
                <fileset dir="${lib}">
                        <include name="**/*.jar" />
                        <exclude name="ant/" />
                </fileset>
        </path>

        <path id="classpath.ant">
                <fileset dir="${lib.ant}">
                        <include name="**/*.jar" />
                </fileset>
        </path>

        <taskdef name="hibernatedoclet" classname="xdoclet.modules.hibernate.HibernateDocletTask">
                <classpath refid="classpath.ant"/>
        </taskdef>

        <target name="compile">
                <mkdir dir="${classes}" />

                <javac
                        srcdir="${src}"
                        destdir="${classes}"
                        classpathref="classpath.compile"
                        debug="on"
                        nowarn="on"
                />
        </target>

        <target name="hibernate">
                <hibernatedoclet
                        destdir="${classes}"
                        excludedtags="@version,@author,@todo"
                        mergedir="${classes}"
                        verbose="false"
                >
                        <fileset dir="src">
                                <include name="**/*.java" />
                        </fileset>
                        <hibernate version="2.0" />
                </hibernatedoclet>
        </target>

        <target name="deploy" depends="compile,hibernate">
                <copy todir="${classes.deploy}">
                        <fileset dir="${classes}" />
                </copy>

                <copy todir="${classes.deploy}">
                        <fileset
                                dir="${classes}"
                                includes="**/*.xml"
                        />
                </copy>

                <copy todir="${app.web-inf}" flatten="yes">
                        <fileset
                                dir="${src}"
                                includes="**/*.tld"
                        />
                </copy>

                <native2ascii
                        encoding="UTF8"
                        src="${src}"
                        dest="${classes.deploy}"
                        includes="**/*.properties"
                />

                <copy todir="${classes.deploy}" file="${conf}/log4j.properties" />
                <copy todir="${classes.deploy}" file="${conf}/hibernate.cfg.xml" />

                <touch file="${app.web-inf}/web.xml" />
        </target>

        <target name="clean">
                <delete dir="${classes}"/>
                <delete dir="${classes.deploy}"/>
        </target>

        <target name="all" depends="clean,deploy" />

        <target name="test" depends="deploy">
                <java
                        classname="ak.hostadmiral.core.model.test.Test"
                        classpathref="classpath.test"
                />
        </target>

</project>