@@ -16,7 +16,6 @@ from __future__ import print_function
16
16
import argparse
17
17
import os
18
18
import sys
19
- import pdb
20
19
21
20
sys .path .append (os .path .dirname (__file__ ))
22
21
@@ -53,20 +52,24 @@ def update_working_copy(repo_path):
53
52
else :
54
53
check_call ([ "svn" , "update" ])
55
54
56
- def obtain_additional_swift_sources ():
55
+ def obtain_additional_swift_sources (opts = { 'with_ssh' : False } ):
57
56
additional_repos = {
58
- 'llvm' : 'https://github.com/ apple/swift-llvm.git ' ,
59
- 'clang' : 'https://github.com/ apple/swift-clang.git ' ,
60
- 'lldb' : 'https://github.com/ apple/swift-lldb.git ' ,
61
- 'cmark' : 'https://github.com/ apple/swift-cmark.git ' ,
62
- 'llbuild' : 'https://github.com/ apple/swift-llbuild.git ' ,
63
- 'swiftpm' : 'https://github.com/ apple/swift-package-manager.git ' ,
64
- 'swift-corelibs-xctest' : 'https://github.com/ apple/swift-corelibs-xctest.git ' ,
65
- 'swift-corelibs-foundation' : 'https://github.com/ apple/swift-corelibs-foundation.git '
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'
66
65
}
67
66
for dir_name , repo in additional_repos .iteritems ():
68
67
print ("--- Cloning '" + dir_name + "' ---" )
69
- check_call (['git' , 'clone' , repo , 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 ])
70
73
71
74
def main ():
72
75
parser = argparse .ArgumentParser (
@@ -81,14 +84,19 @@ By default, updates your checkouts of Swift, SourceKit, LLDB, and SwiftPM.""")
81
84
parser .add_argument ("--clone" ,
82
85
help = "Obtain Sources for Swift and Related Projects" ,
83
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" )
84
90
args = parser .parse_args ()
85
91
86
- if args .all :
87
- update_working_copy (os .path .join (SWIFT_SOURCE_ROOT , "llbuild" ))
88
- update_working_copy (os .path .join (SWIFT_SOURCE_ROOT , "llvm" ))
89
- update_working_copy (os .path .join (SWIFT_SOURCE_ROOT , "clang" ))
92
+ # if args.all:
93
+ # update_working_copy(os.path.join(SWIFT_SOURCE_ROOT, "llbuild"))
94
+ # update_working_copy(os.path.join(SWIFT_SOURCE_ROOT, "llvm"))
95
+ # update_working_copy(os.path.join(SWIFT_SOURCE_ROOT, "clang"))
90
96
if args .clone :
91
97
obtain_additional_swift_sources ()
98
+ if args .clone_with_ssh :
99
+ obtain_additional_swift_sources ({'with_ssh' : True })
92
100
93
101
update_working_copy (os .path .join (SWIFT_SOURCE_ROOT , "swift" ))
94
102
update_working_copy (
0 commit comments