使用Apache Ant清理过时的.class文件 [英] Cleaning up stale .class files using Apache Ant

查看:138
本文介绍了使用Apache Ant清理过时的.class文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在给定的${srcdir}中现有的.java文件集中的情况下,如何从${workdir}中清除过时的.class文件?过时的意思是从现在删除的.java文件生成的.class文件.我尝试使用Ant映射器和文件集等提出一些建议,但是失败了.删除所有早于其各自源.java文件的.class文件也是可以的.

How do I clean up stale .class files out of ${workdir} given set of existing .java files in ${srcdir}? By stale I mean .class files that were generated from now removed .java files. I have tried coming up with something using Ant mappers and filesets etc. but I failed. Removing all .class files older than their respective source .java files would be acceptable, too.

推荐答案

我敢肯定,有一个蚂蚁任务要杀死比.java更早的.class.

I'm pretty sure there's an ant task to kill .classes older than the .java...

Depend 听起来很接近,并且实际上可以做您想做的事,但这不是预定的目的但是,考虑到发展疯狂的答案,这可能是唯一可以实际起作用的东西.

Depend sounds close, and may actually do what you want, but this isn't its intended purpose. Given developmentalinsanity's answer however, this may be the only thing that will Actually Work.

这篇关于使用Apache Ant清理过时的.class文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