pack_jcoverage_resources.py 541 B

12345678910111213141516171819202122232425
  1. from __future__ import print_function
  2. import sys
  3. import tarfile
  4. import os
  5. import subprocess
  6. def main(args):
  7. output_file = args[0]
  8. report_file = args[1]
  9. res = subprocess.call(args[args.index('-end') + 1 :])
  10. if not os.path.exists(report_file):
  11. print('Can\'t find jacoco exec file', file=sys.stderr)
  12. return res
  13. with tarfile.open(output_file, 'w') as outf:
  14. outf.add(report_file, arcname=os.path.basename(report_file))
  15. return res
  16. if __name__ == '__main__':
  17. sys.exit(main(sys.argv[1:]))