I want to skip some tasks when I run gradle build. I know that it can be done from command line with -x:
-x
gradle build -x unwantedTask >
gradle build -x unwantedTask
Because I need to disable a bunch of tasks, so I use the following codes before apply plugin: in my build.gradle file:
apply plugin:
build.gradle
tasks.whenTaskAdded {task -> if(task.name.contains("unwantedTask")) { task.enabled = false } }