/[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.77 Revision 1.80
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.77 2007/04/24 10:26:33 caster Exp $ 9# $Header: /var/cvsroot/gentoo-x86/eclass/java-utils-2.eclass,v 1.80 2007/04/26 23:32:12 caster 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
832# --build-only - makes the jar(s) not added into package.env DEPEND line. 832# --build-only - makes the jar(s) not added into package.env DEPEND line.
833# (assumed automatically when called inside src_test) 833# (assumed automatically when called inside src_test)
834# --with-dependencies - get jars also from requested package's dependencies 834# --with-dependencies - get jars also from requested package's dependencies
835# transitively. 835# transitively.
836# --into $dir - symlink jar(s) into $dir (must exist) instead of . 836# --into $dir - symlink jar(s) into $dir (must exist) instead of .
837# @param $1 - Package to get jars from. 837# @param $1 - Package to get jars from, or comma-separated list of packages in
838# case other parameters are not used.
838# @param $2 - jar from package. If not specified, all jars will be used. 839# @param $2 - jar from package. If not specified, all jars will be used.
839# @param $3 - When a single jar is specified, destination filename of the 840# @param $3 - When a single jar is specified, destination filename of the
840# symlink. Defaults to the name of the jar. 841# symlink. Defaults to the name of the jar.
841# ------------------------------------------------------------------------------ 842# ------------------------------------------------------------------------------
842# TODO could probably be cleaned up a little 843# TODO could probably be cleaned up a little
845 846
846 local build_only="" 847 local build_only=""
847 local destdir="." 848 local destdir="."
848 local deep="" 849 local deep=""
849 850
850 [[ "${EBUILD_PHASE}" == "test" ]] && build_only="true" 851 [[ "${EBUILD_PHASE}" == "test" ]] && build_only="build"
851 852
852 while [[ "${1}" == --* ]]; do 853 while [[ "${1}" == --* ]]; do
853 if [[ "${1}" = "--build-only" ]]; then 854 if [[ "${1}" = "--build-only" ]]; then
854 build_only="build" 855 build_only="build"
855 elif [[ "${1}" = "--with-dependencies" ]]; then 856 elif [[ "${1}" = "--with-dependencies" ]]; then
873 local error_msg="There was a problem getting the classpath for ${target_pkg}." 874 local error_msg="There was a problem getting the classpath for ${target_pkg}."
874 local classpath 875 local classpath
875 classpath="$(java-config ${deep} --classpath=${target_pkg})" 876 classpath="$(java-config ${deep} --classpath=${target_pkg})"
876 [[ $? != 0 ]] && die ${error_msg} 877 [[ $? != 0 ]] && die ${error_msg}
877 878
879 # When we have commas this functions is called to bring jars from multiple
880 # packages. This affects recording of dependencencies performed later
881 # which expects one package only, so we do it here.
882 if [[ ${target_pkg} = *,* ]]; then
883 for pkg in ${target_pkg//,/ }; do
884 java-pkg_ensure-dep "${build_only}" "${pkg}"
885 [[ -z "${build_only}" ]] && java-pkg_record-jar_ "${pkg}"
886 done
887 # setting this disables further record-jar_ calls later
888 build_only="build"
889 else
878 java-pkg_ensure-dep "${build_only}" "${target_pkg}" 890 java-pkg_ensure-dep "${build_only}" "${target_pkg}"
891 fi
879 892
880 pushd ${destdir} > /dev/null \ 893 pushd ${destdir} > /dev/null \
881 || die "failed to change directory to ${destdir}" 894 || die "failed to change directory to ${destdir}"
882
883 # When we have commas this functions is called to bring jars from multiple
884 # packages. This affects recording of dependencencies because that syntax uses :
885 # if we don't change them to : gjl and java-config -d -p break
886 if [[ ${target_pkg} = *,* ]]; then
887 build_only="true"
888 java-pkg_record-jar_ ${target_pkg//,/:}
889 fi
890 895
891 local jar 896 local jar
892 for jar in ${classpath//:/ }; do 897 for jar in ${classpath//:/ }; do
893 local jar_name=$(basename "${jar}") 898 local jar_name=$(basename "${jar}")
894 if [[ ! -f "${jar}" ]] ; then 899 if [[ ! -f "${jar}" ]] ; then
957 debug-print-function ${FUNCNAME} $* 962 debug-print-function ${FUNCNAME} $*
958 963
959 local build_only="" 964 local build_only=""
960 local deep="" 965 local deep=""
961 966
962 [[ "${EBUILD_PHASE}" == "test" ]] && build_only="true" 967 [[ "${EBUILD_PHASE}" == "test" ]] && build_only="build"
963 968
964 while [[ "${1}" == --* ]]; do 969 while [[ "${1}" == --* ]]; do
965 if [[ "${1}" = "--build-only" ]]; then 970 if [[ "${1}" = "--build-only" ]]; then
966 build_only="build" 971 build_only="build"
967 elif [[ "${1}" = "--with-dependencies" ]]; then 972 elif [[ "${1}" = "--with-dependencies" ]]; then
990 classpath="${classpath}:${jars}" 995 classpath="${classpath}:${jars}"
991 fi 996 fi
992 997
993 # Only record jars that aren't build-only 998 # Only record jars that aren't build-only
994 if [[ -z "${build_only}" ]]; then 999 if [[ -z "${build_only}" ]]; then
995 oldifs="${IFS}"
996 IFS=","
997 for pkg in ${pkgs}; do 1000 for pkg in ${pkgs//:/ }; do
998 java-pkg_record-jar_ "${pkg}" 1001 java-pkg_record-jar_ "${pkg}"
999 done 1002 done
1000 IFS="${oldifs}"
1001 fi 1003 fi
1002 1004
1003 echo "${classpath}" 1005 echo "${classpath}"
1004} 1006}
1005 1007
1025java-pkg_getjar() { 1027java-pkg_getjar() {
1026 debug-print-function ${FUNCNAME} $* 1028 debug-print-function ${FUNCNAME} $*
1027 1029
1028 local build_only="" 1030 local build_only=""
1029 1031
1030 [[ "${EBUILD_PHASE}" == "test" ]] && build_only="true" 1032 [[ "${EBUILD_PHASE}" == "test" ]] && build_only="build"
1031 1033
1032 while [[ "${1}" == --* ]]; do 1034 while [[ "${1}" == --* ]]; do
1033 if [[ "${1}" = "--build-only" ]]; then 1035 if [[ "${1}" = "--build-only" ]]; then
1034 build_only="build" 1036 build_only="build"
1035 else 1037 else

Legend:
Removed from v.1.77  
changed lines
  Added in v.1.80

  ViewVC Help
Powered by ViewVC 1.1.20