Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [p2-dev] Custom Touchpoint Action Craziness

The example I'm working on is a bit more comprehensive and also uses custom actions but ere's a quick and dirty example using an IUFragment to alter the root_files IU.

(See attached file: example.p2inf.rootfiles.zip)



Inactive hide details for Simon Kaegi---05/12/2009 11:37:14 PM---Mark,Simon Kaegi---05/12/2009 11:37:14 PM---Mark,


From:

Simon Kaegi/Ottawa/IBM@IBMCA

To:

P2 developer discussions <p2-dev@xxxxxxxxxxx>

Date:

05/12/2009 11:37 PM

Subject:

RE: [p2-dev] Custom Touchpoint Action Craziness




Mark,

I suspect the parse error is occurring because we're finding the "import" without any actions declared. The parse error is maybe over zealous however we are expecting to see action declarations to go along with the import so I think if you declare some actions you should be alright.

re (1) - log a bug. I think we want some feedback here
re (2) - I'm working on an example right now and will post something tomorrow.

In a nutshell we recognize a "unit" as an IUFragment if it has a hostRequirement, so the approach I'm suggesting is to:
1) create an IU with a hostRequirement on the {featureName}_root IU.
2) add the requirement for this IUFragment to the main p2.inf

One thing to keep in mind with using an IUFragment we will always unzip the artifact associated with the root IU so potentially tweak the "root" declaration in your feature's build.properties to unzip in a more appropriate folder.

-Simon

Inactive hide details for "Mark Melvin" ---05/12/2009 10:14:57 PM---Sorry guys - this reads worse than I intended and frankly i"Mark Melvin" ---05/12/2009 10:14:57 PM---Sorry guys - this reads worse than I intended and frankly it is a little confusing to parse. (Note to self: Don't send emails

From:

"Mark Melvin" <Mark.Melvin@xxxxxxxxxx>

To:

"P2 developer discussions" <p2-dev@xxxxxxxxxxx>

Date:

05/12/2009 10:14 PM

Subject:

RE: [p2-dev] Custom Touchpoint Action Craziness




Sorry guys - this reads worse than I intended and frankly it is a little confusing to parse.  (Note to self: Don't send emails when frustrated and on the way out the door to make an appointment).  Anyway, I'll debug it tomorrow since I have a stack trace to work from.  I feel better now after a stiff drink and a few hours away from it. ;)

I guess my main two points/qeustions are:

1) Shouldn't the export operation fail outright, rather than silently log an exception and generate default metadata?
2) Simon mentioned I am re-declaring all of my metadata (which is true) rather than using IUFragments in another email thread.  Is there something fundamental I am missing?  If there is a way to do this by somehow declaring small fragments of metadata rather than re-declaring everything, I'd love to hear about it.

Thanks again,
Mark.

________________________________

From: p2-dev-bounces@xxxxxxxxxxx on behalf of Mark Melvin
Sent: Tue 12/05/2009 5:56 PM
To: P2 developer discussions
Subject: [p2-dev] Custom Touchpoint Action Craziness



Hello Again,

I am trying to contribute a custom touchpoint action, and then require
and use it from a p2.inf file.  I can't seem to make the metadata
generator behave unless I declare things a certain way and it makes no
sense.  Perhaps answers to some fundamental questions will ease my
suffering...

First of all, when I declare a custom touchpoint action via an extension
point, what do I fill in for "touchpointType" and "touchpointVersion"?
It seems if I do not specify "org.eclipse.equinox.p2.native", I can't
really do much with it later (we'll get to that).  And why are these
fields optional?

Second, it has been brought up before, but it seems that if I want to
override the root files IU for a simple root files feature, I must
re-declare everything from scratch.  I also have found that if one tiny
thing is off, all of the metadata reverts back to the default values
making it next to impossible to figure out what the hell is going on.
For instance, let's say I have this:


properties.0.name=org.eclipse.equinox.p2.type.group
properties.0.value=false
requires.0.namespace=org.eclipse.equinox.p2.iu
requires.0.name=my.feature.name_root
requires.0.range=$version$
requires.0.greedy=true
requires.0.optional=false
requires.0.multiple=false
units.0.id=my.feature.name_root
units.0.version=$version$
units.0.singleton=true
units.0.provides.0.name=my.feature.name_root
units.0.provides.0.namespace=org.eclipse.equinox.p2.iu
units.0.provides.0.version=$version$
units.0.artifacts.0.classifier=binary
units.0.artifacts.0.id=my.feature.name_root
units.0.artifacts.0.version=$version$
units.0.touchpoint.id=org.eclipse.equinox.p2.native
units.0.touchpoint.version=1.0.0
units.0.instructions.install=helloworld();
units.0.instructions.uninstall=helloworld();

This particular construct allows me to simply override the default
install/uninstall action for my root files IU.  If I simply add one more
line to import my custom action and essentially hook it up like so:

units.0.instructions.configure.import=my.custom.feature.helloworld

Then I re-export, and my metadata looks entirely different.  It has
reverted back to being a group, the actions are defaulted back to
"unzip(source:@artifact, target:${installFolder});" and
"cleanupzip(source:@artifact, target:${installFolder});", and other
things are different as well.

Actually, further investigation shows that there is an error in my log
file indicating the following:

An error occured while parsing advice file:
basePath=C:/Temp/workspaces/test3.5sk/my.feature.name,
adviceFilePath=p2.inf.
java.lang.IllegalStateException: bad token:
units.0.instructions.configure.import
at
org.eclipse.equinox.p2.publisher.eclipse.AdviceFileParser.parseInstructi
ons(AdviceFileParser.java:240)
at
org.eclipse.equinox.p2.publisher.eclipse.AdviceFileParser.parseUnit(Advi
ceFileParser.java:353)
.
.


So I'm not sure what it is choking on, but shouldn't this cause the PDE
export operation to fail, instead of silently producing completely
different (default) metadata?  I've been fighting this for an hour and
still don't know what I am doing wrong.

Any hints on what the import statement is choking on?  I know I have
made this work before with Simon's metarequires sample and my .inf file
looks no different (apart from the names).

Thanks,
Mark.
_______________________________________________
p2-dev mailing list
p2-dev@xxxxxxxxxxx

https://dev.eclipse.org/mailman/listinfo/p2-dev


[attachment "winmail.dat" deleted by Simon Kaegi/Ottawa/IBM] _______________________________________________
p2-dev mailing list
p2-dev@xxxxxxxxxxx

https://dev.eclipse.org/mailman/listinfo/p2-dev

_______________________________________________
p2-dev mailing list
p2-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/p2-dev


GIF image

GIF image

GIF image

GIF image

Attachment: example.p2inf.rootfiles.zip
Description: Zip archive


Back to the top