blob: 4dfc9244d1f5f2de5912f8ee3a2a96f78f933e15 [file] [log] [blame]
Ian Zernyd8dd0e12022-05-30 13:03:12 +02001#!/usr/bin/env python3
2# Copyright (c) 2022, the R8 project authors. Please see the AUTHORS file
3# for details. All rights reserved. Use of this source code is governed by a
4# BSD-style license that can be found in the LICENSE file.
5
6import sys
7import argparse
8import compiledump
9
Christoffer Quist Adamsen2434a4d2023-10-16 11:29:03 +020010
Ian Zernyd8dd0e12022-05-30 13:03:12 +020011def parse_arguments():
Christoffer Quist Adamsen2434a4d2023-10-16 11:29:03 +020012 parser = argparse.ArgumentParser(
13 description='Helper to fetch r8.jar from cloudstorage.')
14 parser.add_argument(
15 '-v',
16 '--version',
17 help='Version or commit-hash to download '
18 '(e.g., 3.3.50 or 33ae86d80351efc4d632452331d06cb97e42f2a7).',
19 required=True)
20 parser.add_argument(
21 '--outdir',
22 help='Output directory to place the r8.jar in (default cwd).',
23 default=None)
Ian Zerny67972a32023-11-07 13:28:32 +010024 parser.add_argument(
25 '--nolib',
26 help='Use the non-lib distribution (default uses the lib distribution)',
27 default=False,
28 action='store_true')
Christoffer Quist Adamsen2434a4d2023-10-16 11:29:03 +020029 return parser.parse_args()
30
Ian Zernyd8dd0e12022-05-30 13:03:12 +020031
32def main():
Christoffer Quist Adamsen2434a4d2023-10-16 11:29:03 +020033 args = parse_arguments()
34 outdir = args.outdir if args.outdir else ''
Ian Zerny67972a32023-11-07 13:28:32 +010035 print(compiledump.download_distribution(args.version, args, outdir))
Christoffer Quist Adamsen2434a4d2023-10-16 11:29:03 +020036 return 0
37
Ian Zernyd8dd0e12022-05-30 13:03:12 +020038
39if __name__ == '__main__':
Christoffer Quist Adamsen2434a4d2023-10-16 11:29:03 +020040 sys.exit(main())