Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Oomph » How to execute Target Definition Generator?
How to execute Target Definition Generator? [message #1443363] Sun, 12 October 2014 16:17 Go to next message
Abel Hegedus is currently offline Abel HegedusFriend
Messages: 197
Registered: September 2015
Senior Member
I read several times that you can generate the .target files from Targlet setup tasks in Oomph.

I also looked at the oomph.setup model and copied the annotation to my model.

I looked at the source code and found the TargetDefinitionGenerator class, and see that it _should_ be called on workspace updates.

However, I cannot get the generation to happen (tried changing the setup model, performing setup tasks manually, etc.). Since the generation is implemented as a listener, I guess there is no button or something to trigger it explicitly.

How do I get it to generate?

Thanks!
Re: How to execute Target Definition Generator? [message #1443368 is a reply to message #1443363] Sun, 12 October 2014 16:26 Go to previous messageGo to next message
Abel Hegedus is currently offline Abel HegedusFriend
Messages: 197
Registered: September 2015
Senior Member
Okay, I should have looked a bit more. There are some error messages in the log:

java.io.FileNotFoundException: <location> (The system cannot find the path specified)
	at java.io.FileInputStream.open(Native Method)
	at java.io.FileInputStream.<init>(Unknown Source)
	at org.eclipse.oomph.targlets.internal.core.listeners.FileUpdater.getContents(FileUpdater.java:103)
	at org.eclipse.oomph.targlets.internal.core.listeners.FileUpdater.update(FileUpdater.java:47)
	at org.eclipse.oomph.targlets.internal.core.listeners.TargetDefinitionGenerator.generateTargetDefinition(TargetDefinitionGenerator.java:205)
	at org.eclipse.oomph.targlets.internal.core.listeners.TargetDefinitionGenerator.handleTargletContainerEvent(TargetDefinitionGenerator.java:112)
	at org.eclipse.oomph.targlets.internal.core.listeners.WorkspaceUpdateListener.handleTargletContainerEvent(WorkspaceUpdateListener.java:53)


The location is from a Targlet that has been changed and renamed since it was added to the Modular Target Platform.

What is the best way to clean up the Modular Target Platform, deleting it from the Preferences view and performing the setup tasks?
Re: How to execute Target Definition Generator? [message #1443373 is a reply to message #1443368] Sun, 12 October 2014 16:37 Go to previous messageGo to next message
Abel Hegedus is currently offline Abel HegedusFriend
Messages: 197
Registered: September 2015
Senior Member
Okay, after cleaning the Modular Target Platform and performing the setup tasks, the generator listener is invoked.

For anyone having similar issues: the listeners log to the setup windows, so you have to see something like this:
[18:29:31] Notifying listeners of targlet container Oomph
[18:29:32] Updating <location>.target


If you don't, there maybe some errors preventing the listener to be called.

Perfect example of a rubber duck problem Smile
Re: How to execute Target Definition Generator? [message #1450188 is a reply to message #1443373] Wed, 22 October 2014 07:23 Go to previous messageGo to next message
Joachim Engelhardt is currently offline Joachim EngelhardtFriend
Messages: 53
Registered: September 2013
Member

Hello,

I tried also to generate a .target file as task, but my location seems to be ignored. During the targlet job, the target generator listener is invoked, but my .target file is updated in my user's temporary folder (Updating ...\AppData\Local\Temp\tmp-498949906943849911.target)

The given location for the target generator in my .setup is ${workspace.location}/myProjectName/myTargetFileName.target

What I'm doing wrong here?
Re: How to execute Target Definition Generator? [message #1450226 is a reply to message #1450188] Wed, 22 October 2014 08:14 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33258
Registered: July 2009
Senior Member
Joachim,

Is your file physically located in the workspace? If your source code
is in git, it's more likely that it's physically located in the clone
folder, as is the case for Oomph itself:

${git.clone.oomph.location/releng/org.eclipse.oomph.releng/org.eclipse.oomph.releng.target}

On 22/10/2014 9:23 AM, Joachim Engelhardt wrote:
> Hello,
>
> I tried also to generate a .target file as task, but my location seems
> to be ignored. During the targlet job, the target generator listener
> is invoked, but my .target file is updated in my user's temporary
> folder (Updating ...\AppData\Local\Temp\tmp-498949906943849911.target)
>
> The given location for the target generator in my .setup is
> ${workspace.location}/myProjectName/myTargetFileName.target
>
> What I'm doing wrong here?


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: How to execute Target Definition Generator? [message #1450245 is a reply to message #1450226] Wed, 22 October 2014 08:35 Go to previous messageGo to next message
Joachim Engelhardt is currently offline Joachim EngelhardtFriend
Messages: 53
Registered: September 2013
Member

Hi Ed,

unfortunately, we are using SVN. So I tried the same trick of you as for the source locator and used the path to the workspace where the sources are checked out.
Is this not possible in this case?
Re: How to execute Target Definition Generator? [message #1450273 is a reply to message #1450245] Wed, 22 October 2014 09:06 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33258
Registered: July 2009
Senior Member
Joachim,

It should work if that's really where the file is. I see this code:

String location = details.get(ANNOTATION_LOCATION);
if (StringUtil.isEmpty(location))
{
location = File.createTempFile("tmp-",
".target").getAbsolutePath();
TargletsCorePlugin.INSTANCE.log("Generating target definition
for targlet " + targlet.getName() + " to " + location);
}

this suggests to me that you've not specified the location for your
annotation.

<?xml version="1.0" encoding="UTF-8"?>
<base:Annotation
xmi:version="2.0"
xmlns:xmi="http://www.omg.org/XMI"
xmlns:base="http://www.eclipse.org/oomph/base/1.0"
source="http:/www.eclipse.org/oomph/targlets/TargetDefinitionGenerator">
<detail key="location">
<value>${git.clone.oomph.location/releng/org.eclipse.oomph.releng/org.eclipse.oomph.releng.target}</value>
</detail>
<detail key="includeAllPlatforms">
<value>false</value>
</detail>
<detail key="includeSource">
<value>false</value>
</detail>
</base:Annotation>


On 22/10/2014 10:35 AM, Joachim Engelhardt wrote:
> Hi Ed,
>
> unfortunately, we are using SVN. So I tried the same trick of you as
> for the source locator and used the path to the workspace where the
> sources are checked out.
> Is this not possible in this case?


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: How to execute Target Definition Generator? [message #1451839 is a reply to message #1450273] Fri, 24 October 2014 11:13 Go to previous messageGo to next message
Joachim Engelhardt is currently offline Joachim EngelhardtFriend
Messages: 53
Registered: September 2013
Member

Thank you for the XML-Snippet.
In the setup editor I choosed the wrong child element for the details entry. It was of type content instead of detail. The icon is the same and so I mixed them up.
Now it works like a charm Smile
Re: How to execute Target Definition Generator? [message #1451852 is a reply to message #1451839] Fri, 24 October 2014 11:36 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33258
Registered: July 2009
Senior Member
Joachim,

A little known fact is that we've added all kinds of cool drag and drop
support that augments EMF's more basic drag and drop support. A copy
action and a drag-and-drop process puts all kinds of formats on the
system clipboard, including the XMI serialization of the object. So
it's quite easy to drag an object and drop it into an email, and in the
opposite direction too...

On 24/10/2014 1:13 PM, Joachim Engelhardt wrote:
> Thank you for the XML-Snippet.
> In the setup editor I choosed the wrong child element for the details
> entry. It was of type content instead of detail. The icon is the same
> and so I mixed them up.
> Now it works like a charm :)


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: How to execute Target Definition Generator? [message #1452027 is a reply to message #1451839] Fri, 24 October 2014 17:31 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6692
Registered: July 2009
Senior Member
Hi Joachim,

Please note that there's a nasty bug in the TargetDefinitionGenerator. If you compose your TargletContainer of multiple
Targlets the content of the generated .target file will reflect the resolved contents of the entire TargletContainer,
not just the annotated Targlet. But apparently that didn't hit you ;-)

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper



Am 24.10.2014 um 13:13 schrieb Joachim Engelhardt:
> Thank you for the XML-Snippet.
> In the setup editor I choosed the wrong child element for the details entry. It was of type content instead of detail.
> The icon is the same and so I mixed them up.
> Now it works like a charm :)


Re: How to execute Target Definition Generator? [message #1454281 is a reply to message #1452027] Tue, 28 October 2014 07:22 Go to previous messageGo to next message
Joachim Engelhardt is currently offline Joachim EngelhardtFriend
Messages: 53
Registered: September 2013
Member

Hi Eike,

in my case this is even what I want to have Smile
But nevertheless, thank you for the hint that this is a bug and not a feature.

Regards
Joachim
Re: How to execute Target Definition Generator? [message #1604145 is a reply to message #1454281] Fri, 06 February 2015 17:13 Go to previous message
Dave Hartnoll is currently offline Dave HartnollFriend
Messages: 6
Registered: January 2015
Junior Member
I would like to have this "feature" too, but I guess the "bug" is fixed now because my generated .target only reflects the resolved contents of the single TargletContainer with the annotation. Is there any supported way to get the .target to be composed from multiple Targlets? (I tried putting the same annotation on all Targlets but I still got only one Targlet reflected.)

Dave.
Previous Topic:Variables showing multiple times during setup
Next Topic:Error on psf import with SVN projects
Goto Forum:
  


Current Time: Mon Dec 09 09:25:36 GMT 2024

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

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

Back to the top