build: Prepare CustomTarget.process_kwargs to co-exist
We still need this to co-exist as long as there are interfaces for
CustomTarget other than `func_custom_target`, this gets us there.
@@ -2388,7 +2388,7 @@ class CustomTarget(Target, CommandBase):
raise InvalidArguments("Can't both capture output and output to console")
if 'command' not in kwargs:
raise InvalidArguments('Missing keyword argument "command".')
- if 'depfile' in kwargs:
+ if kwargs.get('depfile') is not None:
depfile = kwargs['depfile']
if not isinstance(depfile, str):
raise InvalidArguments('Depfile must be a string.')
@@ -2429,13 +2429,13 @@ class CustomTarget(Target, CommandBase):
self.install_dir = [None]
self.install_mode = None
self.install_tag = []
- if 'build_always' in kwargs and 'build_always_stale' in kwargs:
+ if kwargs.get('build_always') is not None and kwargs.get('build_always_stale') is not None:
raise InvalidArguments('build_always and build_always_stale are mutually exclusive. Combine build_by_default and build_always_stale.')
- elif 'build_always' in kwargs:
- if 'build_by_default' not in kwargs:
+ elif kwargs.get('build_always') is not None:
+ if kwargs.get('build_by_default') is not None:
self.build_by_default = kwargs['build_always']
self.build_always_stale = kwargs['build_always']
- elif 'build_always_stale' in kwargs:
+ elif kwargs.get('build_always_stale') is not None:
self.build_always_stale = kwargs['build_always_stale']
if not isinstance(self.build_always_stale, bool):
raise InvalidArguments('Argument build_always_stale must be a boolean.')
