nicolaken    2002/11/29 01:48:41

  Added:       proposal/gump altbuild.xml
  Log:
  A reworked and cleaned up version of build.xml, that publishes the build
  results in build dir, work all in work dir and scripts in bin dir.
  I'm using it to switch to using Forrest for Gump site generation.
  
  Revision  Changes    Path
  1.1                  jakarta-alexandria/proposal/gump/altbuild.xml
  
  Index: altbuild.xml
  ===================================================================
  <?xml version="1.0"?>
  <!--
  
    Build the scripts and/or site for http://jakarta.apache.org/gump/
    
    If you need to bootstrap this, see gen.sh or gen.bat.
  
    Important targets:
      scripts - generate the scripts
      site    - generate the web site
      all     - generate both the scripts and the site
  
  -->
  <project default="scripts" name="gump">
    
    <!-- ******************************************************* -->
    <!--                Global properties                        -->
    <!-- ******************************************************* -->
    
    <!-- Default properties. Define them before to override them.-->
    
    <property name="home.dir"    value="."/> 
    
    <property name="build.dir"  value="${home.dir}/build"/> 
  <!-- Doesn't work because Jenny atm has hardwired path
    <property name="work.dir"    value="${build.dir}/work"/> -->
    <property name="work.dir"    value="${home.dir}/work"/> 
    <property name="classes.dir" value="${work.dir}/classes"/> 
    <property name="docs.dir"    value="${work.dir}/gumpdocs"/> 
    <property name="merge"       value="${work.dir}/merge.xml"/> 
      
    <property name="bin.dir"     value="${home.dir}/bin"/> 
    <property name="site.dir"    value="${build.dir}/site"/>  
    
    <property name="workspace"   value="${home.dir}/rubypad.xml"/>
    <property name="webstyle"    value="${home.dir}/stylesheet/jakarta.xsl"/>   
    
    <property name="extension"   value="sh" />   
    <property name="target"      value="bash"/>   
     
    
    <!-- ******************************************************* -->
    <!--                    Initialization                       -->
    <!-- ******************************************************* -->     
  
    <!-- Init -->
    <target name="init">
      <mkdir dir="${work.dir}"/>   
      <mkdir dir="${docs.dir}"/>   
      <mkdir dir="${site.dir}"/>   
      <mkdir dir="${classes.dir}"/>    
      <mkdir dir="${build.dir}"/>    
    </target>
  
    <!-- Build the code used to generate the merged xml scripts -->
    <target name="compile" depends="init">
      <javac srcdir="java" destdir="${classes.dir}"/>
  
      <uptodate property="uptodate" targetfile="${merge}">
        <srcfiles dir="." includes=".timestamp"/>
        <srcfiles dir="." includes="${build.dir}/jenny.jar"/>
        <srcfiles dir="." includes="${workspace}"/>
        <srcfiles dir="profile" includes="*.xml"/>
        <srcfiles dir="project" includes="*.xml"/>
        <srcfiles dir="repository" includes="*.xml"/>
        <srcfiles dir="server" includes="*.xml"/>
      </uptodate>
  
      <uptodate property="javadocs.uptodate" targetfile="javadocs/index.html">
        <srcfiles dir="java" includes="*.java"/>
      </uptodate>
    </target>
         
    <!-- Merge the xml sources, resolving references -->
    <target name="merge" depends="package" unless="uptodate">
      <java classname="Jenny" fork="yes" failonerror="true" 
classpath="${build.dir}/jenny.jar">
        <arg value="${workspace}"/>
      </java>
    </target>  
    
    <!-- Merge the xml sources, resolving references -->
    <target name="gen" depends="merge"/>
      
    <target name="package" depends="compile">
      <jar destfile="${build.dir}/jenny.jar" basedir="${classes.dir}"/>
    </target>
   
    <!-- Generate javadocs -->
    <target name="javadocs" depends="package">
      <mkdir dir="build/javadocs"/>
      <javadoc packagenames="org.apache.alexandria.jenny.*" sourcepath="src/java" 
destdir="build/javadocs" classpath="build/jenny.jar">
      
      </javadoc>
    </target>
  
  
    <!-- ******************************************************* -->
    <!--                Generate the scripts                     -->
    <!-- ******************************************************* -->
  
    <!-- ******* Generate infos for the site... ******* -->
  
    <!-- Extract the info necessary to produce the update script -->
    <target name="update" depends="merge">
      <xslt in="${merge}" out="${work.dir}/update.def" 
             style="${home.dir}/stylesheet/update.xsl"/>
    </target>
  
    <!-- Extract the info necessary to produce the build script -->
    <target name="build" depends="merge">  
      <xslt in="${merge}" out="${work.dir}/build.def" 
             style="${home.dir}/stylesheet/build.xsl"/>
    </target>
  
    <!-- Extract the info necessary to produce the xref script -->
    <target name="xref" depends="merge">
      <xslt in="${merge}" out="${work.dir}/xref.def" 
             style="${home.dir}/stylesheet/xref.xsl"/>
    </target>
  
    <!-- ******* ...then do the site. ******* -->
      
    <!-- Add in the website information -->
    <target name="website" depends="build,update,publish,xref,deliver,naglist">
      <xslt basedir="${work.dir}" destdir="${work.dir}" includes="*.def" 
extension=".site"
             style="${webstyle}"/>
    </target>
    
    <!-- Produce the gump web site -->
    <target name="site">
      <ant dir="${home.dir}/site"/>
    </target>  
    
    <!-- ******* Generate infos for the scripts... ******* -->  
      
    <!-- Extract the info necessary to produce the publish script -->
    <target name="publish" depends="merge">
      <copy file="${merge}" tofile="${work.dir}/puball.site"/>
      <xslt in="${merge}" out="${work.dir}/publish.def" 
             style="${home.dir}/stylesheet/publish.xsl"/>
      <xslt in="${merge}" out="${work.dir}/map.pl" 
             style="${home.dir}/stylesheet/sedmap.xsl"/>
    </target>
    
    <!-- Extract the info necessary to produce the deliver script -->
    <target name="deliver" depends="merge">
      <xslt in="${merge}" out="${work.dir}/deliver-local.sh" 
             style="${home.dir}/stylesheet/deliver-local.xsl"/>
    </target>
  
    <!-- Extract the info necessary to produce the naglist -->
    <target name="naglist" depends="merge">
      <xslt in="${merge}" out="${work.dir}/naglist" 
             style="${home.dir}/stylesheet/nag.xsl"/>
    </target>
    
    <!-- ******* ...then generate the scripts.  ******* -->  
  
    <!-- Generate the scripts -->
    <target name="scripts" depends="website">
      <xslt basedir="${work.dir}" destdir="${bin.dir}" includes="*.site"
             extension=".${extension}" style="${home.dir}/stylesheet/${target}.xsl"/>
    </target>
   
    <!-- Generate publish instructions for the javadocs -->
    <target name="pubdocs" depends="merge">
      <xslt in="${merge}" out="${bin.dir}/pubdoc.pl" 
             style="${home.dir}/stylesheet/pubdocs.xsl"/>
    </target>
  
    <!-- ******************************************************* -->
    <!--                   Extra targets                         -->
    <!-- ******************************************************* -->
    
    <!-- Do everything -->
    <target name="all" depends="scripts,pubdocs,site"/>
  
    <!-- Remove all outputs and intermediate results -->
    <target name="clean">
      <delete file=".timestamp"/>
      <delete dir="${work.dir}"/>
      <delete dir="${build.dir}"/>
    </target>
    
      
  </project>
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to