I'm writing a custom gradle plugin. I'm working on two tasks at the moment:
project.tasks.create("prepareCustomTask", PrepareCustomTask) {
it.group = TASK_GROUP
it.description = "Prepares custom task"
}
project.tasks.create("customTask", CustomTask) {
it.group = TASK_GROUP
it.description = "Executes custom task"
}
I have debugged both a lot and found that once I add grgit line
grgit.checkout(branch: "dev", startPoint: "origin/" + "dev", createBranch: true)
in the "PrepareCustomTask" gradle doesn't find the task "CustomTask" when executing, even though it is listed in gradle task -all
Task 'CustomTask' not found in root project
I'm confused about why this is happening. Can you help me?
Edit: I'm calling both tasks with
gradle prepareCustomTask --refresh-dependencies --stacktrace -Dorg.ajoberstar.grgit.auth.username=**** -Dorg.ajoberstar.grgit.auth.password=****
gradle customTask --refresh-dependencies --stacktrace -Dorg.ajoberstar.grgit.auth.username=**** -Dorg.ajoberstar.grgit.auth.password=****