@@ -52,6 +52,24 @@ def update_working_copy(repo_path):
52
52
else :
53
53
check_call ([ "svn" , "update" ])
54
54
55
+ def obtain_additional_swift_sources (opts = {'with_ssh' : False }):
56
+ additional_repos = {
57
+ 'llvm' : 'apple/swift-llvm' ,
58
+ 'clang' : 'apple/swift-clang' ,
59
+ 'lldb' : 'apple/swift-lldb' ,
60
+ 'cmark' : 'apple/swift-cmark' ,
61
+ 'llbuild' : 'apple/swift-llbuild' ,
62
+ 'swiftpm' : 'apple/swift-package-manager' ,
63
+ 'swift-corelibs-xctest' : 'apple/swift-corelibs-xctest' ,
64
+ 'swift-corelibs-foundation' : 'apple/swift-corelibs-foundation'
65
+ }
66
+ for dir_name , repo in additional_repos .iteritems ():
67
+ print ("--- Cloning '" + dir_name + "' ---" )
68
+ if opts ['with_ssh' ] == True :
69
+ remote = "[email protected] :" + repo + '.git'
70
+ else :
71
+ remote = "https://github.com/" + repo + '.git'
72
+ check_call (['git' , 'clone' , remote , dir_name ])
55
73
56
74
def main ():
57
75
parser = argparse .ArgumentParser (
@@ -63,12 +81,22 @@ By default, updates your checkouts of Swift, SourceKit, LLDB, and SwiftPM.""")
63
81
parser .add_argument ("-a" , "--all" ,
64
82
help = "also update checkouts of llbuild, LLVM, and Clang" ,
65
83
action = "store_true" )
84
+ parser .add_argument ("--clone" ,
85
+ help = "Obtain Sources for Swift and Related Projects" ,
86
+ action = "store_true" )
87
+ parser .add_argument ("--clone-with-ssh" ,
88
+ help = "Obtain Sources for Swift and Related Projects via SSH" ,
89
+ action = "store_true" )
66
90
args = parser .parse_args ()
67
91
68
92
if args .all :
69
93
update_working_copy (os .path .join (SWIFT_SOURCE_ROOT , "llbuild" ))
70
94
update_working_copy (os .path .join (SWIFT_SOURCE_ROOT , "llvm" ))
71
95
update_working_copy (os .path .join (SWIFT_SOURCE_ROOT , "clang" ))
96
+ if args .clone :
97
+ obtain_additional_swift_sources ()
98
+ if args .clone_with_ssh :
99
+ obtain_additional_swift_sources ({'with_ssh' : True })
72
100
73
101
update_working_copy (os .path .join (SWIFT_SOURCE_ROOT , "swift" ))
74
102
update_working_copy (
0 commit comments