Skip to content

Commit fe35809

Browse files
committed
Merge remote-tracking branch 'origin/master' into SR-1741
2 parents 7b95046 + 7f27fcf commit fe35809

File tree

158 files changed

+3779
-1254
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

158 files changed

+3779
-1254
lines changed

.mailmap

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
Adrian-Constantin Popescu <[email protected]> <[email protected]>
2+
3+
4+
Alexis Beingessner <[email protected]> <[email protected]>
5+
6+
7+
8+
Argyrios Kyrtzidis <[email protected]> <[email protected]>
9+
10+
Ben Cohen <[email protected]>
11+
12+
13+
14+
Brent Royal-Gordon <[email protected]> <[email protected]>
15+
16+
17+
18+
19+
Chris Bieneman <[email protected]>
20+
21+
22+
23+
24+
25+
codester <[email protected]> codestergit <[email protected]>
26+
27+
28+
Dante Broggi <[email protected]>
29+
30+
31+
32+
33+
34+
35+
36+
37+
38+
39+
40+
41+
42+
43+
44+
45+
46+
47+
48+
49+
50+
51+
52+
53+
54+
55+
56+
57+
58+
59+
60+
61+
Ingmar Stein <[email protected]>
62+
63+
Jacob Bandes-Storch <[email protected]> <[email protected]>
64+
65+
Janosch Hildebrand <[email protected]> <[email protected]>
66+
Janosch Hildebrand <[email protected]> <[email protected]>
67+
68+
69+
70+
71+
joe DeCapo <[email protected]>
72+
73+
74+
75+
76+
77+
78+
79+
80+
81+
82+
Luiz Fernando Silva <[email protected]>
83+
84+
85+
86+
87+
88+
89+
90+
91+
92+
93+
94+
95+
96+
97+
Mishal Awadah <[email protected]>
98+
99+
100+
101+
102+
103+
104+
105+
Nicole Jacque <[email protected]>
106+
107+
108+
109+
Paweł Szot <[email protected]>
110+
111+
Pete Cooper <[email protected]>
112+
113+
114+
115+
116+
117+
118+
119+
120+
121+
122+
123+
Stephen Canon <[email protected]>
124+
125+
Sukolsak Sakshuwong <[email protected]>
126+
127+
128+
129+
130+
131+
132+
133+
134+

CODE_OWNERS.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ beautification by scripts. The fields are: name (N), email (E), web-address
88
(W), PGP key ID and fingerprint (P), description (D), and snail-mail address
99
(S).
1010

11+
N: Ankit Aggarwal
12+
13+
D: Package Manager
14+
1115
N: Anders Bertelrud
1216
1317
D: Package Manager

