[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tycho-dev] Invoke maven project extension before TychoMavenLifecycleParticipant - patch question

Just one additional remark: Tycho does not (yet) have any Java API. You are of course free to “mess” with the internals of Tycho, but we may need to change things which would mean that you’d have to adapt your extension for new Tycho versions. Can you live with this?

 

Regards

Tobias

 

 

From: tycho-dev-bounces@xxxxxxxxxxx [mailto:tycho-dev-bounces@xxxxxxxxxxx] On Behalf Of Oberlies, Tobias
Sent: Donnerstag, 8. März 2012 14:10
To: Tycho developers list
Subject: Re: [tycho-dev] Invoke maven project extension before TychoMavenLifecycleParticipant - patch question

 

I agree that extensibility is a weak point in Tycho. If the proposed change really helps you, I’d be willing to accept a patch. The contributor guide [1] should answer the practical questions how we can accept patches.

 

Regards

Tobias

 

 

[1] http://wiki.eclipse.org/Tycho/Contributor_Guide

 

 

From: tycho-dev-bounces@xxxxxxxxxxx [mailto:tycho-dev-bounces@xxxxxxxxxxx] On Behalf Of Tom Bujok
Sent: Mittwoch, 7. März 2012 11:28
To: Tycho developers list
Subject: Re: [tycho-dev] Invoke maven project extension before TychoMavenLifecycleParticipant - patch question

 

Hi Jeff,

 

I am aware of that, but my main goal was to be able to execute logic before and after tycho - the order was not that important.

But it is a good hint - we may also think of using something else than lookuplist…

 

Tom

 

 

On Mar 7, 2012, at 11:00 AM, Jeff MAURY wrote:

 

Please not that the use of Plexus for discovery does not guarantee an order of execution following the declaration in the POM.

Regards
Jeff
 

On Wed, Mar 7, 2012 at 8:36 AM, Tom Bujok <tom.bujok@xxxxxxxxx> wrote:

Hi guys,

In this thread I described why it is impossible to invoke any processing logic before TychoMavenLifecycleParticipant:
http://dev.eclipse.org/mhonarc/lists/tycho-user/msg02103.html
It is also connected to this problem: http://www.mail-archive.com/users@xxxxxxxxxxxxxxxx/msg123753.html

Such limitation breaks the maven processing principle - since normally the order of plugins' in the pom.xml file defines in which order they are executed. Right now with tycho - there is now way to invoke anything before the tycho project setup finishes.  In order to add some more flexibility to a tycho build I think it would be perfect if there was some kind of a callback mechanism included in the TychoMavenLifecycleParticipant.

let's say that we could have such interface:

public interface TychoLifecycleParticipant {

       void beforeProjectSetup(MavenSession session);
       void afterProjectSetup(MavenSession session);

}

and then in the TychoMavenLifecycleParticipant we could add:

public class TychoMavenLifecycleParticipant extends AbstractMavenLifecycleParticipant {
   @Override
   public void afterProjectsRead(MavenSession session) throws MavenExecutionException {
       Collection<TychoLifecycleParticipant> tychoParticipants = plexus.lookupList(TychoMavenLifecycleParticipant.class);

       for (TychoLifecycleParticipant p : tychoParticipants) {
               p. beforeProjectSetup(session);
        }

       (…)

       for (TychoLifecycleParticipant p : tychoParticipants) {
               p. afterProjectSetup(session);
        }
   }
}


Do you agree with that and would you accept such patch?

Cheers,
Tom Bujok
_______________________________________________
tycho-dev mailing list
tycho-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/tycho-dev




--
Jeff MAURY

"Legacy code" often differs from its suggested alternative by actually working and scaling.
 - Bjarne Stroustrup

http://www.jeffmaury.com
http://riadiscuss.jeffmaury.com
http://www.twitter.com/jeffmaury
_______________________________________________
tycho-dev mailing list
tycho-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/tycho-dev