2
2
3
3
** Welcome to Swift!**
4
4
5
- Swift is a high performance systems programming language. It has a clean
5
+ Swift is a high- performance system programming language. It has a clean
6
6
and modern syntax, and offers seamless access to existing C and Objective-C code
7
7
and frameworks, and is memory safe (by default).
8
8
@@ -18,20 +18,20 @@ modules, eliminating the need for headers and the code duplication they entail.
18
18
To read the documentation, start by installing the Sphinx documentation
19
19
generator tool (http://sphinx-doc.org , just run ` easy_install -U Sphinx ` from
20
20
the command line and you're good to go). Once you have that, you can build the
21
- swift documentation by going into ` swift/ docs` and typing ` make ` . This compiles
22
- the ' rst' files in the docs directory into HTML in the ` swift/ docs/_build/html`
21
+ Swift documentation by going into ` docs ` and typing ` make ` . This compiles
22
+ the ` . rst` files in the ` docs ` directory into HTML in the ` docs/_build/html `
23
23
directory.
24
24
25
- Once built, the best place to start is with the swift whitepaper , which gives a
26
- tour of the language (in ` swift/ docs/_build/html/whitepaper/index.html` ).
25
+ Once built, the best place to start is with the Swift white paper , which gives a
26
+ tour of the language (in ` docs/_build/html/whitepaper/index.html ` ).
27
27
Another potentially useful document is ` docs/LangRef ` , which gives a low level
28
28
tour of how the language works from the implementation perspective.
29
29
30
30
Many of the docs are out of date, but you can see some historical design
31
31
documents in the ` docs ` directory.
32
32
33
- Another source of documentation is the standard library itself, located at
34
- ` swift/ stdlib` . Much of the language is actually implemented in the library
33
+ Another source of documentation is the standard library itself, located in
34
+ ` stdlib ` . Much of the language is actually implemented in the library
35
35
(including ` Int ` ), and the standard library gives some examples of what can be
36
36
expressed today.
37
37
@@ -66,9 +66,31 @@ compiler for C++14 support and create a symlink:
66
66
67
67
### Getting Sources for Swift and Related Projects
68
68
69
+ For those checking out sources as read-only:
70
+
69
71
git clone https://github.com/apple/swift.git swift
70
- cd swift
71
- ./utils/update-checkout --clone
72
+ git clone https://github.com/apple/swift-llvm.git llvm
73
+ git clone https://github.com/apple/swift-clang.git clang
74
+ git clone https://github.com/apple/swift-lldb.git lldb
75
+ git clone https://github.com/apple/swift-cmark.git cmark
76
+ git clone https://github.com/apple/swift-llbuild.git llbuild
77
+ git clone https://github.com/apple/swift-package-manager.git swiftpm
78
+ git clone https://github.com/apple/swift-corelibs-xctest.git
79
+ git clone https://github.com/apple/swift-corelibs-foundation.git
80
+
81
+ For those who plan on regular making direct commits, cloning over
82
+ SSH may provide a better experience (which requires uploading
83
+ SSH keys to GitHub):
84
+
85
+ git clone [email protected] :apple/swift.git swift
86
+ git clone [email protected] :apple/swift-llvm.git llvm
87
+ git clone [email protected] :apple/swift-clang.git clang
88
+ git clone [email protected] :apple/swift-lldb.git lldb
89
+ git clone [email protected] :apple/swift-cmark.git cmark
90
+ git clone [email protected] :apple/swift-llbuild.git llbuild
91
+ git clone [email protected] :apple/swift-package-manager.git swiftpm
92
+ git clone [email protected] :apple/swift-corelibs-xctest.git
93
+ git clone [email protected] :apple/swift-corelibs-foundation.git
72
94
73
95
[ CMake] ( http://cmake.org ) is the core infrastructure used to configure builds of
74
96
Swift and its companion projects; at least version 2.8.12.2 is required. Your
@@ -79,18 +101,22 @@ command line tools to your `PATH`:
79
101
80
102
export PATH=/Applications/CMake.app/Contents/bin:$PATH
81
103
82
- [ Ninja] ( http ://martine.github.io/ ninja/ ) is the current recommended build system
104
+ [ Ninja] ( https ://ninja-build.org ) is the current recommended build system
83
105
for building Swift and is the default configuration generated by CMake. If
84
106
you're on OS X or don't install it as part of your Linux distribution, clone
85
107
it next to the other projects and it will be bootstrapped automatically:
86
108
87
109
git clone [email protected] :martine/ninja.git
88
110
89
- You can also use a third-party packaging tool like [ Homebrew ] ( http://brew.sh ) to
90
- install CMake and Ninja on OS X:
111
+ You can also install CMake and Ninja on OS X using a third-party
112
+ packaging tool like [ Homebrew ] ( http://brew.sh ) …
91
113
92
114
brew install cmake ninja
93
115
116
+ …or [ MacPorts] ( https://macports.org ) .
117
+
118
+ sudo port install cmake ninja
119
+
94
120
### Building Swift
95
121
96
122
The ` build-script ` is a high-level build automation script that supports basic
@@ -100,30 +126,30 @@ supports presets which you can define for common combinations of build options.
100
126
101
127
To find out more:
102
128
103
- swift/ utils/build-script -h
129
+ utils/build-script -h
104
130
105
131
Note: Arguments after "--" above are forwarded to ` build-script-impl ` , which is
106
132
the ultimate shell script that invokes the actual build and test commands.
107
133
108
134
A basic command to build Swift and run basic tests with Ninja:
109
135
110
- swift/ utils/build-script -t
136
+ utils/build-script -t
111
137
112
- ## Develop Swift in Xcode
138
+ ## Developing Swift in Xcode
113
139
114
140
The Xcode IDE can be used to edit the Swift source code, but it is not currently
115
141
fully supported as a build environment for SDKs other than OS X. If you'd like
116
142
to build for other SDKs but still use Xcode, once you've built Swift using Ninja
117
143
or one of the other supported CMake generators, you can set up an IDE-only Xcode
118
144
environment using the build-script's ` -X ` flag:
119
145
120
- swift/ utils/build-script -X --skip-build -- --reconfigure
146
+ utils/build-script -X --skip-build -- --reconfigure
121
147
122
- The ` --skip-build ` flag tells build-script to only generate the project,
148
+ The ` --skip-build ` flag tells ` build-script ` to only generate the project,
123
149
not build it in its entirety. A bare minimum of LLVM tools will build in order
124
150
to configure the Xcode projects.
125
151
126
- The ` --reconfigure ` flag tells build-script-impl to run the CMake configuration
152
+ The ` --reconfigure ` flag tells ` build-script-impl ` to run the CMake configuration
127
153
step even if there is a cached configuration. As you develop in Xcode, you may
128
154
need to rerun this from time to time to refresh your generated Xcode project,
129
155
picking up new targets, file removals, or file additions.
@@ -135,3 +161,14 @@ See [docs/Testing.rst](docs/Testing.rst).
135
161
## Contributing to Swift
136
162
137
163
Contributions to Swift are welcomed and encouraged! Please see the [ Contributing to Swift guide] ( https://swift.org/contributing/ ) .
164
+
165
+ To be a truly great community, Swift.org needs to welcome developers from all
166
+ walks of life, with different backgrounds, and with a wide range of experience.
167
+ A diverse and friendly community will have more great ideas, more unique
168
+ perspectives, and produce more great code. We will work diligently to make the
169
+ Swift community welcoming to everyone.
170
+
171
+ To give clarity of what is expected of our members, Swift has adopted the
172
+ code of conduct defined by the Contributor Covenant. This document is used
173
+ across many open source communities, and we think it articulates our values
174
+ well. For more, see [ the website] ( https://swift.org/community/#code-of-conduct ) .
0 commit comments