Package meta data
Package configuration data - extends a feature_config_t
to represent the “default”
package feature. The following are now inherited from feature_config_t: name (but for package
it’s the package name), description, compiler, os_type (defaults to id_all, OS_ALL for packages)
library, executable(:), dependency(:), dev_dependency(:), example(:), test(:), preprocess(:)
flags, c_flags, cxx_flags, link_time_flags, requires_features(:)
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
character(len=:), | public, | allocatable | :: | author | |||
type(build_config_t), | public, | allocatable | :: | build |
Build configuration |
||
character(len=:), | public, | allocatable | :: | c_flags | |||
character(len=:), | public, | allocatable | :: | copyright | |||
character(len=:), | public, | allocatable | :: | cxx_flags | |||
logical, | public | :: | default | = | .false. |
Is this feature enabled by default |
|
type(dependency_config_t), | public, | allocatable | :: | dependency(:) |
Dependencies |
||
character(len=:), | public, | allocatable | :: | description | |||
type(dependency_config_t), | public, | allocatable | :: | dev_dependency(:) |
Development dependencies |
||
type(example_config_t), | public, | allocatable | :: | example(:) |
Examples |
||
type(executable_config_t), | public, | allocatable | :: | executable(:) |
Executable configurations |
||
type(feature_collection_t), | public, | allocatable | :: | features(:) |
Additional feature collections beyond the default package feature |
||
character(len=:), | public, | allocatable | :: | flags |
Compiler flags |
||
type(fortran_config_t), | public, | allocatable | :: | fortran |
Fortran configuration |
||
type(install_config_t), | public, | allocatable | :: | install |
Installation configuration |
||
type(library_config_t), | public, | allocatable | :: | library |
Library configuration |
||
character(len=:), | public, | allocatable | :: | license |
Package metadata (package-specific) |
||
character(len=:), | public, | allocatable | :: | link_time_flags | |||
character(len=:), | public, | allocatable | :: | maintainer | |||
type(metapackage_config_t), | public | :: | meta |
Metapackage data |
|||
character(len=:), | public, | allocatable | :: | name |
Feature identity |
||
type(platform_config_t), | public | :: | platform |
Compiler/OS targeting (consistent with profile_config_t pattern) |
|||
type(preprocess_config_t), | public, | allocatable | :: | preprocess(:) |
Preprocessor configuration |
||
type(profile_config_t), | public, | allocatable | :: | profiles(:) |
Profiles (collections of features) |
||
type(string_t), | public, | allocatable | :: | requires_features(:) |
Feature dependencies |
||
type(test_config_t), | public, | allocatable | :: | test(:) |
Tests |
||
type(version_t), | public | :: | version |
Package version (name is inherited from feature_config_t%name) |
Check validity of the TOML table
Check local schema for allowed entries
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(toml_table), | intent(inout) | :: | table |
Instance of the TOML data structure |
||
type(error_t), | intent(out), | allocatable | :: | error |
Error handling |
Dump dependency to toml table
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(srcfile_t), | intent(inout) | :: | self |
Instance of the serializable object |
||
type(toml_table), | intent(inout) | :: | table |
Data structure |
||
type(error_t), | intent(out), | allocatable | :: | error |
Error handling |
Write serializable object to file
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(serializable_t), | intent(inout) | :: | self |
Instance of the dependency tree |
||
character(len=*), | intent(in) | :: | file |
File name |
||
type(error_t), | intent(out), | allocatable | :: | error |
Error handling |
|
logical, | intent(in), | optional | :: | json |
Optional JSON format |
Write serializable object to a formatted Fortran unit
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(serializable_t), | intent(inout) | :: | self |
Instance of the dependency tree |
||
integer, | intent(in) | :: | unit |
Formatted unit |
||
type(error_t), | intent(out), | allocatable | :: | error |
Error handling |
|
logical, | intent(in), | optional | :: | json |
Optional JSON format requested? |
Dump manifest to toml table
Duplicate profile names are possible, as multiple profiles are possible with the same name, same compiler, etc. So, use a unique name here
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(package_config_t), | intent(inout) | :: | self |
Instance of the serializable object |
||
type(toml_table), | intent(inout) | :: | table |
Data structure |
||
type(error_t), | intent(out), | allocatable | :: | error |
Error handling |
Export package configuration with features applied
Export package configuration for a given (OS+compiler) platform
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(package_config_t), | intent(in) | :: | self |
Instance of the package configuration |
||
type(platform_config_t), | intent(in) | :: | platform |
Target platform |
||
type(string_t), | intent(in), | optional | :: | features(:) |
Optional list of features to apply (currently idle) |
Print information on this instance
Write information on instance
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(package_config_t), | intent(in) | :: | self |
Instance of the package configuration |
||
integer, | intent(in) | :: | unit |
Unit for IO |
||
integer, | intent(in), | optional | :: | verbosity |
Verbosity of the printout |
Read dependency from toml table (no checks made at this stage)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(srcfile_t), | intent(inout) | :: | self |
Instance of the serializable object |
||
type(toml_table), | intent(inout) | :: | table |
Data structure |
||
type(error_t), | intent(out), | allocatable | :: | error |
Error handling |
Read dependency tree from file
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(serializable_t), | intent(inout) | :: | self |
Instance of the dependency tree |
||
character(len=*), | intent(in) | :: | file |
File name |
||
type(error_t), | intent(out), | allocatable | :: | error |
Error handling |
|
logical, | intent(in), | optional | :: | json |
Optional JSON format |
Read dependency tree from file init JSON interpreter Read object from TOML table
use default TOML parser
Read object from TOML table
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(serializable_t), | intent(inout) | :: | self |
Instance of the dependency tree |
||
integer, | intent(in) | :: | unit |
File name |
||
type(error_t), | intent(out), | allocatable | :: | error |
Error handling |
|
logical, | intent(in), | optional | :: | json |
Optional JSON format |
Read manifest from toml table (no checks made at this stage)
Load base fields Read all packages
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(package_config_t), | intent(inout) | :: | self |
Instance of the serializable object |
||
type(toml_table), | intent(inout) | :: | table |
Data structure |
||
type(error_t), | intent(out), | allocatable | :: | error |
Error handling |
Get manifest name
Return a name string as it would appear in the TOML manifest
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(feature_config_t), | intent(in) | :: | self |
Check that two source files are equal All checks passed!
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(srcfile_t), | intent(in) | :: | this | |||
class(serializable_t), | intent(in) | :: | that |
Serialization interface
All checks passed!
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(package_config_t), | intent(in) | :: | this | |||
class(serializable_t), | intent(in) | :: | that |
Test load/write roundtrip
Test serialization of a serializable object Dump to scratch file Load from scratch file Check same
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(serializable_t), | intent(inout) | :: | self | |||
character(len=*), | intent(in) | :: | message | |||
type(error_t), | intent(out), | allocatable | :: | error |
type, extends(feature_config_t) :: package_config_t !> Package version (name is inherited from feature_config_t%name) type(version_t) :: version !> Package metadata (package-specific) character(len=:), allocatable :: license character(len=:), allocatable :: author character(len=:), allocatable :: maintainer character(len=:), allocatable :: copyright !> Additional feature collections beyond the default package feature type(feature_collection_t), allocatable :: features(:) !> Profiles (collections of features) type(profile_config_t), allocatable :: profiles(:) contains !> Print information on this instance procedure :: info !> Serialization interface procedure :: serializable_is_same => manifest_is_same procedure :: dump_to_toml procedure :: load_from_toml !> Export package configuration with features applied procedure :: export_config end type package_config_t