mbonnin
09/29/2017, 8:49 AM(task("test") as Test?)?.testLogging?.showStandardStreams = true
leigh
09/29/2017, 1:49 PMA problem occurred configuring root project '...'.
> Cannot add task ':test' as a task with that name already exists.
mbonnin
09/29/2017, 1:50 PMmbonnin
09/29/2017, 1:51 PM(task["test"] as Test?)?.testLogging?.showStandardStreams = true
mbonnin
09/29/2017, 1:51 PMmbonnin
09/29/2017, 1:51 PMleigh
09/29/2017, 1:57 PM()
e: build.gradle.kts:14:2: Function invocation 'task(...)' expected
e: build.gradle.kts:14:2: None of the following functions can be called with the arguments supplied:
public open fun task(p0: String): Task defined in Build_gradle
public open fun task(p0: String, p1: Closure<(raw) Any!>): Task defined in Build_gradle
public open fun task(p0: (Mutable)Map<String!, *>, p1: String): Task defined in Build_gradle
public open fun task(p0: (Mutable)Map<String!, *>, p1: String, p2: Closure<(raw) Any!>): Task defined in Build_gradle
mbonnin
09/29/2017, 2:04 PMmkobit
09/29/2017, 2:05 PMTest::class
and test
as the task name would workmbonnin
09/29/2017, 2:06 PMtasks.getByName("test")
mkobit
09/29/2017, 2:20 PMas Test
leigh
09/29/2017, 4:02 PMdagguh
09/29/2017, 9:16 PMtasks["test"]
should work as well
also, no need to cast to Test?
go for Test