/[gentoo-x86]/eclass/java-utils-2.eclass
Gentoo

Diff of /eclass/java-utils-2.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.29 Revision 1.30
4# Copyright (c) 2004, Karl Trygve Kalleberg <karltk@gentoo.org> 4# Copyright (c) 2004, Karl Trygve Kalleberg <karltk@gentoo.org>
5# Copyright (c) 2004-2005, Gentoo Foundation 5# Copyright (c) 2004-2005, Gentoo Foundation
6# 6#
7# Licensed under the GNU General Public License, v2 7# Licensed under the GNU General Public License, v2
8# 8#
9# $Header: /var/cvsroot/gentoo-x86/eclass/java-utils-2.eclass,v 1.29 2006/12/03 13:05:06 betelgeuse Exp $ 9# $Header: /var/cvsroot/gentoo-x86/eclass/java-utils-2.eclass,v 1.30 2006/12/03 17:42:53 betelgeuse Exp $
10 10
11 11
12# ----------------------------------------------------------------------------- 12# -----------------------------------------------------------------------------
13# @eclass-begin 13# @eclass-begin
14# @eclass-shortdesc Java Utility eclass 14# @eclass-shortdesc Java Utility eclass
302# ------------------------------------------------------------------------------ 302# ------------------------------------------------------------------------------
303java-pkg_addcp() { 303java-pkg_addcp() {
304 java-pkg_append_ JAVA_PKG_CLASSPATH "${@}" 304 java-pkg_append_ JAVA_PKG_CLASSPATH "${@}"
305 java-pkg_do_write_ 305 java-pkg_do_write_
306} 306}
307
308 307
309# ------------------------------------------------------------------------------ 308# ------------------------------------------------------------------------------
310# @ebuild-function java-pkg_doso 309# @ebuild-function java-pkg_doso
311# 310#
312# Installs any number of JNI libraries 311# Installs any number of JNI libraries
438 # a reasonable way to catch # docs for all of the 437 # a reasonable way to catch # docs for all of the
439 # old ebuilds. 438 # old ebuilds.
440 java-pkg_recordjavadoc 439 java-pkg_recordjavadoc
441} 440}
442 441
443# TODO document 442# ------------------------------------------------------------------------------
443# @ebuild-function java-pkg_dojavadoc
444#
445# Installs javadoc documentation. This should be controlled by the doc use flag.
446#
447# @param $1: - The javadoc root directory.
448#
449# @example:
450# java-pkg_dojavadoc docs/api
451#
452# ------------------------------------------------------------------------------
444java-pkg_dojavadoc() { 453java-pkg_dojavadoc() {
445 local dir="$1" 454 local dir="$1"
446 455
447 java-pkg_check-phase install 456 java-pkg_check-phase install
448 457
764# The providing packages are recorded as dependencies into package.env DEPEND 773# The providing packages are recorded as dependencies into package.env DEPEND
765# line, unless "--build-only" is passed as the very first argument, for jars 774# line, unless "--build-only" is passed as the very first argument, for jars
766# that have to be present only at build time and are not needed on runtime 775# that have to be present only at build time and are not needed on runtime
767# (junit testing etc). 776# (junit testing etc).
768# 777#
769# Example: Get the classpath for xerces-2, 778# Example: Get the classpath for xerces-2 and xalan,
770# java-pkg_getjars xerces-2 xalan 779# java-pkg_getjars xerces-2,xalan
771# Example Return: 780# Example Return:
772# /usr/share/xerces-2/lib/xml-apis.jar:/usr/share/xerces-2/lib/xmlParserAPIs.jar:/usr/share/xalan/lib/xalan.jar 781# /usr/share/xerces-2/lib/xml-apis.jar:/usr/share/xerces-2/lib/xmlParserAPIs.jar:/usr/share/xalan/lib/xalan.jar
773# 782#
774# @param $1 - (optional) "--build-only" makes the jar(s) not added into 783# @param $1 - (optional) "--build-only" makes the jar(s) not added into
775# package.env DEPEND line. 784# package.env DEPEND line.
776# @param $@ - list of packages to get jars from 785# @param $2 - list of packages to get jars from
786# (passed to java-config --classpath)
777# ------------------------------------------------------------------------------ 787# ------------------------------------------------------------------------------
778java-pkg_getjars() { 788java-pkg_getjars() {
779 debug-print-function ${FUNCNAME} $* 789 debug-print-function ${FUNCNAME} $*
780 790
781 local build_only="" 791 [[ ${#} -lt 1 || ${#} -gt 2 ]] && die "${FUNCNAME} takes only one or two arguments"
782 792
783 if [[ "${1}" = "--build-only" ]]; then 793 if [[ "${1}" = "--build-only" ]]; then
784 build_only="true" 794 local build_only="true"
785 shift 795 shift
786 fi 796 fi
787 797
788 [[ ${#} -lt 1 ]] && die "At least one argument needed"
789
790 # NOTE could probably just pass $@ to java-config --classpath. and return it
791 local classpath pkg 798 local classpath pkgs="${1}"
792 for pkg in ${@//,/ }; do
793 #for pkg in $(echo "$@" | tr ',' ' '); do
794 jars="$(java-config --classpath=${pkg})" 799 jars="$(java-config --classpath=${pkgs})"
795 [[ -z "${jars}" ]] && die "java-config --classpath=${pkg} failed" 800 [[ -z "${jars}" ]] && die "java-config --classpath=${pkgs} failed"
796 debug-print "${pkg}:${jars}" 801 debug-print "${pkgs}:${jars}"
797 802
798 if [[ -z "${classpath}" ]]; then 803 if [[ -z "${classpath}" ]]; then
799 classpath="${jars}" 804 classpath="${jars}"
800 else 805 else
801 classpath="${classpath}:${jars}" 806 classpath="${classpath}:${jars}"
802 fi 807 fi
808
803 # Only record jars that aren't build-only 809 # Only record jars that aren't build-only
804 [[ -z "${build_only}" ]] && java-pkg_record-jar_ "${pkg}" 810 if [[ -z "${build_only}" ]]; then
811 oldifs="${IFS}"
812 IFS=":"
813 for pkg in ${pkgs}; do
814 java-pkg_record-jar_ "${pkg}"
805 done 815 done
816 IFS="${oldifs}"
817 fi
818
806 echo "${classpath}" 819 echo "${classpath}"
807} 820}
808 821
809# ------------------------------------------------------------------------------ 822# ------------------------------------------------------------------------------
810# @ebuild-function java-pkg_getjar 823# @ebuild-function java-pkg_getjar

Legend:
Removed from v.1.29  
changed lines
  Added in v.1.30

  ViewVC Help
Powered by ViewVC 1.1.20