I wrote a gradle task run some process for an android project. This task will be executed in a jenkins job. I would like to set the build status of the jenkins job based on the status of the process i run. Below is a simple snippet from the task.
class MyTask extends DefaultTask {
@TaskAction
public void runDirectTask() {
PluginConfig config = project.mytask
TASK_STATUS status =myProcessWithStatusAsReturn(config)
switch (status) {
case PASS:
println("status pass") //TODO handle build pass
break
case UNSTABLE:
println("status unstable") //TODO handle build unstable
break
case FAILED:
println("status fail") //TODO handle build fail
break
}
}
}
Thanks in advance..