kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jjko...@apache.org
Subject kafka git commit: KAFKA-4025; make sure file.encoding system property is set to UTF-8 when calling rat
Date Wed, 12 Oct 2016 23:28:50 GMT
Repository: kafka
Updated Branches:
  refs/heads/trunk c04486f4a -> 83116c733


KAFKA-4025; make sure file.encoding system property is set to UTF-8 when calling rat

https://issues.apache.org/jira/browse/KAFKA-4025
this patch sets the file.encoding system property to UTF-8 before invoking rat during the
build process and resets it to the original value afterwards

Author: radai-rosenblatt <radai.rosenblatt@gmail.com>

Reviewers: Joel Koshy <jjkoshy.w@gmail.com>

Closes #1710 from radai-rosenblatt/fix-build-on-windows


Project: http://git-wip-us.apache.org/repos/asf/kafka/repo
Commit: http://git-wip-us.apache.org/repos/asf/kafka/commit/83116c73
Tree: http://git-wip-us.apache.org/repos/asf/kafka/tree/83116c73
Diff: http://git-wip-us.apache.org/repos/asf/kafka/diff/83116c73

Branch: refs/heads/trunk
Commit: 83116c733d09f5c85ced56701cdb614ce6efc847
Parents: c04486f
Author: radai-rosenblatt <radai.rosenblatt@gmail.com>
Authored: Wed Oct 12 16:28:29 2016 -0700
Committer: Joel Koshy <jjkoshy@gmail.com>
Committed: Wed Oct 12 16:28:29 2016 -0700

----------------------------------------------------------------------
 gradle/rat.gradle | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/83116c73/gradle/rat.gradle
----------------------------------------------------------------------
diff --git a/gradle/rat.gradle b/gradle/rat.gradle
index d62b372..3ead016 100644
--- a/gradle/rat.gradle
+++ b/gradle/rat.gradle
@@ -84,9 +84,15 @@ class RatTask extends DefaultTask {
     if (!reportDir.exists()) {
       reportDir.mkdirs()
     }
-    generateXmlReport(reportDir)
-    printUnknownFiles()
-    generateHtmlReport()
+    def origEncoding = System.getProperty("file.encoding")
+    try {
+      System.setProperty("file.encoding", "UTF-8") //affects the output of the ant rat task
+      generateXmlReport(reportDir)
+      printUnknownFiles()
+      generateHtmlReport()
+    } finally {
+      System.setProperty("file.encoding", origEncoding)
+    }
   }
 }
 


Mime
View raw message