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] JAVA_ANT_ENCODING
Date: Tue, 01 Jul 2008 22:02:40 +0300	[thread overview]
Message-ID: <486A7F50.1010506@gentoo.org> (raw)


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

Most of the time when Java files have !ascii characters they don't 
specify the used encoding in build.xml (usually ISO-8859-1) and 
javac/javadoc split out warnings about this (Many Gentoo machines are 
probably running with UTF8 locales). For this reason you can add 
JAVA_ANT_ENCODING="ISO-8859-1" to the ebuild and with the latest 
javatoolkit the build.xml will get modified to specify the proper encoding.

Regards,
Petteri

[-- Attachment #1.2: java-ant-encoding.patch --]
[-- Type: text/plain, Size: 1877 bytes --]

Index: java-ant-2.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/java-ant-2.eclass,v
retrieving revision 1.35
diff -u -r1.35 java-ant-2.eclass
--- java-ant-2.eclass	20 Jun 2008 10:32:15 -0000	1.35
+++ java-ant-2.eclass	1 Jul 2008 18:56:49 -0000
@@ -240,12 +245,22 @@
 
 		# for javadoc target and all in one pass, we need the new rewriter.
 		local rewriter3="/usr/share/javatoolkit/xml-rewrite-3.py"
-
 		if [[ ! -f ${rewriter3} ]]; then
 			rewriter3="/usr/$(get_libdir)/javatoolkit/bin/xml-rewrite-3.py"
 		fi
 
-		if [[ ! -f ${rewriter3} ]]; then
+		local rewriter4="/usr/$(get_libdir)/javatoolkit/bin/build-xml-rewrite"
+
+		if [[ -x ${rewriter4} && ${JAVA_ANT_ENCODING} ]]; then
+			[[ ${JAVA_ANT_REWRITE_CLASSPATH} ]] && local gcp="-g"
+			[[ ${JAVA_ANT_ENCODING} ]] && local enc="-e ${JAVA_ANT_ENCODING}"
+			eval echo "cElementTree rewriter" ${output}
+			debug-print "${rewriter4} extra args: ${gcp} ${enc}"
+			${rewriter4} ${gcp} ${enc} \
+				-c "${JAVA_PKG_BSFIX_SOURCE_TAGS}" source ${want_source} \
+				-c "${JAVA_PKG_BSFIX_TARGET_TAGS}" target ${want_target} \
+				"${@}" || die "build-xml-rewrite failed"
+		elif [[ ! -f ${rewriter3} ]]; then
 			debug-print "Using second generation rewriter"
 			eval echo "Rewriting source attributes" ${output}
 			eval xml-rewrite-2.py ${files} \
@@ -392,9 +431,8 @@
 # ------------------------------------------------------------------------------
 java-ant_ignore-system-classes() {
 	debug-print-function ${FUNCNAME} $*
-	local file="${1}"
-	[[ -z "${1}" ]] && file=build.xml
-	echo "Changing ignoresystemclasses to true for available tasks"
+	local file=${1:-build.xml}
+	echo "Changing ignoresystemclasses to true for available tasks in ${file}"
 	java-ant_xml-rewrite -f "${file}" --change \
 		-e available -a ignoresystemclasses -v "true"
 }

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

                 reply	other threads:[~2008-07-01 19:02 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=486A7F50.1010506@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