Beispiel #1
0
                pat = pat.replace("in:", "")
            elif pat.startswith("out:"):
                inn = False
                pat = pat.replace("out:", "")
            pat = re.compile(pat, re.M)
            for g in self.groups:
                for tg in g:
                    if isinstance(tg, Task.TaskBase):
                        lst = [tg]
                    else:
                        lst = tg.tasks
                    for tsk in lst:
                        do_exec = False
                        if inn:
                            for node in getattr(tsk, "inputs", []):
                                if pat.search(node.abspath()):
                                    do_exec = True
                                    break
                        if out and not do_exec:
                            for node in getattr(tsk, "outputs", []):
                                if pat.search(node.abspath()):
                                    do_exec = True
                                    break
                        if do_exec:
                            ret = tsk.run()
                            Logs.info("%s -> %r" % (str(tsk), ret))


BuildContext.store = Utils.nogc(BuildContext.store)
BuildContext.restore = Utils.nogc(BuildContext.restore)
Beispiel #2
0
            pat = pat.replace('in:', '')
        elif pat.startswith('out:'):
            inn = False
            pat = pat.replace('out:', '')

        anode = self.root.find_node(pat)
        pattern = None
        if not anode:
            if not pat.startswith('^'):
                pat = '^.+?%s' % pat
            if not pat.endswith('$'):
                pat = '%s$' % pat
            pattern = re.compile(pat)

        def match(node, output):
            if output == True and not out:
                return False
            if output == False and not inn:
                return False

            if anode:
                return anode == node
            else:
                return pattern.match(node.abspath())

        return match


BuildContext.store = Utils.nogc(BuildContext.store)
BuildContext.restore = Utils.nogc(BuildContext.restore)
Beispiel #3
0
                pat = pat.replace('in:', '')
            elif pat.startswith('out:'):
                inn = False
                pat = pat.replace('out:', '')
            pat = re.compile(pat, re.M)
            for g in self.groups:
                for tg in g:
                    if isinstance(tg, Task.TaskBase):
                        lst = [tg]
                    else:
                        lst = tg.tasks
                    for tsk in lst:
                        do_exec = False
                        if inn:
                            for node in getattr(tsk, 'inputs', []):
                                if pat.search(node.abspath()):
                                    do_exec = True
                                    break
                        if out and not do_exec:
                            for node in getattr(tsk, 'outputs', []):
                                if pat.search(node.abspath()):
                                    do_exec = True
                                    break
                        if do_exec:
                            ret = tsk.run()
                            Logs.info('%s -> %r' % (str(tsk), ret))


BuildContext.store = Utils.nogc(BuildContext.store)
BuildContext.load = Utils.nogc(BuildContext.load)
Beispiel #4
0
        try:
            Node.pickle_lock.acquire()
            for x in Build.SAVED_ATTRS:
                if x in data:
                    setattr(self, x, data[x])
                else:
                    Logs.debug(
                        "build: SAVED_ATTRS key {} missing from cache".format(
                            x))
        finally:
            Node.pickle_lock.release()

    self.init_dirs()


Build.BuildContext.restore = Utils.nogc(restore)


def store(self):
    """
    Store the data for next runs, sets the attributes listed in :py:const:`waflib.Build.SAVED_ATTRS`. Uses a temporary
    file to avoid problems on ctrl+c.
    """

    # Write ArtifactsCacheMetrics to file

    if self.artifacts_cache and self.is_option_true(
            'artifacts_cache_restore') and getattr(
                self, 'artifacts_cache_metrics', False):
        json_data = {}
        json_data['tasks_processed_num'] = len(
Beispiel #5
0
			if pat.startswith('in:'):
				out=False
				pat=pat.replace('in:','')
			elif pat.startswith('out:'):
				inn=False
				pat=pat.replace('out:','')
			pat=re.compile(pat,re.M)
			for g in self.groups:
				for tg in g:
					if isinstance(tg,Task.TaskBase):
						lst=[tg]
					else:
						lst=tg.tasks
					for tsk in lst:
						do_exec=False
						if inn:
							for node in getattr(tsk,'inputs',[]):
								if pat.search(node.abspath()):
									do_exec=True
									break
						if out and not do_exec:
							for node in getattr(tsk,'outputs',[]):
								if pat.search(node.abspath()):
									do_exec=True
									break
						if do_exec:
							ret=tsk.run()
							Logs.info('%s -> %r'%(str(tsk),ret))
BuildContext.store=Utils.nogc(BuildContext.store)
BuildContext.load=Utils.nogc(BuildContext.load)
Beispiel #6
0
Datei: Build.py Projekt: zsx/waf
				pat = pat.replace('out:', '')

			pat = re.compile(pat, re.M)

			for g in self.groups:
				for tg in g:
					if isinstance(tg, Task.TaskBase):
						lst = [tg]
					else:
						lst = tg.tasks
					for tsk in lst:
						do_exec = False
						if inn:
							for node in getattr(tsk, 'inputs', []):
								if pat.search(node.abspath()):
									do_exec = True
									break
						if out and not do_exec:
							for node in getattr(tsk, 'outputs', []):
								if pat.search(node.abspath()):
									do_exec = True
									break

						if do_exec:
							ret = tsk.run()
							Logs.info('%s -> %r' % (str(tsk), ret))

BuildContext.save = Utils.nogc(BuildContext.save)
BuildContext.load = Utils.nogc(BuildContext.load)