Ant support in (was Re: [ports-i386@bento ...])

Herve Quiroz herve.quiroz at
Fri Apr 9 07:25:13 PDT 2004

On Fri, Apr 09, 2004 at 11:51:12AM +0200, Herve Quiroz wrote:
> I submited a patch for commons-cli and commons-logging (the same issue
> but regarding commons-lang dependency) that enforces:
> IMHO, such thing would be better in, that is a clean nice
> Ant support in that handles:
> - Ant dependency
> - including of needed JARs in CLASSPATH
> - definition of useful macros, such as ${ANT}
> - definition of standard targets, such as 'do-build' performing the
>   required (user defined) ${ANT_TARGETS}
> I think we should discuss this point in the list and when we find a nice
> solution I will submit an implementation as a PR...
> Opinions anyone ?

A PR regarding Ant support in has already been sent some
time ago:

It mostly fixes a bug (ant ignores USE_JAVA settings) but I think we
could build Ant support on top of this.

Previous attempts failed because of complexity. So we should stay
minimalist this time.

That gives:

Variables that a port may define:

- USE_ANT: when set, it means that Ant should be part of the
  dependencies of the port.
- ANT_BUILD: when set, it means that Ant should be part of
- ANT_RUN: when set, it means that Ant should be part of RUN_DEPENDS.
- ANT_INCLUDE_SHARED_JARS: when set, it means that JARs from JAVAVARDIR
  should be added to the classpath.

Variables/macros provided by in return:

- ANT_CMD: the 'ant' executable
- ANT: the command-line for running Ant. This will setenv JAVA_HOME
  according to the JDK set for this port build, and possibly setenv
  ANT_INCLUDE_SHARED_JARS=YES according to the Make variable of the same
  name (see above).

NOTE: the ANT_BUILD/ANT_RUN variables may seem a bit odd. Actually, they
mimic the JAVA_RUN/JAVA_BUILD from Still we have to be able
to differenciate build and run dependencies. Indeed, although most
applications will use Ant at build stage, some ports (devel/maven for
instance) use Ant to run. Furthermore, devel/maven does not even require
Ant at build stage (it's a binary port). Another method would be:

Variables that a port may define:

- USE_ANT: same as above
- ANT_INCLUDE_SHARED_JARS: same as above

Variable provided by in return:

- ANT_CMD: same as above
- ANT: same as above
- ANT_DEPENDS: the *_DEPENDS value regarding Ant only. This means the
  Makefile may contain:




..or even both of these statements.


More information about the freebsd-java mailing list