forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nicola...@apache.org
Subject cvs commit: xml-forrest/src/resources/forrestbot2/core buildall.xml cvs.xml default-forrest.properties email.xml emailtemplate.txt forrestbot.xml local.xml rebuild-forrest.xml
Date Mon, 20 Oct 2003 11:43:59 GMT
nicolaken    2003/10/20 04:43:59

  Added:       scratchpad/forrestbot2 avalon-phoenix.xml avalon-site.xml
                        incubator-site.xml README.txt sf-struts.xml
                        ws-site.xml xml-fop.xml xml-forrest-krysalis.xml
                        xml-forrest-seed.xml xml-forrest.xml xml-site.xml
                        xml-xindice.xml xml-xmlbeans.xml
               scratchpad/forrestbot2/core buildall.xml cvs.xml
                        default-forrest.properties email.xml
                        emailtemplate.txt forrestbot.xml local.xml
                        rebuild-forrest.xml
  Removed:     src/resources/forrestbot2 avalon-phoenix.xml avalon-site.xml
                        incubator-site.xml README.txt sf-struts.xml
                        ws-site.xml xml-fop.xml xml-forrest-krysalis.xml
                        xml-forrest-seed.xml xml-forrest.xml xml-site.xml
                        xml-xindice.xml xml-xmlbeans.xml
               src/resources/forrestbot2/core buildall.xml cvs.xml
                        default-forrest.properties email.xml
                        emailtemplate.txt forrestbot.xml local.xml
                        rebuild-forrest.xml
  Log:
  Move forrestbot2 to scratchpad.
  Hope it matures quickly, as it's *much* better than the first iteration.
  
  Revision  Changes    Path
  1.1                  xml-forrest/scratchpad/forrestbot2/avalon-phoenix.xml
  
  Index: avalon-phoenix.xml
  ===================================================================
  <?xml version="1.0"?>
  <project name="avalon-phoenix" default="main">
  
    <!--
    <property name="project.root-dir" value="${user.home}/apache/avalon/avalon-phoenix"/>
    <target name="getsrc" depends="local.getsrc"/>
    -->
    <import file="core/forrestbot.xml"/>
  
  </project>
   
  
  
  
  1.1                  xml-forrest/scratchpad/forrestbot2/avalon-site.xml
  
  Index: avalon-site.xml
  ===================================================================
  <?xml version="1.0"?>
  <project name="avalon-site" default="main">
  
    <!--
    <property name="project.root-dir" value="${user.home}/apache/avalon/avalon-site"/>
    <target name="getsrc" depends="local.getsrc"/>
    -->
    <import file="core/forrestbot.xml"/>
  
  </project>
   
  
  
  
  1.1                  xml-forrest/scratchpad/forrestbot2/incubator-site.xml
  
  Index: incubator-site.xml
  ===================================================================
  <?xml version="1.0"?>
  <project name="incubator-site" default="main">
  
    <!--
    <property name="project.root-dir" value="${user.home}/apache/incubator/incubator-site"/>
    <target name="getsrc" depends="local.getsrc"/>
    -->
    <import file="core/forrestbot.xml"/>
  
  
  </project>
   
  
  
  
  1.1                  xml-forrest/scratchpad/forrestbot2/README.txt
  
  Index: README.txt
  ===================================================================
                                   Forrestbot v2
                                   =============
  
  Introduction
  ------------
  
  This directory contains an attempt at rewriting the Forrestbot using vanilla
  Ant 1.6, making extensive use of the <import> task.
  
  Motivation
  ----------
  
  The old Forrestbot works by generating an Ant script with XSLT.  This script
  calls targets in templates.build.xml, which in turn calls targets in
  forrest.build.xml.  This scheme has two problems:
  
   - With three layers of indirection, this gets very hard to debug
  
   - It's inflexible.  We cannot define project-specific tasks.  We very much
     need this missing flexibility, because a lot of projects (notably Cocoon)
     call Forrest after customising the xdocs in their own Ant scripts.
  
  
  Design
  ------
  
  Instead, Forrestbot v2 uses Ant 1.6's <import> to define a hierarchy of
  scripts:
  
                                 forrest.build.xml
                                         |
                                         V
                                   forrestbot.xml
                                         |
                                         V
        xml-forrest.xml, xml-fop.xml, cocoon-site.xml, jakarta-poi.xml, ...
  
  
  forrestbot.xml runs <import file="forrest.build.xml"/>, making it a logical
  superset of forrest.build.xml.  Scripts for building each Forrest-using
  projects are likewise supersets of forrestbot.xml
  
  The nice thing about <import> is that overriding scripts can:
  
   - Redefine properties.  Our project scripts can all redefine details like the
     CVS location, where confirmation mail should go to, etc.
  
   - Override targets.  Two uses:
   
      - Customize the forrestbot workflow.  Want to get a project's contents
        locally instead of from CVS?  Just override the 'getsrc' method:
  
         <target name="getsrc" depends="local.getsrc"/>
  
        Similarly for 'deploy' (local, ftp, scp) and 'notify' (email or just
        <echo>), 
  
      - Project-specific stuff.  Cocoon needs to copy lib/jars.xml to the xdocs
        directory, xml-cocoon.xml would override the 'get-src' target from
        forrestbot.xml, and do the copy (or invoke a Cocoon script to do it).
  
  
  Status
  ------
  
  *Very* alpha.  Requires the latest Ant, which I don't think Forrest's is.  Only
  a few project scripts implemented.
  
  
  -- 
  $Date: 2003/10/20 11:43:58 $ 
  
  
  
  1.1                  xml-forrest/scratchpad/forrestbot2/sf-struts.xml
  
  Index: sf-struts.xml
  ===================================================================
  <?xml version="1.0"?>
  <project name="struts-site" default="main">
  
    <property name="user" value="anonymous"/>
    <property name="password" value=""/>
    <property name="root" value="/cvsroot/struts"/>
    <property name="host" value="cvs.sourceforge.net"/>
    <property name="module" value="${ant.project.name}"/>
  
    <import file="core/forrestbot.xml"/>
  
    <target name="getsrc" depends="cvs.getsrc"/>
  
    <!-- <target name="notify" depends="email.notify-onfail"/> -->
    <target name="notify" depends="local.notify"/>
  
  </project>
   
  
  
  
  1.1                  xml-forrest/scratchpad/forrestbot2/ws-site.xml
  
  Index: ws-site.xml
  ===================================================================
  <?xml version="1.0"?>
  <project name="ws-site" default="main">
  
    <!--
    <property name="project.root-dir" value="${user.home}/apache/ws/ws-site"/>
    <target name="getsrc" depends="local.getsrc"/>
    -->
    <import file="core/forrestbot.xml"/>
  
  </project>
   
  
  
  
  1.1                  xml-forrest/scratchpad/forrestbot2/xml-fop.xml
  
  Index: xml-fop.xml
  ===================================================================
  <?xml version="1.0"?>
  <project name="xml-fop" default="main">
  
    <!--
    <property name="project.root-dir" value="${user.home}/apache/xml/xml-fop"/>
    <target name="getsrc" depends="local.getsrc"/>
    -->
    <import file="core/forrestbot.xml"/>
  
  </project>
   
  
  
  
  1.1                  xml-forrest/scratchpad/forrestbot2/xml-forrest-krysalis.xml
  
  Index: xml-forrest-krysalis.xml
  ===================================================================
  <?xml version="1.0"?>
  <project name="xml-forrest-krysalis" default="main">
  
      <!--
      <target name="getsrc" depends="local.getsrc"/> 
      <property name="project.root-dir" value="${user.home}/apache/xml/xml-forrest"/>
      -->
      <property name="project.skin" value="krysalis-site"/>
      <import file="core/forrestbot.xml"/>
  
  </project>
   
  
  
  
  1.1                  xml-forrest/scratchpad/forrestbot2/xml-forrest-seed.xml
  
  Index: xml-forrest-seed.xml
  ===================================================================
  <?xml version="1.0"?>
  <project name="xml-forrest-seed" default="main">
  
      <property name="module" value="xml-forrest"/>
      <property name="project.root-dir" value="src/resources/fresh-site"/>
  
      <!--
      <property name="project.root-dir" location="../fresh-site"/>
      <target name="getsrc" depends="local.getsrc"/> 
      -->
  
    <import file="core/forrestbot.xml"/>
  
  </project>
  
  
  
  
  1.1                  xml-forrest/scratchpad/forrestbot2/xml-forrest.xml
  
  Index: xml-forrest.xml
  ===================================================================
  <?xml version="1.0"?>
  <project name="xml-forrest" default="main">
  
    <import file="core/forrestbot.xml"/>
  
  </project>
   
  
  
  
  1.1                  xml-forrest/scratchpad/forrestbot2/xml-site.xml
  
  Index: xml-site.xml
  ===================================================================
  <?xml version="1.0"?>
  <project name="xml-site" default="main">
  
    <!--
    <property name="project.root-dir" value="${user.home}/apache/xml/xml-site"/>
    <target name="getsrc" depends="local.getsrc"/>
    -->
    <import file="core/forrestbot.xml"/>
  
  </project>
   
  
  
  
  1.1                  xml-forrest/scratchpad/forrestbot2/xml-xindice.xml
  
  Index: xml-xindice.xml
  ===================================================================
  <?xml version="1.0"?>
  <project name="xml-xindice" default="main">
  
    <!--
    <property name="project.root-dir" value="${user.home}/apache/xml/xml-xindice"/>
    <target name="getsrc" depends="local.getsrc"/>
    -->
    <import file="core/forrestbot.xml"/>
  
  </project>
   
  
  
  
  1.1                  xml-forrest/scratchpad/forrestbot2/xml-xmlbeans.xml
  
  Index: xml-xmlbeans.xml
  ===================================================================
  <?xml version="1.0"?>
  <project name="xml-xmlbeans" default="main">
  
    <property name="project.root-dir" value="website"/>
  
    <import file="core/forrestbot.xml"/>
  
    <!--<target name="getsrc" depends="local.getsrc"/>-->
  
  </project>
   
  
  
  
  1.1                  xml-forrest/scratchpad/forrestbot2/core/buildall.xml
  
  Index: buildall.xml
  ===================================================================
  <project>
  
    <fileset id="buildfiles" dir="." includes="*.xml">
      <exclude name="base.xml"/>
      <exclude name="build.xml"/>
    </fileset>
  
    <property name="buildfiles.prop" refid="buildfiles"/>
    <echo>Building ${buildfiles.prop}</echo>
  
    <subant>
      <fileset refid="buildfiles"/>
    </subant>
  </project>
  
  
  
  1.1                  xml-forrest/scratchpad/forrestbot2/core/cvs.xml
  
  Index: cvs.xml
  ===================================================================
  <project name="cvs">
  
    <property name="user" value="anoncvs"/>
    <property name="password" value="anoncvs"/>
    <property name="root" value="/home/cvspublic"/>
    <property name="host" value="cvs.apache.org"/>
    <property name="module" value="${ant.project.name}"/>
    <property name="tag" value=""/>
  
    <property name="build.cvsmodule-dir"    value="work/cvsmodules"/>
    <property name="build.work-dir"         value="work/${ant.project.name}"/>
  
    <condition property="root-dir" value="/${project.root-dir}">
      <isset property="project.root-dir"/>
    </condition>
    <property name="root-dir" value=""/>
  
    <target name="getsrc">
  
      <cvspass cvsroot=":pserver:${user}@${host}:${root}" password="${password}"/>
  
      <echo><![CDATA[<cvs cvsRoot=":pserver:${user}@${host}:${root}"
        package="${module}${root-dir}"
        dest="${build.cvsmodule-dir}"
        quiet="false"
        command="checkout -l"
        tag="${tag}"
        />]]></echo>
  
      <cvs cvsRoot=":pserver:${user}@${host}:${root}"
        package="${module}${root-dir}"
        dest="${build.cvsmodule-dir}"
        quiet="true"
        command="checkout -l"
        tag="${tag}"
        />
  
      <echo>Loading ${build.cvsmodule-dir}/${module}${root-dir}/forrest.properties..</echo>
      <loadproperties srcFile="${build.cvsmodule-dir}/${module}${root-dir}/forrest.properties"/>
      <loadproperties srcFile="${bot.home}/default-forrest.properties"/>
  
      <echo><![CDATA[<cvs cvsRoot=":pserver:${user}@${host}:${root}"
        package="${module}${root-dir}/${project.content-dir}"
        dest="${build.cvsmodule-dir}"
        quiet="false"
        tag="${tag}"
        />]]></echo>
  
      <cvs cvsRoot=":pserver:${user}@${host}:${root}"
        package="${module}${root-dir}/${project.content-dir}"
        dest="${build.cvsmodule-dir}"
        quiet="true"
        tag="${tag}"
        />
  
      <copy todir="${build.work-dir}">
        <fileset dir="${build.cvsmodule-dir}/${module}${root-dir}"/>
      </copy>
  
    </target>
  
  
  </project>
  
  
  
  1.1                  xml-forrest/scratchpad/forrestbot2/core/default-forrest.properties
  
  Index: default-forrest.properties
  ===================================================================
  project.content-dir=src/documentation
  project.conf-dir=${project.content-dir}/conf
  project.sitemap-dir=${project.content-dir}
  project.xdocs-dir=${project.content-dir}/content/xdocs
  project.resources-dir=${project.content-dir}/resources
  project.stylesheets-dir=${project.resources-dir}/stylesheets
  project.images-dir=${project.resources-dir}/images
  project.schema-dir=${project.resources-dir}/schema
  project.skins-dir=${project.content-dir}/skins
  project.skinconf=${project.content-dir}/skinconf.xml
  project.lib-dir=${project.content-dir}/lib
  project.classes-dir=${project.content-dir}/classes
  
  
  
  1.1                  xml-forrest/scratchpad/forrestbot2/core/email.xml
  
  Index: email.xml
  ===================================================================
  <project name="email">
  
    <target name="notify" depends="site" if="build-failed">
      <tstamp>
        <format property="NOW" pattern="dd MMMM hh:mm aa"/>
      </tstamp>
      <mail from="forrestbot@xml.apache.org"
        mailhost="${mail.host}"
        tolist="${mail.to}"
        subject="ForrestBot build for ${ant.project.name} ${completion-status}"
        failonerror="false"
        files="${build.logfile}"
        messagefile="${bot.home}/emailtemplate.txt">
      </mail>
    </target>
  
  </project>
  
  
  
  1.1                  xml-forrest/scratchpad/forrestbot2/core/emailtemplate.txt
  
  Index: emailtemplate.txt
  ===================================================================
  Automated build for ${ant.project.name} ${completion-status}
  Log attached.
  
  -- 
  Forrestbot run ended at ${NOW}
  Using Forrest ${version}
  Forrestbot administrator: ${administrator}
  
  
  
  1.1                  xml-forrest/scratchpad/forrestbot2/core/forrestbot.xml
  
  Index: forrestbot.xml
  ===================================================================
  <?xml version="1.0"?>
  
  <project basedir="." default="main">
  
    <property environment="ENV"/>
    <property name="forrest.home" value="${ENV.FORREST_HOME}"/>
    <property name="bot.home" value="${forrest.home}/forrestbot2/core"/>
    <import file="${forrest.home}/forrest.build.xml"/>
  
    <!--<import file="${bot.home}/rebuild-forrest.xml"/>-->
    <import file="${bot.home}/cvs.xml"/>
    <import file="${bot.home}/local.xml"/>
    <import file="${bot.home}/email.xml"/>
  
    <property name="administrator"  value="jefft@apache.org"/>
    <property name="build.work-dir"         location="work/${ant.project.name}"/>
    <property name="build.site-dir"         location="work/${ant.project.name}/site"/>
    <property name="build.deploy-dir"       location="sites/${ant.project.name}"/>
    <mkdir dir="logs"/>
    <tstamp>
      <format property="logtime" pattern="yyMMdd-hhmm"/>
    </tstamp>
    <property name="build.logfile"          location="logs/${ant.project.name}.log"/>
    <property name="build.logfile-stored"   location="logs/${ant.project.name}-${logtime}.log"/>
  
    <property name="mail.host" value="localhost"/>
    <property name="mail.to"   value="${user.name}@localhost"/>
  
    <target name="getsrc" depends="cvs.getsrc"/>
  
    <target name="site" depends="getsrc">
  
      <taskdef resource="net/sf/antcontrib/antcontrib.properties">
        <classpath>
          <pathelement location="${forrest.home}/forrestbot/lib/ant-contrib-0.1.jar"/>
        </classpath>
      </taskdef>
  
      <trycatch property="errmsg">
        <try>
          <record name="${build.logfile}" action="start"/>
          <echo>
            ....... Forrest render START
            ... Rendering docs in ${build.work-dir}
          </echo>
          <antcall target="forrest.site" inheritAll="false">
            <param name="project.home" value="${build.work-dir}"/>
            <param name="project.build-dir" value="${build.work-dir}"/>
            <param name="project.site-dir" value="${build.site-dir}"/>
          </antcall>
          <echo>
            ....... Forrest render END
          </echo>
          <record name="${build.logfile}" action="stop"/>
          <property name="completion-status" value="succeeded" />
        </try>
        <catch>
          <record name="${build.logfile}" action="stop"/>
          <echo>Oops, something broke</echo>
          <property name="completion-status" value="FAILED" />
          <property name="build-failed" value="true"/>
          <throw refid="exception" message="${errmsg}"/>
        </catch>
      </trycatch>
      <copy file="${build.logfile}" tofile="${build.logfile-stored}"/>
    </target>
  
    <target name="deploy" depends="local.deploy"/>
  
    <target name="notify" depends="local.notify"/>
  
    <target name="main" depends="getsrc, site, deploy, notify"/>
  
  </project>
  
  
  
  1.1                  xml-forrest/scratchpad/forrestbot2/core/local.xml
  
  Index: local.xml
  ===================================================================
  <project name="local">
  
    <property name="build.work-dir"         value="work/${ant.project.name}"/>
  
    <target name="getsrc">
      <echo>
        ....... local.getsrc START
        Copying source from ${project.root-dir}
      </echo>
      <mkdir dir="${build.work-dir}"/>
      <copy todir="${build.work-dir}">
        <fileset dir="${project.root-dir}">
          <include name="forrest.properties"/>
          <include name="status.xml"/>
          <include name="module.xml"/>
        </fileset>
      </copy>
      <echo>Loading ${build.work-dir}/forrest.properties..</echo>
      <loadproperties srcFile="${build.work-dir}/forrest.properties"/>
      <loadproperties srcFile="${bot.home}/default-forrest.properties"/>
      <echo>
        Copying source from ${project.root-dir}/${project.content-dir}
      </echo>
      <copy todir="${build.work-dir}/${project.content-dir}">
        <fileset dir="${project.root-dir}/${project.content-dir}"/>
      </copy>
      <echo>
        ....... local.getsrc END
      </echo>
    </target>
  
    <target name="deploy">
      <mkdir dir="${build.deploy-dir}"/>
      <echo>Deploying from ${build.site-dir} to ${build.deploy-dir}</echo>
      <copy todir="${build.deploy-dir}">
        <fileset dir="${build.site-dir}"/>
      </copy>
    </target>
  
    <target name="notify" depends="site">
      <tstamp>
        <format property="NOW" pattern="dd MMMM hh:mm aa"/>
      </tstamp>
      <echo>
        ----------------------------------
        Forrestbot run ${completion-status}
        Output in: ${build.deploy-dir}
        Log in:    ${build.logfile-stored}
  
        Time: ${NOW}
        Using Forrest ${version}
        ----------------------------------
      </echo>
    </target>
  
  
  </project>
  
  
  
  1.1                  xml-forrest/scratchpad/forrestbot2/core/rebuild-forrest.xml
  
  Index: rebuild-forrest.xml
  ===================================================================
  <project name="rebuild-forrest">
  
    <property name="apache-cvsroot" value=":pserver:anoncvs@cvs.apache.org:/home/cvspublic"/>
  
    <property name="forrest.tag" value="HEAD"/>
  
    <cvspass cvsroot="${apache-cvsroot}" password="anoncvs"/>
  
    <cvs cvsRoot="${apache-cvsroot}"
      package="xml-forrest"
      dest="cvs/"
      quiet="true"
      command="update -dP"
      />
    <property name="forrest.home" value="cvs/xml-forrest"/>
    <echo>forrest.home set to ${forrest.home}</echo>
  
  </project>
  
  
  

Mime
View raw message