Skip to content

Commit

Permalink
Add build tasks in build group
Browse files Browse the repository at this point in the history
  • Loading branch information
nberth committed Apr 8, 2024
1 parent dbb2419 commit cf8972f
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions src/vscode/superbol-vscode-platform/superbol_tasks.ml
Original file line number Diff line number Diff line change
Expand Up @@ -121,28 +121,32 @@ let cobc_execution ?config attributes =
~command:(`String cobc)
~args:(List.map (fun elt -> `String elt) args))

let make_default_cobc_task =
Task.make
~source:"SuperBOL"
~scope:Workspace
~problemMatchers:[
"$gnucobol";
"$gnucobol-warning";
"$gnucobol-error";
"$gnucobol-note";
]
let make_default_cobc_task ~name ~definition ~execution =
let task =
Task.make ~name ~definition ~execution ()
~source:"SuperBOL"
~scope:Workspace
~problemMatchers:[
"$gnucobol";
"$gnucobol-warning";
"$gnucobol-error";
"$gnucobol-note";
]
in
Task.set_group task TaskGroup.build;
task

let cobc_build_task ~task ?config attributes =
Promise.Option.return @@
make_default_cobc_task ()
make_default_cobc_task
~name:(Task.name task)
~definition:(Task.definition task)
~execution:(cobc_execution ?config attributes)

let define_cobc_build_task ?config ~debug name =
let map_attributes = List.map (fun (a, C (_, f, d)) -> a, f d) in
let attributes = map_attributes @@ attributes_spec ~debug in
make_default_cobc_task ()
make_default_cobc_task
~name
~definition:(TaskDefinition.create () ~type_ ~attributes)
~execution:(cobc_execution ?config attributes)
Expand Down

0 comments on commit cf8972f

Please sign in to comment.