-
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 9 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 |
---|---|---|
|
@@ -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,20 @@ 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 = { | ||
'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 +78,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("--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( | ||
|
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.
pdb
needed? :-)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.
nope, nice catch :)