pack_jcoverage_resources.py 500 B

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