Skip to content

Commit

Permalink
Remove example binaries from products (#1303)
Browse files Browse the repository at this point in the history
Motivation:

Avoid examples being build when using as library.
Address #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`
  • Loading branch information
johnlinvc authored and Lukasa committed Dec 12, 2019
1 parent 5a56770 commit 9ec23f5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
13 changes: 0 additions & 13 deletions Package.swift
Expand Up @@ -82,19 +82,6 @@ var targets: [PackageDescription.Target] = [
let package = Package(
name: "swift-nio",
products: [
.executable(name: "NIOEchoServer", targets: ["NIOEchoServer"]),
.executable(name: "NIOEchoClient", targets: ["NIOEchoClient"]),
.executable(name: "NIOChatServer", targets: ["NIOChatServer"]),
.executable(name: "NIOChatClient", targets: ["NIOChatClient"]),
.executable(name: "NIOHTTP1Server", targets: ["NIOHTTP1Server"]),
.executable(name: "NIOHTTP1Client", targets: ["NIOHTTP1Client"]),
.executable(name: "NIOWebSocketServer", targets: ["NIOWebSocketServer"]),
.executable(name: "NIOWebSocketClient", targets: ["NIOWebSocketClient"]),
.executable(name: "NIOPerformanceTester",
targets: ["NIOPerformanceTester"]),
.executable(name: "NIOMulticastChat", targets: ["NIOMulticastChat"]),
.executable(name: "NIOUDPEchoServer", targets: ["NIOUDPEchoServer"]),
.executable(name: "NIOUDPEchoClient", targets: ["NIOUDPEchoClient"]),
.library(name: "NIO", targets: ["NIO"]),
.library(name: "_NIO1APIShims", targets: ["_NIO1APIShims"]),
.library(name: "NIOTLS", targets: ["NIOTLS"]),
Expand Down
12 changes: 12 additions & 0 deletions README.md
Expand Up @@ -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`:
Expand Down

0 comments on commit 9ec23f5

Please sign in to comment.