Unable to exclude task after upgrading from 6.6.1 to 6.8 or later

Hello, I have a build.gradle that builds several Git submodules. It’s like:

task buildUpstream(type: GradleBuild) {
    buildFile = "somewhere/build.gradle"
    tasks = [':dist:distDir']
    startParameter.excludedTaskNames = [':dist:copyClientBinaries']

It executes :dist:distDir task that depends on other tasks.
You can find it here:

As you might notice, buildUpstream task excludes copyClientBinaries .

It was working without any problem before I upgraded.
However, after upgrading it seems like the copyClientBinaries is not excluded.
Do you guys have any clue?

1 Like

I was able to reproduce your issue but was unable to narrow down exactly what’s causing this regression. To help narrow things down I also checked Gradle 6.7.1, the issue does not appear.

This has been reported in test task cannot be excluded with setExcludedTaskNames · Issue #16756 · gradle/gradle · GitHub

I suspect it may be related to these PRs:

@donat, given your work in this area perhaps you can pinpoint an issue faster than I.

1 Like

Thanks for checking it!
It happens when I upgrade from 6.7.1 to 6.8

I did some more digging and left my additional thoughts in the github issue.

1 Like