blob: 766e690d8815370fa621d83b51969e2412d58b64 [file] [log] [blame]
Ian Zernydcb172e2022-02-22 15:36:45 +01001#!/usr/bin/env python3
Mads Ager418d1ca2017-05-22 09:35:49 +02002# Copyright (c) 2017, 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
Christoffer Quist Adamsen4d38d032021-04-20 12:31:31 +02006import utils
7
8import optparse
Mads Ager418d1ca2017-05-22 09:35:49 +02009import sys
Mathias Ravdd6a6de2018-05-18 10:18:33 +020010import toolhelper
Mads Ager418d1ca2017-05-22 09:35:49 +020011
Christoffer Quist Adamsen4d38d032021-04-20 12:31:31 +020012def ParseOptions(argv):
13 parser = optparse.OptionParser(usage='%prog [options] -- [D8 options]')
14 parser.add_option(
15 '-c',
16 '--commit-hash',
17 '--commit_hash',
18 help='Commit hash of D8 to use.',
19 default=None)
20 parser.add_option(
21 '--version',
22 help='Version of D8 to use.',
23 default=None)
24 parser.add_option(
25 '--tag',
26 help='Tag of D8 to use.',
27 default=None)
28 return parser.parse_args(argv)
29
30def main(argv):
31 (options, args) = ParseOptions(sys.argv)
32 d8_args = args[1:]
33 return toolhelper.run(
34 'd8',
35 d8_args,
36 jar=utils.find_r8_jar_from_options(options),
37 main='com.android.tools.r8.D8')
38
Mads Ager418d1ca2017-05-22 09:35:49 +020039if __name__ == '__main__':
Christoffer Quist Adamsen4d38d032021-04-20 12:31:31 +020040 sys.exit(main(sys.argv[1:]))