简体   繁体   中英

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.

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

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

If you want to change an already existing config use

configurations.testImplementation.get().extendsFrom(configurations.compileOnly.get())

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM