You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Steve Loughran <st...@iseran.com> on 2002/05/15 19:42:00 UTC

Ant on java 1.4

Sam's attempt to get everything to build on ant 1.4 is halted not directly
by ant or xerces, but by junit:

http://nagoya.apache.org/~rubys/gump/java14/

However, the trace log shows that it is sort of our fault:

Buildfile: build.xml

init:

versiontag:
     [copy] Copying 1 file to /tmp/gump/junit/junit/runner
     [move] Moving 1 files to /tmp/gump/junit/junit/runner

build:
    [javac] Compiling 86 source files to /tmp/gump/junit

BUILD FAILED
/tmp/gump/junit/build.xml:28: This version of java does not support the
classic compiler

Total time: 3 seconds

--------

The junit build file must be setting build.compiler=classic, which we are
correctly recognising as wrong, and halting.

Should we try and go the other way, recognise when there is no classic
compiler and request 'modern'?

IMO it would be consistent with the fact that CompilerAdapterFactory goes
the other way.


..changes would be minor; replace throwing an exception message with a
warning and a fall through:
            if (compilerType.equalsIgnoreCase("classic") ||
                compilerType.equalsIgnoreCase("javac1.1") ||
                compilerType.equalsIgnoreCase("javac1.2")) {
                if (isClassicCompilerSupported) {
                    return new Javac12();
                } else {
                    task.log("This version of java does "
                                             + "not support the classic "
                                             + "compiler",
Project.MSG_WARN);
                    compilerType="modern";
                }
            }

Thoughts?


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Ant on java 1.4

Posted by Stefan Bodewig <bo...@apache.org>.
On Wed, 15 May 2002, Steve Loughran <st...@iseran.com> wrote:

> The junit build file must be setting build.compiler=classic, which
> we are correctly recognising as wrong, and halting.

Gump could override this with a <property> in the Gump workspace that
set's build.compiler explicitly - but there may be cases where you
know that the compiler is not just a matter of taste but really a
requirement to make the compilation pass.

> Should we try and go the other way, recognise when there is no
> classic compiler and request 'modern'?

+1

Stefan

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Ant on java 1.4

Posted by Stefan Bodewig <bo...@apache.org>.
On Fri, 17 May 2002, Steve Loughran <st...@iseran.com> wrote:

> till 1.4 there was an implicit "1.1" right?

An implicit "leave it to the compiler", which is something different
IMHO.

> So fixing target to 1.1 if unspecified only makes things
> consistent.

See Magesh's other thread.

> But maybe we need a way to say "target=unspecified" to let the
> compiler decide.

Which means I'd have to make my build file Ant 1.5 specific to make it
work the same way as an unchanged version did in 1.4.1.  No good IMHO.

> Also, we are going to have to write a 1.4 special notes page
> somewhere in the docs to spell out all this fun,

Thank you for volunteering 8-)

Seriously, I've not been using JDK 1.4 too much, so I haven't run into
any issues myself yet - I doubt anybody would veto "more
documentation".

>> The target attribute has been in <javac> since ever, so I don't
>> know why nobody is using it.
> 
> because, till now, it was irrelevant

Point taken.

Stefan

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Ant on java 1.4

Posted by Steve Loughran <st...@iseran.com>.
----- Original Message -----
From: "Stefan Bodewig" <bo...@apache.org>
To: <an...@jakarta.apache.org>
Sent: Friday, May 17, 2002 5:22 AM
Subject: Re: Ant on java 1.4


> On Thu, 16 May 2002, <co...@covalent.net> wrote:
>
> > Would it be a problem if we set the default to "1.1", and let people
> > override it if they want ?
>
> Yes it would - you wouldn't have a way to use no -target switch at all
> and it would break backwards compatibility.

till 1.4 there was an implicit "1.1" right? So fixing target to 1.1 if
unspecified only makes things consistent. But maybe we need a way to say
"target=unspecified" to let the compiler decide.

Also, we are going to have to write a 1.4 special notes page somewhere in
the docs to spell out all this fun,

