ashald / EnvFile

EnvFile 3.x is a plugin for JetBrains IDEs that allows you to set environment variables for your run configurations from one or multiple files.
MIT License
539 stars 129 forks source link

In IntelliJ 2020.2 Experimental features checkbox is greyed out #119

Open charlesritchea opened 4 years ago

charlesritchea commented 4 years ago

I was using EnvFile experimental features when running tests with Gradle Test Runner, and just like the description says, it broke at anytime :) I know I need to just load the .env file in gradle and problem solved, but wanted to let you know.

liudongcxw commented 4 years ago

How Do I Load .env in gradle?

charlesritchea commented 4 years ago

@liudongcxw in a task:

    doFirst() {
        def props = new Properties()
        file(".env").withInputStream { props.load(it) }
        props.each { String key, String val ->
            System.setProperty(key, val)
            environment key, val
        }
    }
ashald commented 1 year ago

Still relevant?