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
Show file tree
Hide file tree
Changes from 6 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
11 changes: 1 addition & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Contributor

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.

Copy link

Choose a reason for hiding this comment

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

👍


[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
Expand Down
21 changes: 21 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,21 @@ 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 = {
'swift': 'https://github.com/apple/swift.git',
Copy link
Contributor

Choose a reason for hiding this comment

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

No need to clone swift, we are inside of it.

Copy link

Choose a reason for hiding this comment

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

Choose a reason for hiding this comment

The 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.

Copy link

Choose a reason for hiding this comment

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