[ant] 04/05: Set the encoding of the javadoc task to 'UTF-8' if none was specified and SOURCE_DATE_EPOCH is set
Emmanuel Bourg
ebourg-guest at moszumanska.debian.org
Thu Apr 14 10:23:09 UTC 2016
This is an automated email from the git hooks/post-receive script.
ebourg-guest pushed a commit to branch master
in repository ant.
commit e442db75a6efb47a42846a56863f6acc5f71e5ac
Author: Emmanuel Bourg <ebourg at apache.org>
Date: Thu Apr 14 12:11:39 2016 +0200
Set the encoding of the javadoc task to 'UTF-8' if none was specified and SOURCE_DATE_EPOCH is set
---
debian/changelog | 3 +++
.../patches/0010-reproducible-javadoc-task.patch | 29 +++++++++++++++++-----
2 files changed, 26 insertions(+), 6 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index d4922f7..c0a89b4 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -3,6 +3,9 @@ ant (1.9.7-1) UNRELEASED; urgency=medium
* Team upload.
* New upstream release
- Refreshed the patches
+ * Reproducibility improvements:
+ - The Javadoc task uses UTF-8 as the default encoding if none was specified
+ and SOURCE_DATE_EPOCH is set.
* Standards-Version updated to 3.9.8 (no changes)
-- Emmanuel Bourg <ebourg at apache.org> Thu, 14 Apr 2016 11:07:15 +0200
diff --git a/debian/patches/0010-reproducible-javadoc-task.patch b/debian/patches/0010-reproducible-javadoc-task.patch
index ee03abd..f2c59ca 100644
--- a/debian/patches/0010-reproducible-javadoc-task.patch
+++ b/debian/patches/0010-reproducible-javadoc-task.patch
@@ -1,17 +1,20 @@
-Description: Set the locale of the javadoc task to 'en' if none was specified and SOURCE_DATE_EPOCH is set.
+Description: Improves the reproducibility of the javadoc task for the Debian
+ builds by setting the locale to 'en' and the encoding to UTF-8 if none was
+ specified and SOURCE_DATE_EPOCH is set.
Author: Emmanuel Bourg <ebourg at apache.org>
Forwarded: no
--- a/src/main/org/apache/tools/ant/taskdefs/Javadoc.java
+++ b/src/main/org/apache/tools/ant/taskdefs/Javadoc.java
-@@ -472,6 +472,7 @@
+@@ -472,6 +472,8 @@
private String excludeDocFilesSubDir = null;
private String docEncoding = null;
private boolean postProcessGeneratedJavadocs = true;
+ private String locale;
++ private String encoding;
private final ResourceCollectionContainer nestedSourceFiles
= new ResourceCollectionContainer();
-@@ -895,6 +896,8 @@
+@@ -895,6 +897,8 @@
* @param locale the locale to use.
*/
public void setLocale(final String locale) {
@@ -20,12 +23,26 @@ Forwarded: no
// createArgument(true) is necessary to make sure -locale
// is the first argument (required in 1.3+).
cmd.createArgument(true).setValue(locale);
-@@ -1703,6 +1706,10 @@
+@@ -907,6 +911,8 @@
+ * @param enc the name of the encoding for the source files.
+ */
+ public void setEncoding(final String enc) {
++ this.encoding = encoding;
++
+ cmd.createArgument().setValue("-encoding");
+ cmd.createArgument().setValue(enc);
+ }
+@@ -1703,6 +1709,15 @@
*/
@Override
public void execute() throws BuildException {
-+ if (locale == null && System.getenv("SOURCE_DATE_EPOCH") != null) {
-+ setLocale("en");
++ if (System.getenv("SOURCE_DATE_EPOCH") != null) {
++ if (locale == null) {
++ setLocale("en");
++ }
++ if (encoding == null) {
++ setEncoding("UTF-8");
++ }
+ }
+
checkTaskName();
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/ant.git
More information about the pkg-java-commits
mailing list