You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello I'm doing my best to understand the way this plugin works but I find it quite difficult.
I am trying to make a task to run a cmake build process with the intend to start the DAP debugger.
For this I try to use the orchestrator strategy (I've tried wrestling with dependencies as wel). return { name = "cmake build", builder = function() return { name = "CMake build", strategy = { "orchestrator", tasks = { { cmd = { "mkdir" }, args = { "-p", "build" }, components = { "custom.check_cmake_project" } }, { cmd = { "cd" }, args = { "build" } }, { cmd = { "cmake" }, args = { "../src" } }, } } } end }
I made a custom component "custom.check_cmake_project" which simply checks whether or not the current directory contains a CMakeLists.txt file.
If not it returns false so that the task does not get run.
This is the code I am using in the component:
` on_pre_start = function(self, task)
local currentDir = vim.fn.expand("%:p:h");
local cmakePath = currentDir .. "/CMakeLists.txt";
--log:error(Dump(task));
--log:error(Dump(task.dependencies));
--log:error(require("overseer.task_list"));
if (fh.FileExists(cmakePath)) then
return true;
else
log:error("This tasks should be run from a directory containing CMakeLists.txt");
task:dispose(true);
return false;
end
end,
`
The functionality works, but when the task is disposed it leaves the other remaining tasks in a pending state.
What is the correct way to define a sequence, which if any of the tasks fails, it removes any remaining tasks in the sequence?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello I'm doing my best to understand the way this plugin works but I find it quite difficult.
I am trying to make a task to run a cmake build process with the intend to start the DAP debugger.
For this I try to use the orchestrator strategy (I've tried wrestling with dependencies as wel).
return { name = "cmake build", builder = function() return { name = "CMake build", strategy = { "orchestrator", tasks = { { cmd = { "mkdir" }, args = { "-p", "build" }, components = { "custom.check_cmake_project" } }, { cmd = { "cd" }, args = { "build" } }, { cmd = { "cmake" }, args = { "../src" } }, } } } end }
I made a custom component "custom.check_cmake_project" which simply checks whether or not the current directory contains a CMakeLists.txt file.
If not it returns false so that the task does not get run.
This is the code I am using in the component:
` on_pre_start = function(self, task)
local currentDir = vim.fn.expand("%:p:h");
local cmakePath = currentDir .. "/CMakeLists.txt";
`
The functionality works, but when the task is disposed it leaves the other remaining tasks in a pending state.
What is the correct way to define a sequence, which if any of the tasks fails, it removes any remaining tasks in the sequence?
Beta Was this translation helpful? Give feedback.
All reactions