Esempio n. 1
0
    if loader.errors:
        print("Loader Errors:")
        for e in loader.errors:
            print(e)

        print("")

    # Creating dependency list
    deps, missing = utils.to_dep_dict(files_data, ["globals"])
    print("Undefined Dependencies:")
    for m in sorted(missing):
        print(m)
    print("")

    # Merging
    m = Merger()

    print("Circular dependencies?")
    circular = m.check_circular(deps)
    for c in circular:
        print(c)

    if circular:
        exit()
    else:
        print("No!")
        print("")

    print("Merge order:")
    for i, files in enumerate(m.make_dep_list(deps)):
        print("{0}: {1}".format(i, ", ".join(files)))
Esempio n. 2
0
        print("Using Cache")
    except IOError:
        files_data = loader.load(files, parser, [GlobalsAnalyzer()])

        if loader.errors:
            print("Loader Errors:")
            for e in loader.errors:
                print(e)

            print('')

        pickle.dump(files_data, open(cache, 'w'))

    # Creating dependency list
    deps, missing = utils.to_dep_dict(files_data, ['ext', 'globals'], 'Ext.')
    print('Undefined Dependencies:')
    for m in sorted(missing):
        print(m)
    print('')

    # Merging
    m = Merger()
    print('Merge order:')
    for i, files in enumerate(m.make_dep_list(deps)):
        print('{0}: {1}'.format(i, ', '.join(files)))

    print('')

    print('Merging Files')
    m.merge(deps, open('merged.js', 'w'), loader)