Skip to content

Commit

Permalink
mintro: Add license and license_files to project introspection data
Browse files Browse the repository at this point in the history
  • Loading branch information
dnicolodi committed Oct 12, 2024
1 parent 304207b commit e52ae39
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mesonbuild/ast/introspection.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,13 @@ def func_project(self, node: BaseNode, args: T.List[TYPE_var], kwargs: T.Dict[st
proj_name = args[0]
proj_vers = kwargs.get('version', 'undefined')
proj_langs = self.flatten_args(args[1:])
proj_license = kwargs.get('license', None)
proj_license_files = kwargs.get('license_files', None)
if isinstance(proj_vers, ElementaryNode):
proj_vers = proj_vers.value
if not isinstance(proj_vers, str):
proj_vers = 'undefined'
self.project_data = {'descriptive_name': proj_name, 'version': proj_vers}
self.project_data = {'descriptive_name': proj_name, 'version': proj_vers, 'license': proj_license, 'license_files': proj_license_files}

optfile = os.path.join(self.source_root, self.subdir, 'meson.options')
if not os.path.exists(optfile):
Expand Down
2 changes: 2 additions & 0 deletions mesonbuild/mintro.py
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,8 @@ def list_projinfo(builddata: build.Build) -> T.Dict[str, T.Union[str, T.List[T.D
result: T.Dict[str, T.Union[str, T.List[T.Dict[str, str]]]] = {
'version': builddata.project_version,
'descriptive_name': builddata.project_name,
'license': builddata.license,
'license_files': builddata.license_files,
'subproject_dir': builddata.subproject_dir,
}
subprojects = []
Expand Down

0 comments on commit e52ae39

Please sign in to comment.