maiflai / gradle-scalatest

A plugin to enable the use of scalatest in a gradle Scala project.
The Unlicense
73 stars 35 forks source link

How do I pass `-Dfile.encoding=UTF-8` to the jvm running ScalaTest? #88

Closed gabrieljones closed 3 years ago

gabrieljones commented 3 years ago

How do I pass -Dfile.encoding=UTF-8 to the jvm running ScalaTest?

i.e. What is the equivalent of <argLine>-Dfile.encoding=UTF-8</argLine> from scalatest-maven-plugin

<plugin>
            <groupId>org.scalatest</groupId>
            <artifactId>scalatest-maven-plugin</artifactId>
            <version>1.0</version>
            <configuration>
                <argLine>-Dfile.encoding=UTF-8</argLine>
            </configuration>
</plugin>
maiflai commented 3 years ago

From https://docs.gradle.org/current/dsl/org.gradle.api.tasks.testing.Test.html I think it is:

jvmArgs '-Dfile.encoding=UTF-8'

And if you want to set that across all test tasks:

tasks.withType(Test) {
  jvmArgs '-Dfile.encoding=UTF-8'
}