From 29b32f7a1a9a90d3d80c70cb40a702d3ea9a821d Mon Sep 17 00:00:00 2001 From: Thomas Nagy Date: Sat, 15 Apr 2017 15:12:03 +0200 Subject: [PATCH] Reflect the current build group in bld.current_group --- playground/implicit_order/wscript | 4 ++-- waflib/Build.py | 24 ++++++++++++------------ waflib/Task.py | 4 ++-- waflib/extras/xcode6.py | 6 +++--- 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/playground/implicit_order/wscript b/playground/implicit_order/wscript index 3949a51f..2d4905c1 100644 --- a/playground/implicit_order/wscript +++ b/playground/implicit_order/wscript @@ -41,9 +41,9 @@ def are_implicit_nodes_ready(self): bld.dct_implicit_nodes = cache = {} try: - dct = cache[bld.cur] + dct = cache[bld.current_group] except KeyError: - dct = cache[bld.cur] = {} + dct = cache[bld.current_group] = {} for tsk in bld.cur_tasks: for x in tsk.outputs: dct[x] = tsk diff --git a/waflib/Build.py b/waflib/Build.py index 5127e33d..1e61e15f 100644 --- a/waflib/Build.py +++ b/waflib/Build.py @@ -716,11 +716,11 @@ class BuildContext(Context.Context): def post_group(self): """ - Post task generators from the group indexed by self.cur; used internally + Post task generators from the group indexed by self.current_group; used internally by :py:meth:`waflib.Build.BuildContext.get_build_iterator` """ if self.targets == '*': - for tg in self.groups[self.cur]: + for tg in self.groups[self.current_group]: try: f = tg.post except AttributeError: @@ -728,8 +728,8 @@ class BuildContext(Context.Context): else: f() elif self.targets: - if self.cur < self._min_grp: - for tg in self.groups[self.cur]: + if self.current_group < self._min_grp: + for tg in self.groups[self.current_group]: try: f = tg.post except AttributeError: @@ -747,7 +747,7 @@ class BuildContext(Context.Context): elif not ln.is_child_of(self.srcnode): Logs.warn('CWD %s is not under %s, forcing --targets=* (run distclean?)', ln.abspath(), self.srcnode.abspath()) ln = self.srcnode - for tg in self.groups[self.cur]: + for tg in self.groups[self.current_group]: try: f = tg.post except AttributeError: @@ -778,25 +778,25 @@ class BuildContext(Context.Context): :return: tasks which can be executed immediately :rtype: generator returning lists of :py:class:`waflib.Task.Task` """ - self.cur = 0 + self.current_group = 0 if self.targets and self.targets != '*': (self._min_grp, self._exact_tg) = self.get_targets() global lazy_post if self.post_mode != POST_LAZY: - while self.cur < len(self.groups): + while self.current_group < len(self.groups): self.post_group() - self.cur += 1 - self.cur = 0 + self.current_group += 1 + self.current_group = 0 - while self.cur < len(self.groups): + while self.current_group < len(self.groups): # first post the task generators for the group if self.post_mode != POST_AT_ONCE: self.post_group() # then extract the tasks - tasks = self.get_tasks_group(self.cur) + tasks = self.get_tasks_group(self.current_group) # if the constraints are set properly (ext_in/ext_out, before/after) # the call to set_file_constraints may be removed (can be a 15% penalty on no-op rebuilds) # (but leave set_file_constraints for the installation step) @@ -807,7 +807,7 @@ class BuildContext(Context.Context): Task.set_precedence_constraints(tasks) self.cur_tasks = tasks - self.cur += 1 + self.current_group += 1 if not tasks: # return something else the build will stop continue yield tasks diff --git a/waflib/Task.py b/waflib/Task.py index 34504894..c0858569 100644 --- a/waflib/Task.py +++ b/waflib/Task.py @@ -797,9 +797,9 @@ class Task(evil): # one cache per build group try: - dct = cache[bld.cur] + dct = cache[bld.current_group] except KeyError: - dct = cache[bld.cur] = {} + dct = cache[bld.current_group] = {} for tsk in bld.cur_tasks: for x in tsk.outputs: dct[x] = tsk diff --git a/waflib/extras/xcode6.py b/waflib/extras/xcode6.py index 5357110b..83dd5c50 100644 --- a/waflib/extras/xcode6.py +++ b/waflib/extras/xcode6.py @@ -664,10 +664,10 @@ class xcode(Build.BuildContext): # post all task generators # the process_xcode method above will be called for each target - self.cur = 0 - while self.cur < len(self.groups): + self.current_group = 0 + while self.current_group < len(self.groups): self.post_group() - self.cur += 1 + self.current_group += 1 node = self.bldnode.make_node('%s.xcodeproj' % appname) node.mkdir()