我正在编写一个自定义 gradle 插件。我目前正在处理两项任务:
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"
}
我已经调试了很多,发现一旦我添加了 grgit行
grgit.checkout(branch: "dev", startPoint: "origin/" + "dev", createBranch: true)
在“PrepareCustomTask” gradle 执行时找不到任务“CustomTask”,即使它列在gradle task -all
Task 'CustomTask' not found in root project
我很困惑为什么会这样。你能帮助我吗?
编辑:我正在调用这两个任务
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=****