topical media & game development

talk show tell print

professional-portal-07-build.xml / xml



  <?xml version="1.0"?>
  <!--
    *******************************************************
    **  Taxonomy example.
    ** 
    *******************************************************
    -->
  
  <project name="Taxonomy" default="help" basedir=".">
            
          <!--
    	*******************************************************
    	** Global properties.
    	****************************************************-->
            <property name="rootdir" value="."/>
            <property name="builddir" value="build"/>
            
          <!--
    	*******************************************************
    	** Classpath properties.
    	****************************************************-->
  
          <path id="classpath.path">
                     <pathelement location="{builddir}"/>
                  <pathelement path="{builddir}/WEB-INF/lib/dom4j-full.jar"/>
            </path>
          
            <!--
    	********************************************************
    	** Remove the (build/release) directories
    	*****************************************************-->
            <target name="clean">
              <delete dir="{builddir}"/>
            </target>
          
            <!--
    	*******************************************************
    	** Create the output directory structure.
    	****************************************************-->
            <target name="prepare" depends="clean">
              <mkdir dir="{builddir}"/>
                  <mkdir dir="{builddir}/deploy"/>
              <mkdir dir="{builddir}/WEB-INF/lib"/>
              <mkdir dir="{builddir}/WEB-INF/classes/taxonomy"/>
  
              <copy todir="{builddir}/WEB-INF/classes/taxonomy">
                        <fileset dir="taxonomy/beans"/>
              </copy>
                  <copy todir="{builddir}">
                        <fileset dir="taxonomy/docroot"/>
              </copy>
                  <copy todir="{builddir}/WEB-INF/lib">
                        <fileset dir="taxonomy/lib"/>
              </copy>
                  <copy todir="{builddir}/WEB-INF">
                        <fileset dir="taxonomy/deployment"/>
              </copy>
  
            </target>
          
            <!--
    	********************************************************
    	** Help
    	*****************************************************-->
            <target name="help" description="The default target">
              <echo message="Taxonomy application"/>
              <echo message=""/>
                <echo message=""/>
          <echo message="Modifications need to be made to the absolute path "/>
          <echo message="of the Helper routine that indicates the path to the "/>
          <echo message="Topic.xml file that is used to build the taxonomy navigation."/>                
          <echo message=""/>                
          <echo message="Other means could have been used to locate the Topic.xml file"/>                
                  <echo message="from a properties file using the ServletContext inside a bean:"/>        
                  <echo message=""/>
                  <echo message="Properties resource = new Properties();"/>        
              <echo message=""/>
          <echo message="URL url = this.getClass().getClassLoader().getResource('taxonomy.properties');"/>
          <echo message="resource.load( new FileInputStream(url.getFile()) );" />
              <echo message="driverName = resource.getProperty('valueInPropertiesFile');"/>                
              <echo message=""/>                
          <echo message=""/>        
              <echo message="To run the web application,"/>                
          <echo message=""/>        
              <echo message="http://[hostname:port#]/taxonomy/home.jsp"/>                
          <echo message=""/>                        
          </target>
     
            <!--
    	********************************************************
    	** Build Taxonomy WAR file
    	*****************************************************-->
            <target name="taxonomy" depends="prepare">
  
              <echo message="Compiling source..."/>
  
          <javac srcdir="{builddir}/WEB-INF/classes/taxonomy"
             destdir="{builddir}/WEB-INF/classes" 
             classpathref="classpath.path" />
     
              <echo message="Creating WAR file [taxonomy.war]..."/>
                  
                  <jar destfile="{builddir}/deploy/taxonomy.war" basedir="{builddir}" />
                                  
            </target>
  
  </project>
  


(C) Æliens 20/2/2008

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.