1

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.

Georg Heiler
  • 16,916
  • 36
  • 162
  • 292

2 Answers2

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

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

LE GALL Benoît
  • 7,159
  • 1
  • 36
  • 48
Georg Heiler
  • 16,916
  • 36
  • 162
  • 292
0

If you want to change an already existing config use

configurations.testImplementation.get().extendsFrom(configurations.compileOnly.get())
Stefan Haberl
  • 9,812
  • 7
  • 72
  • 81