Lines 1724-1764
Link Here
|
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 |
# ------------------------------------------------------------------------------ |
1741 |
java-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. |
Lines 1913-1948
Link Here
|
1913 |
fi |
1878 |
fi |
1914 |
done |
1879 |
done |
1915 |
|
1880 |
|
1916 |
# we use this in src_* so we run ant from / |
1881 |
# default ANT_TASKS to WANT_ANT_TASKS, if ANT_TASKS is not set explicitly |
1917 |
if ROOT=/ has_version ">=dev-java/ant-core-1.7.0"; then |
1882 |
ANT_TASKS="${ANT_TASKS:-${WANT_ANT_TASKS}}" |
1918 |
# default ANT_TASKS to WANT_ANT_TASKS, if ANT_TASKS is not set explicitly |
|
|
1919 |
ANT_TASKS="${ANT_TASKS:-${WANT_ANT_TASKS}}" |
1920 |
|
1921 |
# override ANT_TASKS with JAVA_PKG_FORCE_ANT_TASKS if it's set |
1922 |
ANT_TASKS="${JAVA_PKG_FORCE_ANT_TASKS:-${ANT_TASKS}}" |
1923 |
|
1883 |
|
1924 |
if is-java-strict; then |
1884 |
# override ANT_TASKS with JAVA_PKG_FORCE_ANT_TASKS if it's set |
1925 |
# if ant-tasks were not set by ebuild or forced, try to determine them from depends |
1885 |
ANT_TASKS="${JAVA_PKG_FORCE_ANT_TASKS:-${ANT_TASKS}}" |
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 |
1931 |
ANT_TASKS="${ANT_TASKS:-all}" |
1932 |
fi |
1933 |
|
1886 |
|
1934 |
# at this point, ANT_TASKS should be "all", "none" or explicit list |
1887 |
# if ant-tasks is not set by ebuild or forced, use none |
1935 |
if [[ "${ANT_TASKS}" == "all" ]]; then |
1888 |
ANT_TASKS="${ANT_TASKS:-none}" |
1936 |
einfo "Using all available ANT_TASKS" |
|
|
1937 |
elif [[ "${ANT_TASKS}" == "none" ]]; then |
1938 |
einfo "Disabling all optional ANT_TASKS" |
1939 |
else |
1940 |
einfo "Using following ANT_TASKS: ${ANT_TASKS}" |
1941 |
fi |
1942 |
|
1889 |
|
1943 |
export ANT_TASKS |
1890 |
# at this point, ANT_TASKS should be "all", "none" or explicit list |
|
|
1891 |
if [[ "${ANT_TASKS}" == "all" ]]; then |
1892 |
einfo "Using all available ANT_TASKS" |
1893 |
elif [[ "${ANT_TASKS}" == "none" ]]; then |
1894 |
einfo "Disabling all optional ANT_TASKS" |
1895 |
else |
1896 |
einfo "Using following ANT_TASKS: ${ANT_TASKS}" |
1944 |
fi |
1897 |
fi |
1945 |
|
1898 |
|
|
|
1899 |
export ANT_TASKS |
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 |
|