Private Information in Gradle with Kotlin DSL

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

Hello,

check out this plugin: https://github.com/etiennestuder/gradle-credentials-plugin
it could help with your use case.

1 Like

Great! I think i will use this plugin? Do you know how to do it in the normal way?

Hello what do you mean normal way? Like without use of the plugin? Or how to use the plugin?

Without the plugin as you wrote you can use environment variables or any file and read it from there.
And with the plugin just follow the instructions in readme on github.