You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Milos Kleint <mk...@gmail.com> on 2007/11/06 13:00:30 UTC

Toolchains proposal

Hello,

I've got a working prototype of the toolchains proposal. I'm able to define
the jdk toolchains and have them used in a project. Works with patched
compiler, surefire, javadoc plugins.
details are at http://docs.codehaus.org/display/MAVEN/Toolchains

issues for resolution:
1. currently using build-context, I heard stories about it going away.
2. due to 1. only works in 2.1, need to make sure it works in 2.0.x as well.
3. docs largely missing
4. should have at least one other implementation of the toolchain, next to
jdk to make the api more stable..
5. more?

comments welcome.

Milos

Re: Toolchains proposal

Posted by Shane Isbell <sh...@gmail.com>.
Cool. If it's not tied to 2.1, then I'll get out an implementation for .NET
soon.

Thanks,
Shane

On Dec 17, 2007 2:26 PM, Milos Kleint <mk...@gmail.com> wrote:

> I've reworked the toolchain stuff to work without the build-context
> component that was removed in the trunk. As a side-effect it became easier
> to backport to 2.0.x. it should work in current 2.1-SNAPSHOT and
> 2.0.9-SNAPSHOT binaries. the shared/toolchains project artifacts with
> components needs to be manually put into the M2-HOME/lib folder.
>
> I consider the current version stable myself, I've rewritten 3 plugins so
> far to use the toolchains (all java/jdk related) and it seems to work fine
> and is reasonably simple.
> What is currently necessary is to get some peer review on the current
> api/implementation. Writing additional toolchain implementation is indeed
> a
> good way to review the code.
> Eventually I'd like to move the shared/toolchains project into components/
> and make it part of the maven's core as it's not going to work otherwise.
>
> Milos
>
>
> On Dec 17, 2007 10:44 PM, Shane Isbell <sh...@gmail.com> wrote:
>
> > Where are we sitting on the toolchain support? At NMaven, we're going
> back
> > to basics to get better alignment and integration with the rest of
> Maven.
> > Toolchain support ranks highly.  I see some interfaces and Java support
> > within the toolchain project, but I don't know how complete this is. If
> > the
> > interfaces are stable, I can work on getting a dotnet implementation.
> >
> > Thanks,
> > Shane
> >
> > On Nov 10, 2007 4:10 AM, Jörg Schaible <jo...@gmx.de> wrote:
> >
> > > Milos Kleint wrote:
> > >
> > > > On Nov 6, 2007 4:35 PM, Jason van Zyl <ja...@maven.org> wrote:
> > > >
> > > >>
> > > >> On 6 Nov 07, at 4:00 AM 6 Nov 07, Milos Kleint wrote:
> > > >>
> > > >> > Hello,
> > > >> >
> > > >> > I've got a working prototype of the toolchains proposal. I'm able
> > to
> > > >> > define
> > > >> > the jdk toolchains and have them used in a project. Works with
> > > patched
> > > >> > compiler, surefire, javadoc plugins.
> > > >> > details are at http://docs.codehaus.org/display/MAVEN/Toolchains
> > > >> >
> > > >> > issues for resolution:
> > > >> > 1. currently using build-context, I heard stories about it going
> > > away.
> > > >>
> > > >> My only concern with the build-context, and John can counters as he
> > > >> deems fit, but it's hard to tell where through the core of Maven
> the
> > > >> context actually pops out. You still need to inspect the session,
> but
> > > >> the session would be the one place that you could look to see what
> is
> > > >> changing as it passes through the core. The rub right now is that
> > many
> > > >> components internally are not setup to use a session. That's my
> > > >> opinion: that the session passing through the core could just as
> > > >> easily serve as a build context it's just architecturally the
> context
> > > >> is easier to wormhole through the code.
> > > >
> > > >
> > > > Possibly true. In order to move the toolchains code to session, we
> > would
> > > > need a way to serialize/deserialize Objects. The actual live
> instances
> > > > cannot be used due to plugun classloading.
> > >
> > > Just a suggestion: You might give XStream with the binary driver a
> try.
> > > Not
> > > as bloated as XML and your classes do not have to implement
> > Serializable.
> > >
> > > - Jörg
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > > For additional commands, e-mail: dev-help@maven.apache.org
> > >
> > >
> >
>

