You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Casey Crabb <cr...@nafai.dyndns.org> on 2004/02/07 00:28:52 UTC

deleting specific files

I have two parallel source branches, one for unittests and one for
implementation. Both of these branches compile into a single
codebase. For example:

test/com/foo/myprogram[/subpackage1,subpackage2,...]
src/com/foo/myprogram[/subpackage1,subpackage2,...]

Both of these compile into
codebase/com/foo/myprogram/[/subpackage1,subpackage2,...]

I'd like to write an ant script that will remove only the files that
were built from the test base, leaving the files that resulted from
compiling the src base. I'd like to do this without having to
individually specify files, as I could easily have more than a hundred
files under the test base.

Is there an Ant task which will scrape the source path for files
names, then delete their counterparts in the destination path?


--
Casey


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


Re: deleting specific files

Posted by Thomas Schapitz <Th...@ePost.de>.
Casey Crabb wrote:

>I have two parallel source branches, one for unittests and one for
>implementation. Both of these branches compile into a single
>codebase. For example:
>
>test/com/foo/myprogram[/subpackage1,subpackage2,...]
>src/com/foo/myprogram[/subpackage1,subpackage2,...]
>
>Both of these compile into
>codebase/com/foo/myprogram/[/subpackage1,subpackage2,...]
>
>I'd like to write an ant script that will remove only the files that
>were built from the test base, leaving the files that resulted from
>compiling the src base. I'd like to do this without having to
>individually specify files, as I could easily have more than a hundred
>files under the test base.
>
>Is there an Ant task which will scrape the source path for files
>names, then delete their counterparts in the destination path?
>
>
>--
>Casey
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>For additional commands, e-mail: user-help@ant.apache.org
>
>
>  
>
While I'm too using the approach Donald has suggested, there is still an 
other
option. Junit best practices recommend suffixing all your test class 
names with 'Test'.
So you might employ filters like **/*Test.class and **/*Test$$*.class to 
catch your
test classes (the second one is meant to get inner classes, the 
duplication of  the
$$ should escape it.)

Thomas



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