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
@@ -45,6 +47,7 @@ module fpm_manifest_package
45
47
use fpm_toml, only : toml_table, toml_array, toml_key, toml_stat, get_value, &
46
48
& len
47
49
use fpm_versioning, only : version_t, new_version
50
+ use fpm_filesystem, only: join_path
48
51
implicit none
49
52
private
50
53
@@ -84,6 +87,9 @@ module fpm_manifest_package
84
87
! > Development dependency meta data
85
88
type (dependency_config_t), allocatable :: dev_dependency(:)
86
89
90
+ ! > Profiles meta data
91
+ type (profile_config_t), allocatable :: profiles(:)
92
+
87
93
! > Example meta data
88
94
type (example_config_t), allocatable :: example(:)
89
95
@@ -208,6 +214,15 @@ subroutine new_package(self, table, root, error)
208
214
call new_library(self% library, child, error)
209
215
if (allocated (error)) return
210
216
end if
217
+
218
+ call get_value(table, " profiles" , child, requested= .false. )
219
+ if (associated (child)) then
220
+ call new_profiles(self% profiles, child, error)
221
+ if (allocated (error)) return
222
+ else
223
+ self% profiles = get_default_profiles(error)
224
+ if (allocated (error)) return
225
+ end if
211
226
212
227
call get_value(table, " executable" , children, requested= .false. )
213
228
if (associated (children)) then
@@ -312,7 +327,7 @@ subroutine check(table, error)
312
327
313
328
case (" version" , " license" , " author" , " maintainer" , " copyright" , &
314
329
& " description" , " keywords" , " categories" , " homepage" , " build" , &
315
- & " dependencies" , " dev-dependencies" , " test" , " executable" , &
330
+ & " dependencies" , " dev-dependencies" , " profiles " , " test" , " executable" , &
316
331
& " example" , " library" , " install" , " extra" , " preprocess" )
317
332
continue
318
333
@@ -409,6 +424,15 @@ subroutine info(self, unit, verbosity)
409
424
call self% dev_dependency(ii)% info(unit, pr - 1 )
410
425
end do
411
426
end if
427
+
428
+ if (allocated (self% profiles)) then
429
+ if (size (self% profiles) > 1 .or. pr > 2 ) then
430
+ write (unit, fmti) " - profiles" , size (self% profiles)
431
+ end if
432
+ do ii = 1 , size (self% profiles)
433
+ call self% profiles(ii)% info(unit, pr - 1 )
434
+ end do
435
+ end if
412
436
413
437
end subroutine info
414
438
0 commit comments