Remove example binaries from products (#1303)

Motivation:

Avoid examples being build when using as library.
Address https://github.com/apple/swift-nio/issues/1217

Modifications:

Remove example binaries from products.
Update example section in README, show how to run them.

Result:

Examples are not being built when running `swift build`
This commit is contained in:
John Lin
2019-12-12 21:39:54 +08:00
committed by Cory Benfield
parent 5a567709b2
commit 9ec23f5f8a
2 changed files with 12 additions and 13 deletions
+12
View File
@@ -168,6 +168,18 @@ There are currently several example projects that demonstrate how to use SwiftNI
- **WebSocket client** https://github.com/apple/swift-nio/tree/master/Sources/NIOWebSocketClient
- **WebSocket server** https://github.com/apple/swift-nio/tree/master/Sources/NIOWebSocketServer
To build & run them, run following command, replace TARGET_NAME with the folder name under `./Sources`
```bash
swift run TARGET_NAME
```
For example, to run NIOHTTP1Server, run following command:
```bash
swift run NIOHTTP1Server
```
## Getting Started
SwiftNIO primarily uses [SwiftPM](https://swift.org/package-manager/) as its build tool, so we recommend using that as well. If you want to depend on SwiftNIO in your own project, it's as simple as adding a `dependencies` clause to your `Package.swift`: