Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 350560 - Unable to compile an EGL file within a new eclipse plugin
Summary: Unable to compile an EGL file within a new eclipse plugin
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: EDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Justin Spadea CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-28 07:40 EDT by Bart Van Campenhout CLA
Modified: 2017-02-23 14:17 EST (History)
2 users (show)

See Also:


Attachments
testcase that documents the problems (15.26 KB, application/x-zip-compressed)
2011-06-28 07:40 EDT, Bart Van Campenhout CLA
no flags Details
Updated plug-in to use new API and fix a path error (14.95 KB, patch)
2011-07-14 17:28 EDT, Justin Spadea CLA
lasher: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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