public inbox for gentoo-java@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Petteri Räty" <betelgeuse@gentoo.org>
To: Gentoo Java <gentoo-java@lists.gentoo.org>
Subject: [gentoo-java] Improvements to javadoc handling
Date: Wed, 28 Nov 2007 03:51:55 +0200	[thread overview]
Message-ID: <474CC9BB.2000502@gentoo.org> (raw)


[-- 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 --]

                 reply	other threads:[~2007-11-28  1:54 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=474CC9BB.2000502@gentoo.org \
    --to=betelgeuse@gentoo.org \
    --cc=gentoo-java@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox