fpm_manifest_dependency Module

Implementation of the meta data for dependencies.

A dependency table can currently have the following fields

[dependencies]
"dep1" = { git = "url" }
"dep2" = { git = "url", branch = "name" }
"dep3" = { git = "url", tag = "name" }
"dep4" = { git = "url", rev = "sha1" }
"dep0" = { path = "path" }

To reduce the amount of boilerplate code this module provides two constructors for dependency types, one basic for an actual dependency (inline) table and another to collect all dependency objects from a dependencies table, which is handling the allocation of the objects and is forwarding the individual dependency tables to their respective constructors. The usual entry point should be the constructor for the super table.

This objects contains a target to retrieve required fpm projects to build the target declaring the dependency. Resolving a dependency will result in obtaining a new package configuration data for the respective project.



Contents


Derived Types

type, public ::  dependency_config_t

Configuration meta data for a dependency

Components

Type Visibility Attributes Name Initial
type(git_target_t), public, allocatable :: git

Git descriptor

character(len=:), public, allocatable :: name

Name of the dependency

character(len=:), public, allocatable :: namespace

Namespace which the dependency belongs to. Enables multiple dependencies with the same name. Required for dependencies that are obtained via the official registry.

character(len=:), public, allocatable :: path

Local target

type(preprocess_config_t), public, allocatable :: preprocess(:)

Requested macros for the dependency

type(version_t), public, allocatable :: requested_version

The requested version of the dependency. The latest version is used if not specified.

Type-Bound Procedures

procedure , public , :: info Subroutine

Print information on this instance


Functions

public function manifest_has_changed(cached, manifest, verbosity, iunit) result(has_changed)

Check if two dependency configurations are different

Read more…

Arguments

Type IntentOptional Attributes Name
class(dependency_config_t), intent(in) :: cached

Two instances of the dependency configuration

class(dependency_config_t), intent(in) :: manifest

Two instances of the dependency configuration

integer, intent(in) :: verbosity

Log verbosity

integer, intent(in) :: iunit

Log verbosity

Return Value logical


Subroutines

public subroutine new_dependencies(deps, table, root, meta, error)

Construct new dependency array from a TOML data structure

Read more…

Arguments

Type IntentOptional Attributes Name
type(dependency_config_t), intent(out), allocatable :: deps(:)

Instance of the dependency configuration

type(toml_table), intent(inout) :: table

Instance of the TOML data structure

character(len=*), intent(in), optional :: root

Root directory of the manifest

type(metapackage_config_t), intent(out), optional :: meta

(optional) metapackages

type(error_t), intent(out), allocatable :: error

Error handling

public subroutine new_dependency(self, table, root, error)

Construct a new dependency configuration from a TOML data structure

Read more…

Arguments

Type IntentOptional Attributes Name
type(dependency_config_t), intent(out) :: self

Instance of the dependency configuration

type(toml_table), intent(inout) :: table

Instance of the TOML data structure

character(len=*), intent(in), optional :: root

Root directory of the manifest

type(error_t), intent(out), allocatable :: error

Error handling