[GRADLE-2974] --exclude-task does not work with multiple dependent tasks. Created: 09/Dec/13  Updated: 25/Feb/14  Resolved: 25/Feb/14

Status: Resolved
Project: Gradle
Affects Version/s: None
Fix Version/s: 1.12-rc-1

Type: Task
Reporter: Gradle Forums Assignee: Luke Daley
Resolution: Fixed Votes: 1



I want to exclude a task from execution. To do this i use --exclude-task/-x on the command line. However when I give more than one task on the command line, that depends on the excluded task, the task is executed anyway.

A short build script to reproduce this is:

task level0
task level1 (dependsOn:level0)
task level2a (dependsOn:level1)
task level2b (dependsOn:level1)

What I want to do is exclude task level1.
Giving just one task on the command line:

gradle level2a -x level1

executes just level2a as expected.

However adding another dependent to the command line like this:

gradle level2a level2b -x level1

executes level2a, level2b and level1.

I think building task level1 is an error.

Task level0 is never build.

I tested this with gradle 1.9 and 1.10-rc-1.


Gradle 1.10-rc-1
Build time: 2013-12-04 15:41:28 UTC
Build number: none
Revision: 36ced393628875ff15575fa03d16c1349ffe8bb6

Groovy: 1.8.6
Ant: Apache Ant(TM) version 1.9.2 compiled on July 8 2013
Ivy: 2.2.0
JVM: 1.7.0_45 (Oracle Corporation 24.45-b08)
OS: Linux 2.6.32-5-amd64 amd64

Generated at Wed Jun 30 12:36:28 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.