gen_java_codenav_protobuf.py 958 B

12345678910111213141516171819202122
  1. import argparse
  2. import os
  3. def just_do_it(kythe_to_proto, entries, out_name, build_file, source_root):
  4. with open(build_file) as f:
  5. classpath = os.pathsep.join([line.strip() for line in f])
  6. os.execv(
  7. kythe_to_proto,
  8. [kythe_to_proto, '--sources-rel-root', 'fake_arcadia_root', '--entries', entries, '--out', out_name, '--classpath', classpath, '--arcadia-root', source_root]
  9. )
  10. if __name__ == '__main__':
  11. parser = argparse.ArgumentParser()
  12. parser.add_argument("--kythe-to-proto", help="kythe_to_proto tool path")
  13. parser.add_argument("--entries", help="entries json path")
  14. parser.add_argument("--out-name", help="protbuf out name")
  15. parser.add_argument("--build-file", help="build file( containing classpath )")
  16. parser.add_argument("--source-root", help="source root")
  17. args = parser.parse_args()
  18. just_do_it(args.kythe_to_proto, args.entries, args.out_name, args.build_file, args.source_root)