I have a gradle multi-module project which was using a very old version of gradle, now I’m upgrading to gradle 8 and kotlin buildscripts.
I’m facing the issue that the old gradle config used the following to declare a dependency between test sources:
testImplementation project(':my.sibling.project').sourceSets.test.output
At least with the kotlin DSL, that no longer works. I tried several alterantives, but gradle is very persistent in telling me that sourceSets
does not exist. I also tried workarounds like:
project(':my.sibling.project').the<org.gradle.api.tasks.SourceSetContainer>()["test"].output
… but that gives the error that no such extension exists on the sibling project (all of the sub-projects use Java/Kotlin).
Any idea? Am I missing something? I’ve read about test fixtures, but I would like to keep the general project structure the same in this upgrade.