blob: 6a4e399ac4ca029e7be41fa42a888ced4ccd7e2d [file] [log] [blame]
Ian Zernydcb172e2022-02-22 15:36:45 +01001#!/usr/bin/env python3
Rico Wind1f4172c2018-09-06 16:29:03 +02002# 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.
7import os
8import sys
9
10LINKED_THIRD_PARTY_DIRECTORIES = [
Rico Wind1f4172c2018-09-06 16:29:03 +020011 'android_jar',
Morten Krogh-Jespersen220e5702019-02-27 12:57:01 +010012 'android_sdk',
Morten Krogh-Jesperseneecb9302019-02-22 11:30:06 +010013 'benchmarks',
14 'framework',
Rico Wind1f4172c2018-09-06 16:29:03 +020015 'gmail',
Morten Krogh-Jesperseneecb9302019-02-22 11:30:06 +010016 'gmscore',
17 'gradle',
18 'gradle-plugin',
Rico Wind1f4172c2018-09-06 16:29:03 +020019 'openjdk',
Ian Zernyfbb1f7a2019-05-02 14:34:13 +020020 'proguard',
Morten Krogh-Jesperseneecb9302019-02-22 11:30:06 +010021 'proguardsettings',
22 'r8',
Morten Krogh-Jespersenafd858c2020-03-11 11:09:19 +010023 'remapper',
Rico Windeb76fcb2020-04-06 13:33:51 +020024 'retrace_benchmark',
Ian Zerny37097652019-04-11 13:13:27 +020025 'sample_libraries',
Morten Krogh-Jesperseneecb9302019-02-22 11:30:06 +010026 'youtube',
Rico Wind1f4172c2018-09-06 16:29:03 +020027]
28
Ian Zernyfbb1f7a2019-05-02 14:34:13 +020029LINKED_TOOL_DIRECTORIES = [
30 'linux/dx',
31]
32
Rico Wind1f4172c2018-09-06 16:29:03 +020033# Path to our internally updated third party
Rico Wind1c737862018-09-12 09:40:26 +020034THIRD_PARTY_SOURCE = "/usr/local/google/home/golem/r8/third_party"
Ian Zernyfbb1f7a2019-05-02 14:34:13 +020035TOOLS_SOURCE = "/usr/local/google/home/golem/r8/tools"
Rico Wind1f4172c2018-09-06 16:29:03 +020036
37def link_third_party():
38 assert os.path.exists('third_party')
39 for dir in LINKED_THIRD_PARTY_DIRECTORIES:
40 src = os.path.join(THIRD_PARTY_SOURCE, dir)
41 dest = os.path.join('third_party', dir)
42 if os.path.exists(dest):
43 raise Exception('Destination "{}" already exists, are you running with'
44 ' --golem locally'.format(dest))
45 print('Symlinking {} to {}'.format(src, dest))
46 os.symlink(src, dest)
Ian Zernyfbb1f7a2019-05-02 14:34:13 +020047 for dir in LINKED_TOOL_DIRECTORIES:
48 src = os.path.join(TOOLS_SOURCE, dir)
49 dest = os.path.join('tools', dir)
50 if os.path.exists(dest):
51 raise Exception('Destination "{}" already exists, are you running with'
52 ' --golem locally'.format(dest))
53 print('Symlinking {} to {}'.format(src, dest))
54 if '/' in dir:
Rico Winded8c24a2019-05-03 08:45:20 +020055 os.makedirs(os.path.dirname(dest))
Ian Zernyfbb1f7a2019-05-02 14:34:13 +020056 os.symlink(src, dest)
Rico Wind1f4172c2018-09-06 16:29:03 +020057
58if __name__ == '__main__':
59 sys.exit(link_third_party())