Define the package data containing the meta data from the configuration file.
The package data defines a Fortran type corresponding to the respective TOML document, after creating it from a package file no more interaction with the TOML document is required.
Every configuration type provides it custom constructor (prefixed with new_
)
and knows how to deserialize itself from a TOML document.
To ensure we find no untracked content in the package file all keywords are
checked and possible entries have to be explicitly allowed in the check
function.
If entries are mutally exclusive or interdependent inside the current table
the check
function is required to enforce this schema on the data structure.
The package file root allows the following keywords
name = "string"
version = "string"
license = "string"
author = "string"
maintainer = "string"
copyright = "string"
[library]
[dependencies]
[dev-dependencies]
[profiles]
[build]
[install]
[fortran]
[[ executable ]]
[[ example ]]
[[ test ]]
[extra]
Package meta data
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
character(len=:), | public, | allocatable | :: | author |
Author meta data |
||
type(build_config_t), | public | :: | build |
Build configuration data |
|||
character(len=:), | public, | allocatable | :: | copyright |
Copyright meta data |
||
type(dependency_config_t), | public, | allocatable | :: | dependency(:) |
Dependency meta data |
||
type(dependency_config_t), | public, | allocatable | :: | dev_dependency(:) |
Development dependency meta data |
||
type(example_config_t), | public, | allocatable | :: | example(:) |
Example meta data |
||
type(executable_config_t), | public, | allocatable | :: | executable(:) |
Executable meta data |
||
type(fortran_config_t), | public | :: | fortran |
Fortran meta data |
|||
type(install_config_t), | public | :: | install |
Installation configuration data |
|||
type(library_config_t), | public, | allocatable | :: | library |
Library meta data |
||
character(len=:), | public, | allocatable | :: | license |
License meta data |
||
character(len=:), | public, | allocatable | :: | maintainer |
Maintainer meta data |
||
type(metapackage_config_t), | public | :: | meta |
Metapackage data |
|||
character(len=:), | public, | allocatable | :: | name |
Name of the package |
||
type(preprocess_config_t), | public, | allocatable | :: | preprocess(:) |
Preprocess meta data |
||
type(profile_config_t), | public, | allocatable | :: | profiles(:) |
Profiles meta data |
||
type(test_config_t), | public, | allocatable | :: | test(:) |
Test meta data |
||
type(version_t), | public | :: | version |
Package version |
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 => manifest_is_same | ../../ Serialization interface |
procedure, public, non_overridable :: test_serialization | ../../ Test load/write roundtrip |
Construct a new package configuration from a TOML data structure
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(package_config_t), | intent(out) | :: | self |
Instance of the package 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 |