gen_java_codenav_protobuf.py 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  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. [
  9. kythe_to_proto,
  10. '--sources-rel-root',
  11. 'fake_arcadia_root',
  12. '--entries',
  13. entries,
  14. '--out',
  15. out_name,
  16. '--classpath',
  17. classpath,
  18. '--arcadia-root',
  19. source_root,
  20. ],
  21. )
  22. if __name__ == '__main__':
  23. parser = argparse.ArgumentParser()
  24. parser.add_argument("--kythe-to-proto", help="kythe_to_proto tool path")
  25. parser.add_argument("--entries", help="entries json path")
  26. parser.add_argument("--out-name", help="protbuf out name")
  27. parser.add_argument("--build-file", help="build file( containing classpath )")
  28. parser.add_argument("--source-root", help="source root")
  29. args = parser.parse_args()
  30. just_do_it(args.kythe_to_proto, args.entries, args.out_name, args.build_file, args.source_root)