Skip to content
Permalink
Browse files

Remove example binaries from products (#1303)

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 9ec23f5f8a7f75f19511b47217f0823c8f3eaf8f
Showing with 12 additions and 13 deletions.
  1. +0 −13 Package.swift
  2. +12 −0 README.md
@@ -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"]),
@@ -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`:

0 comments on commit 9ec23f5

Please sign in to comment.
You can’t perform that action at this time.