Question: For fust build project I use such command

```
gradle clean build -x checkstyleMain -x checkstyleTest -x findbugsMain -x findbugsTest -x test

```

How I can create short task for this?
Something like this

```
task short {
  clean
//  build-x checkstyleMain -x checkstyleTest -x findbugsMain -x findbugsTest -x test
}

```

I have error with **-x**

**UPDATE**

I add such 

```
gradle.taskGraph.whenReady {
  if (gradle.taskGraph.hasTask(":fastRun")) {
    checkstyleMain.enabled = false
    checkstyleTest.enabled = false
    findbugsMain = fasle
    findbugsTest = false
    test = false
  }
}

task fastRun {
//  clean
//  build
}

```

And run

gradle clean build fastRun

But all tasks run =(

Answer: 
Unfortunately, usual [ways of skipping tasks](https://docs.gradle.org/current/userguide/more_about_tasks.html?_ga=2.186246569.1463708433.1517899817-467902555.1516197029#sec:skipping_tasks) won't work in your case just out of the box.

But you can use a [`TaskGraph`](https://docs.gradle.org/current/javadoc/org/gradle/api/execution/TaskExecutionGraph.html) to check whether your custom task will be executed and if it'll be, disable all the tasks you don't want to be executed. For that, you need to add such a configuration snippet:

```
gradle.taskGraph.whenReady {
    if (gradle.taskGraph.hasTask(":short")) {
        checkstyleMain.enabled = false
        checkstyleTest.enabled = false
        // any other task you want to skip...
    }
}

```

This snippet should be placed into the root of the build skript. Just note, that task names could differ depending on the project structure you have.

It's waiting until the task graph is ready and if it has a task named `short` (that means, that this task will be executed), then it disables some other tasks.
You can add the following codes to skip the tasks,

```
gradle.startParameter.excludedTaskNames += "testClasses"
gradle.startParameter.excludedTaskNames += "test"

```