DESCRIPTION

RPMStubby: eclipse template uses tycho if possible

RPMStubby will find the parent pom within the project if
it exists, and build using tycho and using the pom.xml;
otherwise, RPMStubby will use the feature.xml file as before.

Change-Id: I0b50fa6fa80a04e0fbbd5ef4f5e6869499f00d9b
Signed-off-by: Tori Trevino xxx@xxx.xxx


COMMENTS

author: Tori Trevino
date: 2013-08-27 15:09:46.000000000

Uploaded patch set 2.

-------------------------------------
author: Brenden Conley
date: 2013-08-27 15:21:43.000000000

Patch Set 2:

Build Started https://hudson.eclipse.org/sandbox/job/linuxtools/3285/

-------------------------------------
author: Brenden Conley
date: 2013-08-27 15:51:48.000000000

Patch Set 2: Verified+1

Build Successful 

https://hudson.eclipse.org/sandbox/job/linuxtools/3285/ : SUCCESS

-------------------------------------
author: Nathanael Holden
date: 2013-08-30 15:48:53.000000000

Patch Set 2: Verified-1

(1 comment)

I see the following when attempting to stub a file by selecting a feature.xml within an eclipse feature project :

org.eclipse.e4.core.di.InjectionException: java.lang.IllegalArgumentException: Path must include project and resource name: /pom.xml
	at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:63)
	at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:231)
	at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:212)
	at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:131)
	at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:171)
	at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem.executeItem(HandledContributionItem.java:831)
	at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem.handleWidgetSelection(HandledContributionItem.java:724)
	at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem.access$7(HandledContributionItem.java:708)
	at org.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem$4.handleEvent(HandledContributionItem.java:647)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1276)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3562)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3186)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1053)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:942)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:86)
	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:588)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:543)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
	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:353)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:638)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:593)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1447)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1423)
Caused by: java.lang.IllegalArgumentException: Path must include project and resource name: /pom.xml
	at org.eclipse.core.runtime.Assert.isLegal(Assert.java:63)
	at org.eclipse.core.internal.resources.Workspace.newResource(Workspace.java:2169)
	at org.eclipse.core.internal.resources.Container.getFile(Container.java:208)
	at org.eclipse.linuxtools.rpmstubby.RPMStubbyUtils.findPom(RPMStubbyUtils.java:65)
	at org.eclipse.linuxtools.rpmstubby.RPMStubbyUtils.findPom(RPMStubbyUtils.java:72)
	at org.eclipse.linuxtools.internal.rpmstubby.StubbyGenerator.<init>(StubbyGenerator.java:52)
	at org.eclipse.linuxtools.rpmstubby.Generator.generate(Generator.java:49)
	at org.eclipse.linuxtools.internal.rpmstubby.popup.actions.StubifyHandler.execute(StubifyHandler.java:46)
	at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:290)
	at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:76)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:56)
	... 34 more

Line:72, rpmstubby/org.eclipse.linuxtools.rpmstubby/src/org/eclipse/linuxtools/rpmstubby/RPMStubbyUtils.java -> I'm not sure if container.getParent() is correct here since it won't give you the filesystem parent, but just the parent in the Eclipse model.

For eg :

I had a feature project whose parent folder contained a pom.xml but using IResource#getParent() from the feature project gave the workspace root.

-------------------------------------
