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

Bug 350560

Summary: Unable to compile an EGL file within a new eclipse plugin
Product: z_Archived Reporter: Bart Van Campenhout <Bart_van_campenhout>
Component: EDTAssignee: Justin Spadea <jspadea>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: jspadea, mheitz
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
testcase that documents the problems
none
Updated plug-in to use new API and fix a path error lasher: iplog+

Description Bart Van Campenhout CLA 2011-06-28 07:40:57 EDT
Created attachment 198714 [details]
testcase that documents the problems

I've written a custom plugin that should compile an EGL file (with references to another project) to a binary file. 
3 problems occur:
         1. Unable to resolve references to parts, defined outside the project (through EGL Build Path)
         2. Unable to resolve standards EGL components
         3. NullpointerException
         
You'll find an example of each of these problems in the console output (in the zip , attached to this bug).
I've also attached a zip file with the source code of my plugin project, as well as a zip with the EGL projects that contain the parts I wish to do the generation for.
Comment 1 Justin Spadea CLA 2011-07-14 17:27:27 EDT
Hi Bart,

I took a look at your project and what I've done is I added API so that you can pass in an ICompiler to EGL2IR.main(). When running inside the IDE you should be passing in one of the IDE versions of the ICompiler so that the system environment path can be resolved. Otherwise we can't locate the path from a non-IDE version of the compilers (Eclipse's classloaders give us a meaningless path starting with "bundleentry:" instead of what you'd see outside the IDE ("file:/path/to/environment")).

Files modified: EGL2IR.java, EGLG.java

I also had to make some changes to your project's code:

1. Updated it to pass in the ICompiler as described above
2. Added a new argument "-eglPath". This setting tells the compiler the path of the EGL files, and should be separated by File.pathSeparator. Since you had a dependency on Project2 you need to specify the eglsource directory for both Project1 and Project2 (see the code for how I did this).
3. Edited MANIFEST.MF to have a dependency on org.eclipse.edt.ide.core

I'll attach my updated version of the project - take a look at the code in CompilerFromPluginEnv.run().
Comment 2 Justin Spadea CLA 2011-07-14 17:28:29 EDT
Created attachment 199717 [details]
Updated plug-in to use new API and fix a path error
Comment 3 Lisa Lasher CLA 2011-11-02 10:35:40 EDT
closing this defect, which was fixed several months ago