gradle build: setup compiler charset

This commit is contained in:
Alexey Andreev 2023-02-02 10:42:45 +01:00
parent f09a427827
commit 895ec99826
3 changed files with 12 additions and 1 deletions

View File

@ -87,6 +87,9 @@ val generateConfig by tasks.registering {
""".trimIndent()) """.trimIndent())
} }
} }
tasks.compileJava.configure { dependsOn(generateConfig) } tasks.compileJava.configure {
dependsOn(generateConfig)
options.encoding = "UTF-8"
}
sourceSets.main.configure { java.srcDir(generatedConfigDir) } sourceSets.main.configure { java.srcDir(generatedConfigDir) }

View File

@ -73,6 +73,10 @@ gradle.allprojects {
mavenLocal() mavenLocal()
mavenCentral() mavenCentral()
} }
tasks.withType<JavaCompile>().configureEach {
options.encoding = "UTF-8"
}
} }
gradle.afterProject { gradle.afterProject {

View File

@ -61,6 +61,10 @@ gradle.allprojects {
gradle.allprojects { gradle.allprojects {
apply(plugin = "javaVersion") apply(plugin = "javaVersion")
tasks.withType<JavaCompile>().configureEach {
options.encoding = "UTF-8"
}
} }
gradle.afterProject { gradle.afterProject {