Skip to content

Commit 506d29f

Browse files
authored
Set Javadoc encoding (#686)
This avoids issues with javadoc if the platform default happens to be US-ASCII or some other encoding that does not support i18n characters in Google Ads API comments.
1 parent 5fcf3d0 commit 506d29f

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

buildSrc/src/main/groovy/com.google.api-ads.java-conventions.gradle

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,14 @@ jar {
6363

6464
javadoc {
6565
options.addStringOption('Xdoclint:none', '-quiet')
66+
// Sets the input (source) file encoding to UTF-8. The javadoc tool will also
67+
// use this for the output (HTML) file encoding. Without this option, the
68+
// javadoc tool will use the default encoding for the platform.
69+
options.encoding = 'UTF-8'
70+
}
71+
72+
tasks.withType(JavaCompile) {
73+
options.encoding = 'UTF-8'
6674
}
6775

6876
components.java.withVariantsFromConfiguration(configurations.testFixturesApiElements) { skip() }
@@ -135,10 +143,6 @@ if (project.properties.containsKey("release")) {
135143
}
136144
}
137145

138-
tasks.withType(JavaCompile) {
139-
options.encoding = 'UTF-8'
140-
}
141-
142146
dependencies {
143147
api 'com.google.api:gax'
144148
api 'com.google.api:gax-grpc'

0 commit comments

Comments
 (0)