Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Oomph » Create a new Setup Task: can see it in model but task is not triggered during installation process
Create a new Setup Task: can see it in model but task is not triggered during installation process [message #1703399] Fri, 31 July 2015 09:49 Go to next message
Aurélien Pupier is currently offline Aurélien PupierFriend
Messages: 637
Registered: July 2009
Location: Grenoble, FRANCE
Senior Member

Hi,

I'm trying to implement my own Setup Task (git repo here https://github.com/apupier/eclipse-oomph-smart-importer)

I managed to have it available in *.setup file

When I launch the installer the task is not triggered, I don't see neither listed in Eclipse Updater dialog (Help -> Perform Setup task and "show all triggered tasks" checked)

I return always true for isNeeded method.

I double-checked that I added the plugin in the launch configuration.

Do you have any ideas why my own task might not be available? What other things can I check? Where should I put a breakpoint?

Regards,



Aurélien Pupier - Red Hat
Senior Software Engineer in Fuse Tooling team
Re: Create a new Setup Task: can see it in model but task is not triggered during installation proce [message #1703439 is a reply to message #1703399] Fri, 31 July 2015 14:46 Go to previous messageGo to next message
Aurélien Pupier is currently offline Aurélien PupierFriend
Messages: 637
Registered: July 2009
Location: Grenoble, FRANCE
Senior Member

Hi,

I found a way to have it working. I put the Task feature and its dependencies in my *.setup file too.
Seems to be quite a w;orkaround.
Is there a way to include the Task feature added to the Installer directly in the built Eclipse environment (as it is the case with provided ones)?

Regards,


Aurélien Pupier - Red Hat
Senior Software Engineer in Fuse Tooling team
Re: Create a new Setup Task: can see it in model but task is not triggered during installation proce [message #1703497 is a reply to message #1703439] Sat, 01 August 2015 12:46 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33258
Registered: July 2009
Senior Member
Aurelien,

Note that you can use enablement annotations:

<?xml version="1.0" encoding="UTF-8"?>
<ecore:EAnnotation
xmi:version="2.0"
xmlns:xmi="http://www.omg.org/XMI"
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
source="http://www.eclipse.org/oomph/setup/Enablement">
<details key="variableName"
value="setup.projectset.p2"/>
<details key="repository"
value="${oomph.update.url}"/>
<details key="installableUnits"
value="org.eclipse.oomph.setup.projectset.feature.group"/>
</ecore:EAnnotation>

So here you specify a variable and it's value (which in this case is a
variable reference but could be just a p2 URI), and you specify a space
separate list of installable units to be installed from that update
site. Whenever your task is actually needed in an installation, the
necessary prerequisite implementations will be installed so that the
task can actually run.

Be sure to look at some of the other models in Oomph. In particular too
at how they publish a dynamic instance (schemaLocation) of the model at
a known URI. And make use of the GenPackage property for the Publication
Location. This allows your model to be used in the installing without
the implementation needing to be available in the installer itself...
(Of course that's only sufficient for tasks that don't need to perform
at Bootstrap time.)


On 31/07/2015 4:46 PM, Aurelien Pupier wrote:
> Hi,
>
> I found a way to have it working. I put the Task feature and its
> dependencies in my *.setup file too.
> Seems to be quite a w;orkaround.
> Is there a way to include the Task feature added to the Installer
> directly in the built Eclipse environment (as it is the case with
> provided ones)?
>
> Regards,


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Create a new Setup Task: can see it in model but task is not triggered during installation proce [message #1704079 is a reply to message #1703497] Fri, 07 August 2015 08:25 Go to previous messageGo to next message
Aurélien Pupier is currently offline Aurélien PupierFriend
Messages: 637
Registered: July 2009
Location: Grenoble, FRANCE
Senior Member

Hi Ed,

thanks for these information.

it seems that we can't put several Enablement annotations. When I reload the genmodel, only the first Enablement is kept, the other ones are removed.

In fact my use case is that I have several installableUnits but that are hosted on 3 differents Update site. it seems that the enablement supports a single repository.

Should I create a composite update site? or would it better to implement support of several repositories? Would it be easy?

regards,


Aurélien Pupier - Red Hat
Senior Software Engineer in Fuse Tooling team
Re: Create a new Setup Task: can see it in model but task is not triggered during installation proce [message #1704101 is a reply to message #1704079] Fri, 07 August 2015 10:21 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33258
Registered: July 2009
Senior Member
Aurelien,

These are EAnnotations on the Ecore model. The reloading of the
GenModel shouldn't remove them from your Ecore model. And this logic in
org.eclipse.oomph.setup.internal.core.SetupTaskPerformer.createEnablementTasks(EModelElement,
boolean) should iterate and use all of the enablement annotations:

public static EList<SetupTask> createEnablementTasks(EModelElement
eModelElement, boolean withVariables)
{
EList<SetupTask> enablementTasks = null;

for (EAnnotation eAnnotation : eModelElement.getEAnnotations())
{
String source = eAnnotation.getSource();
if (EAnnotationConstants.ANNOTATION_ENABLEMENT.equals(source))
{
if (enablementTasks == null)
{
enablementTasks = new BasicEList<SetupTask>();
}

So I'm not sure the source of the problem...


On 07/08/2015 10:25 AM, Aurelien Pupier wrote:
> Hi Ed,
>
> thanks for these information.
>
> it seems that we can't put several Enablement annotations. When I
> reload the genmodel, only the first Enablement is kept, the other ones
> are removed.
>
> In fact my use case is that I have several installableUnits but that
> are hosted on 3 differents Update site. it seems that the enablement
> supports a single repository.
>
> Should I create a composite update site? or would it better to
> implement support of several repositories? Would it be easy?
>
> regards,
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Create a new Setup Task: can see it in model but task is not triggered during installation proce [message #1704140 is a reply to message #1704101] Fri, 07 August 2015 15:32 Go to previous messageGo to next message
Aurélien Pupier is currently offline Aurélien PupierFriend
Messages: 637
Registered: July 2009
Location: Grenoble, FRANCE
Senior Member

Hi Ed,

thanks for your answer.

I found under which circumstances the Enablement annotations were removed. It is because I had two ecore file for the same model. Now why, I have these two files for the same model? it is because the genmodel was generating an ecore file which was different from the one it is based on. It seems to be the "Public Location" attribute.
I tried to put to the same value and the generation was failing, it said that "The package ... has the same namespace URI .. as package ..". I wasn't able able to get rid of this error. SO I recreated the model from scratch and regenrate the genmodel and it works... almost.
A part of the generation is not the same. Some specific parts to Oomph is generated.
for instance this kind of code
   <extension
         point="org.eclipse.emf.edit.childCreationExtenders">
      <extender
            class="org.eclipse.oomph.smart.importer.provider.ImporterItemProviderAdapterFactory$BaseChildCreationExtender"
            uri="http://www.eclipse.org/oomph/base/1.0">
      </extender>
      <extender
            class="org.eclipse.oomph.smart.importer.provider.ImporterItemProviderAdapterFactory$SetupChildCreationExtender"
            uri="http://www.eclipse.org/oomph/setup/1.0">
      </extender>
   </extension>


I didn't find why by comparing to others ecore and genmodel. How can I activate the correct generation?

Regards,


Aurélien Pupier - Red Hat
Senior Software Engineer in Fuse Tooling team
Re: Create a new Setup Task: can see it in model but task is not triggered during installation proce [message #1704144 is a reply to message #1704140] Fri, 07 August 2015 15:55 Go to previous message
Aurélien Pupier is currently offline Aurélien PupierFriend
Messages: 637
Registered: July 2009
Location: Grenoble, FRANCE
Senior Member

wouch
This not specific to Oomph, I just found the attribute "Child Creation Extenders" in genmodel and set it to true.
Going further... even if not working yet


Aurélien Pupier - Red Hat
Senior Software Engineer in Fuse Tooling team
Previous Topic:Create launcher shortcut
Next Topic:Custom product launcher name
Goto Forum:
  


Current Time: Sun Dec 08 03:51:36 GMT 2024

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

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

Back to the top