ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Weintraub" <qazw...@gmail.com>
Subject Re: Multiple
Date Sun, 06 Jul 2008 03:07:16 GMT
Take a look at filtering when you do a <copy>. In your files, you put
target strings like "@serverName@" and "@user@. Here's an example from
one of my build.xml:

        <copy todir="${dest.dir}"/>
            <fileset dir="${template.dir}"/>
             <filterset begintoken="@" endtoken="@">
                <filtersfile file="${deploy.properties.file}"/>
            </filterset>
        </copy>

The <filterset> sub-task does the replacement. It finds all the tokens
that are in the form of "@server@" or "@user@" and replaces them with
the values found in the "${deploy.properties.file}".


--
David Weintraub
qazwart@gmail.com


On Tue, Jul 1, 2008 at 2:44 PM, Raymond Berg (ALLETE) <rberg@mnpower.com> wrote:
> I've got a situation where I need to search deployment files for various
> server names of a variable count when moving from staging to production
> automatically. However, I can't seem to figure out how to handle a
> dynamic replace count. I was looking at the script task but found no
> syntax that seemed to help. (Also investigated path tools and the few
> string operations available)
>
> I'm debating whether to create a new Ant task, but I'm not comfortable
> enough with my skills yet to attempt this.
>
> If it helps, my script is currently passing in a single delimited string
> as follows: find1~replace#find2~replace2#...#findn~replacen
>
> Any ideas?
>
> Raymond
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>

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


Mime
View raw message