public inbox for gentoo-java@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-java] Improvements to javadoc handling
@ 2007-11-28  1:51 Petteri Räty
  0 siblings, 0 replies; only message in thread
From: Petteri Räty @ 2007-11-28  1:51 UTC (permalink / raw
  To: Gentoo Java


[-- Attachment #1.1: Type: text/plain, Size: 693 bytes --]

With the attached patch that I just committed dojavadoc will create an
api symlink to /usr/share/<pkg>-<slot> if you have USE="doc" and the
package installs javadocs using dojavadoc. This way it stays the same
between revisions which is easier for ides like Netbeans and Eclipse.
You could also do this with the Portage DOC_SYMLINKS_DIR feature but I
find it quite nice to provide everything Java in the same directory for
the package so you have to browse only one directory in your IDE. The
same patch also adds support for --symlink for ebuild writes. That way
we don't have to break html links that expect the api directory to be
named in some specific way.

Regards,
Petteri

[-- Attachment #1.2: dojavadoc.patch --]
[-- Type: text/plain, Size: 1765 bytes --]

Index: java-utils-2.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/java-utils-2.eclass,v
retrieving revision 1.98
diff -u -r1.98 java-utils-2.eclass
--- java-utils-2.eclass	26 Nov 2007 21:00:59 -0000	1.98
+++ java-utils-2.eclass	28 Nov 2007 01:40:47 -0000
@@ -559,15 +559,27 @@
 #
 # Installs javadoc documentation. This should be controlled by the doc use flag.
 #
-# @param $1: - The javadoc root directory.
+# @param $1: optional --symlink creates to symlink like this for html
+#            documentation bundles.
+# @param $2: - The javadoc root directory.
 #
 # @example:
 #	java-pkg_dojavadoc docs/api
+#   java-pkg_dojavadoc --symlink apidocs docs/api
 #
 # ------------------------------------------------------------------------------
 java-pkg_dojavadoc() {
 	debug-print-function ${FUNCNAME} $*
+
+	# For html documentation bundles that link to Javadoc
+	local symlink
+	if [[ ${1} = --symlink ]]; then
+		symlink=${2}
+		shift 2
+	fi
+
 	local dir="$1"
+	local dest=/usr/share/doc/${PF}/html
 
 	# QA checks
 
@@ -581,6 +593,11 @@
 		is-java-strict && die "${msg}"
 	fi
 
+	if [[ -e ${D}/${dest}/api ]]; then
+		eerror "${dest} already exists. Will not overwrite."
+		die "${dest}"
+	fi
+
 	# Renaming to match our directory layout
 
 	local dir_to_install="${dir}"
@@ -592,7 +609,14 @@
 
 	# Actual installation
 
-	java-pkg_dohtml -r ${dir_to_install}
+	java-pkg_dohtml -r "${dir_to_install}"
+
+	# Let's make a symlink to the directory we have everything else under
+	dosym ${dest} "${JAVA_PKG_SHAREPATH}/api" || die
+
+	if [[ ${symlink} ]]; then
+		dosym ${dest}/{api,${symlink}} || die
+	fi
 }
 
 # ------------------------------------------------------------------------------

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 252 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-11-28  1:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-28  1:51 [gentoo-java] Improvements to javadoc handling Petteri Räty

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox