Bug 188559 - Delete files generated by Java 6 processors during build
Summary: Delete files generated by Java 6 processors during build
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: APT (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.3.1   Edit
Assignee: Walter Harley CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-05-23 00:48 EDT by Walter Harley CLA
Modified: 2007-08-20 20:27 EDT (History)
1 user (show)

See Also:
jgarms: review+


Attachments
Proposed patch (10.36 KB, patch)
2007-08-15 19:28 EDT, Walter Harley CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Walter Harley CLA 2007-05-23 00:48:09 EDT
Files generated by Java 6 annotation processors during a build are only removed during a clean: that is, the dependency information specified by the processor is ignored. Instead, generated files should be deleted during any subsequent build in which they are not re-generated, just as for Java 5 files.
Comment 1 Walter Harley CLA 2007-08-15 19:28:42 EDT
Created attachment 76184 [details]
Proposed patch

I believe I have gotten this to work, using the existing AptCompilationParticipant to handle the deletion.  Essentially what now happens in a build is:

1. Units are compiled and Java 6 annotation processing is performed, possibly resulting in generation of some files.  Generated files are recorded in the AptCompilationParticipant.

2. The AptCompilationParticipant is then called to handle Java 5 annotation processing, possibly resulting in even more files being generated.  These files are recorded in the BuildEnv (which unfortunately doesn't exist during step 1).

3. Finally, the AptCompilationParticipant calls GeneratedFileManager to delete any files that were generated in previous builds but that were not generated during step 1 or 2 above.

4. At the end of the build, the list of files created in step 1 is cleared.  (The list created in step 2 was deleted when the BuildEnv was deleted, at the end of step 3.)

So, deletion of both Java 5 and Java 6 generated files is handled via the pre-existing (Java 5) mechanism.

The implementation relies on the fact that files are only generated by Java 6 processors during a build, as opposed to reconcile.  I think this is likely to remain true, but if not, we will have to get more sophisticated about how the list in step 1 is recorded and communicated to step 3.

I have released this change to HEAD.  Jess, please review for inclusion in 3.3.1.
Comment 2 Jess Garms CLA 2007-08-20 19:20:53 EDT
Approved for 3.3.1.
Comment 3 Walter Harley CLA 2007-08-20 20:27:12 EDT
Released to 3.3.1.