添加建设者在Eclipse和增量岬项目投资 [英] Adding Builders to Project in Eclipse and Incremental-ness

查看:143
本文介绍了添加建设者在Eclipse和增量岬项目投资的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Java项目,标准的Java Builder的选择,因为它是唯一的建设者。另外,构建配置为自动构建。

I have a Java project, with the standard Java Builder selected as it's sole builder. Also, the build is configured to build automatically.

我想了解的是所产生的建设情况,当我添加一个Ant构建这个项目(项目 - >属性 - >建设者)。我所期望的,就是每次我更改了我的Java源代码,在Java Builder和我的Ant构建运行,但它似乎并不认为我的蚂蚁构建运行。

What I would like to understand is the resulting build circumstances when I add an ant build to this project (project -> properties -> builders). What I would expect, is that everytime I make a change to my Java source, both the Java Builder and my ant build will run, but it doesn't seem that my ant build runs.

当我第一次加入Ant构建,运行,即我看到控制台输出。然而,当我再修改我的源文件,它不会再次运行,即我没有看到在控制台输出。我知道Java生成器仍在运行,由于我的变化已经进入蚀code意识的事实,即我可以引用从其他类等这些更改

When I first add the ant build, it runs, i.e I see the output in the console. However, when I then make changes to my source files, it doesn't run again, i.e. I don't see output in the console. I know that the Java Builder is still running due to the fact that my changes have entered into Eclipses code awareness, i.e. I can reference those changes from other classes, etc.

请注意,如果我手动调用构建,即通过项目 - >构建所有,蚂蚁构建运行,即我再次看到控制台输出。

Note, if I manually invoke the build, i.e. via Project -> Build All, the ant build runs, i.e. I see the output in the console again.

那么,为什么不蚂蚁构建我增加运行与自动建筑物?请注意,我不一定会指望它能够做增量的工作,因为它不是该做的,但我会想到它会火过当Java生成器触发了吗?我缺少的东西吗?

So, why doesn't the ant build I've added run with the automatic building? Note, I wouldn't necessarily expect it to be able to do incremental work, since it's not made for that, but I would have thought it would fire off when the Java Builder fires off? Am I missing something?

推荐答案

蚂蚁建造者,或任何其他制造商对于这个问题,对建设项目的几种方法。当一个构建发生在Eclipse中,版本(INT样,地图<字符串,字符串> ARGS,IProgressMonitor的监视器)所有活动的建设者方法被调用,但是,有不同种类的身材,任何建设者检查在构建方法。该种版本是:

The ant builder, or any other builder for that matter, have several methods for building a project. When a build occurs in the Eclipse, the build(int kind, Map<String, String> args, IProgressMonitor monitor) method of all the active builders is called, but, there are different kinds of build, that any builder checks for in the build method. The kinds of build are:

FULL_BUILD
AUTO_BUILD
INCREMENTAL_BUILD
CLEAN_BUILD

下面是构建一个例子语法:

Here is an example syntax of build:

protected IProject[] build(int kind, Map<String, String> args, IProgressMonitor monitor) throws CoreException {
    if (kind == FULL_BUILD) {
        fullBuild(monitor);
    } else {
        IResourceDelta delta = getDelta(getProject());
        if (delta == null) {
            fullBuild(monitor);
        } else {
            incrementalBuild(delta, monitor);
        }
    }
    return null;
}

正如你所看到的,制造商可以决定反应了某种版本,甚至采取不同的不同的生成类型的,所以,我的猜测是,蚂蚁构建器实现的,因此,它只是反应全力打造,而不是增量生成。

As you can see, a builder can decide to react to a certain kind of build, and even act differently for different build kinds, so, my guess is, the ant builder is implemented so that it only reacts to full build, and not incremental build.

这篇关于添加建设者在Eclipse和增量岬项目投资的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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