You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Jon Skeet <jo...@peramon.com> on 2002/03/01 00:09:29 UTC
RE: new ant task to update J2ME MIDP JAD files
> I wrote a small ant task (called jad) that is useful for J2ME/MIDP
> development. This task updates the size of a MIDlet jar in the jad
> file. The jar size mentioned in the jad must be accurate or the MIDlet
> is rejected by Motorola's iDEN phones. Sun's J2ME Wireless Toolkit
> does this automatically, but this tool is useful for those who prefer
> to build MIDlets using ant (like myself :-)).
Looks mostly okay to me. A few things:
1) Copyright - I don't think we'd be able to do anything without the ASF being given the copyright and the licence changing appropriately.
2) We'd probably want to change the package to something like org.apache.tools.ant.taskdefs.optional.j2me
3) Any reason why the jar is specified as a File but the jad is specified as a String?
4) I'd probably move tryExecute into the block of the try, personally, but that's just a style issue.
5) I'd clean up closing readers/writers with finally blocks - currently they could hang around.
6) Is a Jad file actually a Properties file? I can't remember off-hand... If so, it's worth using the Properties.load and Properties.store methods rather than reading it in directly.
7) If it's not a actually a Properties file, is it at least meant to be in a specific encoding? If so, it's worth specifying.
8) It's probably worth doing more "user friendly" parameter checking than relying on IOExceptions - check for both files existing and the jad file being writable before trying to do anything else.
I'm a pretty new committer, so I don't know if there's anything else that needs checking. Oh, and do you fancy writing a manual page for it? :)
Jon
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: new ant task to update J2ME MIDP JAD files
Posted by Stefan Bodewig <bo...@apache.org>.
On Thu, 28 Feb 2002, Akhil Arora <ak...@sun.com> wrote:
> another question: is it ok to use java2-specific calls in ant?
Only for optional stuff.
And even then you should step back and think if you really need the
1.2 API calls to achieve what you want.
Stefan
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: new ant task to update J2ME MIDP JAD files
Posted by Steve Loughran <st...@iseran.com>.
----- Original Message -----
From: "Akhil Arora" <ak...@sun.com>
To: "Ant Developers List" <an...@jakarta.apache.org>
Sent: Thursday, February 28, 2002 7:52 PM
Subject: Re: new ant task to update J2ME MIDP JAD files
> thanks for the thorough code review, jon
> are you signing up to commit this code, then?
> another question: is it ok to use java2-specific calls in ant?
>
> Jon Skeet wrote:
> >
> > > I wrote a small ant task (called jad) that is useful for J2ME/MIDP
> > > development. This task updates the size of a MIDlet jar in the jad
> > > file. The jar size mentioned in the jad must be accurate or the MIDlet
> > > is rejected by Motorola's iDEN phones. Sun's J2ME Wireless Toolkit
> > > does this automatically, but this tool is useful for those who prefer
> > > to build MIDlets using ant (like myself :-)).
Akhil. How about getting the task into the Sun toolkit itself?
The reason for that is that tasks dont have to be be in the complete
distribution to be used in a build, and keeping the tasks with the products
not only keeps the ant team's maintenance load down, it also keeps the task
in sync with the product it is working with.
There are already some mobile stuff in the ant list of external tasks:
http://jakarta.apache.org/ant/external.html, but it could do with some
unification, more tests (inevitably) and some rounding documentation (also
inevitably).
There is some (!) discussion on how best to implement a better library
loading mechanism, with the general aim to add this for the next version of
Ant. If we can do this, then we will have a better means of integrating
external task libraries into the tools.
This doesnt mean that the apache project doesnt want your contribution, only
that the Ant team is trying to be more selective now as to what is core and
what can moved into self contained projects. It would seem to me that
'mobile and embedded' would be an interesting area self contained ant
project area, and indeed an interesting and self contained area for other
java dev that apache could start getting into.
>
> as to the manual page, i must write one, i suppose. i may not have
> time to do this before JavaOne, though.
Man page and tests are the things that new tasks are expected to have. I
know we have been slack that requirement in the past, but it only delays the
effort, nowadays we try and add support for existing tasks whenever we get a
chance.
An initial man page can just be a list of attributes and a couple of
examples. With the new xdocs proposal from Erik to autogenerate
documentation, it should be easy.
-steve
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: new ant task to update J2ME MIDP JAD files
Posted by Steve Loughran <st...@iseran.com>.
----- Original Message -----
From: "Akhil Arora" <ak...@sun.com>
To: "Ant Developers List" <an...@jakarta.apache.org>
Sent: Thursday, February 28, 2002 7:52 PM
Subject: Re: new ant task to update J2ME MIDP JAD files
> thanks for the thorough code review, jon
> are you signing up to commit this code, then?
> another question: is it ok to use java2-specific calls in ant?
>
> Jon Skeet wrote:
> >
> > > I wrote a small ant task (called jad) that is useful for J2ME/MIDP
> > > development. This task updates the size of a MIDlet jar in the jad
> > > file. The jar size mentioned in the jad must be accurate or the MIDlet
> > > is rejected by Motorola's iDEN phones. Sun's J2ME Wireless Toolkit
> > > does this automatically, but this tool is useful for those who prefer
> > > to build MIDlets using ant (like myself :-)).
Akhil. How about getting the task into the Sun toolkit itself?
The reason for that is that tasks dont have to be be in the complete
distribution to be used in a build, and keeping the tasks with the products
not only keeps the ant team's maintenance load down, it also keeps the task
in sync with the product it is working with.
There are already some mobile stuff in the ant list of external tasks:
http://jakarta.apache.org/ant/external.html, but it could do with some
unification, more tests (inevitably) and some rounding documentation (also
inevitably).
There is some (!) discussion on how best to implement a better library
loading mechanism, with the general aim to add this for the next version of
Ant. If we can do this, then we will have a better means of integrating
external task libraries into the tools.
This doesnt mean that the apache project doesnt want your contribution, only
that the Ant team is trying to be more selective now as to what is core and
what can moved into self contained projects. It would seem to me that
'mobile and embedded' would be an interesting area self contained ant
project area, and indeed an interesting and self contained area for other
java dev that apache could start getting into.
>
> as to the manual page, i must write one, i suppose. i may not have
> time to do this before JavaOne, though.
Man page and tests are the things that new tasks are expected to have. I
know we have been slack that requirement in the past, but it only delays the
effort, nowadays we try and add support for existing tasks whenever we get a
chance.
An initial man page can just be a list of attributes and a couple of
examples. With the new xdocs proposal from Erik to autogenerate
documentation, it should be easy.
-steve
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: new ant task to update J2ME MIDP JAD files
Posted by Akhil Arora <ak...@sun.com>.
thanks for the thorough code review, jon
are you signing up to commit this code, then?
another question: is it ok to use java2-specific calls in ant?
Jon Skeet wrote:
>
> > I wrote a small ant task (called jad) that is useful for J2ME/MIDP
> > development. This task updates the size of a MIDlet jar in the jad
> > file. The jar size mentioned in the jad must be accurate or the MIDlet
> > is rejected by Motorola's iDEN phones. Sun's J2ME Wireless Toolkit
> > does this automatically, but this tool is useful for those who prefer
> > to build MIDlets using ant (like myself :-)).
>
> Looks mostly okay to me. A few things:
>
> 1) Copyright - I don't think we'd be able to do anything without the ASF being given the copyright and the licence changing appropriately.
that will not be a problem
> 2) We'd probably want to change the package to something like org.apache.tools.ant.taskdefs.optional.j2me
no problem
> 3) Any reason why the jar is specified as a File but the jad is specified as a String?
after some testing i found that File works much better than String, so
now both are Files. thanks
> 4) I'd probably move tryExecute into the block of the try, personally, but that's just a style issue.
>
> 5) I'd clean up closing readers/writers with finally blocks - currently they could hang around.
done
> 6) Is a Jad file actually a Properties file? I can't remember off-hand... If so, it's worth using the Properties.load and Properties.store methods rather than reading it in directly.
no, it is like a manifest. i too first thought of just using
Properties, but Properties uses '=' as the separator, whereas JADs use
':'
> 7) If it's not a actually a Properties file, is it at least meant to be in a specific encoding? If so, it's worth specifying.
the MIDP spec says that the JAD is in Unicode
> 8) It's probably worth doing more "user friendly" parameter checking than relying on IOExceptions - check for both files existing and the jad file being writable before trying to do anything else.
done
> I'm a pretty new committer, so I don't know if there's anything else that needs checking. Oh, and do you fancy writing a manual page for it? :)
do you mean extras like javadocs, internationalization? i added
synchronization...
as to the manual page, i must write one, i suppose. i may not have
time to do this before JavaOne, though.
> Jon
>
> --
> 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>