blob: b1bde5497576959130504abdca8419a7a58b58a1 [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
Ian Zerny3f54e222019-02-12 10:51:17 +01009import jdk
Tamas Kenezf2ee2a32017-06-21 10:30:20 +020010import os
11import subprocess
12import sys
13
14import utils
15
16PROGUARD_JAR = os.path.join(utils.REPO_ROOT, 'third_party', 'proguard',
17 'proguard_internal_159423826', 'ProGuard_deploy.jar')
18
Ian Zerny517c7662018-07-11 15:22:29 +020019def run(args, track_memory_file = None, stdout=None, stderr=None):
Tamas Kenezfc34cd82017-07-13 12:43:57 +020020 cmd = []
21 if track_memory_file:
22 cmd.extend(['tools/track_memory.sh', track_memory_file])
Ian Zerny3f54e222019-02-12 10:51:17 +010023 cmd.extend([jdk.GetJavaExecutable(), '-jar', PROGUARD_JAR])
Tamas Kenezf2ee2a32017-06-21 10:30:20 +020024 cmd.extend(args)
Tamas Kenezfc34cd82017-07-13 12:43:57 +020025 utils.PrintCmd(cmd)
Ian Zerny517c7662018-07-11 15:22:29 +020026 subprocess.call(cmd, stdout=stdout, stderr=stderr)
Tamas Kenezf2ee2a32017-06-21 10:30:20 +020027
28def Main():
29 run(sys.argv[1:])
30
31if __name__ == '__main__':
32 sys.exit(Main())