/[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.105 Revision 1.106
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.105 2008/03/26 23:00:23 ali_bush Exp $ 9# $Header: /var/cvsroot/gentoo-x86/eclass/java-utils-2.eclass,v 1.106 2008/05/03 21:28:07 betelgeuse Exp $
10 10
11# ----------------------------------------------------------------------------- 11# -----------------------------------------------------------------------------
12# @eclass-begin 12# @eclass-begin
13# @eclass-shortdesc Java Utility eclass 13# @eclass-shortdesc Java Utility eclass
14# @eclass-maintainer java@gentoo.org 14# @eclass-maintainer java@gentoo.org
612 612
613 # Let's make a symlink to the directory we have everything else under 613 # Let's make a symlink to the directory we have everything else under
614 dosym ${dest}/api "${JAVA_PKG_SHAREPATH}/api" || die 614 dosym ${dest}/api "${JAVA_PKG_SHAREPATH}/api" || die
615 615
616 if [[ ${symlink} ]]; then 616 if [[ ${symlink} ]]; then
617 debug-print "symlinking ${dest}/{api,${symlink}}"
617 dosym ${dest}/{api,${symlink}} || die 618 dosym ${dest}/{api,${symlink}} || die
618 fi 619 fi
619} 620}
620 621
621# ------------------------------------------------------------------------------ 622# ------------------------------------------------------------------------------
1020 done 1021 done
1021 1022
1022 [[ ${#} -ne 1 ]] && die "${FUNCNAME} takes only one argument besides --*" 1023 [[ ${#} -ne 1 ]] && die "${FUNCNAME} takes only one argument besides --*"
1023 1024
1024 1025
1025 local classpath pkgs="${1}" 1026 local pkgs="${1}"
1026 1027
1027 if [[ "${EAPI}" == "1" ]]; then 1028 if [[ "${EAPI}" == "1" ]]; then
1028 pkgs="${pkgs//:/-}" 1029 pkgs="${pkgs//:/-}"
1029 fi 1030 fi
1030 1031
1031 jars="$(java-config ${deep} --classpath=${pkgs})" 1032 jars="$(java-config ${deep} --classpath=${pkgs})"
1032 [[ $? != 0 || -z "${jars}" ]] && die "java-config --classpath=${pkgs} failed" 1033 [[ $? != 0 ]] && die "java-config --classpath=${pkgs} failed"
1033 debug-print "${pkgs}:${jars}" 1034 debug-print "${pkgs}:${jars}"
1034 1035
1035 for pkg in ${pkgs//,/ }; do 1036 for pkg in ${pkgs//,/ }; do
1036 java-pkg_ensure-dep "${build_only}" "${pkg}" 1037 java-pkg_ensure-dep "${build_only}" "${pkg}"
1037 done 1038 done
1038
1039 if [[ -z "${classpath}" ]]; then
1040 classpath="${jars}"
1041 else
1042 classpath="${classpath}:${jars}"
1043 fi
1044 1039
1045 # Only record jars that aren't build-only 1040 # Only record jars that aren't build-only
1046 if [[ -z "${build_only}" ]]; then 1041 if [[ -z "${build_only}" ]]; then
1047 for pkg in ${pkgs//,/ }; do 1042 for pkg in ${pkgs//,/ }; do
1048 java-pkg_record-jar_ "${pkg}" 1043 java-pkg_record-jar_ "${pkg}"
1049 done 1044 done
1050 fi 1045 fi
1051 1046
1052 echo "${classpath}" 1047 echo "${jars}"
1053} 1048}
1054 1049
1055# ------------------------------------------------------------------------------ 1050# ------------------------------------------------------------------------------
1056# @ebuild-function java-pkg_getjar 1051# @ebuild-function java-pkg_getjar
1057# 1052#
1775# 1770#
1776# @param $1 - -cp or -classpath 1771# @param $1 - -cp or -classpath
1777# @param $2 - classpath; junit and recorded dependencies get appended 1772# @param $2 - classpath; junit and recorded dependencies get appended
1778# @param $@ - the rest of the parameters are passed to java 1773# @param $@ - the rest of the parameters are passed to java
1779# ------------------------------------------------------------------------------ 1774# ------------------------------------------------------------------------------
1780ejunit() { 1775ejunit{
1781 debug-print-function ${FUNCNAME} $* 1776 debug-print-function ${FUNCNAME} $*
1782 1777
1783 local pkgs 1778 local pkgs
1779 if [[ -f ${JAVA_PKG_DEPEND_FILE} ]]; then
1784 for atom in $(cat ${JAVA_PKG_DEPEND_FILE} | tr : ' '); do 1780 for atom in $(cat ${JAVA_PKG_DEPEND_FILE} | tr : ' '); do
1785 pkgs=${pkgs},$(echo ${atom} | sed -re "s/^.*@//") 1781 pkgs=${pkgs},$(echo ${atom} | sed -re "s/^.*@//")
1786 done 1782 done
1783 fi
1787 1784
1788 local cp=$(java-pkg_getjars --with-dependencies junit${pkgs}) 1785 local cp=$(java-pkg_getjars --with-dependencies junit${pkgs})
1789 if [[ ${1} = -cp || ${1} = -classpath ]]; then 1786 if [[ ${1} = -cp || ${1} = -classpath ]]; then
1790 cp="${2}:${cp}" 1787 cp="${2}:${cp}"
1791 shift 2 1788 shift 2

Legend:
Removed from v.1.105  
changed lines
  Added in v.1.106

  ViewVC Help
Powered by ViewVC 1.1.20