Force UTF-8 encoding in javac and scalac (#152)

This commit is contained in:
Raven Szewczyk authored and GitHub committed 2023-03-22 21:47:03 +01:00
1 parent 84b3277b15
commit 2da362842b
1 file changed
+9
+9
View File
@@ -160,6 +160,14 @@ java {
}
}
tasks.withType(JavaCompile).configureEach {
options.encoding = "UTF-8"
}
tasks.withType(ScalaCompile).configureEach {
options.encoding = "UTF-8"
}
pluginManager.withPlugin('org.jetbrains.kotlin.jvm') {
// If Kotlin is enabled in the project
kotlin {
@@ -1014,6 +1022,7 @@ idea {
}
compiler.javac {
afterEvaluate {
javacAdditionalOptions = "-encoding utf8"
moduleJavacAdditionalOptions = [
(project.name + ".main"): tasks.compileJava.options.compilerArgs.collect { '"' + it + '"' }.join(' ')
]