ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bevan Arps <bevan.a...@actfs.co.nz>
Subject Removing Redundancy in build file
Date Thu, 04 Jan 2001 23:41:53 GMT

Gidday everyone.

I'm using ANT to properly automate our existing Build process and have
run into a (hopefully) minor glitch. I haven't been able to find an
answer in the ANT docs, nor on the Faqomatic.

Some background: One characteristic of our Build methodology is that we
want to be able to reproduce (rebuild) any particular version of an
application at any time. Being able to do this aids us with regression
testing, bug fixes and so on.

I've created two build targets that take parameters as follows (I've
chopped out the internals to keep the size of this email down, let me
know if you want to see them):

<!-- Get source in a given directory for a given label
     param SourceDir = Directory to update
     param SourceLabel = Label to use -->
<target name="GetSourceByLabel">
  <echo message="Getting ${SourceLabel} in ${SourceDir}"/>
...
</target>

<!-- Get latest source in a given directory
     param SourceDir = Directory to update -->
<target name="GetLatestSource">
...
</target>

These targets work fine - I invoke them through AntCall tasks.

My problem is that I am ending up with the same list of directories
listed three times in three different places. Since the list of
directories gets larger every time a new application, web page or
service is added to our project, this concerns me as a maintenance
problem.

Here are the three places where the directories are listed:

<target name="Base_2.0.000">
  <delete>
    <fileset dir="C:\Source\Delphi\Packages">
      <include name="mocCORE\*.*/"/>
      <include name="mocTCP\*.*/"/>
      <include name="mocLOG\*.*/"/>
      <include name="mocGUI\*.*/"/>
    </fileset>
  </delete>
  <antcall target="BaseByLabel">
    <param name="SourceLabel" value="Base 2.0.000"/>
  </antcall>
</target>

<target name="Base_Daily">
  <antcall target="GetLatestSource">
    <param name="SourceDir" value="C:\Source\Delphi\Packages\mocCORE"/>
  </antcall>
  <antcall target="GetLatestSource">
    <param name="SourceDir" value="C:\Source\Delphi\Packages\mocTCP"/>
  </antcall>
  <antcall target="GetLatestSource">
    <param name="SourceDir" value="C:\Source\Delphi\Packages\mocLOG"/>
  </antcall>
  <antcall target="GetLatestSource">
    <param name="SourceDir" value="C:\Source\Delphi\Packages\mocGUI"/>
  </antcall>
</target>

<target name="BaseByLabel">
  <antcall target="GetSourceByLabel">
    <param name="SourceDir" value="C:\Source\Delphi\Packages\mocCORE"/>
  </antcall>
  <antcall target="GetSourceByLabel">
    <param name="SourceDir" value="C:\Source\Delphi\Packages\mocTCP"/>
  </antcall>
  <antcall target="GetSourceByLabel">
    <param name="SourceDir" value="C:\Source\Delphi\Packages\mocLOG"/>
  </antcall>
  <antcall target="GetSourceByLabel">
    <param name="SourceDir" value="C:\Source\Delphi\Packages\mocGUI"/>
  </antcall>
</target>

Does anyone have any suggestions on how I can simplify this? Ideally,
I'd like to keep the list of directories ONCE only. Can this be done?

Thanks for your time,
Bevan.

-- 
_______________________________________________________________________
Bevan Arps, OO Analyst                    email: bevan.arps@actfs.co.nz
ACT Financial Systems     "Programming is an Art Form that Fights Back"
***********************************************************************
This  communication  is confidential  to ACT  Financial  Systems  (Asia
Pacific)  and is intended for  use only by the  addressee.   The  views
and opinions  expressed in  this email  are the senders  own and do not
represent  the  views  and  opinions of  ACT  Financial  Systems  (Asia
Pacific).
***********************************************************************

Mime
View raw message