我需要轻松测试我的注释处理器,所以我准备了 Ant 脚本来启动 javac
设置了所有必要的选项。不幸的是,如 another thread 中所述:
By default the task compares the timestamps of .java and corresponding .class files, and only tells the Java compiler to recompile source files that are newer than their corresponding object files, or that don't have an object file at all.
大多数时候这对我来说很好,但当我需要测试我每次都需要启动 javac 的注释处理器时,不管相应的 .class 文件是否已经存在。
有没有办法禁用这种 Ant 默认行为?我查看了
javac
的所有选项任务,但一无所获。除了清理输出目录之外还有其他解决方案吗?
最佳答案
如果您删除 .class 文件,根据您的报价,编译器将被迫重新编译 .java 文件
关于ant - 在 javac Ant 任务中禁用增量编译,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11420510/