diff options
author | Sean Callanan <scallanan@apple.com> | 2017-02-22 22:57:59 +0000 |
---|---|---|
committer | Sean Callanan <scallanan@apple.com> | 2017-02-22 22:57:59 +0000 |
commit | ff1fb7f846829a20a4d8242925686effb8cbbaf1 (patch) | |
tree | c8bb3963c6d1991b0b9c3df76312e01aedc5be28 /lldb/scripts/Xcode/build-llvm.py | |
parent | 63efdd9e1e0a44a1f7c4e31954167857703d16b4 (diff) | |
download | bcm5719-llvm-ff1fb7f846829a20a4d8242925686effb8cbbaf1.tar.gz bcm5719-llvm-ff1fb7f846829a20a4d8242925686effb8cbbaf1.zip |
Changed builld-llvm.py to use .json files
LLDB has many branches in a variety of repositories.
The build-script.py file is subtly different for each set.
This is unnecessary and causes merge headaches.
This patch makes build-llvm.py consult a directory full
of .json files, each one of which matches a particular
branch using a regular expression.
Differential revision: https://reviews.llvm.org/D30275
llvm-svn: 295897
Diffstat (limited to 'lldb/scripts/Xcode/build-llvm.py')
-rwxr-xr-x | lldb/scripts/Xcode/build-llvm.py | 59 |
1 files changed, 28 insertions, 31 deletions
diff --git a/lldb/scripts/Xcode/build-llvm.py b/lldb/scripts/Xcode/build-llvm.py index 792f92558b4..15b6a6b8c50 100755 --- a/lldb/scripts/Xcode/build-llvm.py +++ b/lldb/scripts/Xcode/build-llvm.py @@ -6,6 +6,7 @@ import fnmatch import os import platform import re +import repo import subprocess import sys @@ -17,42 +18,38 @@ from lldbbuild import * def LLVM_HASH_INCLUDES_DIFFS(): return False -# The use of "x = "..."; return x" here is important because tooling looks for -# it with regexps. Only change how this works if you know what you are doing. - - -def LLVM_REF(): - llvm_ref = "master" - return llvm_ref - +# For use with Xcode-style builds -def CLANG_REF(): - clang_ref = "master" - return clang_ref +def process_vcs(vcs): + return { + "svn": VCS.svn, + "git": VCS.git + }[vcs] -# For use with Xcode-style builds +def process_root(name): + return { + "llvm": llvm_source_path(), + "clang": clang_source_path(), + "ninja": ninja_source_path() + }[name] +def process_repo(r): + return { + 'name': r["name"], + 'vcs': process_vcs(r["vcs"]), + 'root': process_root(r["name"]), + 'url': r["url"], + 'ref': r["ref"] + } def XCODE_REPOSITORIES(): - return [ - {'name': "llvm", - 'vcs': VCS.git, - 'root': llvm_source_path(), - 'url': "http://llvm.org/git/llvm.git", - 'ref': LLVM_REF()}, - - {'name': "clang", - 'vcs': VCS.git, - 'root': clang_source_path(), - 'url': "http://llvm.org/git/clang.git", - 'ref': CLANG_REF()}, - - {'name': "ninja", - 'vcs': VCS.git, - 'root': ninja_source_path(), - 'url': "https://github.com/ninja-build/ninja.git", - 'ref': "master"} - ] + identifier = repo.identifier() + if identifier == None: + sys.exit("Couldn't identify the current branch") + set = repo.find(identifier) + if set == None: + sys.exit("Couldn't find a repository set for the current branch") + return [process_repo(r) for r in set] def get_c_compiler(): |