Exemple #1
0
def generate_file(config, name, filename):
    root = getattr(GlobalGenRoots, name)(config)
    code = root.define()

    if replaceFileIfChanged(filename, code):
        print "Generating %s" % (filename)
    else:
        print "%s hasn't changed - not touching it" % (filename)
Exemple #2
0
def generate_file(config, name, filename):
    root = getattr(GlobalGenRoots, name)(config)
    code = root.define()

    if replaceFileIfChanged(filename, code):
        print "Generating %s" % (filename)
    else:
        print "%s hasn't changed - not touching it" % (filename)
Exemple #3
0
def generate_binding_cpp(config, outputprefix, webidlfile):
    """
    |config| Is the configuration object.
    |outputprefix| is a prefix to use for the header guards and filename.
    """

    filename = outputprefix + ".cpp"
    root = CGBindingRoot(config, outputprefix, webidlfile)
    if replaceFileIfChanged(filename, root.define()):
        print "Generating binding implementation: %s" % (filename)
Exemple #4
0
def generate_binding_rs(config, outputprefix, webidlfile):
    """
    |config| Is the configuration object.
    |outputprefix| is a prefix to use for the header guards and filename.
    """

    filename = outputprefix + ".rs"
    root = CGBindingRoot(config, outputprefix, webidlfile)
    if replaceFileIfChanged(filename, root.define()):
        print "Generating binding implementation: %s" % (filename)
Exemple #5
0
def generate_binding_rs(config, outputprefix, webidlfile):
    """
    |config| Is the configuration object.
    |outputprefix| is a prefix to use for the header guards and filename.
    """

    filename = outputprefix + ".rs"
    module = CGBindingRoot(config, outputprefix, webidlfile).define()
    if not module:
        print "Skipping empty module: %s" % (filename)
    elif replaceFileIfChanged(filename, module):
        print "Generating binding implementation: %s" % (filename)
Exemple #6
0
def generate_file(config, name, action):

    root = getattr(GlobalGenRoots, name)(config)
    if action is 'declare':
        filename = name + '.rs'
        code = root.declare()
    elif action == 'declare+define':
        filename = name + '.rs'
        code = root.declare()
        root2 = getattr(GlobalGenRoots, name)(config)
        code += root2.define()
    else:
        assert action is 'define'
        filename = name + '.rs'
        code = root.define()

    if replaceFileIfChanged(filename, code):
        print "Generating %s" % (filename)
    else:
        print "%s hasn't changed - not touching it" % (filename)
Exemple #7
0
def generate_file(config, name, action):

    root = getattr(GlobalGenRoots, name)(config)
    if action is 'declare':
        filename = name + '.rs'
        code = root.declare()
    elif action == 'declare+define':
        filename = name + '.rs'
        code = root.declare()
        root2 = getattr(GlobalGenRoots, name)(config)
        code += root2.define()
    else:
        assert action is 'define'
        filename = name + '.rs'
        code = root.define()

    if replaceFileIfChanged(filename, code):
        print "Generating %s" % (filename)
    else:
        print "%s hasn't changed - not touching it" % (filename)