You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Peter Reilly <pe...@gmail.com> on 2006/10/11 11:49:39 UTC

Backward compatible problem with resources

I have run into a bc problem with resources.
If ant-contrib is compiled with ant1.7, and used with
ant1.6 all the tasks that use Path
cannot be used:

C:\Documents and Settings\reilly\learning\a\for\build.xml:3: Could not
create type antlib:net.sf.antcontrib:for due to
java.lang.NoClassDefFoundError:
org/apache/tools/ant/types/resources/Union

I do not know why I did not see this before (there was a similar problem
with macrodef.attribute) but it is a *big* problem, third party antlibs should
be creatable with ant 1.7 and usable with ant 1.6 for tasks/types that
do not depend on 1.7 features.

A solution would be to convert Path to implement an interface instead
of extending a class, I do  not know if this is possible.

Peter

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


Re: Backward compatible problem with resources

Posted by Steve Loughran <st...@apache.org>.
Peter Reilly wrote:
> I have run into a bc problem with resources.
> If ant-contrib is compiled with ant1.7, and used with
> ant1.6 all the tasks that use Path
> cannot be used:
> 
> C:\Documents and Settings\reilly\learning\a\for\build.xml:3: Could not
> create type antlib:net.sf.antcontrib:for due to
> java.lang.NoClassDefFoundError:
> org/apache/tools/ant/types/resources/Union

not good, not good at all.

> I do not know why I did not see this before (there was a similar problem
> with macrodef.attribute) but it is a *big* problem, third party antlibs 
> should
> be creatable with ant 1.7 and usable with ant 1.6 for tasks/types that
> do not depend on 1.7 features.

Agreed. Its too easy to ship a non backwards compatible JAR just by 
unintentionally building on Ant1.7, and it stops you adding resources 
and 1.7+ alongside 1.6 compatible code. I already have lots of hoops to 
jump through to keep exec/spawn stuff working on java1.6, and dont want 
to abandon that version just yetl

> 
> A solution would be to convert Path to implement an interface instead
> of extending a class, I do  not know if this is possible.

Would that fix it? I need to look up my library compatibility rules



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


Re: Backward compatible problem with resources

Posted by Peter Reilly <pe...@gmail.com>.
On 10/11/06, Matt Benson <gu...@yahoo.com> wrote:
> --- Peter Reilly <pe...@gmail.com> wrote:
>
> > On 10/11/06, Matt Benson <gu...@yahoo.com>
> > wrote:
> > > --- Peter Reilly <pe...@gmail.com>
> > wrote:
> > >
> > > > I have run into a bc problem with resources.
> > > > If ant-contrib is compiled with ant1.7, and used
> > > > with
> > > > ant1.6 all the tasks that use Path
> > > > cannot be used:
> > > >
> > > > C:\Documents and
> > > > Settings\reilly\learning\a\for\build.xml:3:
> > Could
> > > > not
> > > > create type antlib:net.sf.antcontrib:for due to
> > > > java.lang.NoClassDefFoundError:
> > > > org/apache/tools/ant/types/resources/Union
> > > [SNIP]
> > >
> > > Ha!  Call this a "duh" moment on my part.  Don't
> > ask
> > > what I was thinking, since I obviously wasn't.
> > > Anyway, <union> was created by extracting the
> > > "ordered, no-dupes" logic from <path>.  If we just
> > add
> > > most of the <union> code directly back to <path>
> > The code could be accessed via composition rather
> > that inheritance.
> >
>
> I was thinking about that, actually.  :)  Give me a
> break, I'm sick and it was early for me.  The 1.6 API
> would still be fulfilled, the 1.7 APIs would be
> ignored, code would not be duplicated, and Path would
> just inherit from DataType as always.  Sounds like a
> plan.

Mighty!
I will try to get a BC antlib tester - consisting
of simple tasks and types that should work
in ant 1.6 and ant 1.7 (and perhaps ant 1.4).

Peter

>
> -Matt
>
> > Peter
> >
> > , we
> > > should be okay, right.  I think <union> also
> > extends
> > > BaseResourceCollectionContainer, but either way
> > > there's nothing we can't simply duplicate in
> > <path>.
> > > I'll see if I can fix it this week.
> > >
> > > -Matt
> > >
> > >
> > > __________________________________________________
> > > Do You Yahoo!?
> > > Tired of spam?  Yahoo! Mail has the best spam
> > protection around
> > > http://mail.yahoo.com
> > >
> > >
> >
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> > dev-unsubscribe@ant.apache.org
> > > For additional commands, e-mail:
> > dev-help@ant.apache.org
> > >
> > >
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > dev-unsubscribe@ant.apache.org
> > For additional commands, e-mail:
> > dev-help@ant.apache.org
> >
> >
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> For additional commands, e-mail: dev-help@ant.apache.org
>
>

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


