cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Berin Loritsch <blorit...@apache.org>
Subject Re: Standardizing build.xml files
Date Fri, 07 Sep 2001 12:58:50 GMT
Jeff Turner wrote:
> 
> On Thu, Sep 06, 2001 at 10:26:34PM -0400, Berin Loritsch wrote:
> > I proposed this on the general lists, and got a couple +1s
> > from the folks there.  Please let me know if this makes sense
> > for us.  This proposal is a minimum set of targets and
> > conventions for build.xml files.  This allows a familiar
> > environment for all projects (if adopted).
> >
> [..]
> > If a program can be installed, then a build file must
> > use these properties (which can be overridden by a user's
> > .antrc file).
> 
> .antrc is for setting environment variables. It is distinct from
> .ant.properties (aka build.properties), which I presume you mean?

Yes.

> > The standard targets I propose we all adopt are similar to
> > the Make utility conventions ('all' is the default target):
> >
> > 'all'
> >     Compiles the program with debugging enabled by default.
> >     This target is not required to build documentation.  Standard
> >     compilation properties and defaults are:
> >     * build.debug=on
> >     * build.optimize=off
> 
> Great. I've noticed a tendency for people to call this "main". Anyway,
> it's a good addition, because it allows "ant clean all" to be done on
> any project, whereas without knowing the default target, you're stuck
> with "ant clean ; ant".

Exactly.  Actually, this isn't as standard as you might think.

For Avalon projects it is 'main'
For Cocoon projects it is 'package'
For Axis projects it is 'all'

Borrowing a convention from GNU in this respect is not bad.

> > 'install'
> >     This target ensures that everything is built, including
> >     documentation.  It then copies the files in the corresponding
> >     directories already mentioned above.  All jars should be
> >     considered libraries, and scripts should be provided to run
> >     them.
> 
> A bit off-topic but..
> 
> I've managed to avoid "invoking scripts" in my projects by adding the
> following to the jar manifest:
> 
> Class-Path: [requisite jars]
> Main-Class: [main class]
> 
> Eg,
> Class-Path: crimson.jar jaxp.jar catalog.jar
> Main-Class: net.socialchange.validator.Validator
> 
> Then the project can be invoked with "java -jar foo.jar".

Yep, but many projects have more things that have to be set up
for classpaths and setting java heap sizes, etc.  Esp. servers.
I find it a little nicer to have an invoking script in many cases
so that I can simply type "foo" and the java app runs.

Although, in windows if you set ".jar" files to invoke "javaw -jar %1"
you only have to type "foo.jar"--but this isn't common for all
environments.

Besides, the number of jars used can be made dynamic when we use
invoking scripts.

> > 'check'
> >     This target is used to compile and execute any unit tests that
> >     are built into the project.
> 
> Or just "test"?

Well, the common convention for make files is 'check'.  Many
Jakarta/XML projects are just beginning to add unit testing--so
I thought standardizing on an already common convention (I believe
even for Apache httpd) would be a good idea.  If you want "test"
to alias "check" that's fine.

> Another question: what is the default target? I don't see anything
> suitable above, because they all build docs, which usually takes a long
> time.

As I mentioned above in parenthesis (which is probably why you missed
it), the "all" target is the default.

> I'd suggest keeping a "main" target, defaulted to "all", which people
> can then change to "all, tests" or "clean, all, tests" as they see fit.
> 
> --Jeff
> (wishing you success where others have failed)

Thanks.  It seems to be meeting with decent reception right now.

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


Mime
View raw message