-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPackage.swift
67 lines (55 loc) · 1.62 KB
/
Package.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
// swift-tools-version:5.10
import Foundation
import PackageDescription
// MARK: - Package Declaration
let package = Package(
name: "WrkstrmLog",
platforms: [
.iOS(.v16),
.macOS(.v13),
.macCatalyst(.v13),
.tvOS(.v16),
.visionOS(.v1),
.watchOS(.v9),
],
products: [
.library(name: "WrkstrmLog", targets: ["WrkstrmLog"])
],
dependencies: [
.package(url: "https://github.com/apple/swift-docc-plugin", from: "1.1.0"),
.package(url: "https://github.com/apple/swift-log.git", from: "1.5.0"),
],
targets: [
.target(
name: "WrkstrmLog",
dependencies: [.product(name: "Logging", package: "swift-log")],
swiftSettings: Package.Inject.shared.swiftSettings
),
.testTarget(name: "WrkstrmLogTests", dependencies: ["WrkstrmLog"]),
]
)
// MARK: - Package Service
extension Package {
public struct Inject {
public static let version = "0.0.1"
public var swiftSettings: [SwiftSetting] = []
var dependencies: [PackageDescription.Package.Dependency] = []
public static let shared: Inject = ProcessInfo.useLocalDeps ? .local : .remote
static var local: Inject = .init(swiftSettings: [.localSwiftSettings])
static var remote: Inject = .init()
}
}
// MARK: - PackageDescription extensions
extension SwiftSetting {
public static let localSwiftSettings: SwiftSetting = .unsafeFlags([
"-Xfrontend",
"-warn-long-expression-type-checking=10",
])
}
// MARK: - Foundation extensions
extension ProcessInfo {
public static var useLocalDeps: Bool {
ProcessInfo.processInfo.environment["SPM_USE_LOCAL_DEPS"] == "true"
}
}
// PACKAGE_SERVICE_END_V0_0_1