Re: Toolchains proposal

Posted by Milos Kleint <mk...@gmail.com>.
I've reworked the toolchain stuff to work without the build-context
component that was removed in the trunk. As a side-effect it became easier
to backport to 2.0.x. it should work in current 2.1-SNAPSHOT and
2.0.9-SNAPSHOT binaries. the shared/toolchains project artifacts with
components needs to be manually put into the M2-HOME/lib folder.

I consider the current version stable myself, I've rewritten 3 plugins so
far to use the toolchains (all java/jdk related) and it seems to work fine
and is reasonably simple.
What is currently necessary is to get some peer review on the current
api/implementation. Writing additional toolchain implementation is indeed a
good way to review the code.
Eventually I'd like to move the shared/toolchains project into components/
and make it part of the maven's core as it's not going to work otherwise.

Milos


On Dec 17, 2007 10:44 PM, Shane Isbell <sh...@gmail.com> wrote:

> Where are we sitting on the toolchain support? At NMaven, we're going back
> to basics to get better alignment and integration with the rest of Maven.
> Toolchain support ranks highly.  I see some interfaces and Java support
> within the toolchain project, but I don't know how complete this is. If
> the
> interfaces are stable, I can work on getting a dotnet implementation.
>
> Thanks,
> Shane
>
> On Nov 10, 2007 4:10 AM, Jörg Schaible <jo...@gmx.de> wrote:
>
> > Milos Kleint wrote:
> >
> > > On Nov 6, 2007 4:35 PM, Jason van Zyl <ja...@maven.org> wrote:
> > >
> > >>
> > >> On 6 Nov 07, at 4:00 AM 6 Nov 07, Milos Kleint wrote:
> > >>
> > >> > Hello,
> > >> >
> > >> > I've got a working prototype of the toolchains proposal. I'm able
> to
> > >> > define
> > >> > the jdk toolchains and have them used in a project. Works with
> > patched
> > >> > compiler, surefire, javadoc plugins.
> > >> > details are at http://docs.codehaus.org/display/MAVEN/Toolchains
> > >> >
> > >> > issues for resolution:
> > >> > 1. currently using build-context, I heard stories about it going
> > away.
> > >>
> > >> My only concern with the build-context, and John can counters as he
> > >> deems fit, but it's hard to tell where through the core of Maven the
> > >> context actually pops out. You still need to inspect the session, but
> > >> the session would be the one place that you could look to see what is
> > >> changing as it passes through the core. The rub right now is that
> many
> > >> components internally are not setup to use a session. That's my
> > >> opinion: that the session passing through the core could just as
> > >> easily serve as a build context it's just architecturally the context
> > >> is easier to wormhole through the code.
> > >
> > >
> > > Possibly true. In order to move the toolchains code to session, we
> would
> > > need a way to serialize/deserialize Objects. The actual live instances
> > > cannot be used due to plugun classloading.
> >
> > Just a suggestion: You might give XStream with the binary driver a try.
> > Not
> > as bloated as XML and your classes do not have to implement
> Serializable.
> >
> > - Jörg
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > For additional commands, e-mail: dev-help@maven.apache.org
> >
> >
>

Re: Toolchains proposal

Posted by Shane Isbell <sh...@gmail.com>.
Where are we sitting on the toolchain support? At NMaven, we're going back
to basics to get better alignment and integration with the rest of Maven.
Toolchain support ranks highly.  I see some interfaces and Java support
within the toolchain project, but I don't know how complete this is. If the
interfaces are stable, I can work on getting a dotnet implementation.

