-
Notifications
You must be signed in to change notification settings - Fork 0
/
Package.swift
81 lines (72 loc) · 3.2 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
// swift-tools-version:5.2
import PackageDescription
import Foundation
var dependencies: [Package.Dependency] = [
// 💧 A server-side Swift web framework.
.package(name: "vapor", url: "https://github.com/vapor/vapor.git", .exact("4.58.0")),
.package(name: "HTMLKitVaporProvider", url: "https://github.com/MatsMoll/htmlkit-vapor-provider.git", .exact("1.0.1")),
.package(url: "https://github.com/vapor-community/HTMLKit.git", .exact("2.1.1")),
.package(name: "RediStack", url: "https://github.com/Mordil/RediStack", from: "1.3.0"),
.package(url: "https://github.com/apple/swift-nio-ssl.git", from: "2.15.0"),
]
// Kognita Core
switch ProcessInfo.processInfo.environment["BUILD_TYPE"] {
case "LOCAL":
dependencies.append(contentsOf: [
.package(path: "../KognitaAPI"),
.package(path: "../KognitaCore"),
.package(path: "../KognitaViews")
]
)
case "DEV":
dependencies.append(contentsOf: [
.package(name: "KognitaCore", url: "https://github.com/MatsMoll/KognitaCore", .branch("develop")),
.package(name: "KognitaViews", url: "https://github.com/MatsMoll/KognitaPages", .branch("develop")),
.package(name: "KognitaAPI", url: "https://github.com/MatsMoll/kognita-rest-api", .branch("develop"))
]
)
default:
#if os(macOS)
if ProcessInfo.processInfo.environment["CUSTOM_SETTINGS"] == nil {
dependencies.append(contentsOf: [
.package(path: "../KognitaAPI"),
.package(path: "../KognitaCore"),
.package(path: "../KognitaViews"),
.package(path: "../KognitaModels")
]
)
break
}
#endif
let coreVersion = ProcessInfo.processInfo.environment["KOGNITA_CORE"] ?? "2.0.0"
let pagesVersion = ProcessInfo.processInfo.environment["KOGNITA_PAGES"] ?? "2.0.0"
let apiVersion = ProcessInfo.processInfo.environment["KOGNITA_API"] ?? "2.0.0"
dependencies.append(contentsOf: [
.package(name: "KognitaCore", url: "https://github.com/MatsMoll/KognitaCore", from: Version(stringLiteral: coreVersion)),
.package(name: "KognitaViews", url: "https://github.com/MatsMoll/KognitaPages", from: Version(stringLiteral: pagesVersion)),
.package(name: "KognitaAPI", url: "https://github.com/MatsMoll/kognita-rest-api", from: Version(stringLiteral: apiVersion))
]
)
}
let package = Package(
name: "Kognita",
platforms: [
.macOS(.v10_15)
],
dependencies: dependencies,
targets: [
.target(name: "App", dependencies: [
.product(name: "Vapor", package: "vapor"),
.product(name: "KognitaCore", package: "KognitaCore"),
.product(name: "KognitaViews", package: "KognitaViews"),
.product(name: "KognitaAPI", package: "KognitaAPI"),
.product(name: "HTMLKitVaporProvider", package: "HTMLKitVaporProvider")
]),
.target(name: "Run", dependencies: ["App"]),
.testTarget(name: "AppTests", dependencies: [
.target(name: "App"),
.product(name: "KognitaCoreTestable", package: "KognitaCore"),
.product(name: "XCTVapor", package: "vapor")
])
]
)