Unable to compile EGL code [message #755076] |
Mon, 07 November 2011 09:54  |
|
As I didn't find any documentation on this, here's the code that I figured out for compiling an EGL file into IR files:
I've added these plug in dependencies:
- org.eclipse.edt.mof.egl
- org.eclipse.edt.mof.eglx.services
- org.eclipse.edt.mof.eglx.persistence.sql
- org.eclipse.ect.compiler
public static void compileFile(File toCompile, ArrayList<File> eglPathDirectories, File outputDir){
String[] compileArgs = new String[7];
int i = 0;
compileArgs[i++] = SOURCE_PATH;
StringBuffer eglPath = new StringBuffer();
for (File file : eglPathDirectories) {
eglPath.append(file.getAbsolutePath() + ";");
}
compileArgs[i++] = eglPath.toString();
compileArgs[i++] = IR_OUTPUT_PATH;
outputDir.mkdirs();
compileArgs[i++] = outputDir.getAbsolutePath();
compileArgs[i++] = IS_VAG_COMPATIBLE;
compileArgs[i++] = CLEAN;
compileArgs[i++] = toCompile.getAbsolutePath();
EGL2IR.main(compileArgs);
}
This code is called like this:
File tocompFile = new File("C:/Users/BVC/TestIndigo/JUnitEGLSimple_EDT/EGLSource/haha/abc.egl");
ArrayList<File> eglPathDirs = new ArrayList<File>();
eglPathDirs.add(new File("C:/Users/BVC/TestIndigo/JUnitEGLSimple_EDT/EGLSource"));
File outputDir = new File("C:/Temp/EGL_Bin_Small_New");
Compile.compileFile(tocompFile, eglPathDirs, outputDir);
The exception I get is:
Processing Part: abc
Bootstrap initialize...
org.eclipse.edt.compiler.internal.core.builder.BuildException: java.lang.NullPointerException
at org.eclipse.edt.compiler.AbstractProcessingQueue.process(AbstractProcessingQueue.java:189)
at org.eclipse.edt.compiler.AbstractProcessingQueue.process(AbstractProcessingQueue.java:154)
at org.eclipse.edt.compiler.tools.EGLC.compile(EGLC.java:135)
at org.eclipse.edt.compiler.tools.EGL2IR.compile(EGL2IR.java:89)
at org.eclipse.edt.compiler.tools.EGL2IR.main(EGL2IR.java:54)
at org.eclipse.edt.compiler.tools.EGL2IR.main(EGL2IR.java:47)
at edtapi.Compile.compileFile(Compile.java:43)
at edtapi.actions.SampleAction.run(SampleAction.java:44)
at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:251)
at org.eclipse.ui.internal.WWinPluginAction.runWithEvent(WWinPluginAction.java:229)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4165)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3754)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2696)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2660)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494)
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
at org.eclipse.equinox.launcher.Main.main(Main.java:1386)
Caused by: java.lang.NullPointerException
at org.eclipse.edt.compiler.internal.egl2mof.Egl2MofPart.handleVisitPart(Egl2MofPart.java:414)
at org.eclipse.edt.compiler.internal.egl2mof.Egl2MofPart.defaultHandleVisitPart(Egl2MofPart.java:383)
at org.eclipse.edt.compiler.internal.egl2mof.Egl2MofPart.visit(Egl2MofPart.java:216)
at org.eclipse.edt.compiler.core.ast.Library.accept(Library.java:49)
at org.eclipse.edt.compiler.internal.egl2mof.Egl2Mof.convert(Egl2Mof.java:160)
at org.eclipse.edt.compiler.Processor.createIRFromBoundAST2(Processor.java:164)
at org.eclipse.edt.compiler.Processor.level03Compile(Processor.java:120)
at org.eclipse.edt.compiler.AbstractProcessingQueue.process(AbstractProcessingQueue.java:171)
... 37 more
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.01937 seconds