kotlingradlebuildgradle-kotlin-dslkotlin-dsl

gradle kotlin DSL extendsfrom


How can I reformulate:

testCompile.extendsFrom compileOnly

of the Gradle Groovy DSL to its Kotlin-based equivalent?

configurations {
        testCompile{
            extendsFrom(compileOnly)
        }
    }

My approach above fails.


Solution

  • configurations {
            create("testCompile").apply {
                extendsFrom(configurations.compileOnly.get())
            }
        }
    

    https://github.com/spring-projects/spring-boot/issues/16251