blob: 6789f18686967f1ad94c96a8205880d614e0b195 [file] [log] [blame]
Søren Gjesse6d1934f2017-11-09 10:00:24 +01001#!/usr/bin/env python
2# 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
6import argparse
7import gradle
8import os
9import sys
10import utils
11
12from shutil import copyfile
13
14def parse_arguments():
15 parser = argparse.ArgumentParser(
16 description = 'Build and copy jars to an Android tree.')
17 parser.add_argument('android_root', nargs=1,
18 help='Android checkout root.')
19 return parser.parse_args()
20
21def Main():
22 args = parse_arguments()
23 targets = ['r8', 'd8', 'compatdx', 'compatproguard']
24 gradle.RunGradle(targets)
25 for target in targets:
26 src = os.path.join(utils.REPO_ROOT, 'build', 'libs', target + '.jar')
27 dest = os.path.join(
28 args.android_root[0], 'prebuilts', 'r8', target + '-master.jar')
29 print 'Copying: ' + src + ' -> ' + dest
30 copyfile(src, dest)
31
32if __name__ == '__main__':
33 sys.exit(Main())