Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set an encoding for the JavaDoc in gradle?

Tags:

I have written Java-Classes with JavaDoc-commands that contain special characters like äöü. I generate the JavaDoc using a gradle build-file:

apply plugin: 'java' 

and the in the commandline: gradle javadoc.

The encoding of the original files is UTF-8. The encoding of the JavaDoc files is also UTF-8. But there is no hint in the HTML-sources, that the files are UTF-8. Thats why my browser always thinks it is ISO-8859.

How can I tell javadoc (via gradle) to also add <meta charset="utf-8"/> to the source codes, when generating the JavaDoc?

like image 469
Edward Avatar asked Sep 18 '14 12:09

Edward


People also ask

What is Javadoc in gradle?

Javadoc. Generates HTML API documentation for Java classes. If you create your own Javadoc tasks remember to specify the 'source' property! Without source the Javadoc task will not create any documentation. Example: plugins { id 'java' } task myJavadocs(type: Javadoc) { source = sourceSets.main.allJava }

What is org gradle Jvmargs?

org.gradle.jvmargs - specifies jvmargs used for daemon process. You want to set high enough memory limit to fix dex in Gradle process, so minimum configuration here is -Xmx2g , while 3-4 gigabytes won't hurt either.

What are a gradle project and task?

In Gradle, Task is a single unit of work that a build performs. These tasks can be compiling classes, creating a JAR, Generating Javadoc, and publishing some archives to a repository and more. It can be considered as a single atomic piece of work for a build process.


1 Answers

You'll want to set the javadoc charset option.

javadoc {     options.encoding = 'UTF-8' } 
like image 167
Mark Vieira Avatar answered Oct 24 '22 05:10

Mark Vieira