我正在编写一个自定义的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)
即使执行gradle task -all
中的任务中的
在执行时也找不到任务“ CustomTask”
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=****