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'
}
}
}
Seems simpler to just
dependsOn 'taskToAlias'
--works in Gradle 7.4.2