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.



Interfaces

public interface resize

  • private pure subroutine resize_dependency_config(var, n)

    Reallocate a list of dependencies

    Arguments

    Type IntentOptional Attributes Name
    type(dependency_config_t), intent(inout), allocatable :: var(:)

    Instance of the array to be resized

    integer, intent(in), optional :: n

    Dimension of the final array size


Derived Types

type, public, extends(serializable_t) ::  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

generic, public :: dump => dump_to_toml, dump_to_file, dump_to_unit
procedure, public :: dump_to_toml
procedure, public :: info ../../

Print information on this instance

generic, public :: load => load_from_toml, load_from_file, load_from_unit
procedure, public :: load_from_toml
generic, public :: operator(==) => serializable_is_same
procedure, public :: serializable_is_same => dependency_is_same ../../

Serialization interface

procedure, public, non_overridable :: test_serialization ../../

Test load/write roundtrip


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 elemental subroutine dependency_destroy(self)

Clean memory

Arguments

Type IntentOptional Attributes Name
class(dependency_config_t), intent(inout) :: self

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