When I run a test in Gradle I would like to pass some properties:
./gradlew test -DmyProperty=someValue
So in my Spock test I will use to retrieve the value:
def value = System.getProperty("myProperty")
Im using the kotlin gradle dsl. When I try and use 'tasks.test' as in this documentation: https://docs.gradle.org/current/userguide/java_testing.html#test_filtering
'test' is not recognised in my build.gradle.kts
file.
I'm assuming I would need to use something similar to the answer in the post below but it is not clear how it should be done in the using the gradle kotlin DSL.