ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <bode...@apache.org>
Subject Re: determine a list of class files to delete based on java files
Date Sun, 11 May 2014 17:56:21 GMT
On 2014-05-07, KM wrote:

> Hi All,

> I need to figure out a way to get a list of the java files in my
> structure and then delete the corresponding class files.   for example
> if I have 2 java files a/one.java  and b/two.java, I want to determine
> that the list is:

> a/one.java
> b/two.java

> and then delete from my "output" directory:
> output/a/one.class
> output/b/two.class

> How can I do it? I tried to delete all of the class files based on
> the list of java files using a mapper but it keeps telling me that
> delete doesn't support the nested mapper element.

> Is there an easy way to do this?


I think the <present> select should work

<delete>
  <fileset dir="output">
    <includes name="**/*.class"/>
    <present targetdir="YOUR_SOURCE_DIR">
      <globmapper from="*.class" to="*.java"/>
    </present>
  </fileset>
</delete>

Stefan


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


Mime
View raw message