예제 #1
0
    def __init__(self, c: ClassVar, name: str, env):
        Task.__init__(self, env=env)
        self.name = name

        # Ensure that the task is run again when the task's source code changes.
        class_hierarchy_code = \
            str.join(",", [inspect.getsource(a) for a in inspect.getmro(c) if "idpdbuild" in str(a)]).encode()
        self.hcode = hashlib.md5(class_hierarchy_code).digest()
예제 #2
0
    def runnable_status(self):
        self_status = Task.runnable_status(self)

        # Check only for ASK_LATER and not != RUN_ME. The runnable_status
        # method will return SKIP_ME for pre-built libraries that are only
        # being copied but we still need to run the rpath update on the library
        if self_status == ASK_LATER:
            return self_status

        if self.use_link_task:
            # Need to use hasrun to determine if the task was runned or skipped
            # as runnable_status is always returning RUN_ME after the task has
            # been run.

            # If the link_task status is not success then the link task was
            # either skipped or we had an error so no reason to run. We don't
            # have to worry about NOT_RUN state since we set this task to only
            # run after the link_task has been run when we create it below.
            if self.generator.link_task.hasrun != SUCCESS:
                return SKIP_ME

        source_lib = self.inputs[0]
        if source_lib.abspath(
        ) in self.processed_libs or source_lib in self.queued_libs:
            return SKIP_ME

        self.queued_libs.add(source_lib)

        return RUN_ME
    def runnable_status(self):
        if Task.runnable_status(self) == ASK_LATER:
            return ASK_LATER

        source_lib = self.inputs[0]
        depenedent_libs = self.get_dependent_libs(source_lib.abspath())
        for dependent_name in depenedent_libs:
            if dependent_name and dependent_name != source_lib.name and re.match(
                    "[@/]", dependent_name) is None:
                return RUN_ME

        return SKIP_ME
예제 #4
0
    def runnable_status(self):
        self_status = Task.runnable_status(self)
        if self_status == ASK_LATER:
            return ASK_LATER

        source_lib = self.inputs[0]
        if source_lib.abspath(
        ) in self.processed_libs or source_lib in self.queued_libs:
            return SKIP_ME

        self.queued_libs.add(source_lib)

        return RUN_ME
예제 #5
0
def format_error(self):
    """Write task details into a file. Print only the first line in console.
    See :py:meth:`waflib.Task.Task.format_error`"""
    text = Task.format_error(self)
    if self.hasrun == CRASHED:
        msg = getattr(self, 'last_cmd', '')
        name = getattr(self.generator, 'name', '')
        bldlog = osp.join(self.generator.bld.cwd, '%s.log' % name)
        slog = ''
        try:
            open(bldlog,
                 'wb').write('task: %r\nlast command:\n%r\n' % (self, msg))
        except (OSError, IOError), exc:
            slog = '\ncan not write the log file: %s' % str(exc)
        text = text.splitlines()[0] \
             + '\n    task details in: {0}{1}'.format(bldlog, slog)
예제 #6
0
    def __init__(self, *k, **kw):
        Task.__init__(self, *k, **kw)

        if "target" in kw:
            self.set_outputs(kw["target"])
예제 #7
0
    def __init__(self, *k, **kw):
        Task.__init__(self, *k, **kw)

        if "target" in kw:
            self.set_outputs(kw["target"])
예제 #8
0
 def __init__(self, bld: BuildContext, input_file: Nod3):
     Task.__init__(self, env=bld.env.derive())
     output_file: Nod3 = bld.path.find_or_declare(input_file.name + ".dupe")
     self.set_inputs(input_file)
     self.set_outputs(output_file)