get org.eclipse.jdt.core.ICompilationUnit without IJavaProject [message #1735266] |
Thu, 16 June 2016 16:52 |
|
Hi to all,
I want to write a refactoring tool for the commandline. I now have some prototypes with JDT and other Java model abstraction running.
I would prefer JDT as implementation, but only have it running in context of an eclipse headless application. Now I want to go a step further to run it without this whole eclipse workspace and equinox stuff around to get it a bit lightweight.
So can I get a IJavaProject without setting up complete eclipse?
or can I get a org.eclipse.jdt.core.ICompilationUnit without having a IJavaProject?
Would be nice to get infos from you.
Cheers
Markus
|
|
|
Re: get org.eclipse.jdt.core.ICompilationUnit without IJavaProject [message #1735327 is a reply to message #1735266] |
Fri, 17 June 2016 11:52 |
Stephan Herrmann Messages: 1853 Registered: July 2009 |
Senior Member |
|
|
I don't see how this would be possible ...
Quote:can I get a IJavaProject without setting up complete eclipse?
to get an IJavaProject you need an IProject -> org.eclipse.core.resources must be available.
Quote:can I get a org.eclipse.jdt.core.ICompilationUnit without having a IJavaProject?
The closest you can probably get is org.eclipse.jdt.core.JavaCore.createCompilationUnitFrom(IFile), this seems to work without an IJavaProject, but still you need an IFile (from o.e.core.resources). Since you need jdt anyway, bypassing IJavaProject while still needing the resource doesn't seem to buy you anything. Internally, we may not really need the IFile, perhaps an IPath (o.e.core.runtime) is sufficient, but I don't see anything like this surfacing in API.
Nor is using the full o.e.jdt.core without Equinox supported.
OTOH, compared to jdt.core (almost 6MB) I wouldn't consider things like o.e.core.resources (< 900kB) as such a huge penalty...
[Updated on: Fri, 17 June 2016 11:53] Report message to a moderator
|
|
|
|
|
|
|
|
|
Re: get org.eclipse.jdt.core.ICompilationUnit without IJavaProject [message #1736252 is a reply to message #1735430] |
Mon, 27 June 2016 20:50 |
|
Hi Stephan,
Sorry for waiting so long until answering....
I want a simple junit test, because we are building with gradle and I guess there is no support for running eclipse plugin tests so far. And another cause is - a simple junit test is more lightweight.
I am working a lot with xtext and there you can replace nearly anything by another implementation of a given interface... Did you think about opening jdt a bit more to have the possibility to use it in another scenario?
Thanks for your answer,
Cheers
Markus
|
|
|
|
Powered by
FUDForum. Page generated in 0.06493 seconds