> The target
> attribute has been in <javac> since ever, so I don't know why nobody
> is using it.

because, till now, it was irrelevant





--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Ant on java 1.4

Posted by David Jencks <da...@directvinternet.com>.
I just spent a couple of days dealing with essentially this issue  (caused
by the Versant class enhancer only working with 1.1 (45.3) format class
files).  I think it might be useful if the documentation on "target"
included the information that pre-jdk1.4 compilers defaulted to 1.1 and
jdk1.4 defaults to 1.2.  It's hard to know, but I suspect that if I had had
this information handy in the ant docs I would have solved the problem I
was having in minutes not days.  I really didn't imagine that the default
class format didn't keep up with the compiler versions.

Thanks
david jencks


On 2002.05.17 10:50:02 -0400 Stefan Bodewig wrote:
> On Fri, 17 May 2002, <co...@covalent.net> wrote:
> 
> > If you use JDK1.1-JDK1.3, the default is 1.1 anyway ( on javac ).
> 
> OK.
> 
> > If you use JDK1.4, the current default is 1.2.
> 
> And it has been that way a month ago.
> 
> > That brakes backward compatibility for all projects who target
> > JDK1.1.
> 
> I'm not taking about JDK 1.4 breaking backwards compatibility - we
> both know it does in too many places to enumerate them - but backwards
> compatibility to Ant 1.4.
> 
> If I don't care for JDK 1.1, I won't set the target option in Ant 1.4 and
> use the compiler's default value.  If I do, I better set the target
> option instead of relying on Ant (which I can't if my users may be
> stuck with Ant 1.4 anyway).
> 
> > Many projects _require_ 1.4 to be fully built, and all those will
> > not work with JDK1.1.
> 
> If these projects want to be compatible to JDK 1.1, they should make
> that decision consciously and set the target attribute explicitly
> IMHO.
> 
> Stefan
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 
> 
> 

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Task.setRuntimeConfigurableWrapper()

Posted by co...@covalent.net.
setRuntimeConfigurableWrapper() is currently protected, and used from
RuntimeConfigurable which is in the same packet.

Using a class that extends RuntimeConfigurable allows a ProjectHelper to
use SAX2 or extend the property replacement alghoritm or do any other
fancy thing with the parsing. 

Unfortunately that won't work unless the method is made public, or 
the extended RuntimeConfigurable is put in the same package ( which
will brake Sealing and is ugly ).

Is it ok to change it to public ? Do you have any better sugestion that 
would avoid that call ? 

( I'll check in a modified ProjectHeloper2 using RuntimeConfigurable2 
to better show how I would like to use it )

Costin 


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Ant on java 1.4

Posted by Steve Loughran <st...@iseran.com>.
----- Original Message -----
From: <co...@covalent.net>
To: "Ant Developers List" <an...@jakarta.apache.org>
Sent: Wednesday, May 22, 2002 9:39 AM
Subject: Re: Ant on java 1.4


> On 21 May 2002, Stefan Bodewig wrote:
>
> > > In fact many are setting 'classic' compiler in build.xml, so they'll
> > > not even compile with JDK1.4 out of box.
> >
> > Well, they better should have never done so 8-).  Seriously, this is
> > something that needs to get addressed (fall back to modern as we do
> > the other way around for JDK 1.2 and 1.1).
>
> +1
>
> I'll commit a fix.

Fix is in ANT_15_BRANCH


> > Documenting it in <javac>'s doc and on a 1.4 issues page is better
> > than implicitly setting command line switches just because we feel the
> > default value is wrong.
>
> Ok. I'll get all the projects I am commiter and have 1.1 support updated.

I suppose we could send a note out to the appropriate jakarta (and xml) mail
lists.

> Again, my problem is not the fact that in most cases we'll generate
> code that doesn't work with 1.1 ( it's Sun fault and goal ). My
> problem is that jikes and other compilers migh have problems
> working with the compiled code. JDK1.1 is not the only consumer
> for the 1.1 class version tag, compilers use it too and this
> may brake non-Sun compilers too, not only 1.1 VMs.
>