Thanks,
Shane

On Nov 10, 2007 4:10 AM, Jörg Schaible <jo...@gmx.de> wrote:

> Milos Kleint wrote:
>
> > On Nov 6, 2007 4:35 PM, Jason van Zyl <ja...@maven.org> wrote:
> >
> >>
> >> On 6 Nov 07, at 4:00 AM 6 Nov 07, Milos Kleint wrote:
> >>
> >> > Hello,
> >> >
> >> > I've got a working prototype of the toolchains proposal. I'm able to
> >> > define
> >> > the jdk toolchains and have them used in a project. Works with
> patched
> >> > compiler, surefire, javadoc plugins.
> >> > details are at http://docs.codehaus.org/display/MAVEN/Toolchains
> >> >
> >> > issues for resolution:
> >> > 1. currently using build-context, I heard stories about it going
> away.
> >>
> >> My only concern with the build-context, and John can counters as he
> >> deems fit, but it's hard to tell where through the core of Maven the
> >> context actually pops out. You still need to inspect the session, but
> >> the session would be the one place that you could look to see what is
> >> changing as it passes through the core. The rub right now is that many
> >> components internally are not setup to use a session. That's my
> >> opinion: that the session passing through the core could just as
> >> easily serve as a build context it's just architecturally the context
> >> is easier to wormhole through the code.
> >
> >
> > Possibly true. In order to move the toolchains code to session, we would
> > need a way to serialize/deserialize Objects. The actual live instances
> > cannot be used due to plugun classloading.
>
> Just a suggestion: You might give XStream with the binary driver a try.
> Not
> as bloated as XML and your classes do not have to implement Serializable.
>
> - Jörg
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>

Re: Toolchains proposal

Posted by Jörg Schaible <jo...@gmx.de>.
Milos Kleint wrote:

> On Nov 6, 2007 4:35 PM, Jason van Zyl <ja...@maven.org> wrote:
> 
>>
>> On 6 Nov 07, at 4:00 AM 6 Nov 07, Milos Kleint wrote:
>>
>> > Hello,
>> >
>> > I've got a working prototype of the toolchains proposal. I'm able to
>> > define
>> > the jdk toolchains and have them used in a project. Works with patched
>> > compiler, surefire, javadoc plugins.
>> > details are at http://docs.codehaus.org/display/MAVEN/Toolchains
>> >
>> > issues for resolution:
>> > 1. currently using build-context, I heard stories about it going away.
>>
>> My only concern with the build-context, and John can counters as he
>> deems fit, but it's hard to tell where through the core of Maven the
>> context actually pops out. You still need to inspect the session, but
>> the session would be the one place that you could look to see what is
>> changing as it passes through the core. The rub right now is that many
>> components internally are not setup to use a session. That's my
>> opinion: that the session passing through the core could just as
>> easily serve as a build context it's just architecturally the context
>> is easier to wormhole through the code.
> 
> 
> Possibly true. In order to move the toolchains code to session, we would
> need a way to serialize/deserialize Objects. The actual live instances
> cannot be used due to plugun classloading.

Just a suggestion: You might give XStream with the binary driver a try. Not
as bloated as XML and your classes do not have to implement Serializable.

- Jörg


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: Toolchains proposal

Posted by Milos Kleint <mk...@gmail.com>.
On Nov 6, 2007 4:35 PM, Jason van Zyl <ja...@maven.org> wrote:

>
> On 6 Nov 07, at 4:00 AM 6 Nov 07, Milos Kleint wrote:
>
> > Hello,
> >
> > I've got a working prototype of the toolchains proposal. I'm able to
> > define
> > the jdk toolchains and have them used in a project. Works with patched
> > compiler, surefire, javadoc plugins.
> > details are at http://docs.codehaus.org/display/MAVEN/Toolchains
> >
> > issues for resolution:
> > 1. currently using build-context, I heard stories about it going away.
>
> My only concern with the build-context, and John can counters as he
> deems fit, but it's hard to tell where through the core of Maven the
> context actually pops out. You still need to inspect the session, but
> the session would be the one place that you could look to see what is
> changing as it passes through the core. The rub right now is that many
> components internally are not setup to use a session. That's my
> opinion: that the session passing through the core could just as
> easily serve as a build context it's just architecturally the context
> is easier to wormhole through the code.


