Esempio n. 1
0
def builds(metatarget_reference, project, ps, what):
    # Attempt to build a metatarget named by 'metatarget-reference'
    # in context of 'project' with properties 'ps'.
    # Returns non-empty value if build is OK.
    assert isinstance(metatarget_reference, basestring)
    assert isinstance(project, targets_.ProjectTarget)
    assert isinstance(ps, property_set.PropertySet)
    assert isinstance(what, basestring)

    result = []

    existing = __builds_cache.get((what, ps), None)
    if existing is None:

        result = False
        __builds_cache[(what, ps)] = False

        targets = targets_.generate_from_reference(metatarget_reference,
                                                   project, ps).targets()
        jam_targets = []
        for t in targets:
            jam_targets.append(t.actualize())

        x = ("    - %s" % what).rjust(__width)
        if bjam.call("UPDATE_NOW", jam_targets, str(__log_fd),
                     "ignore-minus-n"):
            __builds_cache[(what, ps)] = True
            result = True
            log_check_result("%s: yes" % x)
        else:
            log_check_result("%s: no" % x)

        return result
    else:
        return existing
Esempio n. 2
0
def builds(metatarget_reference, project, ps, what):
    # Attempt to build a metatarget named by 'metatarget-reference'
    # in context of 'project' with properties 'ps'.
    # Returns non-empty value if build is OK.
    assert isinstance(metatarget_reference, basestring)
    assert isinstance(project, targets_.ProjectTarget)
    assert isinstance(ps, property_set.PropertySet)
    assert isinstance(what, basestring)

    result = []

    existing = __builds_cache.get((what, ps), None)
    if existing is None:

        result = False
        __builds_cache[(what, ps)] = False

        targets = targets_.generate_from_reference(
            metatarget_reference, project, ps).targets()
        jam_targets = []
        for t in targets:
            jam_targets.append(t.actualize())

        x = ("    - %s" % what).rjust(__width)
        if bjam.call("UPDATE_NOW", jam_targets, str(__log_fd), "ignore-minus-n"):
            __builds_cache[(what, ps)] = True
            result = True
            log_check_result("%s: yes" % x)
        else:
            log_check_result("%s: no" % x)

        return result
    else:
        return existing