我如何以编程方式使用 Apache ANT [英] How can i use Apache ANT Programmatically
问题描述
我正在制作一个简单的程序来编译和制作一个 jar 文件,但我不想使用 build.xml(然后用 exec 调用它).
I'm making a simple program that compile and make a jar file but i don't want to use a build.xml (and then invoke it with exec).
但我想使用 ANT API(例如:org.apache.tools.ant.Task
)
but i want using ANT API(for example:org.apache.tools.ant.Task
)
有什么帮助吗?
推荐答案
你不妨直接从源码中得到答案:在 Ant 之外使用 Ant 任务
You might as well get the answer directly from the source: Using Ant Tasks Outside of Ant
您可能还对 Leafcutter 之类的东西感兴趣,它声称提供:
You might also be interested in something like Leafcutter, which claims to provide:
允许您从 Java 代码执行 Ant 任务的 API.
An API which allows you to execute Ant tasks from Java code.
我没有亲自使用它,只是让你知道它存在......
I haven't used it personally, just letting you know that it exists...
这篇关于我如何以编程方式使用 Apache ANT的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!