blob: 466c3ab843ab92a965a2dab04d31f7000c8ef2ab [file] [log] [blame]
Rico Wind1f4172c2018-09-06 16:29:03 +02001#!/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.
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',
Morten Krogh-Jesperseneecb9302019-02-22 11:30:06 +010020 'opensource_apps',
Ian Zernyfbb1f7a2019-05-02 14:34:13 +020021 'proguard',
Morten Krogh-Jesperseneecb9302019-02-22 11:30:06 +010022 'proguardsettings',
23 'r8',
Ian Zerny37097652019-04-11 13:13:27 +020024 'sample_libraries',
Morten Krogh-Jesperseneecb9302019-02-22 11:30:06 +010025 'youtube',
Rico Wind1f4172c2018-09-06 16:29:03 +020026]
27
Ian Zernyfbb1f7a2019-05-02 14:34:13 +020028LINKED_TOOL_DIRECTORIES = [
29 'linux/dx',
30]
31
Rico Wind1f4172c2018-09-06 16:29:03 +020032# Path to our internally updated third party
Rico Wind1c737862018-09-12 09:40:26 +020033THIRD_PARTY_SOURCE = "/usr/local/google/home/golem/r8/third_party"
Ian Zernyfbb1f7a2019-05-02 14:34:13 +020034TOOLS_SOURCE = "/usr/local/google/home/golem/r8/tools"
Rico Wind1f4172c2018-09-06 16:29:03 +020035
36def 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 Zernyfbb1f7a2019-05-02 14:34:13 +020046 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 Winded8c24a2019-05-03 08:45:20 +020054 os.makedirs(os.path.dirname(dest))
Ian Zernyfbb1f7a2019-05-02 14:34:13 +020055 os.symlink(src, dest)
Rico Wind1f4172c2018-09-06 16:29:03 +020056
57if __name__ == '__main__':
58 sys.exit(link_third_party())