【问题标题】:Run ant build.xml from custom eclipse plugin从自定义 Eclipse 插件运行 ant build.xml
【发布时间】:2014-10-01 22:44:21
【问题描述】:

我正在创建一个 Eclipse 插件来自动将大量项目导入 Eclipse。导入完成后,我想使用插件本身的 build.xml 构建它们。我是插件创建的新手。有人可以帮我解决这个问题吗?

【问题讨论】:

    标签: java eclipse plugins ant build.xml


    【解决方案1】:

    作为初学者,你可能想看看here

    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。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-02-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-06-24
      • 1970-01-01
      • 2015-01-16
      相关资源
      最近更新 更多