def parse_text_rules(text_lines):
    """ A helper function to read text lines and construct and returns a list of
    dependency rules which can be used for comparison.

    The list is built with the text order.  Each rule is described in the
    following way:
        {'target': <target name>, 'dependency': <set of dependent filenames>}
    """
    rules = []
    for line in text_lines:
        if line.strip() == "":
            continue
        rule = {'target': line.split(': ')[0].strip(),
                'dependency': set(line.split(': ')[-1].strip().split(' '))}
        rules.append(rule)
    return rules