Skip to content
This repository was archived by the owner on Dec 2, 2022. It is now read-only.

Commit d315114

Browse files
committed
Modernize Package.swift
1 parent c071f10 commit d315114

File tree

4 files changed

+42
-84
lines changed

4 files changed

+42
-84
lines changed

Package.swift

Lines changed: 42 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,12 @@
1-
// swift-tools-version:5.0
1+
// swift-tools-version:5.3
22

33
import PackageDescription
44

5-
// MARK: Targets
6-
7-
let SlackKit: Target = .target(name: "SlackKit",
8-
dependencies: ["SKCore", "SKClient", "SKRTMAPI", "SKServer"],
9-
path: "SlackKit/Sources")
10-
11-
let SKClient: Target = .target(name: "SKClient",
12-
dependencies: ["SKCore"],
13-
path: "SKClient/Sources")
14-
15-
let SKCore: Target = .target(name: "SKCore",
16-
path: "SKCore/Sources")
17-
18-
let SKRTMAPI: Target = .target(name: "SKRTMAPI",
19-
path: "SKRTMAPI/Sources")
20-
21-
#if os(macOS)
22-
SKRTMAPI.dependencies = [
23-
"SKCore",
24-
"SKWebAPI",
25-
"Starscream",
26-
"WebSocket"
27-
]
28-
#elseif os(Linux)
29-
SKRTMAPI.dependencies = [
30-
"SKCore",
31-
"SKWebAPI",
32-
"WebSocket"
33-
]
34-
#elseif os(iOS) || os(tvOS)
35-
SKRTMAPI.dependencies = [
36-
"SKCore",
37-
"SKWebAPI",
38-
"Starscream",
39-
]
40-
#endif
41-
42-
let SKServer: Target = .target(name: "SKServer",
43-
dependencies: ["SKCore", "SKWebAPI", "Swifter"],
44-
path: "SKServer/Sources")
45-
46-
let SKWebAPI: Target = .target(name: "SKWebAPI",
47-
dependencies: ["SKCore"],
48-
path: "SKWebAPI/Sources")
49-
50-
let SlackKitTests: Target = .testTarget(name: "SlackKitTests",
51-
dependencies: ["SlackKit", "SKCore", "SKClient", "SKRTMAPI", "SKServer"],
52-
path: "SlackKitTests")
53-
// MARK: Package
54-
555
let package = Package(
566
name: "SlackKit",
7+
platforms: [
8+
.macOS(.v10_11), .iOS(.v10), .tvOS(.v10)
9+
],
5710
products: [
5811
.library(name: "SlackKit", targets: ["SlackKit"]),
5912
.library(name: "SKClient", targets: ["SKClient"]),
@@ -62,26 +15,43 @@ let package = Package(
6215
.library(name: "SKServer", targets: ["SKServer"]),
6316
.library(name: "SKWebAPI", targets: ["SKWebAPI"])
6417
],
18+
dependencies: [
19+
.package(name: "Swifter", url: "https://github.com/httpswift/swifter.git", .upToNextMinor(from: "1.5.0")),
20+
.package(name: "WebSocket", url: "https://github.com/vapor/websocket", .upToNextMinor(from: "1.1.2")),
21+
.package(name: "Starscream", url: "https://github.com/daltoniam/Starscream", .upToNextMinor(from: "4.0.4"))
22+
],
6523
targets: [
66-
SlackKit, SKClient, SKCore, SKRTMAPI, SKServer, SKWebAPI, SlackKitTests
67-
]
24+
.target(name: "SlackKit",
25+
dependencies: ["SKCore", "SKClient", "SKRTMAPI", "SKServer"],
26+
path: "SlackKit/Sources"),
27+
.target(name: "SKClient",
28+
dependencies: ["SKCore"],
29+
path: "SKClient/Sources"),
30+
.target(name: "SKCore",
31+
path: "SKCore/Sources"),
32+
.target(name: "SKRTMAPI",
33+
dependencies: [
34+
"SKCore",
35+
"SKWebAPI",
36+
.product(name: "Starscream", package: "Starscream", condition: .when(platforms: [.macOS, .iOS, .tvOS])),
37+
.product(name: "WebSocket", package: "WebSocket", condition: .when(platforms: [.macOS, .linux])),
38+
],
39+
path: "SKRTMAPI/Sources"),
40+
.target(name: "SKServer",
41+
dependencies: ["SKCore", "SKWebAPI", "Swifter"],
42+
path: "SKServer/Sources"),
43+
.target(name: "SKWebAPI",
44+
dependencies: ["SKCore"],
45+
path: "SKWebAPI/Sources"),
46+
.testTarget(name: "SlackKitTests",
47+
dependencies: ["SlackKit", "SKCore", "SKClient", "SKRTMAPI", "SKServer"],
48+
path: "SlackKitTests",
49+
exclude: [
50+
"Supporting Files"
51+
],
52+
resources: [
53+
.copy("Resources")
54+
])
55+
],
56+
swiftLanguageVersions: [.v5]
6857
)
69-
70-
#if os(macOS)
71-
package.dependencies = [
72-
.package(url: "https://github.com/httpswift/swifter.git", .upToNextMinor(from: "1.5.0")),
73-
.package(url: "https://github.com/vapor/websocket", .upToNextMinor(from: "1.1.2")),
74-
.package(url: "https://github.com/daltoniam/Starscream", .upToNextMinor(from: "4.0.4"))
75-
]
76-
#elseif os(Linux)
77-
package.dependencies = [
78-
.package(url: "https://github.com/httpswift/swifter.git", .upToNextMinor(from: "1.5.0")),
79-
.package(url: "https://github.com/vapor/websocket", .upToNextMinor(from: "1.1.2"))
80-
]
81-
#elseif os(iOS) || os(tvOS)
82-
package.dependencies = [
83-
.package(url: "https://github.com/httpswift/swifter.git", .upToNextMinor(from: "1.5.0")),
84-
.package(url: "https://github.com/daltoniam/Starscream", .upToNextMinor(from: "4.0.4"))
85-
]
86-
#endif
87-

SKServer/Sources/Titan/Titan404/README.md

Lines changed: 0 additions & 2 deletions
This file was deleted.

SKServer/Sources/Titan/TitanCore/README.md

Lines changed: 0 additions & 8 deletions
This file was deleted.

SKServer/Sources/Titan/TitanRouter/README.md

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)