Community
Participate
Working Groups
Using Eclipse 3.1M6 + AJDT 1.2.0.20050518111521 After adding source folder to a new AspectJ without one I get the following error popup when building: Errors during build. Errors running builder "AspectJ Builder" on project test. Resource /test/bin does not exist. 1. Create new AspectJ project with no source folder i.e. Finish on first page 2. Add source folder from Package Explorer context menu 3. Add package 4. Project builds 5. Errror popup
This can be reproduced using Eclipse 3.0 and AJDT 1.2.0 rc2.
The problem is that when the src folder is created in the AspectJ project, a bin directory is not being created. If you follow the same steps with a purely java project, then when the src folder is created a bin directory is created at the same time. Consequently, we fail when we're trying to copy over the folder (package). part of failing stack trace: org.eclipse.core.internal.resources.ResourceException: Resource /testproject/bin does not exist. at org.eclipse.core.internal.resources.Resource.checkExists(Resource.java:310) at org.eclipse.core.internal.resources.Resource.checkAccessible(Resource.java:178) at org.eclipse.core.internal.resources.Folder.assertCreateRequirements(Folder.java:28) at org.eclipse.core.internal.resources.Folder.create(Folder.java:88) at org.eclipse.core.internal.resources.Folder.create(Folder.java:119) at org.eclipse.ajdt.core.builder.AJBuilder.createFolder(AJBuilder.java:565) at org.eclipse.ajdt.core.builder.AJBuilder.copyResources(AJBuilder.java:460) at org.eclipse.ajdt.core.builder.AJBuilder.copyResources(AJBuilder.java:418) at org.eclipse.ajdt.core.builder.AJBuilder.build(AJBuilder.java:151) ...
I did some initial investigation into this bug. The place where we're going wrong is AJBuilder.createFolder(IPath packagePath, IContainer outputFolder) and we're returning because packagePath.isEmpty() is true. The problem is that with the javabuilder, when packagePath.isEmpty returns true they still copy and create the bin directory (This code is to do with how we copy over resources - see bug 78579). I believe there should be another mechanism they (the javabuilder) uses to create the bin directory other than these methods....other than that, our code should be the same as when copying resources we mirror their behaviour.
Fixed - added a check in AJBuilder that creates the output folder if it does not already exist.