watch_fpm_graph Module

Compute watch lists from the fpm dependency graph.

Builds the fpm model and expands targets into a set of source files to watch. Optional dependency watching can include dependency project trees (including those located under the build directory).

This module is responsible for connecting fpm-watch to the fpm internal model/target structures. It selects the relevant closure of targets for the configured command (build/test/run), and produces: - files: unique normalized file paths - file_mask: bitmasks mapping each file to root targets - roots: the root targets corresponding to runnable/testable executables


Uses

  • module~~watch_fpm_graph~~UsesGraph module~watch_fpm_graph watch_fpm_graph fpm fpm module~watch_fpm_graph->fpm fpm_command_line fpm_command_line module~watch_fpm_graph->fpm_command_line fpm_dependency fpm_dependency module~watch_fpm_graph->fpm_dependency fpm_error fpm_error module~watch_fpm_graph->fpm_error fpm_filesystem fpm_filesystem module~watch_fpm_graph->fpm_filesystem fpm_manifest fpm_manifest module~watch_fpm_graph->fpm_manifest fpm_model fpm_model module~watch_fpm_graph->fpm_model fpm_strings fpm_strings module~watch_fpm_graph->fpm_strings fpm_targets fpm_targets module~watch_fpm_graph->fpm_targets iso_fortran_env iso_fortran_env module~watch_fpm_graph->iso_fortran_env module~watch_filter watch_filter module~watch_fpm_graph->module~watch_filter module~watch_log watch_log module~watch_fpm_graph->module~watch_log module~watch_types watch_types module~watch_fpm_graph->module~watch_types module~watch_util watch_util module~watch_fpm_graph->module~watch_util module~watch_filter->fpm_filesystem module~watch_filter->fpm_strings module~watch_filter->iso_fortran_env module~watch_log->iso_fortran_env module~watch_log->module~watch_types face face module~watch_log->face module~watch_types->fpm_command_line module~watch_types->fpm_strings module~watch_types->iso_fortran_env module~watch_util->fpm_strings

Used by

  • module~~watch_fpm_graph~~UsedByGraph module~watch_fpm_graph watch_fpm_graph module~watch_engine watch_engine module~watch_engine->module~watch_fpm_graph

Functions

private function find_ptr_index(p, all) result(idx)

Arguments

Type IntentOptional Attributes Name
type(build_target_t), intent(in), pointer :: p
type(build_target_ptr), intent(in) :: all(:)

Return Value integer

private pure function is_in_dep_dirs(p, dep_dirs) result(ok)

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: p
type(string_t), intent(in), allocatable :: dep_dirs(:)

Return Value logical

private function is_run_or_test(settings)

Return whether the settings correspond to fpm run or fpm test.

Arguments

Type IntentOptional Attributes Name
class(fpm_build_settings), intent(in) :: settings

Return Value logical


Subroutines

public subroutine compute_watch_files_from_settings(settings, w, files, file_mask, roots, manifest_key, build_secs, secs_model, secs_targets, secs_watch)

Compute watched files and masks from current fpm settings.

Read more…

Arguments

Type IntentOptional Attributes Name
class(fpm_build_settings), intent(inout) :: settings
type(watch_opts_t), intent(in) :: w
type(string_t), intent(out), allocatable :: files(:)
integer(kind=int64), intent(out), allocatable :: file_mask(:)
type(root_info_t), intent(out), allocatable :: roots(:)
integer(kind=int64), intent(out) :: manifest_key
real, intent(out) :: build_secs
real, intent(out) :: secs_model
real, intent(out) :: secs_targets
real, intent(out) :: secs_watch

private recursive subroutine dfs_mark_bool(node, all, visited)

Arguments

Type IntentOptional Attributes Name
type(build_target_t), intent(in), pointer :: node
type(build_target_ptr), intent(in) :: all(:)
logical, intent(inout) :: visited(:)

private recursive subroutine dfs_mark_mask(node, all, tmask, mask)

Arguments

Type IntentOptional Attributes Name
type(build_target_t), intent(in), pointer :: node
type(build_target_ptr), intent(in) :: all(:)
integer(kind=int64), intent(inout) :: tmask(:)
integer(kind=int64), intent(in) :: mask

private subroutine gather_files_with_mask(targets, visited, target_mask, files, file_mask, build_dir, dep_dirs)

Arguments

Type IntentOptional Attributes Name
type(build_target_ptr), intent(in) :: targets(:)
logical, intent(in) :: visited(:)
integer(kind=int64), intent(in), optional, allocatable :: target_mask(:)
type(string_t), intent(out), allocatable :: files(:)
integer(kind=int64), intent(out), allocatable :: file_mask(:)
character(len=*), intent(in) :: build_dir
type(string_t), intent(in), optional, allocatable :: dep_dirs(:)

private subroutine push_file_with_mask(files, file_mask, path, build_dir, mask, dep_dirs)

Arguments

Type IntentOptional Attributes Name
type(string_t), intent(inout), allocatable :: files(:)
integer(kind=int64), intent(inout), allocatable :: file_mask(:)
character(len=*), intent(in) :: path
character(len=*), intent(in) :: build_dir
integer(kind=int64), intent(in) :: mask
type(string_t), intent(in), optional, allocatable :: dep_dirs(:)

private subroutine select_names_or_all(targets, scope, names, keep)

Arguments

Type IntentOptional Attributes Name
type(build_target_ptr), intent(in) :: targets(:)
integer, intent(in) :: scope
character(len=*), intent(in), optional :: names(:)
logical, intent(inout) :: keep(:)

private subroutine vec_grow(buf, mbuf, cap)

Arguments

Type IntentOptional Attributes Name
type(string_t), intent(inout), allocatable :: buf(:)
integer(kind=int64), intent(inout), allocatable :: mbuf(:)
integer, intent(inout) :: cap

private subroutine vec_push_unique(buf, mbuf, n, cap, path, build_dir, mask, dep_dirs)

Arguments

Type IntentOptional Attributes Name
type(string_t), intent(inout), allocatable :: buf(:)
integer(kind=int64), intent(inout), allocatable :: mbuf(:)
integer, intent(inout) :: n
integer, intent(inout) :: cap
character(len=*), intent(in) :: path
character(len=*), intent(in) :: build_dir
integer(kind=int64), intent(in) :: mask
type(string_t), intent(in), optional, allocatable :: dep_dirs(:)