Interesting to see that you state it is the aim. Decided it was time to put
the MSJVM to bed, I suppose.



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Ant on java 1.4

Posted by Magesh Umasankar <um...@apache.org>.
Didn't proceed any further - as it kept failing every time
with the issue I reported earlier - but I would suspect
it has more to do with JDK 1.1.8 on Windows because you
have been able to make it run using the Blackdown version.

Cheers,
Magesh

***********************************************************
*  Classic: A book which people praise, but do not read.  *
***********************************************************
----- Original Message ----- 
From: "Stefan Bodewig" <bo...@apache.org>
To: <an...@jakarta.apache.org>
Sent: Friday, May 24, 2002 10:53 AM
Subject: Re: Ant on java 1.4


> On Wed, 22 May 2002, <co...@covalent.net> wrote:
> 
> > Ok. I'll get all the projects I am commiter and have 1.1 support
> > updated.
> 
> I'd wait and see what Magesh is discovering in his Windows JDK 1.1
> case, it seemed as if target=1.1 wasn't doing any good for him.
> 
> > My problem is that jikes and other compilers migh have problems
> > working with the compiled code.
> 
> Won't the same compilers have problems to use JJR 1.4's rt.jar as
> well?  I'd expect them to (grumbling) follow Sun's class format
> update.
> 
> Stefan
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Ant on java 1.4

Posted by Stefan Bodewig <bo...@apache.org>.
On Wed, 22 May 2002, <co...@covalent.net> wrote:

> Ok. I'll get all the projects I am commiter and have 1.1 support
> updated.

I'd wait and see what Magesh is discovering in his Windows JDK 1.1
case, it seemed as if target=1.1 wasn't doing any good for him.

> My problem is that jikes and other compilers migh have problems
> working with the compiled code.

Won't the same compilers have problems to use JJR 1.4's rt.jar as
well?  I'd expect them to (grumbling) follow Sun's class format
update.

Stefan

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Ant on java 1.4

Posted by co...@covalent.net.
On 21 May 2002, Stefan Bodewig wrote:

> > In fact many are setting 'classic' compiler in build.xml, so they'll
> > not even compile with JDK1.4 out of box.
> 
> Well, they better should have never done so 8-).  Seriously, this is
> something that needs to get addressed (fall back to modern as we do
> the other way around for JDK 1.2 and 1.1).

+1

I'll commit a fix.
 
 
> > My point is that most people just don't know about this new
> > wonderfull 'feature' of JDK1.4.
> 
> I simply don't want to turn the JDK 1.4 feature into an Ant 1.5
> feature of "why does Ant force me to set the target attribute if I
> don't care for JDK 1.1".

> Documenting it in <javac>'s doc and on a 1.4 issues page is better
> than implicitly setting command line switches just because we feel the
> default value is wrong.

Ok. I'll get all the projects I am commiter and have 1.1 support updated.

Again, my problem is not the fact that in most cases we'll generate
code that doesn't work with 1.1 ( it's Sun fault and goal ). My 
problem is that jikes and other compilers migh have problems 
working with the compiled code. JDK1.1 is not the only consumer 
for the 1.1 class version tag, compilers use it too and this 
may brake non-Sun compilers too, not only 1.1 VMs.

Costin 

 


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Ant on java 1.4

Posted by Stefan Bodewig <bo...@apache.org>.
On Fri, 17 May 2002, <co...@covalent.net> wrote:

> I did a quick grep and no jakarta or xml project is using target
> attribute.

Because probably nobody responsible for the build files has been aware
of JDK 1.4's "feature" yet.  Just like you or myself.

> In fact many are setting 'classic' compiler in build.xml, so they'll
> not even compile with JDK1.4 out of box.

Well, they better should have never done so 8-).  Seriously, this is
something that needs to get addressed (fall back to modern as we do
the other way around for JDK 1.2 and 1.1).

> My point is that most people just don't know about this new
> wonderfull 'feature' of JDK1.4.

I simply don't want to turn the JDK 1.4 feature into an Ant 1.5
feature of "why does Ant force me to set the target attribute if I
don't care for JDK 1.1".

