Slackbot
03/08/2022, 2:56 PMMarkus Maier
03/08/2022, 3:15 PMconfigurations.integrationTestImplementation.extendsFrom testImplementation
If you're using the analyzeDependencies plugin, this will have to be taken into account, else you can get a lot of UnusedDeclared violations there.
EDIT: safer code that will fail if generated config name ever changesSukhbir Singh
03/08/2022, 4:37 PMMarkus Maier
03/08/2022, 7:44 PMSukhbir Singh
03/09/2022, 3:45 AMDaniel Svensson
03/09/2022, 1:30 PMMarkus Maier
03/09/2022, 1:52 PMsrc/test
and still be usable from src/integrationTest
? That would be possible, I suppose, but it requires more manual configuration and is not as cleanly separated. In our project, we were quite happy when we could ditch that approach for test-fixtures.Daniel Svensson
03/09/2022, 1:53 PMmapOf(
"testCompileClasspath" to "integrationTestCompileClasspath",
"testRuntimeClasspath" to "integrationTestRuntimeClasspath"
).map { (src, dst) ->
addExtendsFromRelation(dst, src)
}
Daniel Svensson
03/09/2022, 1:54 PMMarkus Maier
03/09/2022, 2:02 PMconfigurations {
integrationTestCompileClasspath.extendsFrom configurations.testCompileClasspath
...
}
Daniel Svensson
03/09/2022, 2:53 PMconfigurations {
configurations["integrationTestCompileClasspath"].extendsFrom(configurations["testCompileClasspath"])
configurations["integrationTestRuntimeClasspath"].extendsFrom(configurations["testRuntimeClasspath"])
}
... and yep, works fine as well.Daniel Svensson
03/09/2022, 2:55 PMDaniel Svensson
03/09/2022, 2:57 PMconfigurations {
get("integrationTestCompileClasspath").extendsFrom(get("testCompileClasspath"))
get("integrationTestRuntimeClasspath").extendsFrom(get("testRuntimeClasspath"))
}
perhaps.