File: resumeBuild.gradle

package info (click to toggle)
gradle 4.4.1-6
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 85,104 kB
  • sloc: java: 319,724; xml: 14,356; cpp: 4,200; ansic: 1,025; sh: 300; makefile: 60; asm: 17; jsp: 17; objc: 10
file content (10 lines) | stat: -rw-r--r-- 417 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
def resumeTask = project.property("resume")

if (resumeTask) {
    gradle.taskGraph.whenReady { graph ->
        def allTasks = graph.allTasks
        def resumeIndex = allTasks.findIndexOf { it.path == resumeTask }
        if (resumeIndex < 0) throw new GradleException("Can't resume from $resumeTask because no such task is scheduled for execution")
        allTasks.subList(0, resumeIndex)*.enabled = false
    }
}