From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lists.gentoo.org ([140.105.134.102] helo=robin.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1JB9tX-0007nd-7K for garchives@archives.gentoo.org; Sat, 05 Jan 2008 14:21:03 +0000 Received: from robin.gentoo.org (localhost [127.0.0.1]) by robin.gentoo.org (8.14.2/8.14.0) with SMTP id m05EKGP9001495; Sat, 5 Jan 2008 14:20:16 GMT Received: from slimak.dkm.cz (smtp.dkm.cz [62.24.64.34]) by robin.gentoo.org (8.14.2/8.14.0) with SMTP id m05EKFon001486 for ; Sat, 5 Jan 2008 14:20:16 GMT Received: (qmail 95115 invoked by uid 0); 5 Jan 2008 14:20:15 -0000 Received: from rb5cu63.net.upc.cz (HELO ?192.168.1.100?) (89.176.226.63) by smtp.dkm.cz with SMTP; 5 Jan 2008 14:20:15 -0000 Message-ID: <477F921F.9010507@gentoo.org> Date: Sat, 05 Jan 2008 15:20:15 +0100 From: Vlastimil Babka User-Agent: Thunderbird 2.0.0.9 (X11/20071212) 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: [gentoo-java] ejavac enhancement proposal Content-Type: multipart/mixed; boundary="------------000401030409070401060208" X-Archives-Salt: 8831dcdd-b597-4a3d-9c57-6aa2e5b6a273 X-Archives-Hash: 4456ff5621b70de403f121942091d9e6 This is a multi-part message in MIME format. --------------000401030409070401060208 Content-Type: text/plain; charset=ISO-8859-2; format=flowed Content-Transfer-Encoding: 7bit I think this would be useful, many ebuilds do that manually. RFC. VB --------------000401030409070401060208 Content-Type: text/x-patch; name="ejavac.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="ejavac.patch" Index: java-utils-2.eclass =================================================================== RCS file: /var/cvsroot/gentoo-x86/eclass/java-utils-2.eclass,v retrieving revision 1.100 @@ -1975,13 +1930,27 @@ # @ebuild-function ejavac # # Javac wrapper function. Will use the appropriate compiler, based on -# /etc/java-config/compilers.conf +# /etc/java-config/compilers.conf. Dies on compiler errors. # +# @example +# ejavac -classpath . foo/*.java -d classes +# ejavac --srcdir src -d classes +# +# @param --srcdir $dir - Specifies a dir that will be recursively searched for +# .java files (via find) to pass as to the compiler, instead of passing +# a list of files manually. Uses temporary file to store the list, to +# prevent too long command line. The list is passed as the last argument. # @param $@ - Arguments to be passed to the compiler # ------------------------------------------------------------------------------ ejavac() { debug-print-function ${FUNCNAME} $* + local srcdir="" + if [[ ${1} == --srcdir ]]; then + srcdir="${2}" + shift 2 + fi + java-pkg_init-compiler_ local compiler_executable @@ -1998,8 +1967,15 @@ die "java-pkg_javac-args failed" fi - [[ -n ${JAVA_PKG_DEBUG} ]] && echo ${compiler_executable} ${javac_args} "${@}" - ${compiler_executable} ${javac_args} "${@}" || die "ejavac failed" + if [[ -n ${srcdir} ]]; then + local list="${T}/ejavac.list" + find "${srcdir}" -name "*.java" > "${list}" || die "find failed" + [[ -n ${JAVA_PKG_DEBUG} ]] && echo ${compiler_executable} ${javac_args} "${@}" "@${list}" + ${compiler_executable} ${javac_args} "${@}" "@${list}" || die "ejavac failed" + else + [[ -n ${JAVA_PKG_DEBUG} ]] && echo ${compiler_executable} ${javac_args} "${@}" + ${compiler_executable} ${javac_args} "${@}" || die "ejavac failed" + fi } # ------------------------------------------------------------------------------ --------------000401030409070401060208-- -- gentoo-java@gentoo.org mailing list