blob: efcf560d296660adb6c8ee3a17d451238ca720da [file] [log] [blame]
Tamas Kenezf2ee2a32017-06-21 10:30:20 +02001#!/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
6# Run ProGuard, Google's internal version
7
8from __future__ import print_function
9import os
10import subprocess
11import sys
12
13import utils
14
15PROGUARD_JAR = os.path.join(utils.REPO_ROOT, 'third_party', 'proguard',
16 'proguard_internal_159423826', 'ProGuard_deploy.jar')
17
Tamas Kenezfc34cd82017-07-13 12:43:57 +020018def run(args, track_memory_file = None):
19 cmd = []
20 if track_memory_file:
21 cmd.extend(['tools/track_memory.sh', track_memory_file])
22 cmd.extend(['java', '-jar', PROGUARD_JAR])
Tamas Kenezf2ee2a32017-06-21 10:30:20 +020023 cmd.extend(args)
Tamas Kenezfc34cd82017-07-13 12:43:57 +020024 utils.PrintCmd(cmd)
Tamas Kenezf2ee2a32017-06-21 10:30:20 +020025 subprocess.check_call(cmd)
26
27def Main():
28 run(sys.argv[1:])
29
30if __name__ == '__main__':
31 sys.exit(Main())