示例#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("Docs Json", "../../../h2o-docs", clear_dir=False)

    bi.vprint("Writing schemas.json...")
    bi.write_to_file("schemas.json", json.dumps(bi.schemas(raw=True)))

    bi.vprint("Writing routes.json...")
    bi.write_to_file("routes.json", json.dumps(bi.endpoints(raw=True)))
示例#3
0
def main():
    bi.init("Docs Json", "../../../h2o-docs", clear_dir=False)

    bi.vprint("Writing schemas.json...")
    bi.write_to_file("schemas.json", json.dumps(bi.schemas(raw=True)))

    bi.vprint("Writing routes.json...")
    bi.write_to_file("routes.json", json.dumps(bi.endpoints(raw=True)))
示例#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
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
from __future__ import unicode_literals
import json
import bindings as bi

if __name__ == "__main__":
    bi.init("Docs Json", "../../../h2o-docs", clear_dir=False)

    bi.vprint("Writing schemas.json...")
    bi.write_to_file("schemas.json", json.dumps(bi.schemas(raw=True)))

    bi.vprint("Writing routes.json...")
    bi.write_to_file("routes.json", json.dumps(bi.endpoints(raw=True)))