예제 #1
0
def main():
    bi.init("Java", "java")
    schemas_map = bi.schemas_map(add_generics=True)

    for name, schema in schemas_map.items():
        bi.vprint("Generating schema: " + name)
        bi.write_to_file("water/bindings/pojos/%s.java" % name,
                         generate_schema(name, schema))

    for name, values in bi.enums().items():
        bi.vprint("Generating enum: " + name)
        bi.write_to_file("water/bindings/pojos/%s.java" % name,
                         generate_enum(name, sorted(values)))

    for name, endpoints in bi.endpoint_groups().items():
        if name != "SegmentModelsBuilders":
            bi.vprint("Generating proxy: " + name)
            bi.write_to_file("water/bindings/proxies/retrofit/%s.java" % name,
                             generate_proxy(name, endpoints))

    bi.vprint("Generating H2oApi.java")
    bi.write_to_file("water/bindings/H2oApi.java",
                     generate_main_class(bi.endpoints()))

    type_adapter.vprint_translation_map()
예제 #2
0
def main():
    bi.init("C#", "CSharp")

    for schema in bi.schemas():
        name = schema["name"]
        bi.vprint("Generating schema: " + name)
        bi.write_to_file("h2o/%s.cs" % name, generate_schema(name, schema))

    for name, values in bi.enums().items():
        bi.vprint("Generating enum: " + name)
        bi.write_to_file("h2o/%s.cs" % name, generate_enum(name, sorted(values)))

    type_adapter.vprint_translation_map()
예제 #3
0
def main():
    bi.init("C#", "CSharp")

    for schema in bi.schemas():
        name = schema["name"]
        bi.vprint("Generating schema: " + name)
        bi.write_to_file("h2o/%s.cs" % name, generate_schema(name, schema))

    for name, values in bi.enums().items():
        bi.vprint("Generating enum: " + name)
        bi.write_to_file("h2o/%s.cs" % name,
                         generate_enum(name, sorted(values)))

    type_adapter.vprint_translation_map()
예제 #4
0
파일: gen_java.py 프로젝트: Avighan/h2o-3
def main():
    bi.init("Java", "java")

    for schema in bi.schemas():
        name = schema["name"]
        bi.vprint("Generating schema: " + name)
        bi.write_to_file("water/bindings/pojos/%s.java" % name, generate_schema(name, schema))

    for name, values in bi.enums().items():
        bi.vprint("Generating enum: " + name)
        bi.write_to_file("water/bindings/pojos/%s.java" % name, generate_enum(name, sorted(values)))

    for name, endpoints in bi.endpoint_groups().items():
        bi.vprint("Generating proxy: " + name)
        bi.write_to_file("water/bindings/proxies/retrofit/%s.java" % name, generate_proxy(name, endpoints))

    bi.vprint("Generating H2oApi.java")
    bi.write_to_file("water/bindings/H2oApi.java", generate_main_class(bi.endpoints()))

    type_adapter.vprint_translation_map()
예제 #5
0
def main():
    bi.init("Java", "java")

    for schema in bi.schemas():
        name = schema["name"]
        bi.vprint("Generating schema: " + name)
        bi.write_to_file("water/bindings/pojos/%s.java" % name, generate_schema(name, schema))

    for name, values in bi.enums().items():
        bi.vprint("Generating enum: " + name)
        bi.write_to_file("water/bindings/pojos/%s.java" % name, generate_enum(name, sorted(values)))

    for name, endpoints in bi.endpoint_groups().items():
        bi.vprint("Generating proxy: " + name)
        bi.write_to_file("water/bindings/proxies/retrofit/%s.java" % name, generate_proxy(name, endpoints))

    bi.vprint("Generating H2oApi.java")
    bi.write_to_file("water/bindings/H2oApi.java", generate_main_class(bi.endpoints()))

    type_adapter.vprint_translation_map()
예제 #6
0
파일: gen_csharp.py 프로젝트: ndehri/h2o-3
    yield " * This file is auto-generated by h2o-3/h2o-bindings/bin/gen_csharp.py"
    yield " * Copyright 2016 H2O.ai;  Apache License Version 2.0 (see LICENSE for details)"
    yield " */"
    yield "namespace ai.h2o"
    yield "{"
    yield "  public enum " + name + " {"
    for value in values:
        yield "    %s," % value
    yield "  }"
    yield "}"


# ----------------------------------------------------------------------------------------------------------------------
#   MAIN:
# ----------------------------------------------------------------------------------------------------------------------
if __name__ == "__main__":
    bi.init("C#", "CSharp")
    type_adapter = CSharpTypeTranslator()

    for schema in bi.schemas():
        name = schema["name"]
        bi.vprint("Generating schema: " + name)
        bi.write_to_file("h2o/%s.cs" % name, generate_schema(name, schema))

    for name, values in bi.enums().items():
        bi.vprint("Generating enum: " + name)
        bi.write_to_file("h2o/%s.cs" % name,
                         generate_enum(name, sorted(values)))

    type_adapter.vprint_translation_map()
예제 #7
0
파일: gen_csharp.py 프로젝트: Avighan/h2o-3
    yield "/**"
    yield " * This file is auto-generated by h2o-3/h2o-bindings/bin/gen_csharp.py"
    yield " * Copyright 2016 H2O.ai;  Apache License Version 2.0 (see LICENSE for details)"
    yield " */"
    yield "namespace ai.h2o"
    yield "{"
    yield "  public enum " + name + " {"
    for value in values:
        yield "    %s," % value
    yield "  }"
    yield "}"


# ----------------------------------------------------------------------------------------------------------------------
#   MAIN:
# ----------------------------------------------------------------------------------------------------------------------
if __name__ == "__main__":
    bi.init("C#", "CSharp")
    type_adapter = CSharpTypeTranslator()

    for schema in bi.schemas():
        name = schema["name"]
        bi.vprint("Generating schema: " + name)
        bi.write_to_file("h2o/%s.cs" % name, generate_schema(name, schema))

    for name, values in bi.enums().items():
        bi.vprint("Generating enum: " + name)
        bi.write_to_file("h2o/%s.cs" % name, generate_enum(name, sorted(values)))

    type_adapter.vprint_translation_map()