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

Herve Quiroz herve.quiroz at esil.univ-mrs.fr
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:
> 
> ${SETENV} ANT_INCLUDE_SHARED_JARS=YES ant ...
> 
> IMHO, such thing would be better in bsd.java.mk, that is a clean nice
> Ant support in bsd.java.mk 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 bsd.java.mk has already been sent some
time ago:

http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/59997

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
  BUILD_DEPENDS.
- 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 bsd.java.mk 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 bsd.java.mk. 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 bsd.java.mk 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:

BUILD_DEPENDS+=		${ANT_DEPENDS}

or

RUN_DEPENDS+=		${ANT_DEPENDS}

..or even both of these statements.


Herve


More information about the freebsd-java mailing list