Adam
09/08/2024, 12:03 PMval foo by sourceSets.creating {
// main 'foo' sources
}
val fooTest by sourceSets.creating {
// tests for the main 'foo' source set
extendsFrom(foo) // make the foo code visible in the foo tests
}
Are there any examples for extending one custom source set with another? StackOverflow is full of answers that seem hacky and non-idiomatic.ephemient
09/08/2024, 12:17 PMAdam
09/08/2024, 12:17 PMtesting {
suites.create<JvmTestSuite>("fooTest") {
dependencies {
implementation(project(project.path)) {
val cap = provider { "${group}:${name}-foo" }
capabilities { requireCapability(cap) }
}
}
}
}ephemient
09/08/2024, 12:18 PMAdam
09/08/2024, 12:18 PMsrc/foo aren't visible in src/fooTestephemient
09/08/2024, 12:19 PMimplementation(project) {
capabilities { ... }
would set it up right but hmmephemient
09/08/2024, 12:21 PMinternal? IDE or command line build? (I think there's a number of intellij bugs around jvm test suites)Adam
09/08/2024, 12:24 PMgradleTestKit(). It's just classes from src/foo that are missing.Adam
09/08/2024, 12:27 PM./gradlew check as in IntelliJAdam
09/08/2024, 12:32 PMtestFixtures() util function it modifies the dependency to append -test-fixtures using internal Gradle functionality. So maybe it's just not possible for a project to depend on a variant of itself without using Gradle internals.Adam
09/08/2024, 12:59 PM--run-tasks helped.