Java Mailing List Archive

http://www.ant-tasks.com/

Apache Ant Archive

» Ant Users List
» Ant Developers List
- finding the absolute path of each file in a fileset

- finding the absolute path of each file in a fileset

2004-03-29       - By Rich Mauri

Somewhere you're defining deploy.dir as a property.

One way is to set another property using location= prior to the
replaceregexp task.
For example,

<antcall target="doregexp"/>

<target name=doregexp">
   <property name="deploy.absdir" location="${deploy.dir}"/>

   <replaceregexp byline="true" flags="gi">
     <regexp pattern="pattern1"/>
     <substitution expression="pattern2"/>
     <fileset dir="${deploy.absdir}/components">
         <include name="**/*.xsl"/>
     </fileset>
   </replaceregexp>
</target>


-----Original Message-----
From: Shakun Mahajan [mailto:shakun@(protected)]
Sent: Monday, March 29, 2004 4:32 PM
To: Ant Users List
Subject: [BULK] - Re: [BULK] - finding the absolute path of each file in
a fileset


Hi Rich,

Sorry could not understand you.
my regex is like this :-
 <replaceregexp byline="true" flags="gi">
   <regexp pattern="pattern1"/>
   <substitution expression="pattern2"/>
  <fileset dir="${deploy.dir}/components">
    <include name="**/*.xsl"/>
   </fileset>
 </replaceregexp>

I need to figure out the path of each .xsl file and do an appropriate
substitution. How can I utilize your suggestion here?

Regards,

Shakun

----- Original Message -----
From: "Rich Mauri" <rmauri@(protected)>
To: "Ant Users List" <user@(protected)>
Sent: Monday, March 29, 2004 4:15 PM
Subject: RE: [BULK] - finding the absolute path of each file in a
fileset


> You can use property location trick for example:
>
> <property name="abspathtofile" location="${relpathtofile}"/>
>
> -----Original Message-----
> From: Shakun Mahajan [mailto:shakun@(protected)]
> Sent: Monday, March 29, 2004 4:11 PM
> To: Ant Users List
> Subject: [BULK] - finding the absolute path of each file in a fileset
>
>
> Hi all,
>
> I am using Ant (1.5.3) provided with Eclipse(2.1.3).
>
> After I deploy, I need to change a few files by replacing the paths of

> the included files. I have used the Ant task "Replaceregexp" to do the

> replace. However, for a particular case, I need to know the absolute
> path of the file in the filesystem(For e.g. for a file "xyz.txt",
> which is included in the fileset, I want to know the absolute path).
> This information will help me to extract the required the portion and
> do the replace(the substitution regular expression depends on the file

> path).
>
> Is there a way to do it in Ant ?
>
> Regards,
> Shakun
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)



©2008 ant-tasks.com - Jax Systems, LLC, U.S.A.