/[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.102 Revision 1.103
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.102 2008/01/12 15:04:26 caster Exp $ 9# $Header: /var/cvsroot/gentoo-x86/eclass/java-utils-2.eclass,v 1.103 2008/01/12 15:08:47 caster 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
1722 dodir /usr/share/ant/${TASKS_DIR} 1722 dodir /usr/share/ant/${TASKS_DIR}
1723 touch "${D}/usr/share/ant/${TASKS_DIR}/${TASK_NAME}" 1723 touch "${D}/usr/share/ant/${TASKS_DIR}/${TASK_NAME}"
1724} 1724}
1725 1725
1726# ------------------------------------------------------------------------------ 1726# ------------------------------------------------------------------------------
1727# @internal-function java-pkg_ant-tasks-from-deps
1728#
1729# Function to determine ANT_TASKS from DEPEND variable for backwards
1730# compatibility with ebuilds that don't set ANT_TASKS before calling eant() or
1731# WANT_ANT_TASKS before inheriting java-pkg-2. If the DEPEND string contains
1732# "dev-java/ant" or "dev-java/ant-tasks", then it returns "all", otherwise
1733# "none". It's not smart enough to cope with USE flag depends but that shouldn't
1734# be a problem, the worst it can do is activace all tasks when not needed.
1735# Note that this is called only with JAVA_PKG_STRICT=1, to find ebuilds with
1736# insufficient dependencies, otherwise all available tasks are used for
1737# backwards compatilbility.
1738#
1739# @return "all" or "none"
1740# ------------------------------------------------------------------------------
1741java-pkg_ant-tasks-from-deps() {
1742 local found_ant found_ant_tasks
1743
1744 for dep in ${DEPEND}
1745 do
1746 local ant="$(awk '/(dev-java\/ant)/ { if (match($1, "(dev-java/ant)((-[0-9])+|$)", m)) print m[1] }' <<< ${dep})"
1747 [[ "${ant}" == "dev-java/ant" ]] && found_ant=true
1748 [[ "${dep}" == *"ant-tasks"* ]] && found_ant_tasks=true
1749 done
1750
1751 if [[ -n "${found_ant}" || -n "${found_ant_tasks}" ]]; then
1752 java-pkg_announce-qa-violation --nodie "The ebuild DEPENDS on deprecated ant or ant-tasks"
1753 echo "all"
1754 else
1755 # ebuild doesn't set ANT_TASKS and doesn't depend on ant-tasks or ant
1756 # so we deactivate all tasks that may be installed
1757 echo "none"
1758 fi
1759}
1760
1761# ------------------------------------------------------------------------------
1762# @internal-function java-pkg_ant-tasks-depend 1727# @internal-function java-pkg_ant-tasks-depend
1763# 1728#
1764# Translates the WANT_ANT_TASKS variable into valid dependencies. 1729# Translates the WANT_ANT_TASKS variable into valid dependencies.
1765# ------------------------------------------------------------------------------ 1730# ------------------------------------------------------------------------------
1766java-pkg_ant-tasks-depend() { 1731java-pkg_ant-tasks-depend() {
1911 echo "more info." 1876 echo "more info."
1912 fi 1877 fi
1913 fi 1878 fi
1914 done 1879 done
1915 1880
1916 # we use this in src_* so we run ant from /
1917 if ROOT=/ has_version ">=dev-java/ant-core-1.7.0"; then
1918 # default ANT_TASKS to WANT_ANT_TASKS, if ANT_TASKS is not set explicitly 1881 # default ANT_TASKS to WANT_ANT_TASKS, if ANT_TASKS is not set explicitly
1919 ANT_TASKS="${ANT_TASKS:-${WANT_ANT_TASKS}}" 1882 ANT_TASKS="${ANT_TASKS:-${WANT_ANT_TASKS}}"
1920 1883
1921 # override ANT_TASKS with JAVA_PKG_FORCE_ANT_TASKS if it's set 1884 # override ANT_TASKS with JAVA_PKG_FORCE_ANT_TASKS if it's set
1922 ANT_TASKS="${JAVA_PKG_FORCE_ANT_TASKS:-${ANT_TASKS}}" 1885 ANT_TASKS="${JAVA_PKG_FORCE_ANT_TASKS:-${ANT_TASKS}}"
1923 1886
1924 if is-java-strict; then
1925 # if ant-tasks were not set by ebuild or forced, try to determine them from depends
1926 if [[ -z "${ANT_TASKS}" ]]; then
1927 ANT_TASKS="$(java-pkg_ant-tasks-from-deps)"
1928 fi
1929 else
1930 # if ant-tasks is not set by ebuild or forced, activate all of them 1887 # if ant-tasks is not set by ebuild or forced, use none
1931 ANT_TASKS="${ANT_TASKS:-all}" 1888 ANT_TASKS="${ANT_TASKS:-none}"
1932 fi
1933 1889
1934 # at this point, ANT_TASKS should be "all", "none" or explicit list 1890 # at this point, ANT_TASKS should be "all", "none" or explicit list
1935 if [[ "${ANT_TASKS}" == "all" ]]; then 1891 if [[ "${ANT_TASKS}" == "all" ]]; then
1936 einfo "Using all available ANT_TASKS" 1892 einfo "Using all available ANT_TASKS"
1937 elif [[ "${ANT_TASKS}" == "none" ]]; then 1893 elif [[ "${ANT_TASKS}" == "none" ]]; then
1938 einfo "Disabling all optional ANT_TASKS" 1894 einfo "Disabling all optional ANT_TASKS"
1939 else 1895 else
1940 einfo "Using following ANT_TASKS: ${ANT_TASKS}" 1896 einfo "Using following ANT_TASKS: ${ANT_TASKS}"
1941 fi 1897 fi
1942 1898
1943 export ANT_TASKS 1899 export ANT_TASKS
1944 fi
1945 1900
1946 [[ -n ${JAVA_PKG_DEBUG} ]] && antflags="${antflags} --execdebug -debug" 1901 [[ -n ${JAVA_PKG_DEBUG} ]] && antflags="${antflags} --execdebug -debug"
1947 [[ -n ${PORTAGE_QUIET} ]] && antflags="${antflags} -q" 1902 [[ -n ${PORTAGE_QUIET} ]] && antflags="${antflags} -q"
1948 1903
1949 local gcp="${EANT_GENTOO_CLASSPATH}" 1904 local gcp="${EANT_GENTOO_CLASSPATH}"

Legend:
Removed from v.1.102  
changed lines
  Added in v.1.103

  ViewVC Help
Powered by ViewVC 1.1.20