Rico Wind | 1f4172c | 2018-09-06 16:29:03 +0200 | [diff] [blame] | 1 | #!/usr/bin/env python |
| 2 | # Copyright (c) 2018, 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 | # Utility methods to make running on our performance tracking system easier. |
| 7 | import os |
| 8 | import sys |
| 9 | |
| 10 | LINKED_THIRD_PARTY_DIRECTORIES = [ |
| 11 | 'framework', |
| 12 | 'benchmarks', |
| 13 | 'gradle-plugin', |
| 14 | 'gradle', |
| 15 | 'android_jar', |
| 16 | 'proguardsettings', |
| 17 | 'gmscore', |
| 18 | 'youtube', |
| 19 | 'gmail', |
| 20 | 'r8', |
| 21 | 'openjdk', |
| 22 | ] |
| 23 | |
| 24 | # Path to our internally updated third party |
Rico Wind | 1c73786 | 2018-09-12 09:40:26 +0200 | [diff] [blame] | 25 | THIRD_PARTY_SOURCE = "/usr/local/google/home/golem/r8/third_party" |
Rico Wind | 1f4172c | 2018-09-06 16:29:03 +0200 | [diff] [blame] | 26 | |
| 27 | def link_third_party(): |
| 28 | assert os.path.exists('third_party') |
| 29 | for dir in LINKED_THIRD_PARTY_DIRECTORIES: |
| 30 | src = os.path.join(THIRD_PARTY_SOURCE, dir) |
| 31 | dest = os.path.join('third_party', dir) |
| 32 | if os.path.exists(dest): |
| 33 | raise Exception('Destination "{}" already exists, are you running with' |
| 34 | ' --golem locally'.format(dest)) |
| 35 | print('Symlinking {} to {}'.format(src, dest)) |
| 36 | os.symlink(src, dest) |
| 37 | |
| 38 | if __name__ == '__main__': |
| 39 | sys.exit(link_third_party()) |