Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGL Development Tools » Building from source
Building from source [message #570118] Mon, 06 September 2010 01:41 Go to next message
Gilbert Herschberger is currently offline Gilbert HerschbergerFriend
Messages: 12
Registered: September 2010
Junior Member
How do I build EGL tooling from its source code?
Re: Building from source [message #658708 is a reply to message #570118] Wed, 09 March 2011 14:52 Go to previous messageGo to next message
Aaron Allsbrook is currently offline Aaron AllsbrookFriend
Messages: 23
Registered: July 2009
Junior Member
I'm working on this task now as well. I thought I might document the steps I started with. Maybe others can correct it and add to it...

1. Launch RBD 801 with a new workspace
2. Open CVS Repositories perspective
3. Create a new Repository Location
- Connection Type: pserver
- User: anonymous
- Host: dev.eclipse.org
- Repository path: /cvsroot/tools
- Use default port
4. Expand <HEAD>
5. Expand org,eclipse.edt
6. Expand core
7. Multi select org.eclipse.edt.compiler, org.eclipse.edt.mof, org.eclipse.edt.mof.egl
8. Right click on the selected folders and choose "Check Out"
9. OPTIONAL you can go in the samples and tests folder and get those projects as well.

This will get you the latest source code for you to work with directly in your Eclipse workspace. At the moment I am getting errors. When I work through those, Ill add more to this post.
Re: Building from source - Setting up the workbench [message #658995 is a reply to message #658708] Thu, 10 March 2011 16:07 Go to previous messageGo to next message
Aaron Allsbrook is currently offline Aaron AllsbrookFriend
Messages: 23
Registered: July 2009
Junior Member
So I have a workaround/fix to my workspace errors. Most of the errors were erroneous about issues from annotations @overriding not have a superclass method to override. Clearly looking up the class heirarchy I can see the methods being overwritten.

In any case I seem to have resolved the workbench errors by switching from the default JRE from the one that ships with IBM RBD to suns. This doesn't really make any sense to me but I cant argue with an empty problems view.

Both JREs list as a perfect match when I click "Configure JRE associations" for JavaSE-1.6

Any thoughts about whats going on? Anyone else done this in RBD?
Re: Building from source - Setting up the workbench [message #658999 is a reply to message #658995] Thu, 10 March 2011 16:12 Go to previous messageGo to next message
Aaron Allsbrook is currently offline Aaron AllsbrookFriend
Messages: 23
Registered: July 2009
Junior Member
I do still have two errors... related to the import of sun internal classes with unmet dependencies

BooleanLiteral has the import
sun.security.action.GetBooleanAction;

FunctionArgumentValidator has the import
com.sun.xml.internal.ws.api.model.ParameterBinding;

They both seem to be unnecessary imports and should be deleted.

Is it time for me to have my first commit ??!!??
Re: Building from source - Setting up the workbench [message #659014 is a reply to message #658999] Thu, 10 March 2011 17:05 Go to previous messageGo to next message
Aaron Allsbrook is currently offline Aaron AllsbrookFriend
Messages: 23
Registered: July 2009
Junior Member
I'm attempting to move EGLDoc onto EDT.

Creating a new plugin

1. New Project, Type Plugin Project
2. Name - com.clearblade.edt.egl.doc
3. Next, Next, On templates page choose Plugin with a popup menu
4. On popup menu wizard page
- Target Objects Class - org.eclipse.core.resources.IProject
- Submenu Name - ClearBlade Documentation
- Action Label - Create EGLDoc
- java package name - default
- action calls - EGLDocPopup
- Multiple selection //EDIT I change this to '+' in the plugin editor view so that popup will activate for 1 to many projects selected
5. Click Finish


Updating the plugin dependencies
1. Open the MANIFEST.MF editor
2. Choose dependencies tab
3. Under required plugins - Click add and include org.eclipse.edt.compiler, org.eclipse.edt.mof, and org.eclipse.edt.mof.egl

[Updated on: Thu, 10 March 2011 18:37]

Report message to a moderator

Re: Building from source - Setting up the workbench [message #659026 is a reply to message #658999] Thu, 10 March 2011 17:38 Go to previous messageGo to next message
Tim W Wilson is currently offline Tim W WilsonFriend
Messages: 2
Registered: February 2011
Junior Member
This is not making much sense. The guys from Assist have had no issues here. Maybe they have some insight here.

[Updated on: Thu, 10 March 2011 17:56]

Report message to a moderator

Re: Building from source - Setting up the workbench [message #659043 is a reply to message #659014] Thu, 10 March 2011 19:11 Go to previous messageGo to next message
Aaron Allsbrook is currently offline Aaron AllsbrookFriend
Messages: 23
Registered: July 2009
Junior Member
Below are the updates I made to my popup action class (EGLDocPopup.java) to grab projects with an EGL nature

global variable
private List<IProject> selectedProjects=new ArrayList<IProject>();;

....

public void selectionChanged(IAction action, ISelection selection) {
if (selection instanceof TreeSelection) {
List objs =((TreeSelection)selection).toList();
selectedProjects.clear();
for (int i = 0; i < objs.size(); i++) {
try {
if (objs.get(i) instanceof IProject && ((IProject)objs.get(i)).hasNature("com.ibm.etools.egl.core.EGLNature ")) {
selectedProjects.add((IProject)objs.get(i));
}
} catch (CoreException e) {
e.printStackTrace();
}
}
}
}

....

public void run(IAction action) {
if (selectedProjects.size()==0) {
MessageDialog.openError(shell, "Clearblade EGLDoc", "An EGL Project must be selected. Please select and EGL Project and try again");
} else {
EGLDocManager manager = new EGLDocManager(selectedProjects);
}
}
Re: Building from source - Setting up the workbench [message #659254 is a reply to message #659043] Fri, 11 March 2011 16:58 Go to previous messageGo to next message
Aaron Allsbrook is currently offline Aaron AllsbrookFriend
Messages: 23
Registered: July 2009
Junior Member
Its not the most elegant thing at this point. But this bit of code will inspect eclipse projects, find EGLSource folders, force an EGL to EGLXML compile into a project local directory. It then builds a list of all parts in the compile folder. From there it iterates across each part and prints some interesting stuff to the screen (this is taken from one of the provided samples)

package com.clearblade.edt.egl.doc;

import java.io.File;
import java.io.PrintStream;
import java.net.URL;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.edt.mof.egl.Part;
import org.eclipse.edt.mof.egl.compiler.EGL2IR;
import org.eclipse.edt.mof.egl.utils.IRLoader;
import org.eclipse.edt.mof.egl.utils.LoadPartException;
import org.eclipse.edt.mof.serialization.Serializer;
import org.eclipse.edt.mof.serialization.xml.XMLSerializer;


public class EGLDocManager {
	
	
	private class IRLoaderInfo {
		String rootDir;
		String partName;
	}

	public EGLDocManager(List<IProject> selectedProjects) {
		try {
			for (Iterator<IProject> iterator = selectedProjects.iterator(); iterator.hasNext();) {
				IProject iProject = (IProject) iterator.next();
				if (iProject.exists()){
					forceCompile(iProject);
					
					iProject.getProject().refreshLocal(1, new NullProgressMonitor());
					
					List<IRLoaderInfo>  IRLoaderInfoList = getIRLoaderInfoForProject(iProject);
					
					processParts(IRLoaderInfoList);
					System.out.println("stop here");
					//cleanup the IR xml
					//deleteDir(file)
					iProject.getProject().refreshLocal(1, new NullProgressMonitor());
				}
			}
		} catch (CoreException e) {
			e.printStackTrace();
		}
	}
	
	private void forceCompile(IProject iProject){
		IFolder eglSourceFolder = iProject.getFolder("EGLSource");
		String irDest = (iProject.getLocation().append("edtIR")).toOSString();
		File file = new File (irDest);
		file.mkdir();
		deleteDir(file);
		String[] args = { "-irDestination", irDest, "-xmlOut", "-isVAGCompatible", eglSourceFolder.getLocation().toOSString() };
		try {
			EGL2IR.main(args);
		} catch (Throwable t) {
			t.printStackTrace();
		}
		
	}
	
	private List<IRLoaderInfo>  getIRLoaderInfoForProject(IProject iProject){
		List<IRLoaderInfo>  IRLoaderInfoList = new ArrayList<IRLoaderInfo>();
		String irDest = (iProject.getLocation().append("edtIR")).toOSString();
		IFolder eglIRFolder = iProject.getFolder("edtIR");
		IRLoaderInfoList = getEGLFileList(eglIRFolder, irDest, "");
		return IRLoaderInfoList;
	}
	
	private List<IRLoaderInfo>  getEGLFileList(IFolder iFolder, String rootDir, String eglPackage)  {
		List<IRLoaderInfo>  IRLoaderInfoList = new ArrayList<IRLoaderInfo> ();
		String filePath;
		IRLoaderInfo irLoaderInfo;
		try {
			IResource[] resources = ((IContainer) iFolder).members();
			for (int i = 0; i < resources.length; i++) {
				if (resources[i] instanceof IFolder){
					String nextPackage = ((IFolder)resources[i]).getName();
					if (eglPackage.length()>0) {
						nextPackage = eglPackage+"."+((IFolder)resources[i]).getName();
					}
						
					IRLoaderInfoList.addAll(getEGLFileList((IFolder)resources[i], rootDir, nextPackage));
				}
				else if (resources[i] instanceof IFile && ((IFile)resources[i]).exists()){
					filePath = ((IFile)resources[i]).getLocation().toOSString();
					if ( filePath.endsWith(".eglxml")) {
						irLoaderInfo = new IRLoaderInfo();
						irLoaderInfo.partName=eglPackage+"."+((IFile)resources[i]).getName();
						irLoaderInfo.partName = irLoaderInfo.partName.substring(0, irLoaderInfo.partName.length()-7);
						irLoaderInfo.rootDir=rootDir;
						IRLoaderInfoList.add(irLoaderInfo);
					}
				}
			}
		} catch (CoreException e) {
			e.printStackTrace();
		}
				
		return IRLoaderInfoList;
	}
	
	private void deleteDir(File dir){
		if(dir.isDirectory()){
			for(File sub : dir.listFiles()){
				deleteDir(sub);
			}
			dir.delete();
		}else{
			dir.delete();
		}
	}
	
	private void processParts(List<IRLoaderInfo> irLoaderInfoList) {
		for (Iterator<IRLoaderInfo>  iterator = irLoaderInfoList.iterator(); iterator.hasNext();) {
			IRLoaderInfo irLoaderInfo = (IRLoaderInfo) iterator.next();
			Part part;
			try {
				part = IRLoader.loadEGLPart(irLoaderInfo.rootDir, irLoaderInfo.partName);				
				displayPart(part,System.out);
				displaySerializedPart(part,System.out);
			} catch (LoadPartException e) {
				e.printStackTrace();
			}
		}
	}
	
	public void displayPart(Part part, PrintStream out) {
		out.print(part.toString());
	}
	
	public void displaySerializedPart(Part part, PrintStream out) {
		Serializer xml = new XMLSerializer();
		xml.serialize(part);
		out.print((String)xml.getContents());
	}
	

}

Re: Building from source - Setting up the workbench [message #660448 is a reply to message #658995] Fri, 18 March 2011 13:32 Go to previous messageGo to next message
Hans  is currently offline Hans Friend
Messages: 1
Registered: March 2011
Junior Member
I've just checked out everything under org.eclipse.edt in RBD7.5.1.5. The only errors I have are in the samples and are related to a missing class org.eclipse.edt.mof.codegen.api.AbstractTemplateFactory.

Hans (from Asist)
Re: Building from source [message #667126 is a reply to message #570118] Tue, 26 April 2011 21:55 Go to previous messageGo to next message
Gilbert Herschberger is currently offline Gilbert HerschbergerFriend
Messages: 12
Registered: September 2010
Junior Member
Are you saying that Rational Business Developer, a commercial product from IBM, is required in order to build EGL Development Tools from its source code?

[Updated on: Tue, 26 April 2011 21:56]

Report message to a moderator

Re: Building from source [message #667186 is a reply to message #667126] Wed, 27 April 2011 09:25 Go to previous messageGo to next message
Bart Van Campenhout is currently offline Bart Van CampenhoutFriend
Messages: 9
Registered: February 2011
Junior Member
That is not necessary.
EDT consists of 3 eclipse plugins.
These can be plugged in to any eclipse environment.
Re: Building from source [message #668020 is a reply to message #667126] Tue, 03 May 2011 12:28 Go to previous messageGo to next message
Aaron Allsbrook is currently offline Aaron AllsbrookFriend
Messages: 23
Registered: July 2009
Junior Member
Hi Gilbert,

EDT does not require Rational Business Developer. I do have the requirement to describe how I build IDE extensions for EGL tools. At the moment there is not an open source IDE that includes EGL tooling at the latest level.

Consequently I have used RBD as the host environment in this demonstration. My vision is that EGLDoc finds it way into the EDT project that is a fully functional project on native eclipse alone.

In theory thanks to EDT the code I have would now run independent of any IDE at all. That means I can now support the requirement to run EGLDoc headlessly via a build process or RTC work item state transistion - which is pretty interesting
Re: Building from source [message #668059 is a reply to message #570118] Tue, 03 May 2011 14:57 Go to previous messageGo to next message
Gilbert Herschberger is currently offline Gilbert HerschbergerFriend
Messages: 12
Registered: September 2010
Junior Member
Thanks for information on building the EDT project from its source code. I downloaded the JavaEE flavor of Eclipse "helios", set up a CVS connection as described here, and all of the Java code compiles cleanly.

While exploring the project, there are some annoyances. Unlike EGL Community Edition, the .egl files do not yet have an associated editor.

Which naturally leads to more questions. With the project compiled, what next? How do I explore the .eglar files? How do I build an .eglar file from its source code? How do I generate the Java source code with the development tools?
Re: Building from source [message #668079 is a reply to message #668059] Tue, 03 May 2011 16:23 Go to previous message
Aaron Allsbrook is currently offline Aaron AllsbrookFriend
Messages: 23
Registered: July 2009
Junior Member
Hi Gilbert,

At this point EDT is mostly just about building the EGL Model for introspecting and then generating output. All of the editors and such are all part of future EDT milestone releases from IBM.

Since we don't really have an EGL development environment to work with that's the reason why I am using RBD 8011 as my base rather than a helios drop.

With regards to your questions about eglars.... i dont know... If i were you I would probably open a new thread on it so it doesnt get lost here

Previous Topic:EGLC
Next Topic:how to retrieve native types values from typeSignature
Goto Forum:
  


Current Time: Thu Nov 27 17:48:42 GMT 2014

Powered by FUDForum. Page generated in 0.02223 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software