Skip to content

Instantly share code, notes, and snippets.

@ghale
Created August 5, 2019 14:56
Show Gist options
  • Save ghale/82904d5c411a4fdf17306bf4f0f23590 to your computer and use it in GitHub Desktop.
Save ghale/82904d5c411a4fdf17306bf4f0f23590 to your computer and use it in GitHub Desktop.
apply plugin: DbPlugin
tasks.register("subtask1")
tasks.register("subtask2")
tasks.named("fixDbPermissions") {
addStep subtask1
addStep subtask2
}
class DbPlugin implements Plugin<Project> {
void apply(Project project) {
def createMinDb = project.tasks.register("createMinDb")
def fixDbPerms = project.tasks.register("fixDbPermissions") {
dependsOn createMinDb
ext.addStep = { subtask ->
dependsOn subtask
subtask.mustRunAfter createMinDb
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment