Question

I'm using Java annotation processing to generate a couple of Java source files. I enabled it on the project specific settings (Properties -> Java Compile -> Annotation Processing). The generation works fine and the classes end up in the .apt_generated source folder.

Unfortunately, I'm not able to commit the generated Java source files with Subversive to the svn server. If I selected the .apt_generated source folder and perform Team -> Add to Version Control ... the dialog doesn't list any files to commit. So far, I have been committing .apt_generated source folder from the command line. Can I customize this behavior? I wasn't able to find anything on this in the team preferences.

I'm aware of the option adjusting the headless build. Since my files won't be changed to often, I just would like to commit the generated files for the moment. Thank you!

Était-ce utile?

La solution

The reason for this behaviour can be found in this thread: Subversive doesn't allow to commit "derived" resources. The folder used by the annotation processing and all contained resources automatically get the "derived" flag, which you can verify on their Properties->Resource page.

I'm in a similar situation as you wanting to commit generated files at least initially. There is a plugin that apparently makes it possible to override the behaviour of setting the "derived" flag, which I'm going to test now: AutoDeriv

Autres conseils

Since this has been unanswered for over a year, I'll take a stab at it. I had a similar problem with Eclipse's .project and .classpath files, which I wanted maintained in Subversion.

I believe you may have to tell Eclipse not to ignore "resources." These are files that have extensions but no names (e.g. .project or .classpath or .apt_generated). From Eclipse's Project Explorer click on the View Menu icon (the upside down triangle icon). Then Customize View... then remove the check from the checkbox labeled .* resources.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top