Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 9 Apr 2004 16:25:10 +0200
From:      Herve Quiroz <herve.quiroz@esil.univ-mrs.fr>
To:        java@FreeBSD.org
Subject:   Ant support in bsd.java.mk (was Re: [ports-i386@bento ...])
Message-ID:  <20040409142510.GA94278@arabica.esil.univ-mrs.fr>
In-Reply-To: <20040409095112.GA91905@arabica.esil.univ-mrs.fr>
References:  <20040409005028.GX42056@xor.obsecurity.org> <20040409095112.GA91905@arabica.esil.univ-mrs.fr>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040409142510.GA94278>