Documenting it in <javac>'s doc and on a 1.4 issues page is better
than implicitly setting command line switches just because we feel the
default value is wrong.

Stefan

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Ant on java 1.4

Posted by Magesh Umasankar <um...@apache.org>.
jikes 1.15 (not 1.14, not 1.13) seems to work.
But it would be a shame, wouldn't it, if we
cannot compile it using JDK? ;-)

**********************************************
* Courage is acting as if your hands aren't  *
* trembling.                                 *
**********************************************
----- Original Message -----
From: <co...@covalent.net>
To: "Ant Developers List" <an...@jakarta.apache.org>
Sent: Friday, May 17, 2002 4:54 PM
Subject: Re: Ant on java 1.4


> On Fri, 17 May 2002, Magesh Umasankar wrote:
>
> > I need to build Ant with JDK 1.4 because to generate
> > a total build, there are dependencies on JDK 1.4 in
> > build.xml.  However, if I specify target=1.1, I run
> > into other problems for which I have launched a
> > separate thread of discussion...
> >
> > How do you all out there manage a complete Ant build
> > using JDK 1.4 so that the distro is 1.1 compatible as
> > well?
>
> I didn't tried yet - my 'itch' was the fact that I couldn't
> use jikes.
>
> Probably the best workaround would be to just not use
> javac for the relase ( jikes with rt.jar from 1.4 may work ).
> But of course jikes has it's own bugs...
>
>
> Costin
>
>
> >
> > Cheers,
> > Magesh
> >
> > *************************************************************
> > *  Optimist: A person who while falling from the            *
> > *  Eiffel tower says in midway "See I am not injured yet."  *
> > *************************************************************
> > ----- Original Message -----
> > From: <co...@covalent.net>
> > To: "Ant Developers List" <an...@jakarta.apache.org>
> > Sent: Friday, May 17, 2002 4:19 PM
> > Subject: Re: Ant on java 1.4
> >
> >
> > > On Fri, 17 May 2002 costinm@covalent.net wrote:
> > >
> > > > Stefan,
> > > >
> > > > I did a quick grep and no jakarta or xml project is using target
> > > > attribute. In fact many are setting 'classic' compiler in build.xml,
so
> > > > they'll not even compile with JDK1.4 out of box.
> > > >
> > > > My point is that most people just don't know about this new
wonderfull
> > > > 'feature' of JDK1.4. I didn't know until it bit me.
> > >
> > > BTW, it seems jikes will not work if 'target=1.2' is used - so a
system
> > > build with 1.4 won't be useable with jikes ( and I suspect other
> > compilers ).
> > >
> > >
> > > Costin
> > >
> > >
> > >
> > >
> > > >
> > > >
> > > >
> > > > Costin
> > > >
> > > >
> > > >
> > > > > > That brakes backward compatibility for all projects who target
> > > > > > JDK1.1.
> > > > >
> > > > > I'm not taking about JDK 1.4 breaking backwards compatibility - we
> > > > > both know it does in too many places to enumerate them - but
backwards
> > > > > compatibility to Ant 1.4.
> > > > >
> > > > > If I don't care for JDK 1.1, I won't set the target option in Ant
1.4
> > and
> > > > > use the compiler's default value.  If I do, I better set the
target
> > > > > option instead of relying on Ant (which I can't if my users may be
> > > > > stuck with Ant 1.4 anyway).
> > > > >
> > > > > > Many projects _require_ 1.4 to be fully built, and all those
will
> > > > > > not work with JDK1.1.
> > > > >
> > > > > If these projects want to be compatible to JDK 1.1, they should
make
> > > > > that decision consciously and set the target attribute explicitly
> > > > > IMHO.
> > > > >
> > > > > Stefan
> > > > >
> > > > > --
> > > > > To unsubscribe, e-mail:
> > <ma...@jakarta.apache.org>
> > > > > For additional commands, e-mail:
> > <ma...@jakarta.apache.org>
> > > > >
> > > > >
> > > >
> > > >
> > > > --
> > > > To unsubscribe, e-mail:
> > <ma...@jakarta.apache.org>
> > > > For additional commands, e-mail:
> > <ma...@jakarta.apache.org>
> > > >
> > > >
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> > > For additional commands, e-mail:
<ma...@jakarta.apache.org>
> > >
> >
> >
> > --
> > To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> > For additional commands, e-mail:
<ma...@jakarta.apache.org>
> >
> >
>
>
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Ant on java 1.4

