ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Benson <gudnabr...@yahoo.com>
Subject Re: can filesets be stored in a properties file?
Date Fri, 08 Jun 2007 18:02:56 GMT

--- caleysoldman <tampa_dba@yahoo.com> wrote:

> 
> hi matt, thanks for your reply...here you are ant
> folx:
> 
> my requirement is to produce sql using ant. i am
> enjoined not to use
> velocity, groovy, or anything but ant. 
> 
> as such, what i am trying to replicate is shell
> script logic because those
> are my marching orders. i mention this because i'm
> sure real application
> developers will object to this egregious misuse of
> ant... 
> 
Thanks for clarifying all that up front.  :)

> :arguing:
> 
> regardless, what i did was create a working build
> ...all i really need to
> understand is how to move the fileset to an external
> file that will then be
> used based on the DBMS property which value is
> passed at the command line.
> thanks in advance for your help ant folx!
> 

If you know that you only have a finite number of
filesets, here typicalTableSQL and typicalTabStorage,
it shouldn't be too difficult.  You should be able to
add some properties to generic.properties or another
properties file to handle what you need.  Here's what
I would probably do:

#new file e.g. "filesets.properties":
typicalTableSQL.dir=sql_def/tables
typicalTableSQL.includes=**/*.tmplt
typicalTableSQL.excludes=a.tmplt,b.tmplt,${EXCLUDE01}.tmplt
typicalTabStorage.dir=sql_def/storage
typicalTabStorage.includes=${DBMS}_typtab_storage.tmplt
#end

Then add to your buildfile, after you've loaded
generic.properties:

<property file="filesets.properties" />
<macrodef name="createFileset">
  <attribute name="assignid" />
  <sequential>
    <!-- default includes and excludes -->
    <property name="@{assignid}.includes" value="**/*"
/>
    <property name="@{assignid}.excludes" value="" />
    <fileset id="@{assignid}" dir="${@{assignid}.dir}"
                 includes="${@{assignid}.includes}"
                 excludes="${@{assignid}.excludes}" />
  </sequential>
</macrodef>

<createFileset assignid="typicalTableSQL" />
<createFileset assignid="typicalTabStorage" />

... finally, of course, remove your old fileset
definitions.

Good luck,
Matt

[SNIP]


       
____________________________________________________________________________________
Get the Yahoo! toolbar and be alerted to new email wherever you're surfing.
http://new.toolbar.yahoo.com/toolbar/features/mail/index.php

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message