Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 145750 | Differences between
and this patch

Collapse All | Expand All

(-)/usr/portage/eclass/java-ant-2.eclass (+59 lines)
Lines 145-150 Link Here
145
145
146
	[[ "${JAVA_ANT_IGNORE_SYSTEM_CLASSES}" ]] \
146
	[[ "${JAVA_ANT_IGNORE_SYSTEM_CLASSES}" ]] \
147
		&& java-ant_ignore-system-classes "${S}/build.xml"
147
		&& java-ant_ignore-system-classes "${S}/build.xml"
148
	
149
	if use doc; then
150
		java-ant_link-javadoc
151
	fi
148
152
149
	java-ant_bsfix
153
	java-ant_bsfix
150
	touch "${T}/java-ant-2_src_configure-run"
154
	touch "${T}/java-ant-2_src_configure-run"
Lines 451-453 Link Here
451
		die "xml-rewrite not found"
455
		die "xml-rewrite not found"
452
	fi
456
	fi
453
}
457
}
458
459
460
# ------------------------------------------------------------------------------
461
# @public java-ant_link-javadoc
462
# 
463
# Modifies a build.xml document to link to the local Javadoc documentation for
464
# installed packages.  The following variables determine its behaviour:
465
# 
466
# JAVA_ANT_DOCPATH - Links to the local packages specified in this variable.
467
#                    If not specified, defaults to EANT_GENTOO_CLASSPATH
468
#
469
# @param $@ - the files to rewrite (defaults to build.xml)
470
# ------------------------------------------------------------------------------
471
java-ant_link-javadoc() {
472
	debug-print-function ${FUNCNAME} $*
473
474
	local files=${@:-build.xml}
475
	local helper_args=""
476
477
	# First, get link to local SDK docs, if available
478
	if has_version dev-java/java-sdk-docs ; then
479
		local jdk_package=`best_version dev-java/java-sdk-docs`
480
		local doc_loc=`portageq contents ${ROOT} ${jdk_package} \
481
			| grep "/html/api$"`
482
		helper_args="${helper_args} --link ${doc_loc}"
483
		debug-print "${FUNCNAME}: Linking to local SDK documentation at ${doc_loc}"
484
	fi
485
486
	# get the list of packages to which to link
487
	[[ -z "${JAVA_ANT_DOCPATH}" ]] && JAVA_ANT_DOCPATH="${EANT_GENTOO_CLASSPATH}"
488
	JAVA_ANT_DOCPATH="${JAVA_ANT_DOCPATH//,/ }"
489
	[[ -n "${JAVA_PKG_DEBUG}" ]] && echo "JAVA_ANT_DOCPATH is ${JAVA_ANT_DOCPATH}"
490
491
	# find documentation for each package
492
	for pkg in ${JAVA_ANT_DOCPATH}; do
493
		# check for hamcrest-core documentation
494
		local doc_loc=`java-config-2 --query=JAVADOC_PATH --package=${pkg} 2>/dev/null`
495
		if [[ -n "${doc_loc}" ]]; then
496
			helper_args="${helper_args} --link ${doc_loc}"
497
			debug-print "${FUNCNAME}: Linking to local ${pkg} documentation at ${doc_loc}"
498
		fi
499
	done
500
501
	[[ -n "${JAVA_PKG_DEBUG}" ]] && helper_args="${helper_args} --backup"
502
503
	local jdoc_helper="/usr/$(get_libdir)/javatoolkit/bin/javadoc-helper"
504
505
	eval ${jdoc_helper}  ${helper_args} ${files} || die "javadoc-helper failed"
506
507
	if [[ -n "${JAVA_PKG_DEBUG}" ]]; then
508
		for file in "${files}"; do
509
			diff -NurbB "${file}.jhbk" "${file}"
510
		done
511
	fi
512
}

Return to bug 145750