Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Alias a task name in Gradle

The following snippet is how to alias a task name in Gradle:

build.gradle

    // You can now run "gradle alias" and it would be equivalent to running "gradle taskToAlias"
    task alias {
        dependsOn allprojects.collect { proj ->
            proj.tasks.matching {
                it.name == 'taskToAlias'
            }
        }
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.