From owner-freebsd-java@FreeBSD.ORG Fri Apr 9 07:25:13 2004 Return-Path: Delivered-To: freebsd-java@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 09C5C16A4CE for ; Fri, 9 Apr 2004 07:25:13 -0700 (PDT) Received: from arabica.esil.univ-mrs.fr (arabica.esil.univ-mrs.fr [139.124.41.108]) by mx1.FreeBSD.org (Postfix) with ESMTP id EA44743D49 for ; Fri, 9 Apr 2004 07:25:11 -0700 (PDT) (envelope-from herve.quiroz@esil.univ-mrs.fr) Received: from arabica.esil.univ-mrs.fr (localhost.esil.univ-mrs.fr [127.0.0.1])i39EPADN094420 for ; Fri, 9 Apr 2004 16:25:10 +0200 (CEST) (envelope-from herve.quiroz@esil.univ-mrs.fr) Received: (from rv@localhost) by arabica.esil.univ-mrs.fr (8.12.10/8.12.10/Submit) id i39EPABE094419 for java@FreeBSD.org; Fri, 9 Apr 2004 16:25:10 +0200 (CEST) (envelope-from herve.quiroz@esil.univ-mrs.fr) X-Authentication-Warning: arabica.esil.univ-mrs.fr: rv set sender to herve.quiroz@esil.univ-mrs.fr using -f Date: Fri, 9 Apr 2004 16:25:10 +0200 From: Herve Quiroz To: java@FreeBSD.org Message-ID: <20040409142510.GA94278@arabica.esil.univ-mrs.fr> Mail-Followup-To: java@FreeBSD.org References: <20040409005028.GX42056@xor.obsecurity.org> <20040409095112.GA91905@arabica.esil.univ-mrs.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040409095112.GA91905@arabica.esil.univ-mrs.fr> User-Agent: Mutt/1.4.2.1i Subject: Ant support in bsd.java.mk (was Re: [ports-i386@bento ...]) X-BeenThere: freebsd-java@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting Java to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Apr 2004 14:25:13 -0000 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