Posted by co...@covalent.net.
On Fri, 17 May 2002, Magesh Umasankar wrote:

> I need to build Ant with JDK 1.4 because to generate
> a total build, there are dependencies on JDK 1.4 in
> build.xml.  However, if I specify target=1.1, I run
> into other problems for which I have launched a
> separate thread of discussion...
> 
> How do you all out there manage a complete Ant build
> using JDK 1.4 so that the distro is 1.1 compatible as
> well?

I didn't tried yet - my 'itch' was the fact that I couldn't 
use jikes.

Probably the best workaround would be to just not use
javac for the relase ( jikes with rt.jar from 1.4 may work ).
But of course jikes has it's own bugs... 


Costin


> 
> Cheers,
> Magesh
> 
> *************************************************************
> *  Optimist: A person who while falling from the            *
> *  Eiffel tower says in midway "See I am not injured yet."  *
> *************************************************************
> ----- Original Message -----
> From: <co...@covalent.net>
> To: "Ant Developers List" <an...@jakarta.apache.org>
> Sent: Friday, May 17, 2002 4:19 PM
> Subject: Re: Ant on java 1.4
> 
> 
> > On Fri, 17 May 2002 costinm@covalent.net wrote:
> >
> > > Stefan,
> > >
> > > I did a quick grep and no jakarta or xml project is using target
> > > attribute. In fact many are setting 'classic' compiler in build.xml, so
> > > they'll not even compile with JDK1.4 out of box.
> > >
> > > My point is that most people just don't know about this new wonderfull
> > > 'feature' of JDK1.4. I didn't know until it bit me.
> >
> > BTW, it seems jikes will not work if 'target=1.2' is used - so a system
> > build with 1.4 won't be useable with jikes ( and I suspect other
> compilers ).
> >
> >
> > Costin
> >
> >
> >
> >
> > >
> > >
> > >
> > > Costin
> > >
> > >
> > >
> > > > > That brakes backward compatibility for all projects who target
> > > > > JDK1.1.
> > > >
> > > > I'm not taking about JDK 1.4 breaking backwards compatibility - we
> > > > both know it does in too many places to enumerate them - but backwards
> > > > compatibility to Ant 1.4.
> > > >
> > > > If I don't care for JDK 1.1, I won't set the target option in Ant 1.4
> and
> > > > use the compiler's default value.  If I do, I better set the target
> > > > option instead of relying on Ant (which I can't if my users may be
> > > > stuck with Ant 1.4 anyway).
> > > >
> > > > > Many projects _require_ 1.4 to be fully built, and all those will
> > > > > not work with JDK1.1.
> > > >
> > > > If these projects want to be compatible to JDK 1.1, they should make
> > > > that decision consciously and set the target attribute explicitly
> > > > IMHO.
> > > >
> > > > Stefan
> > > >
> > > > --
> > > > To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> > > > For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> > > >
> > > >
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> > > For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> > >
> > >
> >
> >
> > --
> > To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> > For additional commands, e-mail: <ma...@jakarta.apache.org>
> >
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 
> 


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Ant on java 1.4

Posted by Magesh Umasankar <um...@apache.org>.
I need to build Ant with JDK 1.4 because to generate
a total build, there are dependencies on JDK 1.4 in
build.xml.  However, if I specify target=1.1, I run
into other problems for which I have launched a
separate thread of discussion...

How do you all out there manage a complete Ant build
using JDK 1.4 so that the distro is 1.1 compatible as
well?

Cheers,
Magesh

