You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@forrest.apache.org by je...@apache.org on 2002/11/03 16:51:51 UTC

cvs commit: xml-forrest/src/resources/forrestbot forrestbot.build.xml

jefft       2002/11/03 07:51:50

  Modified:    src/resources/forrestbot forrestbot.build.xml
  Log:
  - Print a decent error message if forrestbot.conf.xml isn't found
  - init targets not needed with Ant 1.6
  
  Revision  Changes    Path
  1.2       +20 -11    xml-forrest/src/resources/forrestbot/forrestbot.build.xml
  
  Index: forrestbot.build.xml
  ===================================================================
  RCS file: /home/cvs/xml-forrest/src/resources/forrestbot/forrestbot.build.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- forrestbot.build.xml	3 Nov 2002 10:49:33 -0000	1.1
  +++ forrestbot.build.xml	3 Nov 2002 15:51:50 -0000	1.2
  @@ -7,21 +7,30 @@
       Generates Forrestbot Ant script for a specified forrestbot.conf.xml file.
     </description>
   
  -  <target name="init">
  -    <property name="forrestbot.home"          location="${forrest.home}/forrestbot"/>
  -    <property name="bot.work.builder.xslt"    location="${forrestbot.home}/xslt/config2work.xsl" />
  -    <property name="bot.default.builder.xslt" location="${forrestbot.home}/xslt/config2defaults.xsl" />
  +  <property name="forrestbot.home"          location="${forrest.home}/forrestbot"/>
  +  <property name="bot.work.builder.xslt"    location="${forrestbot.home}/xslt/config2work.xsl" />
  +  <property name="bot.default.builder.xslt" location="${forrestbot.home}/xslt/config2defaults.xsl" />
   
  -    <echo>Sourcing ${basedir}/forrestbot.properties</echo>
  -    <echo>Sourcing ${forrestbot.home}/forrestbot.properties</echo>
  -    <echo>bot.work.build.xml = ${bot.work.build.xml}</echo>
  -    <property file="forrestbot.properties"/>
  -    <property file="${forrestbot.home}/forrestbot.properties"/>
  +  <property file="forrestbot.properties"/>
  +  <property file="${forrestbot.home}/forrestbot.properties"/>
   
  -    <echo message="Using config file: ${bot.config}" />
  +  <available property="bot.config.present" file="${bot.config}" type="file"/>
  +  <echo message="Using config file: ${bot.config}" />
  +
  +  <target name="check-config" unless="bot.config.present">
  +    <echo>
  + ---------------- Forrestbot Error -----------------
  + Forrest config file:
  +   ${bot.config}
  + not found, resolved relative to:
  + ${basedir})
  + Add -Dbot.config=... to manually specify the file.
  + --------------------------------------------------
  +    </echo>
  +    <fail message="Forrestbot config file '${bot.config}' not found"/>
     </target>
   
  -  <target name="conf2build" depends="init" >
  +  <target name="conf2build" depends="check-config">
       <!-- remove previous versions to force generation again -->
       <delete file="${bot.work.build.xml}" />
       <delete file="${bot.default.parameters.xml}" />