#!/usr/bin/env python
# -*- encoding: utf-8 -*-
from __future__ import print_function
import gen_csharp
import gen_docs_json
import gen_java
import gen_python
import gen_thrift
import bindings
import sys
import os
sys.path.insert(0, "../../scripts")
import run

# Create results folder, where H2OCloud stores its logs
results_dir = "../../results"
if not os.path.exists(results_dir):
    os.mkdir(results_dir)

# Start H2O cloud
print("Starting H2O cloud...")
cloud = run.H2OCloud(
    cloud_num=0,
    use_client=False,
    nodes_per_cloud=1,
    h2o_jar=os.path.abspath("../../build/h2o.jar"),
    base_port=48000,
    xmx="4g",
    cp="",
    output_dir=results_dir
)
cloud.start()
cloud.wait_for_cloud_to_be_up()

# Manipulate the command line arguments, so that bindings module would know which cloud to use
sys.argv.insert(1, "--usecloud")
sys.argv.insert(2, "%s:%s" % (cloud.get_ip(), cloud.get_port()))

# Actually generate all the bindings
print()
gen_java.main()
gen_python.main()
gen_docs_json.main()
gen_thrift.main()
gen_csharp.main()
bindings.done()
print()

# The END
cloud.stop()

@@ -41,16 +41,62 @@
 f-8 -*-%0A
+# This script must run from its own directory%0A
 from __f
@@ -379,17 +379,17 @@
 %22../
-../result
+build/log
 s%22%0Ai
@@ -435,12 +435,15 @@
 os.m
-k
+ake
 dir
+s
 (res

Change the target directory for gen_all's build logs to h2o-bindings/build/logs