77from somesy .cff .writer import CFF
88from somesy .codemeta import Codemeta
99from somesy .core .models import ProjectMetadata , SomesyInput
10+ from somesy .fortran .writer import Fortran
1011from somesy .julia .writer import Julia
1112from somesy .package_json .writer import PackageJSON
1213from somesy .pyproject .writer import Pyproject
@@ -40,6 +41,9 @@ def sync(somesy_input: SomesyInput):
4041 if not conf .no_sync_julia :
4142 _sync_julia (metadata , conf .julia_file )
4243
44+ if not conf .no_sync_fortran :
45+ _sync_fortran (metadata , conf .fortran_file )
46+
4347
4448def _sync_python (
4549 metadata : ProjectMetadata ,
@@ -120,7 +124,7 @@ def _sync_julia(
120124 """Sync Project.toml file using project metadata.
121125
122126 Args:
123- metadata (ProjectMetadata): project metadata to sync pyproject .toml file.
127+ metadata (ProjectMetadata): project metadata to sync Project .toml file.
124128 julia_file (Path, optional): Project.toml file path if wanted to be synced. Defaults to None.
125129 """
126130 logger .verbose ("Loading Project.toml file." )
@@ -129,3 +133,21 @@ def _sync_julia(
129133 cm .sync (metadata )
130134 cm .save ()
131135 logger .verbose (f"Saved synced Project.toml file to { julia_file } ." )
136+
137+
138+ def _sync_fortran (
139+ metadata : ProjectMetadata ,
140+ fortran_file : Path ,
141+ ):
142+ """Sync fpm.toml file using project metadata.
143+
144+ Args:
145+ metadata (ProjectMetadata): project metadata to sync fpm.toml file.
146+ fortran_file (Path, optional): fpm.toml file path if wanted to be synced. Defaults to None.
147+ """
148+ logger .verbose ("Loading fpm.toml file." )
149+ cm = Fortran (fortran_file )
150+ logger .verbose ("Syncing fpm.toml file." )
151+ cm .sync (metadata )
152+ cm .save ()
153+ logger .verbose (f"Saved synced fpm.toml file to { fortran_file } ." )
0 commit comments