Ejemplo n.º 1
0
def compile_go_package(path):
    proto_files = compile_helper.abslistdir(path)

    # Compile with the grpc plugin
    command_out_path = "plugins=grpc"

    # Allow to specify import_prefix for complete vendoring of dependencies
    if go_import_prefix:
        command_out_path += ",import_prefix=%s" % go_import_prefix

    # Combine the output with all other output options
    command_out_path = "%s:%s" % (command_out_path, os.path.abspath(out_path))

    commands.append("""{0} --proto_path="{1}" --go_out={2} {3}""".format(
        protoc_path, tmp_path, command_out_path, proto_files))
Ejemplo n.º 2
0
def compile_go_package(path):
    proto_files = compile_helper.abslistdir(path)

    # Compile with the grpc plugin
    command_out_path = "plugins=grpc"

    # Allow to specify import_prefix for complete vendoring of dependencies
    if go_import_prefix:
        command_out_path += ",import_prefix=%s" % go_import_prefix

    # Combine the output with all other output options
    command_out_path = "%s:%s" % (command_out_path, os.path.abspath(out_path))

    command = """{0} --proto_path="{1}" --go_out={2} {3}""".format(
        protoc_path,
        tmp_path,
        command_out_path,
        proto_files
    )

    call(command, shell=True)