コード例 #1
0
ファイル: Task.py プロジェクト: ylyking/Lumberyard
    def are_implicit_nodes_ready(self):
        """
		For each node returned by the scanner, see if there is a task behind it, and force the build order

		The performance impact on null builds is nearly invisible (1.66s->1.86s), but this is due to
		agressive caching (1.86s->28s)
		"""
        bld = self.generator.bld
        try:
            cache = bld.dct_implicit_nodes
        except AttributeError:
            bld.dct_implicit_nodes = cache = {}

        try:
            dct = cache[bld.cur]
        except KeyError:
            dct = cache[bld.cur] = {}
            for tsk in bld.cur_tasks:
                for x in tsk.outputs:
                    dct[x] = tsk

        modified = False
        for x in bld.node_deps.get(self.uid(), []):
            if x in dct:
                self.run_after.add(dct[x])
                modified = True

        if modified:
            for tsk in self.run_after:
                if not tsk.hasrun:
                    #print "task is not ready..."
                    raise Errors.TaskNotReady('not ready')
コード例 #2
0
	def are_implicit_nodes_ready(self):
		"""
		For each node returned by the scanner, see if there is a task that creates it,
		and infer the build order

		This has a low performance impact on null builds (1.86s->1.66s) thanks to caching (28s->1.86s)
		"""
		bld = self.generator.bld
		try:
			cache = bld.dct_implicit_nodes
		except AttributeError:
			bld.dct_implicit_nodes = cache = {}

		# one cache per build group
		try:
			dct = cache[bld.current_group]
		except KeyError:
			dct = cache[bld.current_group] = {}
			for tsk in bld.cur_tasks:
				for x in tsk.outputs:
					dct[x] = tsk

		modified = False
		for x in bld.node_deps.get(self.uid(), []):
			if x in dct:
				self.run_after.add(dct[x])
				modified = True

		if modified:
			for tsk in self.run_after:
				if not tsk.hasrun:
					#print "task is not ready..."
					raise Errors.TaskNotReady('not ready')
コード例 #3
0
ファイル: Task.py プロジェクト: Pedlar/Lumberyard
    def are_implicit_nodes_ready(self):
        """
		For each node returned by the scanner, see if there is a task behind it, and force the build order

		The performance impact on null builds is nearly invisible (1.66s->1.86s), but this is due to
		agressive caching (1.86s->28s)
		"""
        bld = self.generator.bld
        try:
            cache = bld.dct_implicit_nodes
        except AttributeError:
            bld.dct_implicit_nodes = cache = {}

        try:
            dct = cache[bld.cur]
        except KeyError:
            dct = cache[bld.cur] = {}
            for tsk in bld.cur_tasks:
                for x in tsk.outputs:
                    dct[x] = tsk

        # find any dependency that is not part of the run_after set already
        deps = bld.node_deps.get(self.uid(), [])
        deps_missing_from_runafter = [
            dct[i] for i in deps if i in dct and dct[i] not in self.run_after
        ]

        # verify that all tasks have not already run
        for tsk in deps_missing_from_runafter:
            if not tsk.hasrun:
                #print "task is not ready..."
                raise Errors.TaskNotReady('not ready')

        # update the run_after tasks
        self.run_after.update(deps_missing_from_runafter)
コード例 #4
0
 def run_now(self):
     status = self.runnable_status()
     if status not in (Task.RUN_ME, Task.SKIP_ME):
         raise Errors.TaskNotReady('Could not process %r: status %r' %
                                   (self, status))
     self.run()
     self.hasrun = Task.SUCCESS
コード例 #5
0
ファイル: Build.py プロジェクト: ECSE437-Audacity/audacity
	def run_now(self):
		"""
		Try executing the installation task right now

		:raises: :py:class:`waflib.Errors.TaskNotReady`
		"""
		status = self.runnable_status()
		if status not in (Task.RUN_ME, Task.SKIP_ME):
			raise Errors.TaskNotReady('Could not process %r: status %r' % (self, status))
		self.run()
		self.hasrun = Task.SUCCESS
コード例 #6
0
 def are_implicit_nodes_ready(self):
     bld = self.generator.bld
     try:
         cache = bld.dct_implicit_nodes
     except AttributeError:
         bld.dct_implicit_nodes = cache = {}
     try:
         dct = cache[bld.current_group]
     except KeyError:
         dct = cache[bld.current_group] = {}
         for tsk in bld.cur_tasks:
             for x in tsk.outputs:
                 dct[x] = tsk
     modified = False
     for x in bld.node_deps.get(self.uid(), []):
         if x in dct:
             self.run_after.add(dct[x])
             modified = True
     if modified:
         for tsk in self.run_after:
             if not tsk.hasrun:
                 raise Errors.TaskNotReady('not ready')