Re: Backward compatible problem with resources

Posted by Matt Benson <gu...@yahoo.com>.
--- Peter Reilly <pe...@gmail.com> wrote:

> On 10/11/06, Matt Benson <gu...@yahoo.com>
> wrote:
> > --- Peter Reilly <pe...@gmail.com>
> wrote:
> >
> > > I have run into a bc problem with resources.
> > > If ant-contrib is compiled with ant1.7, and used
> > > with
> > > ant1.6 all the tasks that use Path
> > > cannot be used:
> > >
> > > C:\Documents and
> > > Settings\reilly\learning\a\for\build.xml:3:
> Could
> > > not
> > > create type antlib:net.sf.antcontrib:for due to
> > > java.lang.NoClassDefFoundError:
> > > org/apache/tools/ant/types/resources/Union
> > [SNIP]
> >
> > Ha!  Call this a "duh" moment on my part.  Don't
> ask
> > what I was thinking, since I obviously wasn't.
> > Anyway, <union> was created by extracting the
> > "ordered, no-dupes" logic from <path>.  If we just
> add
> > most of the <union> code directly back to <path>
> The code could be accessed via composition rather
> that inheritance.
> 

I was thinking about that, actually.  :)  Give me a
break, I'm sick and it was early for me.  The 1.6 API
would still be fulfilled, the 1.7 APIs would be
ignored, code would not be duplicated, and Path would
just inherit from DataType as always.  Sounds like a
plan.

-Matt

> Peter
> 
> , we
> > should be okay, right.  I think <union> also
> extends
> > BaseResourceCollectionContainer, but either way
> > there's nothing we can't simply duplicate in
> <path>.
> > I'll see if I can fix it this week.
> >
> > -Matt
> >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Tired of spam?  Yahoo! Mail has the best spam
> protection around
> > http://mail.yahoo.com
> >
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> dev-unsubscribe@ant.apache.org
> > For additional commands, e-mail:
> dev-help@ant.apache.org
> >
> >
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> dev-unsubscribe@ant.apache.org
> For additional commands, e-mail:
> dev-help@ant.apache.org
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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


Re: Backward compatible problem with resources

Posted by Peter Reilly <pe...@gmail.com>.
On 10/11/06, Matt Benson <gu...@yahoo.com> wrote:
> --- Peter Reilly <pe...@gmail.com> wrote:
>
> > I have run into a bc problem with resources.
> > If ant-contrib is compiled with ant1.7, and used
> > with
> > ant1.6 all the tasks that use Path
> > cannot be used:
> >
> > C:\Documents and
> > Settings\reilly\learning\a\for\build.xml:3: Could
> > not
> > create type antlib:net.sf.antcontrib:for due to
> > java.lang.NoClassDefFoundError:
> > org/apache/tools/ant/types/resources/Union
> [SNIP]
>
> Ha!  Call this a "duh" moment on my part.  Don't ask
> what I was thinking, since I obviously wasn't.
> Anyway, <union> was created by extracting the
> "ordered, no-dupes" logic from <path>.  If we just add
> most of the <union> code directly back to <path>
The code could be accessed via composition rather
that inheritance.

Peter

, we
> should be okay, right.  I think <union> also extends
> BaseResourceCollectionContainer, but either way
> there's nothing we can't simply duplicate in <path>.
> I'll see if I can fix it this week.
>
> -Matt
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
> For additional commands, e-mail: dev-help@ant.apache.org
>
>

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


Re: Backward compatible problem with resources

Posted by Matt Benson <gu...@yahoo.com>.
--- Peter Reilly <pe...@gmail.com> wrote:

> I have run into a bc problem with resources.
> If ant-contrib is compiled with ant1.7, and used
> with
> ant1.6 all the tasks that use Path
> cannot be used:
> 
> C:\Documents and
> Settings\reilly\learning\a\for\build.xml:3: Could
> not
> create type antlib:net.sf.antcontrib:for due to
> java.lang.NoClassDefFoundError:
> org/apache/tools/ant/types/resources/Union
[SNIP]

Ha!  Call this a "duh" moment on my part.  Don't ask
what I was thinking, since I obviously wasn't. 
Anyway, <union> was created by extracting the
"ordered, no-dupes" logic from <path>.  If we just add
most of the <union> code directly back to <path>, we
should be okay, right.  I think <union> also extends
BaseResourceCollectionContainer, but either way
there's nothing we can't simply duplicate in <path>. 
I'll see if I can fix it this week.

-Matt


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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