String manipulation in FileSets, FileLists: how ?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Stefan_Bittner
Posted On:   Thursday, July 25, 2002 01:53 AM

Hi, I'd like to get a list of files (a FileSet, I suppose), do some String manipulation in it, like replace .java with .class, strip the beginning of each file path off etc. The result should be used in another task. The rationale is: In my project the sources are in seperate folders, but all binaries end up in the same tree. I'd like to bild seperate jars with the binaries for each source folder. Basically, I thought to take a fileset (that's conceptually a list of strings, right?) of all .java file in the source tree, replace all .java with .class and put the resulting list of .class files in a jar task.    More>>

Hi,


I'd like to get a list of files (a FileSet, I suppose), do some String
manipulation in it, like replace .java with .class, strip the beginning of
each file path off etc.
The result should be used in another task.


The rationale is:


In my project the sources are in seperate folders, but all binaries end up
in the same tree.
I'd like to bild seperate jars with the binaries for each source folder.


Basically, I thought to take a fileset (that's conceptually a list of strings,
right?) of all .java file in the source tree, replace all .java with .class
and put the resulting list of .class files in a jar task.


Is this the right way to do it ?
If so, how do i do string manipulation in a fileset ?


Thanx,
Stefan

   <<Less

Re: String manipulation in FileSets, FileLists: how ?

Posted By:   Erik_Hatcher  
Posted On:   Tuesday, July 30, 2002 11:16 AM

I'm not quite following what you want to do, but its best if you build our source code into trees that mirror the JAR files you want to build rather than compiling it all to a single tree and trying to separate it from there. There are ways to use mappers and selectors to accomplish various tricks that seem to be along the lines of what you're asking.
About | Sitemap | Contact