Community
Participate
Working Groups
AJDT seems to irritate Eclipse build system when AJDT is used for plugin projects. I have two plugin projects where one is converted into an AJDT project. The second plugin project requires the AJDT-enabled plugin project. But Eclipse 3.0 (final) tells me that my second plugin project cannot be built correctly because the required first plugin project is not built (red cross for the second plugin project). Nevertheless the AJDT-enabled plugin project seems to be build correcty (all aspects are compiled), but Eclipse seems to think that it is not built.
Helen, can you take a look? I'm wondering if that work we did on getting dependent projects to work is playing up when one of the projects is an AJDT enabled plugin? thanks.
The message is coming from the JavaBuilder.getLastState() method which is being called from JavaBuilder.isWorthBuilding(). In the case of two plugin projects A and B where B depends on A, A is an AspectJ project and B is a java project, when B is built the JavaBuilder.isWorthBuilding() method returns false because the AspectJ plugin project A has a null state. This exact problem was seen with dependencies between projects which weren't plugin projects. The way it was fixed in this situation was to change the project dependency to a class file dependency. This isn't a nice solution for plugin projects, but also doesn't work because it fails at runtime. As I continue to work on this, an immediate workaround is to convert the second project to also be an AspectJ project.
This is all to do with the state file which isn't there. When an AspectJ project is created, a javabuild happens which creates the state file. However, later on, in the build method for the AJ project, we trash this file. When the java builder looks for it, it isn't there, therefore says that a prerequisite project needs to be rebuilt before the current one is built. The fix is not to trash this file, however, the question is whether this means that Eclipse keeps trying to do multiple builds (this was mentioned around the time we decided to trash the state file and it seemed to stop doing this). This bit needs more testing.
Fix: Have stopped trashing the state.dat file in the build method and there seems to be no adverse building effects. I have also written a junit test which follows the scenario detailed in this bug. I'm therefore closing this bug and the fix will be available in the 1.1.12 release of AJDT.