*************************************************************
*  Optimist: A person who while falling from the            *
*  Eiffel tower says in midway "See I am not injured yet."  *
*************************************************************
----- Original Message -----
From: <co...@covalent.net>
To: "Ant Developers List" <an...@jakarta.apache.org>
Sent: Friday, May 17, 2002 4:19 PM
Subject: Re: Ant on java 1.4


> On Fri, 17 May 2002 costinm@covalent.net wrote:
>
> > Stefan,
> >
> > I did a quick grep and no jakarta or xml project is using target
> > attribute. In fact many are setting 'classic' compiler in build.xml, so
> > they'll not even compile with JDK1.4 out of box.
> >
> > My point is that most people just don't know about this new wonderfull
> > 'feature' of JDK1.4. I didn't know until it bit me.
>
> BTW, it seems jikes will not work if 'target=1.2' is used - so a system
> build with 1.4 won't be useable with jikes ( and I suspect other
compilers ).
>
>
> Costin
>
>
>
>
> >
> >
> >
> > Costin
> >
> >
> >
> > > > That brakes backward compatibility for all projects who target
> > > > JDK1.1.
> > >
> > > I'm not taking about JDK 1.4 breaking backwards compatibility - we
> > > both know it does in too many places to enumerate them - but backwards
> > > compatibility to Ant 1.4.
> > >
> > > If I don't care for JDK 1.1, I won't set the target option in Ant 1.4
and
> > > use the compiler's default value.  If I do, I better set the target
> > > option instead of relying on Ant (which I can't if my users may be
> > > stuck with Ant 1.4 anyway).
> > >
> > > > Many projects _require_ 1.4 to be fully built, and all those will
> > > > not work with JDK1.1.
> > >
> > > If these projects want to be compatible to JDK 1.1, they should make
> > > that decision consciously and set the target attribute explicitly
> > > IMHO.
> > >
> > > Stefan
> > >
> > > --
> > > To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> > > For additional commands, e-mail:
<ma...@jakarta.apache.org>
> > >
> > >
> >
> >
> > --
> > To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> > For additional commands, e-mail:
<ma...@jakarta.apache.org>
> >
> >
>
>
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Ant on java 1.4

Posted by co...@covalent.net.
On Fri, 17 May 2002 costinm@covalent.net wrote:

> Stefan,
> 
> I did a quick grep and no jakarta or xml project is using target 
> attribute. In fact many are setting 'classic' compiler in build.xml, so 
> they'll not even compile with JDK1.4 out of box.
> 
> My point is that most people just don't know about this new wonderfull 
> 'feature' of JDK1.4. I didn't know until it bit me. 

BTW, it seems jikes will not work if 'target=1.2' is used - so a system
build with 1.4 won't be useable with jikes ( and I suspect other compilers ).


Costin




> 
> 
> 
> Costin
> 
> 
> 
> > > That brakes backward compatibility for all projects who target
> > > JDK1.1.
> > 
> > I'm not taking about JDK 1.4 breaking backwards compatibility - we
> > both know it does in too many places to enumerate them - but backwards
> > compatibility to Ant 1.4.
> > 
> > If I don't care for JDK 1.1, I won't set the target option in Ant 1.4 and
> > use the compiler's default value.  If I do, I better set the target
> > option instead of relying on Ant (which I can't if my users may be
> > stuck with Ant 1.4 anyway).
> > 
> > > Many projects _require_ 1.4 to be fully built, and all those will
> > > not work with JDK1.1.
> > 
> > If these projects want to be compatible to JDK 1.1, they should make
> > that decision consciously and set the target attribute explicitly
> > IMHO.
> > 
> > Stefan
> > 
> > --
> > To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> > For additional commands, e-mail: <ma...@jakarta.apache.org>
> > 
> > 
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 
> 


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Ant on java 1.4

Posted by co...@covalent.net.
Stefan,

I did a quick grep and no jakarta or xml project is using target 
attribute. In fact many are setting 'classic' compiler in build.xml, so 
they'll not even compile with JDK1.4 out of box.

My point is that most people just don't know about this new wonderfull 
'feature' of JDK1.4. I didn't know until it bit me. 



Costin



