dependency-analysis-gradle-plugin icon indicating copy to clipboard operation
dependency-analysis-gradle-plugin copied to clipboard

Support custom source sets (source sets other than "main" and "test")

Open DotSpy opened this issue 3 years ago • 1 comments

Hello, in project we have integration tests specified by:


configure(integrationTests()) {
  sourceSets {
    create(integrationTest) {
      withConvention(org.jetbrains.kotlin.gradle.plugin.KotlinSourceSet::class) {
        kotlin.srcDir("src/integrationTest/kotlin")
        resources.srcDir("src/integrationTest/resources")
        compileClasspath += sourceSets["main"].output + configurations["testRuntimeClasspath"]
        runtimeClasspath += output + compileClasspath + sourceSets["test"].runtimeClasspath
      }
    }
  }

  task<Test>(integrationTest) {
    description = "Runs the integration tests"
    group = "verification"
    testClassesDirs = sourceSets[integrationTest].output.classesDirs
    classpath = sourceSets[integrationTest].runtimeClasspath
    mustRunAfter(tasks["test"])
    useJUnitPlatform()
  }
}

in one of subprojects i have only integration test(no unit) and plugin suggest me to remove all testImplementation libraries that i'm using there, can i somehow specify custom source set for it or somehow specify that dependency analysis should consume compileIntegrationTestKotlin and compileIntegrationTestJava tasks?

DotSpy avatar Aug 12 '21 08:08 DotSpy

The plugin currently provides no support for custom source sets. It only supports main and test. I'll consider this a feature request for a future release.

autonomousapps avatar Aug 28 '21 17:08 autonomousapps

This should work now with v1.19.0. (There might be more improvements with #854.)

Happy about feedback though.

jjohannes avatar Feb 10 '23 06:02 jjohannes

I'm going to preemptively close this in the expectation that it works as desired. Feel free to reopen if you see issues!

autonomousapps avatar Feb 10 '23 19:02 autonomousapps