hotdoc module: add dedicated depends kwarg, deprecate file deps in dependencies

We consistently use the "dependencies" kwarg to refer to C-like
CFLAGS/LDFLAGS interfaces. And for hotdoc, we actually accept libraries
for this as well, as we may want to document their (generated?) sources,
so we want their CFLAGS too.

But we also accepted custom targets and just added a build order
dependency on these, which was odd and typically we call that "depends".
Let's deprecate this in favor of the depends kwarg.
pull/10989/head
Eli Schwartz 2 years ago committed by Xavier Claessens
parent 726353460a
commit bcc127b3fd
  1. 19
      mesonbuild/modules/hotdoc.py

@ -23,7 +23,10 @@ from mesonbuild.coredata import MesonException
from . import ModuleReturnValue, ModuleInfo from . import ModuleReturnValue, ModuleInfo
from . import ExtensionModule from . import ExtensionModule
from ..dependencies import Dependency, InternalDependency from ..dependencies import Dependency, InternalDependency
from ..interpreterbase import InvalidArguments, noPosargs, noKwargs, typed_kwargs, ContainerTypeInfo, KwargInfo, typed_pos_args from ..interpreterbase import (
InvalidArguments, noPosargs, noKwargs, typed_kwargs, FeatureDeprecated,
ContainerTypeInfo, KwargInfo, typed_pos_args
)
from ..interpreter import CustomTargetHolder from ..interpreter import CustomTargetHolder
from ..interpreter.type_checking import NoneType from ..interpreter.type_checking import NoneType
from ..programs import ExternalProgram from ..programs import ExternalProgram
@ -290,6 +293,7 @@ class HotdocTargetBuilder:
self.process_extra_assets() self.process_extra_assets()
self.add_extension_paths(self.kwargs.pop('extra_extension_paths')) self.add_extension_paths(self.kwargs.pop('extra_extension_paths'))
self.process_subprojects() self.process_subprojects()
self.extra_depends.extend(self.kwargs.pop('depends'))
install = self.kwargs.pop('install') install = self.kwargs.pop('install')
self.process_extra_args() self.process_extra_args()
@ -415,10 +419,18 @@ class HotDocModule(ExtensionModule):
# --c-include-directories # --c-include-directories
KwargInfo( KwargInfo(
'dependencies', 'dependencies',
ContainerTypeInfo(list, (Dependency, build.StaticLibrary, build.SharedLibrary)), ContainerTypeInfo(list, (Dependency, build.StaticLibrary, build.SharedLibrary,
build.CustomTarget, build.CustomTargetIndex)),
listify=True, listify=True,
default=[], default=[],
), ),
KwargInfo(
'depends',
ContainerTypeInfo(list, (build.CustomTarget, build.CustomTargetIndex)),
listify=True,
default=[],
since='0.64.1',
),
KwargInfo('gi_c_source_roots', ContainerTypeInfo(list, str), listify=True, default=[]), KwargInfo('gi_c_source_roots', ContainerTypeInfo(list, str), listify=True, default=[]),
KwargInfo('extra_assets', ContainerTypeInfo(list, str), listify=True, default=[]), KwargInfo('extra_assets', ContainerTypeInfo(list, str), listify=True, default=[]),
KwargInfo('extra_extension_paths', ContainerTypeInfo(list, str), listify=True, default=[]), KwargInfo('extra_extension_paths', ContainerTypeInfo(list, str), listify=True, default=[]),
@ -428,6 +440,9 @@ class HotDocModule(ExtensionModule):
) )
def generate_doc(self, state, args, kwargs): def generate_doc(self, state, args, kwargs):
project_name = args[0] project_name = args[0]
if any(isinstance(x, (build.CustomTarget, build.CustomTargetIndex)) for x in kwargs['dependencies']):
FeatureDeprecated.single_use('hotdoc.generate_doc dependencies argument with custom_target',
'0.64.1', state.subproject, 'use `depends`', state.current_node)
builder = HotdocTargetBuilder(project_name, state, self.hotdoc, self.interpreter, kwargs) builder = HotdocTargetBuilder(project_name, state, self.hotdoc, self.interpreter, kwargs)
target, install_script = builder.make_targets() target, install_script = builder.make_targets()
targets = [target] targets = [target]

Loading…
Cancel
Save