-
-
Notifications
You must be signed in to change notification settings - Fork 222
Expand file tree
/
Copy pathPackage.swift
More file actions
91 lines (87 loc) · 3.34 KB
/
Package.swift
File metadata and controls
91 lines (87 loc) · 3.34 KB
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
82
83
84
85
86
87
88
89
90
91
// swift-tools-version:5.7
import PackageDescription
var dependencies: [Package.Dependency] = [
.package(url: "https://github.com/CreateAPI/URLQueryEncoder.git", from: "0.2.0"),
.package(url: "https://github.com/apple/swift-crypto.git", from: "3.12.3"),
.package(url: "https://github.com/apple/swift-argument-parser", from: "1.7.0"),
.package(url: "https://github.com/weichsel/ZIPFoundation", from: "0.9.20"),
.package(url: "https://github.com/apple/swift-collections.git", .upToNextMinor(from: "1.1.0"))
]
var targetDependencies: [Target.Dependency] = [
.product(name: "URLQueryEncoder", package: "URLQueryEncoder"),
.product(name: "Crypto", package: "swift-crypto")
]
#if os(Linux)
dependencies.append(.package(url: "https://github.com/OpenCombine/OpenCombine.git", from: "0.14.0"))
targetDependencies.append(.product(name: "OpenCombine", package: "OpenCombine"))
#endif
let package = Package(
name: "AppStoreConnect-Swift-SDK",
platforms: [
.iOS(.v14),
.macOS(.v11),
.tvOS(.v14),
.watchOS(.v9),
],
products: [
.library(name: "AppStoreConnect-Swift-SDK", targets: ["AppStoreConnect-Swift-SDK"])
],
dependencies: dependencies,
targets: [
.testTarget(
name: "AppStoreConnect-Swift-SDK-Tests",
dependencies: [
"AppStoreConnect-Swift-SDK",
.target(name: "OpenAPIGeneratorCore", condition: .when(platforms: [.macOS])),
],
path: "Tests"
),
.target(
name: "AppStoreConnect-Swift-SDK",
dependencies: targetDependencies,
path: "Sources",
exclude: [
"OpenAPI/app_store_connect_api.json",
"OpenAPI/app_store_connect_api.json.orig",
"OpenAPI/app_store_connect_api.json.rej",
"OpenAPI/create-api.yml",
]
),
.target(
name: "OpenAPIGeneratorCore",
dependencies: [
.product(name: "ZIPFoundation", package: "ZIPFoundation"),
.product(name: "OrderedCollections", package: "swift-collections"),
],
path: "Tools/OpenAPIGeneratorCore"
),
.executableTarget(
name: "OpenAPIGenerator",
dependencies: [
"OpenAPIGeneratorCore",
.product(name: "ArgumentParser", package: "swift-argument-parser"),
],
path: "Tools/OpenAPIGenerator"
),
.binaryTarget(
name: "create-api", // Find the URL and checksum at https://github.com/createapi/createapi/releases/latest
url: "https://github.com/CreateAPI/CreateAPI/releases/download/0.2.0/create-api.artifactbundle.zip",
checksum: "6f8a3ce099f07eb2655ccaf6f66d8c9a09b74bb2307781c4adec36609ddac009"
),
.plugin(
name: "CreateAPI",
capability: .command(
intent: .custom(
verb: "generate-open-api",
description: "Generates the OpenAPI entities and paths using CreateAPI"
),
permissions: [
.writeToPackageDirectory(reason: "To output the generated source code")
]
),
dependencies: [
.target(name: "create-api")
]
)
]
)