Gradle build error because of illegal Unicode characters
Smail opened this issue · 11 comments
So I just tried to build BuildCraft on Windows 10 with gradlew.bat setupCIWorkspace build
and I get errors because Unicode characters are getting falsely interpreted. I attached a file with the error message. But this is the second time a unicode character created a problem. The first was in
BuildCraftBaseDir/BuildCraft/common/buildcraft/lib/client/guide/parts/contents/PageLinkItemStack.java
in line 72 for the paragraph symbol. I replaced it with the character code \u00a7
and after that the file worked. I don't think changing all the characters locally to their equivalent Unicode character codes is a good solution. This is probably a Windows related problem and I tried using Powershell as well as CMD, but both print the same error. I also tried using the gradlew
command instead of gradlew.bat
, however this isn't fixing it either. Has anyone a solution to this or do I have to change the files? Note: The character displayed in the text file is different from the one in the shell (there it's ¬
).
error.txt
That's odd - in theory it should be compiled in UTF-8 format, but for some reason it isn't? Can you upload your full gradle log file, as there might be more information in there? (run with --debug but pipe the output to a log file with a command like gradle setupCiWorkspace build --debug > log.txt
)
Ok, so I started fixing the Unicode errors, but after that I started getting more errors about the javadoc and realized that all the errors I got are javadoc related event the Unicode one, so running gradlew.bat setupCIWorkspace build -x javadoc
will not really fix the issues, but will exclude the javadoc.
...oh that could be it, if it's failed at javadoc generation rather than compiling, it could be because I haven't told the javadoc generation to use UTF-8...
Ok, can you retry with that commit? (If you haven't cloned the repository already I would recommend doing that to update it)
Yes I pulled the repository and the utf-8 problems where fixed, but there are still other problems left, which are because of the use of self-enclosing elements in the HTML javadoc like in \common\buildcraft\lib\script\SimpleScript.java:639: error: self-closing element not allowed
. You have to replace the <br/>
with <br>
.
Sorry for not responding earlier - this still needs fixing, but I probably won't get around to it anytime soon (as I should really fix all javadoc tag issues, as I assume there might be more of them)
What javadoc options are you including to make those errors appear? I only get a few warnings when I run it...
Maybe it's because of different JDK versions. Which are you using? Mine:
openjdk version "1.8.0_222"
OpenJDK Runtime Environment (build 1.8.0_222-10)
OpenJDK 64-Bit Server VM (build 25.222-b10, mixed mode)
Ok, I have a fix. Add options.addStringOption('Xdoclint:none', '-quiet')
to javadoc
in the gradle.build
file, but I think the javadoc should be fixed to match the proper HTML spec, since this is only a workaround and not really a fix
Take a look at https://blog.joda.org/2014/02/turning-off-doclint-in-jdk-8-javadoc.html