Skip to content

Commit ecbe23f

Browse files
committed
Chore each framework name
1 parent ed58f7a commit ecbe23f

File tree

2 files changed

+19
-11
lines changed

2 files changed

+19
-11
lines changed

Package.swift

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,37 +45,45 @@ enum GitHubRestAPIOpenAPITag: String, CaseIterable {
4545
case classroom
4646
case desktop
4747

48+
var targetName: String {
49+
let name = rawValue.replacingOccurrences(of: "-", with: "_").capitalized
50+
return "GitHubRestAPI\(name)"
51+
}
52+
4853
var target: PackageDescription.Target {
49-
.target(
50-
name: rawValue,
54+
let targetName = targetName
55+
return .target(
56+
name: targetName,
5157
dependencies: [
5258
.product(name: "OpenAPIRuntime", package: "swift-openapi-runtime"),
5359
.product(name: "OpenAPIURLSession", package: "swift-openapi-urlsession"),
5460
],
61+
path: "Sources/\(rawValue)",
5562
plugins: [
5663
.plugin(name: "OpenAPIGenerator", package: "swift-openapi-generator"),
5764
]
5865
)
5966
}
6067

6168
var library: PackageDescription.Product {
62-
.library(
63-
name: "GitHubRestAPI-\(rawValue)",
64-
targets: [rawValue]
69+
let targetName = targetName
70+
return .library(
71+
name: targetName,
72+
targets: [targetName]
6573
)
6674
}
6775

6876
var testTarget: PackageDescription.Target {
69-
.testTarget(
77+
let targetName = targetName
78+
return .testTarget(
7079
name: "UserTests",
71-
dependencies: [
72-
.target(name: rawValue)
73-
]
80+
dependencies: [.target(name: targetName)]
7481
)
7582
}
83+
7684
static var allInOne: PackageDescription.Product = .library(
7785
name: "GitHubRestAPISwiftOpenAPI",
78-
targets: GitHubRestAPIOpenAPITag.allCases.map(\.rawValue)
86+
targets: GitHubRestAPIOpenAPITag.allCases.map(\.targetName)
7987
)
8088
}
8189

Tests/UsersTests/UsersTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import XCTest
2-
@testable import users
2+
import GitHubRestAPIusers
33
import OpenAPIRuntime
44
import OpenAPIURLSession
55

0 commit comments

Comments
 (0)