xjc-gradle-plugin icon indicating copy to clipboard operation
xjc-gradle-plugin copied to clipboard

Configure language for JavaDoc generation

Open henning-meinhardt opened this issue 6 months ago • 3 comments

Hi, i'm missing an option to specify the language code or locale to use when invoking XJC. The current behavior is that environment variable LANG decides which language is selected for generating the JavaDoc comments in the generated files. I would like to have this reproducible, so I'd like a way to define the language on my own.

You currently use // Set encoding (work-around for https://github.com/gradle/gradle/issues/13843) forkOptions.environment("LANG", System.getenv("LANG") ?: "C.UTF-8") which basically passes the LANG envionment variable down to the XJC worker. But unfortunately LANG is nothing you can control from within a gradle build script or the gradle.properties file. The environment variable can only be set outside of the gradle script, i.e. its value depends on the environment found when the script runs.

My suggestion is to provide a "language" or "locale" option in the XJCExtension that is honored in the forkOptions code above.

I'm using Gradle 8.5 by the way.

Kind regards Henning

henning-meinhardt avatar Jan 03 '24 12:01 henning-meinhardt