mirror of
https://github.com/apple/swift-nio.git
synced 2026-05-20 20:30:36 +00:00
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:
@@ -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`:
|
||||
|
||||
Reference in New Issue
Block a user