24
24
! >[library]
25
25
! >[dependencies]
26
26
! >[dev-dependencies]
27
+ ! >[profiles]
27
28
! >[build]
28
29
! >[install]
29
30
! >[[ executable ]]
34
35
module fpm_manifest_package
35
36
use fpm_manifest_build, only: build_config_t, new_build_config
36
37
use fpm_manifest_dependency, only : dependency_config_t, new_dependencies
38
+ use fpm_manifest_profile, only : profile_config_t, new_profiles, get_default_profiles
37
39
use fpm_manifest_example, only : example_config_t, new_example
38
40
use fpm_manifest_executable, only : executable_config_t, new_executable
39
41
use fpm_manifest_library, only : library_config_t, new_library
@@ -44,6 +46,7 @@ module fpm_manifest_package
44
46
use fpm_toml, only : toml_table, toml_array, toml_key, toml_stat, get_value, &
45
47
& len
46
48
use fpm_versioning, only : version_t, new_version
49
+ use fpm_filesystem, only: join_path
47
50
implicit none
48
51
private
49
52
@@ -83,6 +86,9 @@ module fpm_manifest_package
83
86
! > Development dependency meta data
84
87
type (dependency_config_t), allocatable :: dev_dependency(:)
85
88
89
+ ! > Profiles meta data
90
+ type (profile_config_t), allocatable :: profiles(:)
91
+
86
92
! > Example meta data
87
93
type (example_config_t), allocatable :: example(:)
88
94
@@ -204,6 +210,15 @@ subroutine new_package(self, table, root, error)
204
210
call new_library(self% library, child, error)
205
211
if (allocated (error)) return
206
212
end if
213
+
214
+ call get_value(table, " profiles" , child, requested= .false. )
215
+ if (associated (child)) then
216
+ call new_profiles(self% profiles, child, error)
217
+ if (allocated (error)) return
218
+ else
219
+ self% profiles = get_default_profiles(error)
220
+ if (allocated (error)) return
221
+ end if
207
222
208
223
call get_value(table, " executable" , children, requested= .false. )
209
224
if (associated (children)) then
@@ -303,7 +318,7 @@ subroutine check(table, error)
303
318
304
319
case (" version" , " license" , " author" , " maintainer" , " copyright" , &
305
320
& " description" , " keywords" , " categories" , " homepage" , " build" , &
306
- & " dependencies" , " dev-dependencies" , " test" , " executable" , &
321
+ & " dependencies" , " dev-dependencies" , " profiles " , " test" , " executable" , &
307
322
& " example" , " library" , " install" , " extra" )
308
323
continue
309
324
@@ -400,6 +415,15 @@ subroutine info(self, unit, verbosity)
400
415
call self% dev_dependency(ii)% info(unit, pr - 1 )
401
416
end do
402
417
end if
418
+
419
+ if (allocated (self% profiles)) then
420
+ if (size (self% profiles) > 1 .or. pr > 2 ) then
421
+ write (unit, fmti) " - profiles" , size (self% profiles)
422
+ end if
423
+ do ii = 1 , size (self% profiles)
424
+ call self% profiles(ii)% info(unit, pr - 1 )
425
+ end do
426
+ end if
403
427
404
428
end subroutine info
405
429
0 commit comments