Possibly true. In order to move the toolchains code to session, we would
need a way to serialize/deserialize Objects. The actual live instances
cannot be used due to plugun classloading.


>
>
> >
> > 2. due to 1. only works in 2.1, need to make sure it works in 2.0.x
> > as well.
>
> With all the parts of the internals that you might need to touch even
> if we weren't using the build context I think it would be hard in 2.0.x.


>From Maven internals, I'm using just the buildcontext which also doesn't
have many dependencies on maven internals. it seems to require a newer
version of plexus though. For this reason the buildcontext sounds like an
ideal backward compatible solution, unlike the dependency on  MavenSession
enhancements because that one deems toolchains in 2.0.x impossible.

small part also using maven-artifact, in order to do version matching
properly.



>
>
> >
> > 3. docs largely missing
>
> Well then, it will currently fit fight in :-)
>
> >
> > 4. should have at least one other implementation of the toolchain,
> > next to
> > jdk to make the api more stable..
>
> I think the JDK detection and use is the biggy. Is this in any way
> hooked up profile activators? For example, are you using the JDK
> profile activator to tell the toolchain how it is to behave? Just
> curious.


Not sure I follow the question. This is how it currently works. Toolchains
are injected into the build by the maven-toolchains-plugin.
That one is responsible for reading persisted, defined user toolchains. And
it matches them against the requirements by the project. The requirements
are configuration of the toolchains-plugin. If a match is found, it's used
and added to build-context, if not the build fails. That's approximately the
same as the enforcer-plugin. Any toolchain-enabled plugin down the road just
queries the build context for a toolchain it understands and uses. If found,
it's used. If not, it keeps processing like it does now.



Milos

Re: Toolchains proposal

Posted by Jason van Zyl <ja...@maven.org>.
On 6 Nov 07, at 4:00 AM 6 Nov 07, Milos Kleint wrote:

> Hello,
>
> I've got a working prototype of the toolchains proposal. I'm able to  
> define
> the jdk toolchains and have them used in a project. Works with patched
> compiler, surefire, javadoc plugins.
> details are at http://docs.codehaus.org/display/MAVEN/Toolchains
>
> issues for resolution:
> 1. currently using build-context, I heard stories about it going away.

My only concern with the build-context, and John can counters as he  
deems fit, but it's hard to tell where through the core of Maven the  
context actually pops out. You still need to inspect the session, but  
the session would be the one place that you could look to see what is  
changing as it passes through the core. The rub right now is that many  
components internally are not setup to use a session. That's my  
opinion: that the session passing through the core could just as  
easily serve as a build context it's just architecturally the context  
is easier to wormhole through the code.

>
> 2. due to 1. only works in 2.1, need to make sure it works in 2.0.x  
> as well.

With all the parts of the internals that you might need to touch even  
if we weren't using the build context I think it would be hard in 2.0.x.

>
> 3. docs largely missing

Well then, it will currently fit fight in :-)

>
> 4. should have at least one other implementation of the toolchain,  
> next to
> jdk to make the api more stable..

I think the JDK detection and use is the biggy. Is this in any way  
hooked up profile activators? For example, are you using the JDK  
profile activator to tell the toolchain how it is to behave? Just  
curious.

>
> 5. more?
>
> comments welcome.
>
> Milos

Thanks,

Jason

----------------------------------------------------------
Jason van Zyl
Founder,  Apache Maven
jason at sonatype dot com
----------------------------------------------------------




---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org