Documentation/Development.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ using a [snapshot](https://swift.org/download/#releases) from swift.org.
2929
## Using trunk snapshot
3030

3131

32-
1. [Download](https://swift.org/download/#releases) and install latest Trunk Development snapshot.
32+
1. [Download](https://swift.org/download/#snapshots) and install latest Trunk Development snapshot.
3333
2. Run the following command depending on your platform.
3434

3535

@@ -128,12 +128,12 @@ For contributors on macOS who need to test on Linux, install Docker and use the
128128
following commands:
129129

130130
```sh
131-
$ Utilities/docker-utils build # will build an image with the latest swift snapshot
132-
$ Utilities/docker-utils bootstrap # will bootstrap SwiftPM on the linux container
133-
$ Utilities/docker-utils run bash # to run an interactive bash shell in the container
134-
$ Utilities/docker-utils swift-build # to run swift-build in the container
135-
$ Utilities/docker-utils swift-test # to run swift-test in the container
136-
$ Utilities/docker-utils swift-run # to run swift-run in the container
131+
$ Utilities/Docker/docker-utils build # will build an image with the latest swift snapshot
132+
$ Utilities/Docker/docker-utils bootstrap # will bootstrap SwiftPM on the linux container
133+
$ Utilities/Docker/docker-utils run bash # to run an interactive bash shell in the container
134+
$ Utilities/Docker/docker-utils swift-build # to run swift-build in the container
135+
$ Utilities/Docker/docker-utils swift-test # to run swift-test in the container
136+
$ Utilities/Docker/docker-utils swift-run # to run swift-run in the container
137137
```
138138

139139
## Using custom Swift compilers

Documentation/PackageDescriptionV4.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ All targets should be declared in the `Package.swift` manifest file. Unless the
1919
relative path of the target is declared, the Package Manager will look for
2020
a directory matching the name of the target in these places:
2121

22-
Regular targets: package root, Sources, Source, src, srcs.
23-
Test targets: Tests, package root, Sources, Source, src, srcs.
22+
Regular targets: Sources, Source, src, srcs.
23+
Test targets: Tests, Sources, Source, src, srcs.
2424

2525
## Package Manifest File Format Reference
2626

@@ -242,7 +242,7 @@ The above manifest declares two target, `Foo` and `Bar`. `Bar` is a test target
242242
which depends on `Foo`. The Package Manager will automatically search for the
243243
targets inside package in the [predefined search paths](#target-format-reference).
244244

245-
A target dependency can either be another target in the same package or a target
245+
A target dependency can either be another target in the same package or a product
246246
in one of its package dependencies. All target dependencies, internal or
247247
external, must be explicitly declared.
248248

Documentation/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ Dependencies are specified in your `Package.swift` manifest file.
8181

8282
“Dependency Hell” is the colloquialism for a situation where the graph of dependencies required by a project cannot be met. The end-user is then required to solve the scenario; usually a difficult task:
8383

84-
1. The conflict may be in unfamiliar dependencies (of dependencies) that the user did not explicitly request
84+
1. The conflict may be in unfamiliar dependencies (of dependencies) that the user did not explicitly request.
8585
2. Due to the nature of development it would be rare for two dependency graphs to be the same. Thus the amount of help other users (often even the package authors) can offer is limited. Internet searches will likely prove fruitless.
8686

8787
A good package manager should be designed from the start to minimize the risk of dependency hell and where this is not possible, to mitigate it and provide tooling so that the end-user can solve the scenario with a minimum of trouble. The [Package Manager Community Proposal](PackageManagerCommunityProposal.md) contains our thoughts on how we intend to iterate with these hells in mind.

Documentation/Resources.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
## Support
1717

18-
User-to-user support for Swift Package Manager is available on [swift-users mailing list](mailto:swift-users@swift.org).
18+
User-to-user support for Swift Package Manager is available on [swift-forums](https://forums.swift.org/c/development/SwiftPM).
1919

2020
---
2121

Documentation/Usage.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -719,18 +719,27 @@ SwiftPM ships with completion scripts for both Bash and ZSH. These files should
719719
Use the following commands to install the Bash completions to `~/.swift-package-complete.bash` and automatically load them using your `~/.bash_profile` file.
720720

721721
```bash
722-
swift package generate-completion-script bash > ~/.swift-package-complete.bash
722+
swift package completion-tool generate-bash-script > ~/.swift-package-complete.bash
723723
echo -e "source ~/.swift-package-complete.bash\n" >> ~/.bash_profile
724724
source ~/.swift-package-complete.bash
725725
```
726726

727+
Alternatively, add the following commands to your `~/.bash_profile` file to directly load completions:
728+
729+
```bash
730+
# Source Swift completion
731+
if [ -n "`which swift`" ]; then
732+
eval "`swift package completion-tool generate-bash-script`"
733+
fi
734+
```
735+
727736
### ZSH
728737

729738
Use the following commands to install the ZSH completions to `~/.zsh/_swift`. You can chose a different folder, but the filename should be `_swift`. This will also add `~/.zsh` to your `$fpath` using your `~/.zshrc` file.
730739

731740
```bash
732741
mkdir ~/.zsh
733-
swift package generate-completion-script zsh > ~/.zsh/_swift
742+
swift package completion-tool generate-zsh-script > ~/.zsh/_swift
734743
echo -e "fpath=(~/.zsh \$fpath)\n" >> ~/.zshrc
735744
compinit
736745
```

Fixtures/DependencyResolution/External/Complex/PlayingCard/src/PlayingCard.swift

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
public struct PlayingCard {
1+
public struct PlayingCard: Equatable {
22
let rank: Rank
33
let suit: Suit
44

@@ -8,14 +8,6 @@ public struct PlayingCard {
88
}
99
}
1010

11-
// MARK: - Equatable
12-
13-
extension PlayingCard: Equatable {}
14-
15-
public func ==(lhs: PlayingCard, rhs: PlayingCard) -> Bool {
16-
return lhs.rank == rhs.rank && lhs.suit == rhs.suit
17-
}
18-
1911
// MARK: - Comparable
2012

2113
extension PlayingCard: Comparable {}

Fixtures/DependencyResolution/External/Complex/deck-of-playing-cards/src/Deck.swift

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import FisherYates
1212
import PlayingCard
1313

14-
public struct Deck {
14+
public struct Deck: Equatable {
1515
fileprivate var cards: [PlayingCard]
1616

1717
public static func standard52CardDeck() -> Deck {
@@ -50,11 +50,3 @@ extension Deck : ExpressibleByArrayLiteral {
5050
self.init(elements)
5151
}
5252
}
53-
54-
// MARK: - Equatable
55-
56-
extension Deck : Equatable {}
57-
58-
public func ==(lhs: Deck, rhs: Deck) -> Bool {
59-
return lhs.cards == rhs.cards
60-
}

Fixtures/DependencyResolution/External/IgnoreIndirectTests/PlayingCard/src/PlayingCard.swift

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
public struct PlayingCard {
1+
public struct PlayingCard: Equatable {
22
let rank: Rank
33
let suit: Suit
44

@@ -8,14 +8,6 @@ public struct PlayingCard {
88
}
99
}
1010

11-
// MARK: - Equatable
12-
13-
extension PlayingCard: Equatable {}
14-
15-
public func ==(lhs: PlayingCard, rhs: PlayingCard) -> Bool {
16-
return lhs.rank == rhs.rank && lhs.suit == rhs.suit
17-
}
18-
1911
// MARK: - Comparable
2012

2113
extension PlayingCard: Comparable {}

Fixtures/DependencyResolution/External/IgnoreIndirectTests/deck-of-playing-cards/src/Deck.swift

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import FisherYates
1212
import PlayingCard
1313

14-
public struct Deck {
14+
public struct Deck: Equatable {
1515
fileprivate var cards: [PlayingCard]
1616

1717
public static func standard52CardDeck() -> Deck {
@@ -50,11 +50,3 @@ extension Deck : ExpressibleByArrayLiteral {
5050
self.init(elements)
5151
}
5252
}
53-
54-
// MARK: - Equatable
55-
56-
extension Deck : Equatable {}
57-
58-
public func ==(lhs: Deck, rhs: Deck) -> Bool {
59-
return lhs.cards == rhs.cards
60-
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.DS_Store
2+
/.build
3+
/Packages
4+
/*.xcodeproj
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// swift-tools-version:4.0
2+
3+
import PackageDescription
4+
5+
let package = Package(
6+
name: "race",
7+
targets: [
8+
.target(
9+
name: "lib",
10+
dependencies: []),
11+
.target(
12+
name: "exec",
13+
dependencies: ["lib"]),
14+
.testTarget(
15+
name: "libTests",
16+
dependencies: ["lib"]),
17+
]
18+
)
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# race
2+
3+
A description of this package.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import lib
2+
3+
executeRace()
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import Dispatch
2+
3+
public func executeRace() {
4+
var global = 5
5+
6+
let sema = DispatchSemaphore(value: 0)
7+
DispatchQueue.global().async {
8+
global = 6
9+
sema.signal()
10+
}
11+
12+
global = 7
13+
sema.wait()
14+
15+
print(global)
16+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import XCTest
2+
3+
import libTests
4+
5+
var tests = [XCTestCaseEntry]()
6+
tests += libTests.__allTests()
7+
8+
XCTMain(tests)
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import XCTest
2+
3+
extension libTests {
4+
static let __allTests = [
5+
("testRace", testRace),
6+
]
7+
}
8+
9+
#if !os(macOS)
10+
public func __allTests() -> [XCTestCaseEntry] {
11+
return [
12+
testCase(libTests.__allTests),
13+
]
14+
}
15+
#endif

0 commit comments

Comments
 (0)