Jason Lee
Jason Lee

Reputation: 598

How to get runtime classpath in gradle kts script?

In gradle script I can do sourceSets.main.runtimeClasspath to get the runtime classpath. But in kts script it complains

Unresolved reference. None of the following candidates is applicable because of receiver type mismatch: 
public val NamedDomainObjectContainer<Configuration>.runtimeClasspath: NamedDomainObjectProvider<Configuration> defined in org.gradle.kotlin.dsl

How can I do it in kts script?

Upvotes: 3

Views: 2221

Answers (1)

Jason Lee
Jason Lee

Reputation: 598

It turns out that I need sourceSets["main"].runtimeClasspath . Not sure if it is the most idiomatic way

Upvotes: 7

Related Questions