Bug 79359 - Project cannot depend on a project built by ant
Summary: Project cannot depend on a project built by ant
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Linux
: P3 normal with 1 vote (vote)
Target Milestone: 3.2 M5   Edit
Assignee: Kent Johnson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-11-23 19:51 EST by Guillaume Pothier CLA
Modified: 2006-02-14 09:22 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Guillaume Pothier CLA 2004-11-23 19:51:04 EST
Project A is setup to use the ANT builder and builds without problem. Project B
uses the JDT builder and depends on project A.
When I initially setup project B, I get the following error in the problems
view: "The project cannot be built until its prerequisite A is built. Cleaning
and building all projects is recommended"
So I did clean all the projects, which triggered a complete rebuild. Project A
built without problem again, but project B still has the error.
Comment 1 Kent Johnson CLA 2004-11-25 13:50:08 EST
Whenever the JavaBuilder builds a project, it produces a build state that 
tells dependent projects what has changed. Since Project A is build by Ant 
instead, we don't have the necessary build state to build Project B.

You have 2 options:
- build all of your projects that dependent on project A with Ant

- change Project B to import A's bin/output folder as a class folder (see 
Properties -> Java Builder Path -> Libraries -> Add Class Folder).
Comment 2 Guillaume Pothier CLA 2004-11-26 06:01:15 EST
I have been working with the second solution for a while, and now with the
first, but I think Eclipse should handle this situation more elegantly. I see
two solutions:

- Don't allow a project to depend on a non JDT-built project
- Provide more configuration options to the ANT builder (or to the project
dependency entry) so that the user can tell eclipse where is(are) the output
folder(s). And eclipse should be able to determine if an ant build succeeded or
failed (I think it already can)

The current behaviour is quite misleading.
Comment 3 Daniel Bonniot CLA 2006-02-01 05:24:51 EST
I strongly agree that the current behaviour is not satisfactory. People will waste time trying to understand what is going on, like Guillaume and I did, and will conclude eclipse is buggy. I don't think WORKSFORME is an appropriate resolution.

A minimal solution would be to detect this situation (project with JDT builder depending on project with no JDT builder) and display an appropriate message.

Actually, I think in this case it would make sense to just assume the non-JDT build succeeded, and go on with the current project. At least, when there are no errors, the whole build will succeed, which is the most important. If it fails, well, there will be some indication of the reason.

Detecting if the build actually succeeded would be neat, but much less critical.

Please, reopen this bug, I cannot do that. The severity could be changed to enhancement.
Comment 4 Philipe Mulet CLA 2006-02-01 07:04:44 EST
Also see related bug 76025.
I mentionned there a solution which would benefit to arbitrary build scripts (i.e. non Java, non AspectJ). It could still do incremental (unoptimal though as it doesn't know structural changes, but as good as make).

Kent - how hard would it be to do this ?
Comment 5 Kent Johnson CLA 2006-02-02 12:20:10 EST
We will now build projects that depend on other Java projects without a build state (we'll assume that the Ant build was successful).

Any changes to .class files will get propagated to dependent types.

Added BuildpathTests.testMissingBuilder()
Comment 6 David Audel CLA 2006-02-14 09:22:25 EST
Verified for 3.2 M5 using build I20060214-0010