From 176d903d2eff4e335c46ffa225348b31878c12b6 Mon Sep 17 00:00:00 2001 From: Brandon Mathis Date: Thu, 3 Dec 2015 12:40:17 -0500 Subject: [PATCH 01/10] Simplify obtaining of swift sources --- README.md | 10 +--------- utils/clone_resources.sh | 11 +++++++++++ 2 files changed, 12 insertions(+), 9 deletions(-) create mode 100755 utils/clone_resources.sh diff --git a/README.md b/README.md index 962706af30d2a..0ea042e7b97d4 100644 --- a/README.md +++ b/README.md @@ -66,15 +66,7 @@ compiler for C++14 support and create a symlink: ### Getting Sources for Swift and Related Projects - git clone git@github.com:apple/swift.git swift - git clone git@github.com:apple/swift-llvm.git llvm - git clone git@github.com:apple/swift-clang.git clang - git clone git@github.com:apple/swift-lldb.git lldb - git clone git@github.com:apple/swift-cmark.git cmark - git clone git@github.com:apple/swift-llbuild.git llbuild - git clone git@github.com:apple/swift-package-manager.git swiftpm - git clone git@github.com:apple/swift-corelibs-xctest.git - git clone git@github.com:apple/swift-corelibs-foundation.git + curl -sSL https://raw.githubusercontent.com/apple/swift/master/utils/clone_resources.sh | bash [CMake](http://cmake.org) is the core infrastructure used to configure builds of diff --git a/utils/clone_resources.sh b/utils/clone_resources.sh new file mode 100755 index 0000000000000..00e0db2adadf1 --- /dev/null +++ b/utils/clone_resources.sh @@ -0,0 +1,11 @@ +#!/usr/env bash + +git clone git@github.com:apple/swift.git swift +git clone git@github.com:apple/swift-llvm.git llvm +git clone git@github.com:apple/swift-clang.git clang +git clone git@github.com:apple/swift-lldb.git lldb +git clone git@github.com:apple/swift-cmark.git cmark +git clone git@github.com:apple/swift-llbuild.git llbuild +git clone git@github.com:apple/swift-package-manager.git swiftpm +git clone git@github.com:apple/swift-corelibs-xctest.git +git clone git@github.com:apple/swift-corelibs-foundation.git From 77ec4222029a154393479f9c880a9f3514275f76 Mon Sep 17 00:00:00 2001 From: Brandon Mathis Date: Thu, 3 Dec 2015 12:43:15 -0500 Subject: [PATCH 02/10] Correct interpriter --- utils/clone_resources.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/clone_resources.sh b/utils/clone_resources.sh index 00e0db2adadf1..ca599d3d05ec2 100755 --- a/utils/clone_resources.sh +++ b/utils/clone_resources.sh @@ -1,4 +1,4 @@ -#!/usr/env bash +#!/usr/bin/env bash git clone git@github.com:apple/swift.git swift git clone git@github.com:apple/swift-llvm.git llvm From 665b08b8028e2c245629b2aa916746e52e124723 Mon Sep 17 00:00:00 2001 From: Brandon Mathis Date: Thu, 3 Dec 2015 12:49:01 -0500 Subject: [PATCH 03/10] Favor https over ssh for cloning from github --- utils/clone_resources.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/utils/clone_resources.sh b/utils/clone_resources.sh index ca599d3d05ec2..9bc85c4ab56bb 100755 --- a/utils/clone_resources.sh +++ b/utils/clone_resources.sh @@ -1,11 +1,11 @@ #!/usr/bin/env bash -git clone git@github.com:apple/swift.git swift -git clone git@github.com:apple/swift-llvm.git llvm -git clone git@github.com:apple/swift-clang.git clang -git clone git@github.com:apple/swift-lldb.git lldb -git clone git@github.com:apple/swift-cmark.git cmark -git clone git@github.com:apple/swift-llbuild.git llbuild -git clone git@github.com:apple/swift-package-manager.git swiftpm -git clone git@github.com:apple/swift-corelibs-xctest.git -git clone git@github.com:apple/swift-corelibs-foundation.git +git clone https://github.com/apple/swift.git swift +git clone https://github.com/apple/swift-llvm.git llvm +git clone https://github.com/apple/swift-clang.git clang +git clone https://github.com/apple/swift-lldb.git lldb +git clone https://github.com/apple/swift-cmark.git cmark +git clone https://github.com/apple/swift-llbuild.git llbuild +git clone https://github.com/apple/swift-package-manager.git swiftpm +git clone https://github.com/apple/swift-corelibs-xctest.git +git clone https://github.com/apple/swift-corelibs-foundation.git From 74a1d0592ceb4b4603c7e875982f961d5e7ded1c Mon Sep 17 00:00:00 2001 From: Brandon Mathis Date: Thu, 3 Dec 2015 18:33:46 -0500 Subject: [PATCH 04/10] Move additional repo cloning into the update-checkout py script --- utils/clone_resources.sh | 11 ----------- utils/update-checkout | 21 +++++++++++++++++++++ 2 files changed, 21 insertions(+), 11 deletions(-) delete mode 100755 utils/clone_resources.sh diff --git a/utils/clone_resources.sh b/utils/clone_resources.sh deleted file mode 100755 index 9bc85c4ab56bb..0000000000000 --- a/utils/clone_resources.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env bash - -git clone https://github.com/apple/swift.git swift -git clone https://github.com/apple/swift-llvm.git llvm -git clone https://github.com/apple/swift-clang.git clang -git clone https://github.com/apple/swift-lldb.git lldb -git clone https://github.com/apple/swift-cmark.git cmark -git clone https://github.com/apple/swift-llbuild.git llbuild -git clone https://github.com/apple/swift-package-manager.git swiftpm -git clone https://github.com/apple/swift-corelibs-xctest.git -git clone https://github.com/apple/swift-corelibs-foundation.git diff --git a/utils/update-checkout b/utils/update-checkout index 3dd11af9a027e..7c8ddb15c682f 100755 --- a/utils/update-checkout +++ b/utils/update-checkout @@ -16,6 +16,7 @@ from __future__ import print_function import argparse import os import sys +import pdb sys.path.append(os.path.dirname(__file__)) @@ -52,6 +53,21 @@ def update_working_copy(repo_path): else: check_call([ "svn", "update" ]) +def obtain_additional_swift_sources(): + additional_repos = { + 'swift': 'https://github.com/apple/swift.git', + 'llvm': 'https://github.com/apple/swift-llvm.git', + 'clang': 'https://github.com/apple/swift-clang.git', + 'lldb': 'https://github.com/apple/swift-lldb.git', + 'cmark': 'https://github.com/apple/swift-cmark.git', + 'llbuild': 'https://github.com/apple/swift-llbuild.git', + 'swiftpm': 'https://github.com/apple/swift-package-manager.git', + 'swift-corelibs-xctest': 'https://github.com/apple/swift-corelibs-xctest.git', + 'swift-corelibs-foundation': 'https://github.com/apple/swift-corelibs-foundation.git' + } + for dir_name, repo in additional_repos.iteritems(): + print("--- Cloning '" + dir_name + "' ---") + check_call(['git', 'clone', repo, dir_name]) def main(): parser = argparse.ArgumentParser( @@ -63,12 +79,17 @@ By default, updates your checkouts of Swift, SourceKit, LLDB, and SwiftPM.""") parser.add_argument("-a", "--all", help="also update checkouts of llbuild, LLVM, and Clang", action="store_true") + parser.add_argument("-c", "--clone", + help="Obtain Sources for Swift and Related Projects", + action="store_true") args = parser.parse_args() if args.all: update_working_copy(os.path.join(SWIFT_SOURCE_ROOT, "llbuild")) update_working_copy(os.path.join(SWIFT_SOURCE_ROOT, "llvm")) update_working_copy(os.path.join(SWIFT_SOURCE_ROOT, "clang")) + if args.clone: + obtain_additional_swift_sources() update_working_copy(os.path.join(SWIFT_SOURCE_ROOT, "swift")) update_working_copy( From e84acea93ec5963184cc486ce6007e6f94d0ae90 Mon Sep 17 00:00:00 2001 From: Brandon Mathis Date: Thu, 3 Dec 2015 18:34:32 -0500 Subject: [PATCH 05/10] Update readme --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 0ea042e7b97d4..87d889b46662b 100644 --- a/README.md +++ b/README.md @@ -66,8 +66,7 @@ compiler for C++14 support and create a symlink: ### Getting Sources for Swift and Related Projects - curl -sSL https://raw.githubusercontent.com/apple/swift/master/utils/clone_resources.sh | bash - + utils/update-checkout --clone [CMake](http://cmake.org) is the core infrastructure used to configure builds of Swift and its companion projects; at least version 2.8.12.2 is required. Your From 2a1364d8fa47663f73e8fa4738c62b2a34044968 Mon Sep 17 00:00:00 2001 From: Brandon Mathis Date: Thu, 3 Dec 2015 18:35:19 -0500 Subject: [PATCH 06/10] Specificity --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 87d889b46662b..c006440452d86 100644 --- a/README.md +++ b/README.md @@ -66,7 +66,7 @@ compiler for C++14 support and create a symlink: ### Getting Sources for Swift and Related Projects - utils/update-checkout --clone + ./utils/update-checkout --clone [CMake](http://cmake.org) is the core infrastructure used to configure builds of Swift and its companion projects; at least version 2.8.12.2 is required. Your From 2942c32781438f002df67ce7f87dfeb07ff2a01d Mon Sep 17 00:00:00 2001 From: Brandon Mathis Date: Thu, 3 Dec 2015 19:39:47 -0500 Subject: [PATCH 07/10] Make changes per @gribozavr suggestions --- README.md | 2 ++ utils/update-checkout | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c006440452d86..307cfde26426f 100644 --- a/README.md +++ b/README.md @@ -66,6 +66,8 @@ compiler for C++14 support and create a symlink: ### Getting Sources for Swift and Related Projects + git clone https://github.com/apple/swift.git swift + cd swift ./utils/update-checkout --clone [CMake](http://cmake.org) is the core infrastructure used to configure builds of diff --git a/utils/update-checkout b/utils/update-checkout index 7c8ddb15c682f..bad374ca94de2 100755 --- a/utils/update-checkout +++ b/utils/update-checkout @@ -55,7 +55,6 @@ def update_working_copy(repo_path): def obtain_additional_swift_sources(): additional_repos = { - 'swift': 'https://github.com/apple/swift.git', 'llvm': 'https://github.com/apple/swift-llvm.git', 'clang': 'https://github.com/apple/swift-clang.git', 'lldb': 'https://github.com/apple/swift-lldb.git', @@ -79,7 +78,7 @@ By default, updates your checkouts of Swift, SourceKit, LLDB, and SwiftPM.""") parser.add_argument("-a", "--all", help="also update checkouts of llbuild, LLVM, and Clang", action="store_true") - parser.add_argument("-c", "--clone", + parser.add_argument("--clone", help="Obtain Sources for Swift and Related Projects", action="store_true") args = parser.parse_args() From b0c4fbd2429a430cdc583239e973595da4ca7b31 Mon Sep 17 00:00:00 2001 From: Brandon Mathis Date: Tue, 8 Dec 2015 15:23:42 -0500 Subject: [PATCH 08/10] Added option install with ssh param --- README.md | 44 +++++++++++++++++++------------------------ utils/update-checkout | 38 ++++++++++++++++++++++--------------- 2 files changed, 42 insertions(+), 40 deletions(-) diff --git a/README.md b/README.md index 1ae1bedc88336..0418d16634a4c 100644 --- a/README.md +++ b/README.md @@ -67,31 +67,25 @@ compiler for C++14 support and create a symlink: ### Getting Sources for Swift and Related Projects -For those checking out sources as read-only: - - git clone https://github.com/apple/swift.git swift - git clone https://github.com/apple/swift-llvm.git llvm - git clone https://github.com/apple/swift-clang.git clang - git clone https://github.com/apple/swift-lldb.git lldb - git clone https://github.com/apple/swift-cmark.git cmark - git clone https://github.com/apple/swift-llbuild.git llbuild - git clone https://github.com/apple/swift-package-manager.git swiftpm - git clone https://github.com/apple/swift-corelibs-xctest.git - git clone https://github.com/apple/swift-corelibs-foundation.git - -For those who plan on regularly making direct commits, cloning over -SSH may provide a better experience (which requires uploading -SSH keys to GitHub): - - git clone git@github.com:apple/swift.git swift - git clone git@github.com:apple/swift-llvm.git llvm - git clone git@github.com:apple/swift-clang.git clang - git clone git@github.com:apple/swift-lldb.git lldb - git clone git@github.com:apple/swift-cmark.git cmark - git clone git@github.com:apple/swift-llbuild.git llbuild - git clone git@github.com:apple/swift-package-manager.git swiftpm - git clone git@github.com:apple/swift-corelibs-xctest.git - git clone git@github.com:apple/swift-corelibs-foundation.git +#### Swift Sources + +**Via HTTPS** + git clone https://github.com/apple/swift.git + +**Via SSH** + git clone git@github.com:apple/swift.git + +#### Related Project Sources + + +**Via HTTPS** + cd + ./utils/update-checkout --clone + +**Via SSH** + cd + ./utils/update-checkout --clone-via-ssh + [CMake](http://cmake.org) is the core infrastructure used to configure builds of Swift and its companion projects; at least version 2.8.12.2 is required. Your diff --git a/utils/update-checkout b/utils/update-checkout index 167406c037920..578801aac49d0 100755 --- a/utils/update-checkout +++ b/utils/update-checkout @@ -16,7 +16,6 @@ from __future__ import print_function import argparse import os import sys -import pdb sys.path.append(os.path.dirname(__file__)) @@ -53,20 +52,24 @@ def update_working_copy(repo_path): else: check_call([ "svn", "update" ]) -def obtain_additional_swift_sources(): +def obtain_additional_swift_sources(opts = {'with_ssh': False}): additional_repos = { - 'llvm': 'https://github.com/apple/swift-llvm.git', - 'clang': 'https://github.com/apple/swift-clang.git', - 'lldb': 'https://github.com/apple/swift-lldb.git', - 'cmark': 'https://github.com/apple/swift-cmark.git', - 'llbuild': 'https://github.com/apple/swift-llbuild.git', - 'swiftpm': 'https://github.com/apple/swift-package-manager.git', - 'swift-corelibs-xctest': 'https://github.com/apple/swift-corelibs-xctest.git', - 'swift-corelibs-foundation': 'https://github.com/apple/swift-corelibs-foundation.git' + 'llvm': 'apple/swift-llvm', + 'clang': 'apple/swift-clang', + 'lldb': 'apple/swift-lldb', + 'cmark': 'apple/swift-cmark', + 'llbuild': 'apple/swift-llbuild', + 'swiftpm': 'apple/swift-package-manager', + 'swift-corelibs-xctest': 'apple/swift-corelibs-xctest', + 'swift-corelibs-foundation': 'apple/swift-corelibs-foundation' } for dir_name, repo in additional_repos.iteritems(): print("--- Cloning '" + dir_name + "' ---") - check_call(['git', 'clone', repo, dir_name]) + if opts['with_ssh'] == True: + remote = "git@github.com:" + repo + '.git' + else: + remote = "https://github.com/" + repo + '.git' + check_call(['git', 'clone', remote, dir_name]) def main(): parser = argparse.ArgumentParser( @@ -81,14 +84,19 @@ By default, updates your checkouts of Swift, SourceKit, LLDB, and SwiftPM.""") parser.add_argument("--clone", help="Obtain Sources for Swift and Related Projects", action="store_true") + parser.add_argument("--clone-with-ssh", + help="Obtain Sources for Swift and Related Projects via SSH", + action="store_true") args = parser.parse_args() - if args.all: - update_working_copy(os.path.join(SWIFT_SOURCE_ROOT, "llbuild")) - update_working_copy(os.path.join(SWIFT_SOURCE_ROOT, "llvm")) - update_working_copy(os.path.join(SWIFT_SOURCE_ROOT, "clang")) + # if args.all: + # update_working_copy(os.path.join(SWIFT_SOURCE_ROOT, "llbuild")) + # update_working_copy(os.path.join(SWIFT_SOURCE_ROOT, "llvm")) + # update_working_copy(os.path.join(SWIFT_SOURCE_ROOT, "clang")) if args.clone: obtain_additional_swift_sources() + if args.clone_with_ssh: + obtain_additional_swift_sources({'with_ssh': True}) update_working_copy(os.path.join(SWIFT_SOURCE_ROOT, "swift")) update_working_copy( From f9bc59b25259feb48eecf927a8c32a8a54b2ad54 Mon Sep 17 00:00:00 2001 From: Brandon Mathis Date: Tue, 8 Dec 2015 15:24:42 -0500 Subject: [PATCH 09/10] Uncomment update_working_copy code --- utils/update-checkout | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/utils/update-checkout b/utils/update-checkout index 578801aac49d0..f1fbbbd9ea0ed 100755 --- a/utils/update-checkout +++ b/utils/update-checkout @@ -89,10 +89,10 @@ By default, updates your checkouts of Swift, SourceKit, LLDB, and SwiftPM.""") action="store_true") args = parser.parse_args() - # if args.all: - # update_working_copy(os.path.join(SWIFT_SOURCE_ROOT, "llbuild")) - # update_working_copy(os.path.join(SWIFT_SOURCE_ROOT, "llvm")) - # update_working_copy(os.path.join(SWIFT_SOURCE_ROOT, "clang")) + if args.all: + update_working_copy(os.path.join(SWIFT_SOURCE_ROOT, "llbuild")) + update_working_copy(os.path.join(SWIFT_SOURCE_ROOT, "llvm")) + update_working_copy(os.path.join(SWIFT_SOURCE_ROOT, "clang")) if args.clone: obtain_additional_swift_sources() if args.clone_with_ssh: From 1b5ec13d7497d144d92a84e539924c49b90f57d7 Mon Sep 17 00:00:00 2001 From: Brandon Mathis Date: Tue, 8 Dec 2015 15:25:47 -0500 Subject: [PATCH 10/10] Remove extraneous newline --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 0418d16634a4c..da1f788a13276 100644 --- a/README.md +++ b/README.md @@ -77,7 +77,6 @@ compiler for C++14 support and create a symlink: #### Related Project Sources - **Via HTTPS** cd ./utils/update-checkout --clone