-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use as environment #3
Comments
@mindhaq Sorry for the rate reply. Which one do you mean that is like a type-safe environment variable, or nested variable? For example in the case of the former, I think that solves by a type definition file support. (However, conventional dotenv has no concept of type safety.) |
My use case is to put all dotenv properties into the build environment. Currently, I do it manually like this:
But I'd like to just do
|
I could support to get all environment variables contains dotenv files provided, and it returns |
Released at 1.1.0 |
Thank you, I finally upgraded the plugin and |
@mindhaq Can you please share a usage snippet of your build.gradle ? |
From my fun readDotEnv(environment: MutableMap<String, Any>) {
environment.putAll(env.allVariables)
}
tasks.getByName<BootRun>("bootRun") {
readDotEnv(environment)
}
task<Test>("integrationTest") {
readDotEnv(environment)
// ....
}
This allows me to configure environment variables in a |
Thanks @mindhaq I ended up doing this in my build.gradle bootRun {
File env_file = new File(".env")
if(env_file.exists())
{
environment.putAll(env.allVariables)
}
} I still need to refactor this into a separate function so that other tasks can use it. |
I would like to use the
env
created by the plugin as anenvironment
inside the gradle script, which is aMap<String,?>
.Currently, I don't see a way to do that.
The text was updated successfully, but these errors were encountered: