2
0
mirror of https://gitlab.com/ita1024/waf.git synced 2024-11-22 01:46:15 +01:00

Ensure ConfigurationContext.load/Context.load have the same interface

This commit is contained in:
Thomas Nagy 2021-05-09 10:29:11 +02:00
parent 2f248f78e2
commit 86b1f0def1
4 changed files with 7 additions and 8 deletions

View File

@ -3,6 +3,7 @@ CHANGES IN WAF 2.1.0
* While the Waf file runs on Python 2 and 3, creating it requires version 3 * While the Waf file runs on Python 2 and 3, creating it requires version 3
+ Added wafcache + Added wafcache
+ waf_unit_test: Added task in returned tuples, custom reports should be adapted + waf_unit_test: Added task in returned tuples, custom reports should be adapted
~ Ensure ConfigurationContext.load and Context.load definitions are consistent and remove unused *k parameters
- Remove waflib.Runner.PriorityTasks.appendleft - Remove waflib.Runner.PriorityTasks.appendleft
- Remove waflib.Task.TaskBase - Remove waflib.Task.TaskBase
- Remove the upper class of waflib.Task.Task (metaclass syntax) - Remove the upper class of waflib.Task.Task (metaclass syntax)

3
TODO
View File

@ -2,7 +2,4 @@ Waf 2.1
------- -------
- Fix the circular imports ccroot<->c_config.py - Fix the circular imports ccroot<->c_config.py
- Remove superfluous *k in ctx.load() and other unused parameters
Ensure conf.load() has the same interface as ctx.load()
- Ordered_iter_dict in python 3.7
- Change _add_task to add_task in Runner.py - Change _add_task to add_task in Runner.py

View File

@ -226,7 +226,7 @@ class ConfigurationContext(Context.Context):
tmpenv = self.all_envs[key] tmpenv = self.all_envs[key]
tmpenv.store(os.path.join(self.cachedir.abspath(), key + Build.CACHE_SUFFIX)) tmpenv.store(os.path.join(self.cachedir.abspath(), key + Build.CACHE_SUFFIX))
def load(self, tool_list, tooldir=None, funs=None, with_sys_path=True, cache=False): def load(self, tool_list, **kw):
""" """
Load Waf tools, which will be imported whenever a build is started. Load Waf tools, which will be imported whenever a build is started.
@ -236,7 +236,7 @@ class ConfigurationContext(Context.Context):
:type tooldir: list of string :type tooldir: list of string
:param funs: functions to execute from the waf tools :param funs: functions to execute from the waf tools
:type funs: list of string :type funs: list of string
:param cache: whether to prevent the tool from running twice :param cache: whether to prevent the tool from running twice (false by default)
:type cache: bool :type cache: bool
""" """

View File

@ -188,13 +188,14 @@ class Context(ctx):
Logs.free_logger(logger) Logs.free_logger(logger)
delattr(self, 'logger') delattr(self, 'logger')
def load(self, tool_list, *k, **kw): def load(self, tool_list, **kw):
""" """
Loads a Waf tool as a module, and try calling the function named :py:const:`waflib.Context.Context.fun` Loads a Waf tool as a module, and try calling the function named :py:const:`waflib.Context.Context.fun` from it.
from it. A ``tooldir`` argument may be provided as a list of module paths.
:param tool_list: list of Waf tool names to load :param tool_list: list of Waf tool names to load
:type tool_list: list of string or space-separated string :type tool_list: list of string or space-separated string
:param tooldir: paths for the imports
:type tooldir: list of string
""" """
tools = Utils.to_list(tool_list) tools = Utils.to_list(tool_list)
path = Utils.to_list(kw.get('tooldir', '')) path = Utils.to_list(kw.get('tooldir', ''))