-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Simplify obtaining of swift sources #31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 6 commits
176d903
77ec422
665b08b
74a1d05
e84acea
2a1364d
2942c32
26508ca
9311f72
b0c4fbd
f9bc59b
1b5ec13
dd68e72
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,16 +66,7 @@ compiler for C++14 support and create a symlink: | |
|
||
### Getting Sources for Swift and Related Projects | ||
|
||
git clone [email protected]:apple/swift.git swift | ||
git clone [email protected]:apple/swift-llvm.git llvm | ||
git clone [email protected]:apple/swift-clang.git clang | ||
git clone [email protected]:apple/swift-lldb.git lldb | ||
git clone [email protected]:apple/swift-cmark.git cmark | ||
git clone [email protected]:apple/swift-llbuild.git llbuild | ||
git clone [email protected]:apple/swift-package-manager.git swiftpm | ||
git clone [email protected]:apple/swift-corelibs-xctest.git | ||
git clone [email protected]:apple/swift-corelibs-foundation.git | ||
|
||
./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 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ from __future__ import print_function | |
import argparse | ||
import os | ||
import sys | ||
import pdb | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nope, nice catch :) |
||
|
||
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(): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is outside the scope of what this script is meant for. This script updates current sources.. At this point you are getting into package management.. There are separate utils for this within swift. |
||
additional_repos = { | ||
'swift': 'https://github.com/apple/swift.git', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No need to clone swift, we are inside of it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
'llvm': 'https://github.com/apple/swift-llvm.git', | ||
'clang': 'https://github.com/apple/swift-clang.git', | ||
'lldb': 'https://github.com/apple/swift-lldb.git', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should all repos be cloned or only the minimal subset needed for building Swift ( There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Aren't all of them needed to run the build script? |
||
'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", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is such a rare command, I'd suggest dropping the short option. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
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( | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One still needs to clone the swift repo, and then
cd
into it.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