This module provides a derived type build_progress_t for printing build status
and progress messages to the console while the backend is building the package.
The build_progress_t type supports two modes: normal and plain
where the former does ‘pretty’ output and the latter does not.
The normal mode is intended for typical interactive usage whereas
‘plain’ mode is used with the --verbose flag or when stdout is not attached
to a terminal (e.g. when piping or redirecting stdout). In these cases,
the pretty output must be suppressed to avoid control codes being output.
Constructor for build_progress_t
Initialise a new build progress object
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(build_target_ptr), | intent(in), | target | :: | target_queue(:) |
The queue of scheduled targets |
|
| logical, | intent(in), | optional | :: | plain_mode |
Enable ‘plain’ output for progress object |
|
| character(len=*), | intent(in), | optional | :: | build_dir |
Build directory |
Progress object to initialise
Build progress object
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| character(len=:), | public, | allocatable | :: | build_dir |
Build directory |
||
| type(compile_command_table_t), | public | :: | compile_commands |
The compile_commands.json table |
|||
| type(console_t), | public | :: | console |
Console object for updating console lines |
|||
| integer, | public | :: | n_complete |
Number of completed targets |
|||
| integer, | public | :: | n_target |
Total number of targets scheduled |
|||
| integer, | public, | allocatable | :: | output_lines(:) |
Store needed when updating previous console lines |
||
| logical, | public | :: | plain_mode | = | .true. |
‘Plain’ output (no colors or updating) |
|
| type(build_target_ptr), | public, | pointer | :: | target_queue(:) |
Queue of scheduled build targets |
Constructor for build_progress_t
| private function new_build_progress (target_queue, plain_mode, build_dir) | Initialise a new build progress object |
| procedure, public :: compiling_status => output_status_compiling | Output ‘compiling’ status for build target |
| procedure, public :: completed_status => output_status_complete | Output ‘complete’ status for build target |
| procedure, public :: dump_commands => output_write_compile_commands | Output ‘compile_commands.json’ to build/ folder |
| procedure, public :: success => output_progress_success | Output finished status for whole package |