How to debug why a given exclude on a source set m...
# community-support
b
How to debug why a given exclude on a source set might not work? Currently because of it is failing on the compileTestJava step 🤔
Copy code
testing {
  suites {
    getting(JvmTestSuite::class) {
      targets {
        all {
          testTask.configure {
            sources {
              groovy {
                // exclude the suite to not double run
                exclude(listOf("**/JenkinsSuite.groovy"))
                exclude {
                  logger.warn(it.name)
                  true
                }
              }
            }
            useJUnitPlatform()
            finalizedBy(tasks.jacocoTestReport)
          }
        }
      }
    }
is what I have but does not work because:
Copy code
❯ ./gradlew test
Configuration on demand is an incubating feature.
Calculating task graph as configuration cache cannot be reused because file 'build.gradle.kts' has changed.

> Task :compileTestGroovy FAILED
startup failed:
/Users/bgabor8/git/demo/test/main/JenkinsSuite.groovy: 6: unable to resolve class org.junit.platform.suite.api.Suite
 @ line 6, column 1.
   import org.junit.platform.suite.api.Suite
1
v
Is that a literal copy?
If so, I'd wonder if any of the contents of that lambda has any effect at all
You nowhere tell which task to get and configure, so you just define the configure closure but it is not applied to anyhting
Add
val test by
before the
getting
and you probably get what you expect