japitools-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Japi] Argument parsing


From: Stuart Ballard
Subject: [Japi] Argument parsing
Date: Tue, 7 Nov 2006 16:23:22 -0500

Background:

One feature that's nice in the current CVS of Japitools is that
there's a way to Japize a set of packages based on what's in the
javadocs for those packages. It works something like this:

japiextractpkgs docs/api/overview-frame.html >whatever.pkgs
japize as whatever packages whatever.jar `cat whatever.pkgs`

This is very handy for getting the right set of packages included
without trying to figure out the right set of pluses and minuses by
hand.

Unfortunately the `cat whatever.pkgs` bit only works on Unix-like
shells. And I'd really like to be able to have a supported and
documented process for producing JDK japi files of the right sets of
packages, because I've seen a lot of people not get it quite right
(unsurprisingly so, because without this feature it's hard). And I'd
like that process *not* to start with "First, install Linux..."

What I have in mind is to replace that second line with:
japize as whatever packages whatever.jar @whatever.pkgs

Which means all I need is to write some code that will take a String[]
of arguments and, whenever one of them starts with "@", treat the
remainder of it as a filename and substitute in the list of words in
that file. And return a String[] with those substitutions made.

I was going to write that when I realized it's not quite trivial -
breaking the file into words is a little fiddly when quoting and
escaping are taken into account. And it occurred to me that there
*must* be other programs out there that have done this, because taking
@filename as an argument with this meaning is fairly common. I just
can't think of where I'd be able to find some code that I could use.
ecj, perhaps, but ecj isn't under a GPL-compatible license so I can't
put its code in Japitools.

So I thought before I have a go at writing it I'd see whether anyone
here has any ideas of where some code like that might be found under a
GPL-compatible license.

Thanks,
Stuart.
--
http://sab39.dev.netreach.com/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]