Question

I have following tasks:

  • Automatically generate java source files in the current workspace.
  • Compile those files after generation.
  • Export every generated and compiled class with needed libraries to runnable JAR file.

I already installed Eclipse SDK and I suppose what I need is to make my main class inherit some class from SDK and maybe load some other classes. But i don't know what do I need exactly and where to look. I'd appreciate some clues.

Was it helpful?

Solution

I suggest you look at M2T-JET to generate not only the Java files, but the project, any necessary folders and any other resources you need. One of those resources would be a jardesc file which is used by the JDT to persist jar export options. You can play around with those options to define the jar and export, then generate the jardesc file along with the other generated resources.

M2T-JET can be invoked programmatically, so once that single invocation generates your entire project, your plugin can make the call to the JDT to export the jar using the jardesc file.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top