[英]Run ant build.xml from custom eclipse plugin
我正在創建一個Eclipse插件,以自動將大量項目導入Eclipse。 導入完成后,我想使用插件本身的build.xml來構建它們。 我是插件創建的新手。 有人可以幫我嗎?
首先,您可能想看看這里
File buildFile = new File("build.xml");
Project project = new Project();
project.setUserProperty("ant.file", buildFile.getAbsolutePath());
project.init();
ProjectHelper helper = ProjectHelper.getProjectHelper();
project.addReference("ant.projectHelper", helper);
helper.parse(project, buildFile);
project.executeTarget(p.getDefaultTarget());
以上是本文的基本版本。 我已使用此方法從插件中運行build.xml。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.