Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 370813

Summary: Features like IBMi need to be able to contribute their runtimes to the Java path
Product: z_Archived Reporter: Joseph Vincens <jvincens>
Component: EDTAssignee: Justin Spadea <jspadea>
Status: CLOSED FIXED QA Contact:
Severity: enhancement    
Priority: P1 CC: jspadea, mayunf, svihovec
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard: ibmi Extensibility_Runtime
Attachments:
Description Flags
Patch lasher: iplog+

Description Joseph Vincens CLA 2012-02-07 07:25:43 EST
EDTRuntimeContainerInitializer.initialize adds the JavaRuntime to the project's classpath. This needs to be made extensible so feature plugs can contribute their runtime jars to the project's classpath.
Comment 1 Justin Spadea CLA 2012-02-07 07:52:45 EST
There is much less work here than you might think. What you need to do is allow for the contributions to a generator to also provide runtime containers. It would make sense to change AbstractGenerator.getRuntimeContainers() to return the generator's containers plus all the containers from its contributions. And then update the contributions to support the concept of runtime containers.

The rest should "just work". EDTRuntimeContainerInitializer will use this same method to find out all the containers it should initialize, same with the wizard that lets you manually add an EDT library to the Java build path of a project, as well as the Java generator which adds the containers to the build path if necessary.

To see how to define a new container, take a look at EDTCompilerIDEPlugin.JAVA_RUNTIME_CONTAINER.
Comment 2 Yun Feng Ma CLA 2012-02-26 05:47:48 EST
Created attachment 211631 [details]
Patch

Hi Justin, here is a patch, please review it. Thanks a lot.
Comment 3 Justin Spadea CLA 2012-02-28 11:13:58 EST
I've modified your original fix. The following were modified:

Context.java in edt.gen.java
FunctionTemplate.java in edt.java.templates.eglx.jtopen
EclipseEGL2Java.java and JavaGenerator.java in edt.ide.compiler
AbstractGenerator.java, EDTCoreIDEPlugin.java, and GenerationContributorEntry.java in edt.ide.core
plugin.properties and plugin.xml in edt.ide.jtopen

Now when you generate a part containing IBMi content, its contributed runtime is automatically added to the Java build path.
Comment 4 Joseph Vincens CLA 2012-03-08 12:51:47 EST
verified