About EJB 03 Xdoclet & ANT 组合使用中关于build.xml的设置

以下是build.xml 以及 build-dist.properties 的实例
<?xml version="1.0" encoding="ISO-8859-1"?>

<project name="XDoclet Examples" default="jar" basedir=".">
    <property name="xdoclet.root.dir" value="${basedir}/.."/>

    <property file="build-dist.properties"/>

    <!-- See CustomerBean. This is to demonstrate property substitution. -->
    <property name="ejb.prefix" value="blah"/>

    <!-- =================================================================== -->
    <!-- Define the class path                                               -->
    <!-- =================================================================== -->
    <path id="samples.class.path">
        <fileset dir="${lib.dir}">
            <include name="*.jar"/>
        </fileset>
        <fileset dir="${samples.lib.dir}">
            <include name="*.jar"/>
        </fileset>
    </path>

    <!-- =================================================================== -->
    <!-- Initialise                                                          -->
    <!-- =================================================================== -->
    <target name="init">
        <tstamp>
            <format property="TODAY" pattern="d-MM-yy"/>
        </tstamp>

        <taskdef
            name="ejbdoclet"
            classname="xdoclet.modules.ejb.EjbDocletTask"
            classpathref="samples.class.path"
            />
    </target>

    <!-- =================================================================== -->
    <!-- Prepares the directory structure                                    -->
    <!-- =================================================================== -->
    <target name="prepare" depends="init">
        <mkdir dir="${samples.classes.dir}"/>
        <mkdir dir="${samples.gen-src.dir}"/>
        <mkdir dir="${samples.meta-inf.dir}"/>
    </target>

    <!-- =================================================================== -->
    <!-- Invoke XDoclet's ejbdoclet                                          -->
    <!-- =================================================================== -->
    <target name="ejbdoclet" depends="prepare">
        <ejbdoclet
            destdir="${samples.gen-src.dir}"
            mergedir="parent-fake-to-debug"
            excludedtags="@version,@author,@todo"
            ejbspec="2.0"
            force="${samples.xdoclet.force}"
            verbose="false"
            >

            <fileset dir="${samples.java.dir}">
                <include name="test/ejb/*.java"/>
            </fileset>

            <!--packageSubstitution packages="ejb" substituteWith="interfaces"/-->

            <remoteinterface/>
            <localinterface/>
            <homeinterface/>
            <localhomeinterface/>

            <dataobject/>
            <valueobject/>

            <entitypk/>

            <entitycmp/>
            <entitybmp/>

            <session/>

            <!--dao>
                <packageSubstitution packages="ejb" substituteWith="dao"/>
            </dao-->

            <!--utilobject cacheHomes="true" includeGUID="true"/-->

            <deploymentdescriptor
                destdir="${samples.meta-inf.dir}"
                validatexml="true"
                mergedir="fake-to-debug"
                description="Yorck Zhou"
                >
                <configParam name="clientjar" value="blah.jar"/>
            </deploymentdescriptor>

            <strutsform/>
        </ejbdoclet>

    </target>


    <!-- =================================================================== -->
    <!-- Compiles all the classes                                            -->
    <!-- =================================================================== -->

    <target name="compile" depends="ejbdoclet">

        <echo>+---------------------------------------------------+</echo>
        <echo>|                                                   |</echo>
        <echo>| ===  C O M P I L I N G   S O U R C E S  ===       |</echo>
        <echo>|                                                   |</echo>
        <echo>+---------------------------------------------------+</echo>

        <javac
            destdir="${samples.classes.dir}"
            classpathref="samples.class.path"
            debug="on"
            deprecation="on"
            optimize="off"
            >

            <src path="${samples.java.dir}"/>
            <src path="${samples.gen-src.dir}"/>

        </javac>

    </target>

    <!-- =================================================================== -->
    <!-- Main                                                                -->
    <!-- =================================================================== -->
    <target name="jar" depends="compile">
        <delete file="${samples.dist.dir}/teller-ejb.jar" />
        <jar jarfile="${samples.dist.dir}/teller-ejb.jar">
              <fileset dir="${samples.classes.dir}">
                <include name="test/ejb/*.class"/>
              </fileset>
              <fileset dir="${samples.dist.dir}">
                <include name="META-INF/*.xml"/>
              </fileset>  
        </jar>
        <echo>+---------------------------------------------------+</echo>
        <echo>|                                                   |</echo>
        <echo>| ===  C O M P I L E FINISHED  ===                  |</echo>
        <echo>|                                                   |</echo>
        <echo>+---------------------------------------------------+</echo>       
    </target>

    <!-- =================================================================== -->
    <!-- Clean                                                               -->
    <!-- =================================================================== -->
    <!--target name="clean">
        <delete dir="${samples.dist.dir}"/>
    </target-->

</project>






# These properties are only used when building the samples expanded from the distribution.

lib.dir = d:/xdoclet-1.2.1/lib
dist.lib.dir = ${lib.dir}

samples.dir = ${xdoclet.root.dir}/XDocletSample
samples.dist.dir = ${samples.dir}/target

samples.lib.dir = ${samples.dir}/lib

samples.src.dir = ${samples.dir}/src
samples.java.dir = ${samples.src.dir}/java

samples.gen-src.dir = ${samples.dist.dir}/gen-src
samples.meta-inf.dir = ${samples.dist.dir}/META-INF
samples.classes.dir = ${samples.dist.dir}/classes

samples.xdoclet.force = false

阅读更多
个人分类: 学习日记
想对作者说点什么? 我来说一句

ant,xdocle

2009年06月16日 3.92MB 下载

没有更多推荐了,返回首页

加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!
关闭
关闭