Skip to content

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

Merged
merged 13 commits into from
Dec 11, 2015
Merged
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions utils/update-checkout
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ from __future__ import print_function
import argparse
import os
import sys
import pdb
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pdb needed? :-)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nope, nice catch :)


sys.path.append(os.path.dirname(__file__))

Expand Down Expand Up @@ -52,6 +53,20 @@ def update_working_copy(repo_path):
else:
check_call([ "svn", "update" ])

def obtain_additional_swift_sources():

Choose a reason for hiding this comment

The 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',
Copy link
Contributor

Choose a reason for hiding this comment

The 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 (swift obviously, swift-llvm and swift-clang) ?

Choose a reason for hiding this comment

The 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(
Expand All @@ -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(
Expand Down