summaryrefslogtreecommitdiffstats
path: root/lldb/scripts/Xcode/build-llvm.py
diff options
context:
space:
mode:
authorSean Callanan <scallanan@apple.com>2017-02-23 02:21:34 +0000
committerSean Callanan <scallanan@apple.com>2017-02-23 02:21:34 +0000
commitefe5d5fe9d7f3c774748af7db1e484719b007fbf (patch)
treef6ffefcc0bba641aab7efa904f35f0f81237df63 /lldb/scripts/Xcode/build-llvm.py
parent73c3c21fae2fc8728d6cd8526ee4a43ee8d98d35 (diff)
downloadbcm5719-llvm-efe5d5fe9d7f3c774748af7db1e484719b007fbf.tar.gz
bcm5719-llvm-efe5d5fe9d7f3c774748af7db1e484719b007fbf.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. This update to the patch introduces a FALLBACK file whose contents take precedence if the current branch could not be identified. If the current branch could be identified, FALLBACK is updated, allowing the user to e.g. cut branches off of known branches and still have the automatic checkout mechanism work. It also documents all of this. Differential revision: https://reviews.llvm.org/D30275 llvm-svn: 295922
Diffstat (limited to 'lldb/scripts/Xcode/build-llvm.py')
-rwxr-xr-xlldb/scripts/Xcode/build-llvm.py57
1 files changed, 26 insertions, 31 deletions
diff --git a/lldb/scripts/Xcode/build-llvm.py b/lldb/scripts/Xcode/build-llvm.py
index 792f92558b4..36e491ebf06 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,36 @@ 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:
+ identifier = "<invalid>" # repo.find will just use the fallback file
+ set = repo.find(identifier)
+ return [process_repo(r) for r in set]
def get_c_compiler():
OpenPOWER on IntegriCloud