Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 329645 - Execute bundled models
Summary: Execute bundled models
Status: CLOSED FIXED
Alias: None
Product: AMP
Classification: Modeling
Component: Escape (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Miles Parker CLA
QA Contact: Miles Parker CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-07 20:32 EST by Oliver Mannion CLA
Modified: 2011-05-27 20:29 EDT (History)
2 users (show)

See Also:


Attachments
ExecuteJavaByClassNameHandler (31.20 KB, patch)
2010-11-07 20:36 EST, Oliver Mannion CLA
no flags Details | Diff
Replaces previous ExecuteJavaByClassNameHandler (34.19 KB, patch)
2011-05-17 17:24 EDT, Oliver Mannion CLA
no flags Details | Diff
0001-Fix-Bug-329645-Execute-bundled-models.patch (52.11 KB, patch)
2011-05-23 19:57 EDT, Oliver Mannion CLA
milesparker: iplog+
Details | Diff
MyModel test model (68.02 KB, application/zip)
2011-05-24 01:12 EDT, Oliver Mannion CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Oliver Mannion CLA 2010-11-07 20:32:27 EST
Build Identifier: 

I made changes to EclipseEscapeRunner so loading a model from a Project is a specific case of loading from the name of a class (which now allows loading models from bundles).

I've also modified InfoView so it uses getResource instead of relying on a project to load the about file. This works for both models loaded from workspace projects and models run from bundles.

I've also created a new execute handler and command to load using just the name of the class (ie: for models in bundles).

Reproducible: Always
Comment 1 Oliver Mannion CLA 2010-11-07 20:36:16 EST
Created attachment 182582 [details]
ExecuteJavaByClassNameHandler

NB: requires the "Eclipse-BuddyPolicy: registered" change made to org.ascape.core
Comment 2 Miles Parker CLA 2010-11-08 13:12:34 EST
(In reply to comment #1)
> Created an attachment (id=182582) [details]
> ExecuteJavaByClassNameHandler
> 
> NB: requires the "Eclipse-BuddyPolicy: registered" change made to
> org.ascape.core

Thanks Oliver. We won't be able to modify the ascape core directly on the Eclipse side, so I'll apply that to the Ascape build. Do you think there is anyway to accomplish the same thing by corcing the ascape core classes to load from a dependent plugin instead?
Comment 3 Oliver Mannion CLA 2010-11-08 17:27:27 EST
(In reply to comment #2)
> Thanks Oliver. We won't be able to modify the ascape core directly on the
> Eclipse side, so I'll apply that to the Ascape build. Do you think there is
> anyway to accomplish the same thing by corcing the ascape core classes to load
> from a dependent plugin instead?

I've applied the "Eclipse-BuddyPolicy: registered" change to the Ascape SVN.

By coercing the ascape core classed to load form a dependent plugin do you mean via the "Eclipse-BuddyPolicy: dependent"? Yes that would work but is less efficient than using the registered buddy policy.

NB: If EclipseEscapeRunner.open used its own version of instanceFromName, instead of the super class version, then this change could be made to org.eclipse.amp.escape.ide instead of org.ascape.core. It wouldn't be hard to do.
Comment 4 Miles Parker CLA 2010-11-08 17:43:36 EST
(In reply to comment #3)
> (In reply to comment #2)
> > Thanks Oliver. We won't be able to modify the ascape core directly on the
> > Eclipse side, so I'll apply that to the Ascape build. Do you think there is
> > anyway to accomplish the same thing by corcing the ascape core classes to load
> > from a dependent plugin instead?
> 
> I've applied the "Eclipse-BuddyPolicy: registered" change to the Ascape SVN.

OK, that won't actually show up until we do a new CQ so we should see if we can figure something else out in meantime.

> By coercing the ascape core classed to load form a dependent plugin do you mean
> via the "Eclipse-BuddyPolicy: dependent"? Yes that would work but is less
> efficient than using the registered buddy policy.

Is it measurably different do you think? My brain is too distracted today to try to grok the ins and outs of OSGi buddy policies. ;) I guess it goes without saying that the only thing we absolutely need to avoid is to load the plugin when the user doesn't actually need it for a task they've selected.

> NB: If EclipseEscapeRunner.open used its own version of instanceFromName,
> instead of the super class version, then this change could be made to
> org.eclipse.amp.escape.ide instead of org.ascape.core. It wouldn't be hard to
> do.

That would be ideal -- my thought is that it is best to have o.a.core be a sort of "dumb" plugin in the sense that it doesn't need to know anything about how it might be used. IOTW, we should view it as a set of Java classes that happen to have been packaged up into an Eclipse plugin. 

Have you verified that this all works with the AGF 3D and Chart dependencies? That's been a real bear in fact IIRC I actually had to put in some otherwise unnecessary dependencies for AGF3D and Chart in the regular Escape IDE. Again IIRC this is one of the main reasons that we don't now have the ability to create Escape projects without the "optional" AGF3D dependencies.

It would be *really* nice to allow this bit to be properly pluggable.
Comment 5 Oliver Mannion CLA 2010-11-08 19:34:30 EST
(In reply to comment #4)
> (In reply to comment #3)
> > (In reply to comment #2)
> > > Thanks Oliver. We won't be able to modify the ascape core directly on the
> > > Eclipse side, so I'll apply that to the Ascape build. Do you think there is
> > > anyway to accomplish the same thing by corcing the ascape core classes to load
> > > from a dependent plugin instead?
> > 
> > I've applied the "Eclipse-BuddyPolicy: registered" change to the Ascape SVN.
> 
> OK, that won't actually show up until we do a new CQ so we should see if we can
> figure something else out in meantime.
> 
> > By coercing the ascape core classed to load form a dependent plugin do you mean
> > via the "Eclipse-BuddyPolicy: dependent"? Yes that would work but is less
> > efficient than using the registered buddy policy.
> 
> Is it measurably different do you think? My brain is too distracted today to
> try to grok the ins and outs of OSGi buddy policies. ;) I guess it goes without
> saying that the only thing we absolutely need to avoid is to load the plugin
> when the user doesn't actually need it for a task they've selected.

Depends on the number of bundles dependent on o.a.core. The register buddy policy scopes down the search of dependent bundles to only those registered. This could be tested but what would be the advantage of using "Eclipse-BuddyPolicy: dependent" ?

> 
> > NB: If EclipseEscapeRunner.open used its own version of instanceFromName,
> > instead of the super class version, then this change could be made to
> > org.eclipse.amp.escape.ide instead of org.ascape.core. It wouldn't be hard to
> > do.
> 
> That would be ideal -- my thought is that it is best to have o.a.core be a sort
> of "dumb" plugin in the sense that it doesn't need to know anything about how
> it might be used. IOTW, we should view it as a set of Java classes that happen
> to have been packaged up into an Eclipse plugin. 

The "Eclipse-BuddyPolicy: registered" change is only made to the o.a.core MANIFEST.MF rather than the Java code. So the code doesn't really know anything about how its used. I think the main advantage of moving the scape loading to EclipseEscapeRunner would be to not have to make any changes to o.a.core - I can go ahead and do this?
 
> Have you verified that this all works with the AGF 3D and Chart dependencies?
> That's been a real bear in fact IIRC I actually had to put in some otherwise
> unnecessary dependencies for AGF3D and Chart in the regular Escape IDE. Again
> IIRC this is one of the main reasons that we don't now have the ability to
> create Escape projects without the "optional" AGF3D dependencies.
> 
> It would be *really* nice to allow this bit to be properly pluggable.

The CoordinationGame example model uses charts as works via this method. I can test AGF3D - what example model uses it?

BTW: what does IOTW mean?
Comment 6 Miles Parker CLA 2010-11-26 14:17:02 EST
Oliver, sorry to take so long responding..

(In reply to comment #5)
> (In reply to comment #4)
> > (In reply to comment #3)
> > Is it measurably different do you think? My brain is too distracted today to
> > try to grok the ins and outs of OSGi buddy policies. ;) I guess it goes without
> > saying that the only thing we absolutely need to avoid is to load the plugin
> > when the user doesn't actually need it for a task they've selected.
> 
> Depends on the number of bundles dependent on o.a.core. The register buddy
> policy scopes down the search of dependent bundles to only those registered.
> This could be tested but what would be the advantage of using
> "Eclipse-BuddyPolicy: dependent" ?

I think the primary reason for using "dependent" -- beside not having to put in a new o.a.core plugin contribution which isn't trivial -- is that plugins that need to be loaded with it don't have to explicitly register. That's a non-obvious thing to do and could be important for people who are developing plugins that should work with it. Does that make sense or am I missing your point?

> > That would be ideal -- my thought is that it is best to have o.a.core be a sort
> > of "dumb" plugin in the sense that it doesn't need to know anything about how
> > it might be used. IOTW, we should view it as a set of Java classes that happen
> > to have been packaged up into an Eclipse plugin. 
> 
> The "Eclipse-BuddyPolicy: registered" change is only made to the o.a.core
> MANIFEST.MF rather than the Java code. So the code doesn't really know anything
> about how its used. I think the main advantage of moving the scape loading to
> EclipseEscapeRunner would be to not have to make any changes to o.a.core - I
> can go ahead and do this?

Please.

> > Have you verified that this all works with the AGF 3D and Chart dependencies?
> > That's been a real bear in fact IIRC I actually had to put in some otherwise
> > unnecessary dependencies for AGF3D and Chart in the regular Escape IDE. Again
> > IIRC this is one of the main reasons that we don't now have the ability to
> > create Escape projects without the "optional" AGF3D dependencies.
> > 
> > It would be *really* nice to allow this bit to be properly pluggable.
> 
> The CoordinationGame example model uses charts as works via this method. I can
> test AGF3D - what example model uses it?

All of them do, in the sense that you can always launch a 3D model using the Execute 3D button. (We need a seperate icon for this!) Also, there is always a 3D version of the model generated. (Which is again why we need to be be able to seperate that out so that people who don't want the AGF3D dependency don't have to have it.

> BTW: what does IOTW mean?

In Other Words. :) What does NB mean?
Comment 7 Miles Parker CLA 2010-11-26 14:18:51 EST
Also, Oliver for pro forma IP purposes, could you answer the following:

Did you write the contribution yourself?
Did you reference any 3rd party material?
If yes, under what terms (license) did you receive this material?
Are you authorized by your employer to make the contribution?

BTW, completely unrelated, but Eclipse legal had a suggestion for us that even on the Ascape side it's important to have all code changes referenced from a SourceForge tracker entry. Not a bad policy in any case.
Comment 8 Miles Parker CLA 2010-12-07 13:28:51 EST
Hi Oliver,

With build issues resolved, I'm ready to put this in. Any thoughts on issues above?
Comment 9 Oliver Mannion CLA 2011-05-08 22:00:28 EDT
Comment on attachment 182582 [details]
ExecuteJavaByClassNameHandler

### Eclipse Workspace Patch 1.0
#P org.eclipse.amp.escape.ide
Index: META-INF/MANIFEST.MF
===================================================================
RCS file: /cvsroot/modeling/org.eclipse.amp/org.eclipse.amp.escape/plugins/org.eclipse.amp.escape.ide/META-INF/MANIFEST.MF,v
retrieving revision 1.23
diff -u -r1.23 MANIFEST.MF
--- META-INF/MANIFEST.MF	6 Aug 2010 23:46:40 -0000	1.23
+++ META-INF/MANIFEST.MF	9 May 2011 01:56:39 -0000
@@ -19,12 +19,8 @@
  org.eclipse.jface,
  org.eclipse.ui.views,
  org.eclipse.ui.ide,
- org.eclipse.debug.ui,
- org.eclipse.jdt.debug.ui,
  org.eclipse.core.expressions,
- org.eclipse.jdt.launching,
  org.eclipse.ui.console,
- org.eclipse.ui.editors,
  org.eclipse.amp.axf.core;bundle-version="0.8.0",
  org.eclipse.amp.axf.views,
  org.eclipse.amp.axf.ide,
@@ -34,7 +30,6 @@
  org.eclipse.amp.agf3d;bundle-version="0.8.0";resolution:=optional,
  org.eclipse.amp.escape.ascape.agf3d;bundle-version="0.8.0";resolution:=optional,
  org.eclipse.amp.escape.ascape.chart;bundle-version="0.8.0",
- org.eclipse.jdt.ui;bundle-version="3.5.1",
  org.eclipse.amp.agf.zest;bundle-version="0.8.0";visibility:=reexport,
  org.eclipse.ui;bundle-version="3.6.0",
  org.eclipse.jdt.core,
Index: plugin.xml
===================================================================
RCS file: /cvsroot/modeling/org.eclipse.amp/org.eclipse.amp.escape/plugins/org.eclipse.amp.escape.ide/plugin.xml,v
retrieving revision 1.17
diff -u -r1.17 plugin.xml
--- plugin.xml	4 Aug 2010 02:05:57 -0000	1.17
+++ plugin.xml	9 May 2011 01:56:39 -0000
@@ -22,6 +22,17 @@
         id="org.eclipse.amp.escape.runtime.executeHeadless"
         name="Execute Headless">
 		</command>
+  <command
+        defaultHandler="org.eclipse.amp.escape.command.ExecuteJavaByClassNameHandler"
+        description="Execute a Java Model by Class Name"
+        id="org.eclipse.amp.escape.runtime.executeClassName"
+        name="Execute a Java Model by Class Name">
+     <commandParameter
+           id="scapeClassName"
+           name="scape class name"
+           optional="false">
+     </commandParameter>
+  </command>
 	</extension>
 	<extension point="org.eclipse.ui.menus">
 		<menuContribution locationURI="popup:org.eclipse.ui.popup.any">
Index: src/org/eclipse/amp/escape/command/ExecuteHandler.java
===================================================================
RCS file: /cvsroot/modeling/org.eclipse.amp/org.eclipse.amp.escape/plugins/org.eclipse.amp.escape.ide/src/org/eclipse/amp/escape/command/ExecuteHandler.java,v
retrieving revision 1.5
diff -u -r1.5 ExecuteHandler.java
--- src/org/eclipse/amp/escape/command/ExecuteHandler.java	4 Aug 2010 02:05:57 -0000	1.5
+++ src/org/eclipse/amp/escape/command/ExecuteHandler.java	9 May 2011 01:56:39 -0000
@@ -45,11 +45,15 @@
         this.setHeadless(headless);
     }
 
-    /*
-     * (non-Javadoc)
+    /**
+     * Starts a new job with a {@link EclipseEscapeRunner} that executes 
+     * the scape.
      * 
-     * @see org.eclipse.amp.escape.command.ResourceHandler#execute(java.lang.Object, java.lang.String)
+     * @param executed scape resource/class name to execute
+     * @param name scape name
+     * @throws ExecutionException if problem executing
      */
+    @Override
     public final void execute(final Object executed, String name) throws ExecutionException {
         final EclipseEscapeRunner eclipseRunner = createRunner();
         if (isHeadless()) {
@@ -83,7 +87,7 @@
      * Execute open.
      * 
      * @param eclipseRunner the eclipse runner
-     * @param executed the executed
+     * @param executed the executed scape resource/name
      * @param monitor the monitor
      */
     protected abstract void executeOpen(final EclipseEscapeRunner eclipseRunner, final Object executed,
Index: src/org/eclipse/amp/escape/command/ExecuteJavaByClassNameHandler.java
===================================================================
RCS file: src/org/eclipse/amp/escape/command/ExecuteJavaByClassNameHandler.java
diff -N src/org/eclipse/amp/escape/command/ExecuteJavaByClassNameHandler.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ src/org/eclipse/amp/escape/command/ExecuteJavaByClassNameHandler.java	1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,117 @@
+/**
+ * <copyright>
+ *
+ * Copyright (c) 2009 Metascape, LLC.
+ * All rights reserved.   This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *   Metascape - Initial API and Implementation
+ *
+ * </copyright>
+ *
+ */
+package org.eclipse.amp.escape.command;
+
+import org.eclipse.amp.escape.ide.EclipseEscapeRunner;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IProgressMonitor;
+
+/**
+ * Execute a Java scape by class name. The scape class name is specified by the
+ * command parameter "scapeClassName".
+ * 
+ * Does not implement any {@link ResourceHandler} functionality (ie:
+ * enable/disable based on currently selected resource).
+ */
+public class ExecuteJavaByClassNameHandler extends ExecuteHandler {
+
+	private transient String scapeName;
+
+	/**
+	 * Constructor called when executed via eclipse commmand.
+	 */
+	public ExecuteJavaByClassNameHandler() {
+		this(false);
+	}
+
+	/**
+	 * Construct {@link ExecuteJavaByClassNameHandler}.
+	 * 
+	 * @param headless
+	 *            headless execution?
+	 */
+	public ExecuteJavaByClassNameHandler(boolean headless) {
+		super(headless);
+	}
+
+	/**
+	 * Execute the specified scape.
+	 * 
+	 * @param scapeClassName
+	 *            scape class name
+	 * @throws ExecutionException
+	 *             if problem executing
+	 */
+	public void execute(String scapeClassName) throws ExecutionException {
+		scapeName = scapeClassName
+				.substring(scapeClassName.lastIndexOf('.') + 1);
+		super.execute(scapeClassName, scapeName);
+	}
+
+	/**
+	 * Execute the specified scape.Entry point when this handler is called by a
+	 * command. Calls {@link #execute(String)} with the value of the
+	 * {@code scapeClassName} parameter of the executing command.
+	 * 
+	 * @param event
+	 *            An event containing all the information about the current
+	 *            state of the application; must not be <code>null</code>.
+	 * @return the result of the execution. Reserved for future use, must be
+	 *         <code>null</code>.
+	 * @throws ExecutionException
+	 *             if an exception occurred during execution.
+	 */
+	@Override
+	public Object execute(ExecutionEvent event) throws ExecutionException {
+		String scapeClassName = event.getParameter("scapeClassName");
+		if (scapeClassName != null) {
+			execute(scapeClassName);
+		}
+		return null;
+	}
+
+	/**
+	 * Open the scape via the supplied eclipse runner. Called by a new job
+	 * created by {@link ExecuteHandler#execute(Object, String)}.
+	 * 
+	 * @param eclipseRunner
+	 *            eclipse runner
+	 * @param executed
+	 *            scape class name
+	 * @param monitor
+	 *            progress monitor
+	 */
+	@Override
+	protected void executeOpen(final EclipseEscapeRunner eclipseRunner,
+			final Object executed, IProgressMonitor monitor) {
+		String scapeClassName = (String) executed;
+		eclipseRunner.open(scapeClassName, scapeName);
+	}
+
+	@Override
+	public void setEnabled(Object evaluationContext) {
+		// we don't work with resources so do nothing (much like
+		// AbstractHandler)
+	}
+
+	@Override
+	protected boolean handleSelect(Object sel) {
+		// we don't work with resources so just return true
+		return true;
+	}
+
+}
Index: src/org/eclipse/amp/escape/command/ResourceHandler.java
===================================================================
RCS file: /cvsroot/modeling/org.eclipse.amp/org.eclipse.amp.escape/plugins/org.eclipse.amp.escape.ide/src/org/eclipse/amp/escape/command/ResourceHandler.java,v
retrieving revision 1.5
diff -u -r1.5 ResourceHandler.java
--- src/org/eclipse/amp/escape/command/ResourceHandler.java	4 Aug 2010 02:05:57 -0000	1.5
+++ src/org/eclipse/amp/escape/command/ResourceHandler.java	9 May 2011 01:56:41 -0000
@@ -44,12 +44,15 @@
      */
     public Object execute(ExecutionEvent event) throws ExecutionException {
         try {
+        	// if command has an elementRef parameter, execute that
             IJavaElement javaElement = (IJavaElement) event.getObjectParameterForExecution("elementRef");
             executeForObject(event, javaElement);
             return null;
         } catch (ExecutionException e) {
             // we can safely ignore..the sub-class may not have defined this parameter..
         }
+        
+        // execute on the current selection
         ISelection selection = HandlerUtil.getCurrentSelection(event);
         if (selection != null && !selection.isEmpty() && selection instanceof IStructuredSelection) {
             IStructuredSelection structuredSelection = (IStructuredSelection) selection;
Index: src/org/eclipse/amp/escape/ide/EclipseEscapeRunner.java
===================================================================
RCS file: /cvsroot/modeling/org.eclipse.amp/org.eclipse.amp.escape/plugins/org.eclipse.amp.escape.ide/src/org/eclipse/amp/escape/ide/EclipseEscapeRunner.java,v
retrieving revision 1.19
diff -u -r1.19 EclipseEscapeRunner.java
--- src/org/eclipse/amp/escape/ide/EclipseEscapeRunner.java	4 Aug 2010 02:05:57 -0000	1.19
+++ src/org/eclipse/amp/escape/ide/EclipseEscapeRunner.java	9 May 2011 01:56:41 -0000
@@ -15,6 +15,7 @@
  */
 package org.eclipse.amp.escape.ide;
 
+import java.net.MalformedURLException;
 import java.util.ArrayList;
 import java.util.List;
 
@@ -37,7 +38,6 @@
 import org.eclipse.amp.escape.ascape.wrap.ModelWrapperScapeListener;
 import org.eclipse.amp.escape.ascape.wrap.ScapeWrapperModel;
 import org.eclipse.amp.escape.ascape.wrap.ScapeWrapperModelListener;
-import org.eclipse.core.resources.IProject;
 import org.eclipse.core.resources.IResource;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.IStatus;
@@ -50,7 +50,8 @@
 
 // TODO: Auto-generated Javadoc
 /**
- * The Class EclipseEscapeRunner.
+ * Create a new instance of a model (scape) and start it running in the eclipse
+ * environment.
  */
 public class EclipseEscapeRunner extends NonGraphicRunner implements IEngine {
 
@@ -62,8 +63,6 @@
 
     IModel model;
 
-    IProject project;
-
     private IStatus finishStatus = Status.OK_STATUS;
 
     TimeGranularity updateGranularity = TimeGranularity.DEFAULT_GRANULARITY;
@@ -73,73 +72,179 @@
     // would be nice to have this in Ascape proper but not worth IP submission
     private boolean closeOnStop = false;
 
-    /**
-     * Open.
-     * 
-     * @param modelResource the model resource
-     * @param modelClassName the model class name
-     * @param modelName the model name
-     */
-    public void open(final IResource modelResource, final String modelClassName, String modelName) {
-        open(modelResource, modelClassName, modelName, new String[0]);
-    }
 
-    /**
-     * Open. Wait until execution has stopped to return.
-     * 
-     * @param projectResource the project resource
-     * @param modelClassName the model class name
-     * @param modelName the model name
-     * @param args the args
-     */
-    public void open(final IResource projectResource, final String modelClassName, String modelName, String[] args) {
-        open(projectResource, modelClassName, modelName, args, true);
-    }
-
-    /**
-     * Open.
-     * 
-     * @param projectResource the project resource
-     * @param modelClassName the model class name
-     * @param modelName the model name
-     * @param args the args
-     * @param block true if this method should only return on execution completion.
-     */
-    public void open(final IResource projectResource, final String modelClassName, String modelName, String[] args,
-            boolean block) {
-        this.project = projectResource.getProject();
+	/**
+	 * {@link #open(String, String, String[], boolean) Open} a workspace model
+	 * with no args. Sets up the {@link ProjectLoader} class loader that loads
+	 * workspace resources. Waits until execution has stopped before returning
+	 * (ie: this method blocks).
+	 * 
+	 * @param modelResource
+	 *            the model resource
+	 * @param scapeClassName
+	 *            the model class name
+	 * @param scapeName
+	 *            the model name
+	 */
+	public void open(final IResource modelResource,
+			final String scapeClassName, String scapeName) {
+		open(modelResource, scapeClassName, scapeName, new String[0]);
+	}
+
+	/**
+	 * {@link #open(String, String, String[], boolean) Open} a workspace model
+	 * with supplied args. Sets up the {@link ProjectLoader} class loader that
+	 * loads workspace resources. Waits until execution has stopped before
+	 * returning (ie: this method blocks).
+	 * 
+	 * @param projectResource
+	 *            the project resource
+	 * @param scapeClassName
+	 *            the scape class name
+	 * @param scapeName
+	 *            the scape name
+	 * @param args
+	 *            parameter arguments for the scape
+	 */
+	public void open(final IResource projectResource,
+			final String scapeClassName, String scapeName, String[] args) {
+		open(projectResource, scapeClassName, scapeName, args, true);
+	}
+
+	/**
+	 * {@link #open(String, String, String[], boolean) Open} a workspace model
+	 * with supplied args. Sets up the {@link ProjectLoader} class loader that
+	 * loads workspace resources.
+	 * 
+	 * @param projectResource
+	 *            the project resource
+	 * @param scapeClassName
+	 *            the scape class name
+	 * @param scapeName
+	 *            the scape name
+	 * @param args
+	 *            parameter arguments for the scape
+	 * @param block
+	 *            true if this method should only return on execution
+	 *            completion.
+	 */
+	public void open(final IResource projectResource,
+			final String scapeClassName, String scapeName, String[] args,
+			boolean block) {
+
+		try {
+			delegateLoader = new ProjectLoader(projectResource.getProject());
+		} catch (LoaderCreationException e) {
+			StatusManager
+					.getManager()
+					.handle(new Status(
+							Status.WARNING,
+							scapeName,
+							"Couldn't create project classloader; falling back to default loader",							e));
+		} catch (MalformedURLException e) {
+			StatusManager
+					.getManager()
+					.handle(new Status(
+							Status.WARNING,
+							scapeName,
+							"Couldn't create project classloader; falling back to default loader",
+							e));
+		}
+		open(scapeClassName, scapeName, args, block);
+	}
+
+	/**
+	 * {@link #open(String, String, String[], boolean) Open} a model with no
+	 * args. Waits until execution has stopped before returning (ie: this method
+	 * blocks).
+	 * 
+	 * @param scapeClassName
+	 *            the scape class name
+	 * @param scapeName
+	 *            the scape name
+	 */
+	public void open(final String scapeClassName, String scapeName) {
+		open(scapeClassName, scapeName, new String[0]);
+	}
+
+	/**
+	 * {@link #open(String, String, String[], boolean) Open} a model with
+	 * supplied args. Waits until execution has stopped before returning (ie:
+	 * this method blocks).
+	 * 
+	 * @param scapeClassName
+	 *            the scape class name
+	 * @param scapeName
+	 *            the scape name
+	 * @param args
+	 *            parameter arguments for the scape
+	 */
+	public void open(final String scapeClassName, String scapeName,
+			String[] args) {
+		open(scapeClassName, scapeName, args, true);
+	}
+
+	/**
+	 * Open a model. A instance of the scape specified is created using the
+	 * using the current thread's context class loader. This will be
+	 * {@link ProjectLoader} if
+	 * {@link #open(IResource, String, String, String[], boolean) open} is used
+	 * or otherwise {@link org.eclipse.core.runtime.internal.adaptor.ContextFinder}.
+	 * <p>
+	 * If the {@link org.eclipse.core.runtime.internal.adaptor.ContextFinder} class 
+	 * loader is in use then this <a href=
+	 * "http://wiki.eclipse.org/index.php/Context_Class_Loader_Enhance2ments#Search_Order"
+	 * > search logic</a> is used to locate the scape class. For this to work
+	 * the bundle containing the scape class ought to have the following in its
+	 * MANIFEST.MF:
+	 * 
+	 * <pre>
+	 * Eclipse-RegisterBuddy: org.ascape.core
+	 * Import-Package: org.ascape.runtime
+	 * </pre>
+	 * 
+	 * @param scapeClassName
+	 *            the class name of the scape
+	 * @param scapeName
+	 *            the name of the scape
+	 * @param args
+	 *            parameter arguments for the scape
+	 * @param block
+	 *            true if this method should only return on execution
+	 *            completion.
+	 */
+    public void open(final String scapeClassName, String scapeName, 
+    		String[] args, boolean block) {
         setStartOnOpen(false);
         setAutoRestart(false);
-        final MessageConsole eclipseConsole = new MessageConsole("Run " + modelName, null);
+        final MessageConsole eclipseConsole = new MessageConsole("Run " + scapeName, null);
         getEnvironment().getConsole().setIMessageStream(new MessageAdapter(eclipseConsole));
         IConsole[] consules = { eclipseConsole };
         ConsolePlugin.getDefault().getConsoleManager().addConsoles(consules);
         eclipseConsole.activate();
         AscapeRuntimePlugin.getDefault();
+        
+        Scape newScape;
         try {
-            delegateLoader = new ProjectLoader(projectResource.getProject());
-        } catch (LoaderCreationException e) {
-            StatusManager.getManager()
-            .handle(
-                    new Status(Status.WARNING, project.getName(),
-                               "Couldn't create project classloader; falling back to default loader", e));
-        }
-        Scape newAgent;
-        try {
-            newAgent = (Scape) instanceFromName(modelClassName);
+        	// create instance using the current thread's context class loader
+        	// this will be ProjectLoader or ContextFinder 
+            newScape = (Scape) instanceFromName(scapeClassName);
         } catch (RuntimeException e) {
             StatusManager.getManager().handle(
-                                              new Status(Status.ERROR, project.getName(), "Could not read class: "
-                                                         + modelClassName
+                                              new Status(Status.ERROR, scapeName, "Could not read class: "
+                                                         + scapeClassName
                                                          + ". Please ensure that the class exists in class path.", e),
                                                          StatusManager.SHOW | StatusManager.LOG);
             dispose();
             throw e;
         }
-        newAgent.setName(modelName);
-        setRootScape(newAgent);
+        newScape.setName(scapeName);
+        setRootScape(newScape);
         model = new ScapeWrapperModel(getRootScape());
+        
+        // register this model with the ModelViewManager
         AXFWorkbenchPlugin.getDefault().getManager().register(model, this, getRootScape());
+        
         // getModel().addModelListener(new ModelMonitorView(modelMonitor));
         // getModel().addModelListener(new ControlViewProxy());
         try {
@@ -246,7 +351,7 @@
                     if (model != null) {
                         message = "An exception occurred when running: " + getModel().getName();
                     }
-                    StatusManager.getManager().handle(new Status(Status.ERROR, project.getName(), message, e),
+                    StatusManager.getManager().handle(new Status(Status.ERROR, getModel().getName(), message, e),
                                                       StatusManager.SHOW | StatusManager.LOG);
                     if (closeOnStop) {
                         close();
@@ -512,7 +617,7 @@
     }
 
     /**
-     * @return
+     * @return granularity
      * @see org.eclipse.amp.axf.core.IEngine#getUpdateGranularity()
      */
     public ITimeGranularity getUpdateGranularity() {
@@ -527,10 +632,6 @@
         this.updateGranularity = (TimeGranularity) granularity;
     }
 
-    public IProject getExecutingProject() {
-        return project;
-    }
-
     /**
      * Should the model exit upon a stop command?
      * 
Index: src/org/eclipse/amp/escape/ide/InfoView.java
===================================================================
RCS file: /cvsroot/modeling/org.eclipse.amp/org.eclipse.amp.escape/plugins/org.eclipse.amp.escape.ide/src/org/eclipse/amp/escape/ide/InfoView.java,v
retrieving revision 1.4
diff -u -r1.4 InfoView.java
--- src/org/eclipse/amp/escape/ide/InfoView.java	4 Aug 2010 02:05:57 -0000	1.4
+++ src/org/eclipse/amp/escape/ide/InfoView.java	9 May 2011 01:56:41 -0000
@@ -1,15 +1,13 @@
 package org.eclipse.amp.escape.ide;
 
-import java.net.MalformedURLException;
+import java.io.IOException;
 import java.net.URL;
 
 import org.ascape.model.Scape;
 import org.eclipse.amp.axf.core.IModel;
 import org.eclipse.amp.axf.ide.view.ActiveModelViewPart;
 import org.eclipse.amp.escape.ascape.wrap.ScapeWrapperModel;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.FileLocator;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.browser.Browser;
 import org.eclipse.swt.widgets.Composite;
@@ -31,52 +29,91 @@
  */
 
 /**
+ * The 'About this Model' view.
+ * 
+ * The 'About this Model' view displays information about a (AMF or Java based)
+ * model if it has been provided by the developer. In order to appear in this
+ * dialog, create a file named "About[MyModel].html" where "MyModel" is the
+ * model's Scape Class Name (not the AMF model file name). The file should be an
+ * html fragment -- that is, without body and head tags -- and can include any
+ * valid html tags, including links.
+ * <p>
+ * The model's class loader is used to locate the file. If the model is a
+ * workspace resource then {@link ProjectLoader} will be used to locate the
+ * file. See {@link ProjectLoader} for more info.
+ * <p>
+ * If the model is part of a loaded bundle then
+ * {@link org.eclipse.osgi.internal.loader.BundleLoader#findResource(String)} 
+ * will be the class loader code used
+ * to locate the file using this <a href=
+ * "http://wiki.eclipse.org/index.php/Context_Class_Loader_Enhancements#Search_Order"
+ * > search logic</a>. To have the class loader search a res folder in the
+ * model's bundle add this entry to the model bundle's MANIFEST.MF:
+ * <p>
+ * {@code Bundle-Classpath: bin;res}
+ * <p>
+ * Then place the "About[MyModel].html" file in a "res" source folder in
+ * bundle's root directory in a parallel directory path to the Java class
+ * package. For example, an about file for a model defined by the scape
+ * "edu.brook.norms.Norms" could be placed at
+ * "res/edu/brook/norms/AboutNorms.html".
  * 
  * @author mparker
  * 
  */
 public class InfoView extends ActiveModelViewPart {
 
-    private Browser browser;
+	private Browser browser;
 
-    /**
-     * @param parent
-     * @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
-     */
-    public void createPartControl(Composite parent) {
-        browser = new Browser(parent, SWT.NONE);
-        super.createPartControl(parent);
-    }
-
-    protected void modelChanged(IModel model) {
-        if (model instanceof ScapeWrapperModel) {
-            Scape scape = ((ScapeWrapperModel) model).getScape();
-            EclipseEscapeRunner runner = (EclipseEscapeRunner) scape.getRunner();
-            IPath path = new Path("res/" + scape.getClass().getName().replace('.', '/'));
-            path = path.removeLastSegments(1).append("About" + path.lastSegment()).addFileExtension("html");
-            final IFile file = runner.getExecutingProject().getFile(path);
-            browser.getDisplay().asyncExec(new Runnable() {
-                public void run() {
-                    if (file.exists()) {
-                        try {
-                            final URL url = file.getLocationURI().toURL();
-                            browser.setUrl(url.getFile());
-                            browser.setBackground(browser.getDisplay().getSystemColor(SWT.COLOR_WHITE));
-                        } catch (MalformedURLException e) {
-                            browser.setText("<b>[Bad URL:" + e + "]");
-                            browser.setBackground(browser.getDisplay().getSystemColor(SWT.COLOR_GRAY));
-                        }
-                    } else {
-                        browser.setBackground(browser.getDisplay().getSystemColor(SWT.COLOR_GRAY));
-                        browser.setText("<b>[Empty]");
-                    }
-                }
-            });
-        }
-    }
-
-    public void dispose() {
-        browser.dispose();
-        super.dispose();
-    }
+	/**
+	 * @param parent
+	 * @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
+	 */
+	public void createPartControl(Composite parent) {
+		browser = new Browser(parent, SWT.NONE);
+		super.createPartControl(parent);
+	}
+
+	protected void modelChanged(IModel model) {
+		if (model instanceof ScapeWrapperModel) {
+			Scape scape = ((ScapeWrapperModel) model).getScape();
+
+			String aboutFileName = "About" + scape.getClass().getSimpleName()
+					+ ".html";
+
+			// get a URL to the resource. aboutFileName does not contain a
+			// package name so this will prefixed by the scape's package
+			// eg: AboutCoordinationGame.html ->
+			// the class loader will search its class path for
+			// ede/model/brook/AboutCoordinationGame.html
+			final URL aboutURL = scape.getClass().getResource(aboutFileName);
+
+			browser.getDisplay().asyncExec(new Runnable() {
+				public void run() {
+					if (aboutURL != null) {
+						try {
+							// resolve bundleresource URLs to file URLs
+							final URL url = FileLocator.resolve(aboutURL);
+							browser.setUrl(url.toString());
+							browser.setBackground(browser.getDisplay()
+									.getSystemColor(SWT.COLOR_WHITE));
+						} catch (IOException e) {
+							browser.setText("<b>[Bad URL:" + e + "]");
+							browser.setBackground(browser.getDisplay()
+									.getSystemColor(SWT.COLOR_GRAY));
+						}
+					} else {
+						browser.setBackground(browser.getDisplay()
+								.getSystemColor(SWT.COLOR_GRAY));
+						browser.setText("<b>[Empty]");
+					}
+				}
+			});
+		}
+	}
+
+	public void dispose() {
+		browser.dispose();
+		super.dispose();
+	}
 }
Index: src/org/eclipse/amp/escape/ide/ProjectLoader.java
===================================================================
RCS file: /cvsroot/modeling/org.eclipse.amp/org.eclipse.amp.escape/plugins/org.eclipse.amp.escape.ide/src/org/eclipse/amp/escape/ide/ProjectLoader.java,v
retrieving revision 1.6
diff -u -r1.6 ProjectLoader.java
--- src/org/eclipse/amp/escape/ide/ProjectLoader.java	23 Jan 2010 04:23:27 -0000	1.6
+++ src/org/eclipse/amp/escape/ide/ProjectLoader.java	9 May 2011 01:56:41 -0000
@@ -16,6 +16,7 @@
 package org.eclipse.amp.escape.ide;
 
 import java.io.File;
+import java.net.MalformedURLException;
 import java.net.URL;
 import java.net.URLClassLoader;
 import java.util.ArrayList;
@@ -27,18 +28,23 @@
 import org.eclipse.jdt.core.JavaCore;
 import org.osgi.framework.Bundle;
 
-// TODO: Auto-generated Javadoc
 /**
- * Provides class loading for a project, with a fall back to the main class-loader for all other classes. Overriding a
- * specific class loader seems to be the only model that works. Decorator pattern does not find new classes.
+ * Provides class loading for a project, with a fall back to the main
+ * class-loader for all other classes. Overriding a specific class loader seems
+ * to be the only model that works. Decorator pattern does not find new classes.
+ * 
+ * Resources (such as the 'About this model' file displayed by {@link InfoView})
+ * can be placed in the same folder as their class, or in a placed in a "res"
+ * source folder in the model project directory in a parallel directory path to
+ * the Java class package. For example, an about file for a model defined by the
+ * scape "edu.brook.norms.Norms" could be placed at
+ * "res/edu/brook/norms/AboutNorms.html".
  * 
  * @author milesparker
  */
 public class ProjectLoader extends URLClassLoader {
 
-    IProject project;
-
-    public ClassLoader mainLoader;
+    private ClassLoader mainLoader;
 
     private Bundle bundle;
 
@@ -48,16 +54,25 @@
      * @param project the project
      * 
      * @throws LoaderCreationException the loader creation exception
+     * @throws MalformedURLException if can't get URL to project resource dir
      */
-    public ProjectLoader(IProject project) throws LoaderCreationException {
-        super(new URL[0]);
-        this.project = project;
+	public ProjectLoader(IProject project) throws LoaderCreationException,
+			MalformedURLException {
+		// add the project's res directory to this URL search path so
+		// getResource calls will look here
+		super(
+				new URL[] { new URL(project.getLocationURI().toString()
+						+ "/res/") });
+
         try {
-            project.open(null);
+        	// get the project's output locations, eg: bin dir
+        	// and add them to the search path
+        	project.open(null);
             IJavaProject javaProject = JavaCore.create(project);
             List<URL> outputURL = new ArrayList<URL>();
-            outputURL.add(new File(project.getLocation() + "/" + javaProject.getOutputLocation().removeFirstSegments(1)
-                                   + "/").toURI().toURL());
+			outputURL.add(new File(project.getLocation() + "/"
+					+ javaProject.getOutputLocation().removeFirstSegments(1)
+					+ "/").toURI().toURL());
             for (URL url : outputURL) {
                 addURL(url);
             }
@@ -72,31 +87,26 @@
      * 
      * @throws LoaderCreationException the loader creation exception
      */
-    public void activate() throws LoaderCreationException {
+    private void activate() throws LoaderCreationException {
         bundle = Platform.getBundle("org.eclipse.amp.escape.runtime");
         mainLoader = Thread.currentThread().getContextClassLoader();
         Thread.currentThread().setContextClassLoader(this);
     }
 
     /**
-     * Restore.
+     * Restore the thread's previous class loader.
      */
     public void restore() {
         Thread.currentThread().setContextClassLoader(mainLoader);
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see java.lang.ClassLoader#loadClass(java.lang.String)
-     */
-    /**
-     * 
-     * @see java.lang.ClassLoader#loadClass(java.lang.String)
-     */
     @Override
     public Class<?> loadClass(String name) throws ClassNotFoundException {
         try {
+        	// try using this loader, which has a search path
+        	// containing the project's output dirs
+        	// if it fails, load via the 
+        	// "org.eclipse.amp.escape.runtime" bundle 
             Class<?> loadClass = super.loadClass(name);
             return loadClass;
         } catch (NoClassDefFoundError classNotFoundException) {
@@ -109,7 +119,8 @@
             Class<?> loadClassI = bundle.loadClass(name);
             return loadClassI;
         } catch (UnsupportedClassVersionError classNotFoundException) {
-            throw new RuntimeException("Bad class: " + name, classNotFoundException);
+			throw new RuntimeException("Bad class: " + name,
+					classNotFoundException);
         } catch (Exception e) {
             throw new RuntimeException("Unexpected Exception for " + name, e);
         }
Comment 10 Oliver Mannion CLA 2011-05-08 22:01:44 EDT
To answer the legal questions:

Did you write the contribution yourself? Yes
Did you reference any 3rd party material? No
If yes, under what terms (license) did you receive this material? N/A
Are you authorized by your employer to make the contribution? Yes
Comment 11 Oliver Mannion CLA 2011-05-08 22:02:02 EDT
It's been some time but I've finally got back to this. So I'll just recap the changes again:

org.eclipse.amp.escape.command

ExecuteHandler - added comments
ResourceHandler - added comments
ExecuteJavaByClassNameHandler - a new ExecuteHandler that executes a scape via class name

org.eclipse.amp.escape.ide

EclipseEscapeRunner - the main open method has been reworked to create a scape instance by name using the current thread's context class loader. This will be a ProjectLoader if loading the scape from an Eclipse IProject, or a ContextFinder if loading the scape from a bundle. References to the IProject (which only exists when loading a scape from an Eclipse Project) have been removed and replaced with references to the IModel (which exist for both scapes in Eclipse IProjects and in bundles).

InfoView - uses getResource instead of relying on a project to load the about HTML file. This works for both models loaded from workspace projects and models run from bundles.

ProjectLoader - adds the add the project's res directory to the URL search path so getResource calls will look in the res dir

Plugin.xml - new org.eclipse.amp.escape.runtime.executeClassName command

MANIFEST.MF - removed some unrequired dependencies
Comment 12 Oliver Mannion CLA 2011-05-08 23:08:08 EDT
Hi Miles,

Do I still need to implement changes to avoid having to put in a new o.a.core plugin contribution ? Happy to do so if that is required.
Comment 13 Miles Parker CLA 2011-05-17 13:32:44 EDT
Hi Oliver,

I'm trying to get this in, thanks! We'll have to get you on as a committer. :) I've got to resolve some build issues before putting it in, and at same time we have to make sure that this gets into IP log for Indigo release. I'll update everyone on where we are as soon as possible.

Miles
Comment 14 Miles Parker CLA 2011-05-17 13:34:06 EDT
(In reply to comment #12)
> Hi Miles,
> 
> Do I still need to implement changes to avoid having to put in a new o.a.core
> plugin contribution ? Happy to do so if that is required.

Oh and yes on this. Unless we want to wait until after Indigo release, because we're way past deadline of when we can make changes to 3rd party contributions which is odd as it sounds what org.ascape is.
Comment 15 Miles Parker CLA 2011-05-17 16:08:49 EDT
Hi Oliver,

I couldn't apply patch. I'm not sure if I've done something wrong or if it just isn't possible to add new files using the patch mechanism. Perhaps you could attach those separately. But it looks like we need to org.ascape change moved out as well? I don't know if you have any hope of doing these before tmrw, but if not perhaps it is time to simply make you a contributor. Seriously, it wouldn't be hard and better IP wise at this point.

cheers,

Miles
Comment 16 Oliver Mannion CLA 2011-05-17 17:10:01 EDT
I'll work on this now.
Comment 17 Oliver Mannion CLA 2011-05-17 17:24:20 EDT
Created attachment 195912 [details]
Replaces previous ExecuteJavaByClassNameHandler

Includes previously mentioned changes PLUS now uses org.eclipse.amp.escape.ide Eclipse-BuddyPolicy, which is dependent, to load Scapes.
Comment 18 Miles Parker CLA 2011-05-17 18:36:33 EDT
Are you sure tis patch is against the latest AMP repos contents, i.e. ssh://mparker@git.eclipse.org/gitroot/amp/org.eclipse.amp.git ?
Comment 19 Oliver Mannion CLA 2011-05-17 18:40:39 EDT
(In reply to comment #18)
> Are you sure tis patch is against the latest AMP repos contents, i.e.
> ssh://mparker@git.eclipse.org/gitroot/amp/org.eclipse.amp.git ?

Ah it's not! It is against the CVS repo. Sorry I wasn't aware source had moved to git. I'll check that out and work on that.
Comment 20 Miles Parker CLA 2011-05-17 18:44:36 EDT
Sorry, hope this doesn't totally throw you for a loop. Jonas made some changes in the same area, so hopefully there won't be much to figure out how to merge. Here are the basics for setting up the build environment:

1. From Indigo Site, install: 

EGit, Git, SVN 

2. From http://download.eclipse.org/tools/buckminster/updates-3.7

Buckminster 
Buckminster SVN Support (Subversive) 

3. Grab amp from the git site. Important: *Do not actually import all of the projects.* 

4. Import only: releng/o.e.a.releng 

5. You need to set buckminster to use org.eclipse.amp.releng/releng/local.properties. The easiest way to do that is to modify the properties entries in the queries below. 
6. Open o.e.a.releng/releng/amp-platform.cquery and select "Resolve and Materialize" (or right-click and "Import.."
7. Open o.e.a.releng/releng/amp.cquery and select "Resolve and Materialize" (ditto)
Comment 21 Oliver Mannion CLA 2011-05-17 22:32:47 EDT
Thanks will give it a go. So the git repo is the primary repo? I think CVS is still be mentioned on http://eclipse.org/amp/developers/.
Comment 22 Oliver Mannion CLA 2011-05-17 22:46:45 EDT
Sorry Miles, in git how do I only import releng/o.e.a.releng  ?
Comment 23 Miles Parker CLA 2011-05-18 00:13:17 EDT
Yeah, sorry about the confusion!

(In reply to comment #22)
> Sorry Miles, in git how do I only import releng/o.e.a.releng  ?

So you go into the git repos perspective, navigate to the Working directory, find releng and import it from there.

Big but... I'm having a real issue with Buckminster right now. bug 346140 You might be better off ignoring the above and just importing all of the projects for now.
Comment 24 Oliver Mannion CLA 2011-05-18 17:51:35 EDT
Sorry Miles, I'm a bit confused. Just to confirm, I need to clone the entire git amp repo from git://git.eclipse.org/gitroot/amp/org.eclipse.amp.git/ to a local git repo, then import just releng/o.e.a.releng from my local repo into my Eclipse workscape and then do the buckminister stuff?
Comment 25 Miles Parker CLA 2011-05-18 20:20:44 EDT
(In reply to comment #24)
> Sorry Miles, I'm a bit confused. Just to confirm, I need to clone the entire
> git amp repo from git://git.eclipse.org/gitroot/amp/org.eclipse.amp.git/ to a
> local git repo, then import just releng/o.e.a.releng from my local repo into my
> Eclipse workscape and then do the buckminister stuff?

That's ok, it's more than a little confusing! No matter what you have to clone the whole repos. I was suggesting that you perhaps forego Buckminster and just import stuff manually because I have been having problems with Buckminster and EGit. But I remembered that you weren't needing to commit as you're creating a patch, So the steps outlined above *should* work...
Comment 26 Oliver Mannion CLA 2011-05-19 01:39:03 EDT
(In reply to comment #25)
> (In reply to comment #24)
> > Sorry Miles, I'm a bit confused. Just to confirm, I need to clone the entire
> > git amp repo from git://git.eclipse.org/gitroot/amp/org.eclipse.amp.git/ to a
> > local git repo, then import just releng/o.e.a.releng from my local repo into my
> > Eclipse workscape and then do the buckminister stuff?
> 
> That's ok, it's more than a little confusing! No matter what you have to clone
> the whole repos. I was suggesting that you perhaps forego Buckminster and just
> import stuff manually because I have been having problems with Buckminster and
> EGit. But I remembered that you weren't needing to commit as you're creating a
> patch, So the steps outlined above *should* work...

I've tried to install Buckminster on Indigo M7 but have troubles (see http://www.eclipse.org/forums/index.php/m/671780/#msg_671780)

Will try and make the patch anyway, although at this stage won't be able to test it.
Comment 27 Miles Parker CLA 2011-05-19 13:11:14 EDT
Hi Oliver,

That was one of the issues I was thinking about. But Indigo RC1 is out now so that should take care of that one. Don't worry if it doesn't quite work..I can patch it up. I'm not totally sure we'll be able to get it in for this release but at least it will be in the library.

I was serious about the committer status, btw. Think it over.

cheers,

Miles
Comment 28 Oliver Mannion CLA 2011-05-23 19:57:06 EDT
Created attachment 196389 [details]
0001-Fix-Bug-329645-Execute-bundled-models.patch

Patch for application to git master branch.

Please note, I haven't been able to test this myself. I haven't got Indigo & Buckminister setup yet. Are you able to test this out Miles?
Comment 29 Miles Parker CLA 2011-05-23 20:19:59 EDT
I will, and thanks for your patience while we go through the pain of transitioning to the new build system. If you want to see what my development life has been like lately... see here: bug 346140.
Comment 30 Miles Parker CLA 2011-05-23 21:33:31 EDT
Oliver, what would be the best way to ensure that it is working correctly? (Given that w/ class-loading issues we don't have unit test overage for all of this, but we'll be able to do that now!)
Comment 31 Oliver Mannion CLA 2011-05-24 01:12:17 EDT
Created attachment 196395 [details]
MyModel test model

(In reply to comment #30)
> Oliver, what would be the best way to ensure that it is working correctly?
> (Given that w/ class-loading issues we don't have unit test overage for all of
> this, but we'll be able to do that now!)

The first test would be a regression test, ie: running Escape and making sure a model in the project explorer runs.

The second test would be to create an Eclipse application containing a basic scape such as CoordinationGame. The application should execute the command "org.eclipse.amp.escape.runtime.executeClassName" with a scapeClassName parameter set to CoordinationGame. I attach such an example called MyModel to this issue. Note: this example was used with the older escape 0.8.
Comment 32 Miles Parker CLA 2011-05-24 20:59:24 EDT
I've applied and submitted this patch.
Comment 33 Miles Parker CLA 2011-05-25 00:51:07 EDT
Perhaps we need to close this to have it show up in IP log?
Comment 34 Wayne Beaton CLA 2011-05-25 16:49:16 EDT
Cleared the iplog+ flag on the bug. I don't believe that there is any ip in any of the comments on this bug, just in the attachment.
Comment 35 Miles Parker CLA 2011-05-25 18:11:57 EDT
That is correct. From the wiki I wasn't clear if both were necessary or not.
Comment 36 Miles Parker CLA 2011-05-27 20:29:31 EDT
Oliver, see http://eclipse.org/amp/developers/building.php  bug 347532 -- hopefully this will be a lot easier now. Send a note to amp-dev if you still have problems.