ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kailash.Subraman...@alltel.com
Subject RE: Renaming the directories recursively
Date Wed, 27 Mar 2002 21:30:33 GMT

I am compiling the jsps and that is how these directories are created with
an "_" infront of all the directories. Infact, I don't want the "_". I
don't know a way to tell the compiler not create the "_" infront of the
directories or it would be even better, if the java and class files from
jsps can be created under the source directory itself. In that case, I
don't have to worry about this renaming at all.

The source directory structure is
../HIBERNIA/com/alltel/ebusiness/pages/*.jsps
The javas and classes are created under
../HIBERNIA/jsp_servlets/_com/_alltel/_ebusiness_/_pages/_*.java because of
the -d ${src} option I have to use.

I know, if I use the absolute path down to where the jsps are, I can
achieve what I want. But the problem there is, if somebody creates a new
directory with jsps, then I need to manually add that directory into my ANT
build file.

This is the ANT code I am using to compile jsps

<target name="jspcompile" depends="init">
     <apply executable="java">
     <arg line="-classpath ${cp} weblogic.jspc -compiler javac -d ${src} -keepgenerated
" />
     <fileset dir="${src}" includes="**/*.jsp/**" excludes="**/UIEngine/**,**/widgets/**"
/>
     </apply>
     </target>


Thx
Kailash



From: Adam Murdoch <adammurdoch_ml@yahoo.com> on 03/26/2002 10:32 PM

Please respond to Ant Users List <ant-user@jakarta.apache.org>

To:   Ant Users List <ant-user@jakarta.apache.org>
cc:

Subject:  RE: Renaming the directories recursively



> -----Original Message-----
> From: Kailash.Subramanian@alltel.com
> [mailto:Kailash.Subramanian@alltel.com]
> Sent: Wednesday, 27 March 2002 12:38 PM
> To: Ant Users List
> Subject: Renaming the directories recursively
>
>
>
> I want to rename the directories only recursively. Basically, I want to
> rename _com/_alltel/_ebusiness/........ to
> com/alltel/ebusiness............... I checked out the documentation, and
> figured out how to rename the files.
>
> This is the code I am trying to useand it renames only the top most
> directory leaving the subdirectories without renaming.
> <target name="move" >
>      <move todir="." >
>      <fileset dir="." includes="**" >
>      </fileset>
>      <mapper type="glob" from="_*" to="*"/>
>      </move>
>      </target>
>
>      Can somebody help me out ?

The names that get passed to the mapper are paths relative to the root
directory of the source file set.  So, in your case, the mapper will be
getting passed names like

_com/_alltel/_ebusiness/somefile.java
_com/_alltel/_ebusiness/someotherfile.java

This is why you're seeing only the top most directory being renamed - the
glob mapper is removing the first '_' only from all of the names.

Unfortunately, to solve your particular problem, I think you will have to
write your own mapper implementation.  It's not particularaly hard -
implement FileNameMapper to do the appropriate conversion, compile it up,
and use <mapper classname=".." /> to use it.

Of course, that is a rather odd directory layout you've got - why can't you
get rid of the underscores from the directory names and give the whole
renaming problem a miss?


Adam


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








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


Mime
View raw message