Is it possible to hook into the eclipse compiler? [message #647487] |
Thu, 06 January 2011 16:00 |
Amos Messages: 3 Registered: January 2011 |
Junior Member |
|
|
Hi all,
I have written some java code to perform source code scannings with the help of the JDT API. This scanning is meant to find things which aren't allowed in my company (e.g. usage of JSplitPane) and should be performed every day on our continous integration system which uses the eclipse compiler.
Now my intention was, is it possible to integrate my "conditional rules" to the eclipse compiler, so my code is getting the actual AST and/or the CompilationUnit which the compiler is currently working on, so i can do my checks?
Or is there another possibility to hook into the work of the compiler?
Otherwise it would be a waste of time and resources if the compiler parses everything, and when he is done i will have to do the exact same work again.
Thanks for your help and time!
Greetings
Amos
[Updated on: Thu, 06 January 2011 16:02] Report message to a moderator
|
|
|
|
|
|
Re: Is it possible to hook into the eclipse compiler? [message #647583 is a reply to message #647487] |
Fri, 07 January 2011 07:49 |
Amos Messages: 3 Registered: January 2011 |
Junior Member |
|
|
@Prakash
No i don't think checkstyle can do what i need. For example i need to find all classes which extend a specific class and extract some information of these classes, there comes no way to my mind how checkstyle could do this But if you know, pls let me know =)
@Deepak Azad
I have already had a look at the CompilationParticipant but how i understood this, it is more like pre / post compilation work like cleaning up and so on but not that the compiler lets me hook into the compilation unit which it is currently working on, so i can check this unit too and create for my "rules" compiler warnings and things alike.
Best case would be, compiler does its work, handles me the compilation unit (or something similar) and maybe the AST, i can do my work and generate warnings/errors which will the compiler print out, so the whole source code has not to be parsed and analyized twice (we are talking about 5mio LoC here).
any ideas?
thanks in advance
Amos
[Updated on: Fri, 07 January 2011 07:53] Report message to a moderator
|
|
|
|
Re: Is it possible to hook into the eclipse compiler? [message #647587 is a reply to message #647586] |
Fri, 07 January 2011 08:35 |
Amos Messages: 3 Registered: January 2011 |
Junior Member |
|
|
hi Dani,
thanks for your answer but unfortunately its not that easy, because it is not only things which aren't allowed to use, there are several other rules to be adhered, e.g. every class has a @author tag, some things are not allowed to use, classes of a specific hiearchy have to contain special things / these things have to be a checked and so on...
I wish there was an simple solution
pretty cool would be a way to reuse (NOT copy paste!) my code for an eclipse plug-in which could provide restricted access informations on the fly for the programmers while typing and create problems in the eclipse problem view / mark them in the code as errors / warnings
[Updated on: Fri, 07 January 2011 08:38] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.03757 seconds