From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lists.gentoo.org ([140.105.134.102] helo=robin.gentoo.org) by nuthatch.gentoo.org with esmtp (Exim 4.62) (envelope-from ) id 1Gvz8W-0002tL-7H for garchives@archives.gentoo.org; Sun, 17 Dec 2006 16:45:16 +0000 Received: from robin.gentoo.org (localhost [127.0.0.1]) by robin.gentoo.org (8.13.8/8.13.8) with SMTP id kBHGiZZJ001338; Sun, 17 Dec 2006 16:44:35 GMT Received: from gw01.mail.saunalahti.fi (gw01.mail.saunalahti.fi [195.197.172.115]) by robin.gentoo.org (8.13.8/8.13.8) with ESMTP id kBHGiZS9023615 for ; Sun, 17 Dec 2006 16:44:35 GMT Received: from mrp1.mail.saunalahti.fi (mrp1.mail.saunalahti.fi [62.142.5.30]) by gw01.mail.saunalahti.fi (Postfix) with ESMTP id 53388151723 for ; Sun, 17 Dec 2006 18:44:35 +0200 (EET) Received: from [192.168.150.87] (a88-112-194-247.elisa-laajakaista.fi [88.112.194.247]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mrp1.mail.saunalahti.fi (Postfix) with ESMTP id CFAB533C003 for ; Sun, 17 Dec 2006 18:44:33 +0200 (EET) Message-ID: <458573F1.4010607@gentoo.org> Date: Sun, 17 Dec 2006 18:44:33 +0200 From: =?UTF-8?B?UGV0dGVyaSBSw6R0eQ==?= User-Agent: Thunderbird 1.5.0.8 (X11/20061109) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-java@gentoo.org MIME-Version: 1.0 To: gentoo-java@lists.gentoo.org Subject: Re: [gentoo-java] RFC: Default src_compile for java-pkg-2.eclass References: <457AA9BF.6060705@gentoo.org> <457CE72F.7050906@gentoo.org> <457D3A0B.5090301@gentoo.org> <457D7375.4060803@gentoo.org> In-Reply-To: <457D7375.4060803@gentoo.org> X-Enigmail-Version: 0.94.0.0 OpenPGP: url=http://users.tkk.fi/~praty/public.asc Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig16B130753DB280031430566D" X-Archives-Salt: 311956e3-9fac-499b-a278-a0db936d57c0 X-Archives-Hash: cc6fa88bf73fa2a5698879b618dc498b This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig16B130753DB280031430566D Content-Type: multipart/mixed; boundary="------------030500080907080503090302" This is a multi-part message in MIME format. --------------030500080907080503090302 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Joshua Nichols kirjoitti: > Vlastimil Babka wrote: >> I wonder if ebuild using those variables would be more typing than >> ebuild with own src_compile() :) but not a bad idea anyway. >> >> =20 > The idea is that you don't end up repeating the same code snippet over > and over. Instead, you use some variables to configure what targets get= > called. This helps with maintainence, as if we change src_compile, you > don't have to update it in a trillion places. For example, eant dies by= > itself on error, but a lot of places do eant || die. If we had a defaul= t > src_compile, you'd have to fix it in exactly one place. >> Yeah check is needed, otherwise you'll be trying to compile current -b= in >> packages without src_compile() in ebuild... >> Not sure if any ebuild would use the variable, but why not... >> =20 > The answer to 'why not' would be added complexity. But some packages > would use it, ie, I know some packages have build files at, for example= > 'build/build.xml'. >=20 Committed the attached. Regards, Petteri --------------030500080907080503090302 Content-Type: text/x-patch; name="default-src_compile-2.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline; filename="default-src_compile-2.patch" Index: java-pkg-2.eclass =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /var/cvsroot/gentoo-x86/eclass/java-pkg-2.eclass,v retrieving revision 1.5 diff -u -r1.5 java-pkg-2.eclass --- java-pkg-2.eclass 8 Dec 2006 12:12:04 -0000 1.5 +++ java-pkg-2.eclass 17 Dec 2006 16:41:21 -0000 @@ -33,7 +33,7 @@ # ----------------------------------------------------------------------= -------- RDEPEND=3D"${DEPEND}" =20 -EXPORT_FUNCTIONS pkg_setup +EXPORT_FUNCTIONS pkg_setup src_compile =20 # ----------------------------------------------------------------------= -------- # @eclass-pkg_setup @@ -46,6 +46,27 @@ } =20 # ----------------------------------------------------------------------= -------- +# @eclass-src_compile +# +# Default src_compile for java packages +# variables: +# EANT_BUILD_XML - controls the location of the build.xml (default: ./bu= ild.xml) +# EANT_BUILD_TARGET - the ant target/targets to execute (default: jar) +# EANT_DOC_TARGET - the target to build extra docs under the doc use fla= g +# (default: the one provided by use_doc in +# java-utils-2.eclass) +# ----------------------------------------------------------------------= -------- +java-pkg-2_src_compile() { + if [[ -e "${EANT_BUILD_XML:=3Dbuild.xml}" ]]; then + local antflags=3D"${EANT_BUILD_TARGET:=3Djar}" + hasq doc ${IUSE} && antflags=3D"${antflags} $(use_doc ${EANT_DOC_TARGE= T})" + eant ${antflags} -f ${EANT_BUILD_XML} + else + vecho "${FUNCNAME}: No build.xml found so nothing to do." + fi +} + +# ----------------------------------------------------------------------= -------- # @note # # We need to initialize the environment in every function because Portag= e --------------030500080907080503090302-- --------------enig16B130753DB280031430566D Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFhXP0cxLzpIGCsLQRApmoAJ9StvdqMeQP4XOrF+ON5hwemqcIKwCbBeHL tl7mPqbDzOQRxgoEOOkhwsk= =DPiH -----END PGP SIGNATURE----- --------------enig16B130753DB280031430566D-- -- gentoo-java@gentoo.org mailing list