> > That brakes backward compatibility for all projects who target
> > JDK1.1.
> 
> I'm not taking about JDK 1.4 breaking backwards compatibility - we
> both know it does in too many places to enumerate them - but backwards
> compatibility to Ant 1.4.
> 
> If I don't care for JDK 1.1, I won't set the target option in Ant 1.4 and
> use the compiler's default value.  If I do, I better set the target
> option instead of relying on Ant (which I can't if my users may be
> stuck with Ant 1.4 anyway).
> 
> > Many projects _require_ 1.4 to be fully built, and all those will
> > not work with JDK1.1.
> 
> If these projects want to be compatible to JDK 1.1, they should make
> that decision consciously and set the target attribute explicitly
> IMHO.
> 
> Stefan
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 
> 


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Ant on java 1.4

Posted by Stefan Bodewig <bo...@apache.org>.
On Fri, 17 May 2002, <co...@covalent.net> wrote:

> If you use JDK1.1-JDK1.3, the default is 1.1 anyway ( on javac ).

OK.

> If you use JDK1.4, the current default is 1.2.

And it has been that way a month ago.

> That brakes backward compatibility for all projects who target
> JDK1.1.

I'm not taking about JDK 1.4 breaking backwards compatibility - we
both know it does in too many places to enumerate them - but backwards
compatibility to Ant 1.4.

If I don't care for JDK 1.1, I won't set the target option in Ant 1.4 and
use the compiler's default value.  If I do, I better set the target
option instead of relying on Ant (which I can't if my users may be
stuck with Ant 1.4 anyway).

> Many projects _require_ 1.4 to be fully built, and all those will
> not work with JDK1.1.

If these projects want to be compatible to JDK 1.1, they should make
that decision consciously and set the target attribute explicitly
IMHO.

Stefan

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Ant on java 1.4

Posted by co...@covalent.net.
On 17 May 2002, Stefan Bodewig wrote:

> On Thu, 16 May 2002, <co...@covalent.net> wrote:
> 
> > Would it be a problem if we set the default to "1.1", and let people
> > override it if they want ?
> 
> Yes it would - you wouldn't have a way to use no -target switch at all
> and it would break backwards compatibility.

If you use JDK1.1-JDK1.3, the default is 1.1 anyway ( on javac ). If you 
don't specify any -target, nothing change. If you specify a -target, it'll 
be honored. No behavior change here.

If you use JDK1.4, the current default is 1.2. That brakes backward 
compatibility for all projects who target JDK1.1. If we default to 
-target1.1, we generate code that is identical with what 1.1 generates 
without any change in build.xml. If people include an explicit 
-target, then it will be used.

My point is that we'll be soon in a nightmare situation with support for 
1.1. Many projects _require_ 1.4 to be fully built, and all those will
not work with JDK1.1. Changing all build.xml files is unlikely as most
projects are not aware of that. Even ant doesn't do it now.

Costin




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Ant on java 1.4

Posted by Stefan Bodewig <bo...@apache.org>.
On Thu, 16 May 2002, <co...@covalent.net> wrote:

> Would it be a problem if we set the default to "1.1", and let people
> override it if they want ?

Yes it would - you wouldn't have a way to use no -target switch at all
and it would break backwards compatibility.

> 1.4 defaults to 1.2 - and no project that I even seen ( including
> ant ) has the 'target=1.1'.

I know, but I'd expect Magesh to change that for Ant.  The target
attribute has been in <javac> since ever, so I don't know why nobody
is using it.

Stefan

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Ant on java 1.4

Posted by co...@covalent.net.
On 16 May 2002, Stefan Bodewig wrote:

> On Wed, 15 May 2002, <co...@covalent.net> wrote:
> 
> > I'll try to commit a fix and set flag to generate 1.1 code
> > and use modern if 1.4 is detected, but I don't have any time now.
> 
> I wouldn't want this to happen unconditionally.  There is no reason to
> generate 1.1 compatible class files if you know your code will only
> ever run on 1.4 VMs.
> 
> The flag that you have been talking about it the -target switch, which
> is already supported via <javac>'s target attribute.  There shouldn't
> be a reason for more than that IMHO.  This attribute is ignored if you
> happen to compile on JDK 1.1 - so it is save to always set it to "1.1"
> or something.

