Search code examples
gradle-kotlin-dsl

How to pass all system properties to test task in gradle kotlin dsl?


How do I convert this gradle groovy snippet to gradle kotlin dsl without being very verbose?

test {
    systemProperties System.getProperties() 
}

Solution

  • I ended up with this...

    tasks.named<Test>("test") {
        systemProperties System.getProperties() as Map<String, Any>
    }