Kotlin DSL, Gradle and private information

Hi there!
I’m working on a porting of a big library from Java to Kotlin and use gradle to create a mpp project.
Gradle traduce Kotlin to JS and JVM and give the chance to pubblish the module JS to npmjs.com
I have to put private information like password and email somewhere.
Where? in gradle.properties.kts? or could i create a specific file as npm.properties.kts? Or use enviroment variable?
Can explain some good pratictes and how i can retrieve them in buildscript?

Thanks in advance

If you use TeamCity, I can suggest password parameters, please check official docs here. During the build script you can just read gradle property.

I hope there is the same for Jenkins, GitLab, etc.

You can use gradle.properties in the home directory. Gradle can also read environment variables.

1 Like