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 = [ |
Rico Wind | 1f4172c | 2018-09-06 16:29:03 +0200 | [diff] [blame] | 11 | 'android_jar', |
Morten Krogh-Jespersen | 220e570 | 2019-02-27 12:57:01 +0100 | [diff] [blame] | 12 | 'android_sdk', |
Morten Krogh-Jespersen | eecb930 | 2019-02-22 11:30:06 +0100 | [diff] [blame] | 13 | 'benchmarks', |
| 14 | 'framework', |
Rico Wind | 1f4172c | 2018-09-06 16:29:03 +0200 | [diff] [blame] | 15 | 'gmail', |
Morten Krogh-Jespersen | eecb930 | 2019-02-22 11:30:06 +0100 | [diff] [blame] | 16 | 'gmscore', |
| 17 | 'gradle', |
| 18 | 'gradle-plugin', |
Rico Wind | 1f4172c | 2018-09-06 16:29:03 +0200 | [diff] [blame] | 19 | 'openjdk', |
Morten Krogh-Jespersen | eecb930 | 2019-02-22 11:30:06 +0100 | [diff] [blame] | 20 | 'opensource_apps', |
Ian Zerny | fbb1f7a | 2019-05-02 14:34:13 +0200 | [diff] [blame] | 21 | 'proguard', |
Morten Krogh-Jespersen | eecb930 | 2019-02-22 11:30:06 +0100 | [diff] [blame] | 22 | 'proguardsettings', |
| 23 | 'r8', |
Ian Zerny | 3709765 | 2019-04-11 13:13:27 +0200 | [diff] [blame] | 24 | 'sample_libraries', |
Morten Krogh-Jespersen | eecb930 | 2019-02-22 11:30:06 +0100 | [diff] [blame] | 25 | 'youtube', |
Rico Wind | 1f4172c | 2018-09-06 16:29:03 +0200 | [diff] [blame] | 26 | ] |
| 27 | |
Ian Zerny | fbb1f7a | 2019-05-02 14:34:13 +0200 | [diff] [blame] | 28 | LINKED_TOOL_DIRECTORIES = [ |
| 29 | 'linux/dx', |
| 30 | ] |
| 31 | |
Rico Wind | 1f4172c | 2018-09-06 16:29:03 +0200 | [diff] [blame] | 32 | # Path to our internally updated third party |
Rico Wind | 1c73786 | 2018-09-12 09:40:26 +0200 | [diff] [blame] | 33 | THIRD_PARTY_SOURCE = "/usr/local/google/home/golem/r8/third_party" |
Ian Zerny | fbb1f7a | 2019-05-02 14:34:13 +0200 | [diff] [blame] | 34 | TOOLS_SOURCE = "/usr/local/google/home/golem/r8/tools" |
Rico Wind | 1f4172c | 2018-09-06 16:29:03 +0200 | [diff] [blame] | 35 | |
| 36 | def link_third_party(): |
| 37 | assert os.path.exists('third_party') |
| 38 | for dir in LINKED_THIRD_PARTY_DIRECTORIES: |
| 39 | src = os.path.join(THIRD_PARTY_SOURCE, dir) |
| 40 | dest = os.path.join('third_party', dir) |
| 41 | if os.path.exists(dest): |
| 42 | raise Exception('Destination "{}" already exists, are you running with' |
| 43 | ' --golem locally'.format(dest)) |
| 44 | print('Symlinking {} to {}'.format(src, dest)) |
| 45 | os.symlink(src, dest) |
Ian Zerny | fbb1f7a | 2019-05-02 14:34:13 +0200 | [diff] [blame] | 46 | for dir in LINKED_TOOL_DIRECTORIES: |
| 47 | src = os.path.join(TOOLS_SOURCE, dir) |
| 48 | dest = os.path.join('tools', dir) |
| 49 | if os.path.exists(dest): |
| 50 | raise Exception('Destination "{}" already exists, are you running with' |
| 51 | ' --golem locally'.format(dest)) |
| 52 | print('Symlinking {} to {}'.format(src, dest)) |
| 53 | if '/' in dir: |
Rico Wind | ed8c24a | 2019-05-03 08:45:20 +0200 | [diff] [blame] | 54 | os.makedirs(os.path.dirname(dest)) |
Ian Zerny | fbb1f7a | 2019-05-02 14:34:13 +0200 | [diff] [blame] | 55 | os.symlink(src, dest) |
Rico Wind | 1f4172c | 2018-09-06 16:29:03 +0200 | [diff] [blame] | 56 | |
| 57 | if __name__ == '__main__': |
| 58 | sys.exit(link_third_party()) |