Would it be a problem if we set the default to "1.1", and let people 
override it if they want ? 

1.4 defaults to 1.2 - and no project that I even seen ( including ant )
has the 'target=1.1'. 

With the new 'write once, run only on JDK1.4' policy from Sun, many 
projects will be forced to build with JDK1.4 - and the result will not
work with JDK1.1.

Connection pools, commons-logging, tomcat, ant - if you build with 
JDK1.4 with the current build.xml it won't run on JDK1.1, and if
you build with JDK1.3 it will not work with JDK1.4 ( or some features
will be removed ).



Costin




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Ant on java 1.4

Posted by Stefan Bodewig <bo...@apache.org>.
On Wed, 15 May 2002, <co...@covalent.net> wrote:

> I'll try to commit a fix and set flag to generate 1.1 code
> and use modern if 1.4 is detected, but I don't have any time now.

I wouldn't want this to happen unconditionally.  There is no reason to
generate 1.1 compatible class files if you know your code will only
ever run on 1.4 VMs.

The flag that you have been talking about it the -target switch, which
is already supported via <javac>'s target attribute.  There shouldn't
be a reason for more than that IMHO.  This attribute is ignored if you
happen to compile on JDK 1.1 - so it is save to always set it to "1.1"
or something.

Stefan

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Ant on java 1.4

Posted by co...@covalent.net.
I run gump on 1.4 by explicitely setting the compiler to modern.
( there are several other projects that set it to 'classic', junit
is just high on the deps list of gump ).

The bigger problem is that JDK1.4 requires a special flag to generate
code that will run on JDK1.1 ( it generates a class format that is not 
accepted ). On the other side, several jakarta packages require JDK1.4 
compilation ( since conditional compilation will exclude the JDK1.4 
stuff).

In particular the various impl. of jdbc.Connection ( including 
commons-pools ) can work on JDK1.4 only if compiled for JDK1.4. 

At this moment it is impossible to create a package that used 
connection pools and works on 1.1 to 1.4 ( or I don't know
any mechanism ).

I'll try to commit a fix and set flag to generate 1.1 code
and use modern if 1.4 is detected, but I don't have any time now.

Costin  


On Wed, 15 May 2002, Steve Loughran wrote:

> 
> Sam's attempt to get everything to build on ant 1.4 is halted not directly
> by ant or xerces, but by junit:
> 
> http://nagoya.apache.org/~rubys/gump/java14/
> 
> However, the trace log shows that it is sort of our fault:
> 
> Buildfile: build.xml
> 
> init:
> 
> versiontag:
>      [copy] Copying 1 file to /tmp/gump/junit/junit/runner
>      [move] Moving 1 files to /tmp/gump/junit/junit/runner
> 
> build:
>     [javac] Compiling 86 source files to /tmp/gump/junit
> 
> BUILD FAILED
> /tmp/gump/junit/build.xml:28: This version of java does not support the
> classic compiler
> 
> Total time: 3 seconds
> 
> --------
> 
> The junit build file must be setting build.compiler=classic, which we are
> correctly recognising as wrong, and halting.
> 
> Should we try and go the other way, recognise when there is no classic
> compiler and request 'modern'?
> 
> IMO it would be consistent with the fact that CompilerAdapterFactory goes
> the other way.
> 
> 
> ..changes would be minor; replace throwing an exception message with a
> warning and a fall through:
>             if (compilerType.equalsIgnoreCase("classic") ||
>                 compilerType.equalsIgnoreCase("javac1.1") ||
>                 compilerType.equalsIgnoreCase("javac1.2")) {
>                 if (isClassicCompilerSupported) {
>                     return new Javac12();
>                 } else {
>                     task.log("This version of java does "
>                                              + "not support the classic "
>                                              + "compiler",
> Project.MSG_WARN);
>                     compilerType="modern";
>                 }
>             }
> 
> Thoughts?
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 
> 


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>