Skip to content

Commit 0945489

Browse files
committed
Rename ClangPackageWithCustomModulePath to ClangPackageWithRelativePublicHeadersPath
1 parent 23efcc2 commit 0945489

File tree

6 files changed

+19
-15
lines changed

6 files changed

+19
-15
lines changed

.swiftlint.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,7 @@ trailing_comma:
2323
mandatory_comma: true
2424
type_body_length:
2525
warning: 400
26+
identifier_name:
27+
max_length:
28+
warning: 45
29+

Tests/ScipioKitTests/Resources/Fixtures/ClangPackageWithCustomModulePath/Package.swift renamed to Tests/ScipioKitTests/Resources/Fixtures/ClangPackageWithRelativePublicHeadersPath/Package.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,24 @@
44
import PackageDescription
55

66
let package = Package(
7-
name: "ClangPackageWithCustomModulePath",
7+
name: "ClangPackageWithRelativePublicHeadersPath",
88
platforms: [
99
.iOS(.v18)
1010
],
1111
products: [
1212
// Products define the executables and libraries a package produces, making them visible to other packages.
1313
.library(
14-
name: "ClangPackageWithCustomModulePath",
15-
targets: ["ClangPackageWithCustomModulePath"]
14+
name: "ClangPackageWithRelativePublicHeadersPath",
15+
targets: ["ClangPackageWithRelativePublicHeadersPath"]
1616
)
1717
],
1818
targets: [
1919
// Targets are the basic building blocks of a package, defining a module or a test suite.
2020
// Targets can depend on other targets in this package and products from dependencies.
2121
.target(
22-
name: "ClangPackageWithCustomModulePath",
22+
name: "ClangPackageWithRelativePublicHeadersPath",
2323
path: ".",
24-
sources: ["ClangPackageWithCustomModulePath"],
24+
sources: ["ClangPackageWithRelativePublicHeadersPath"],
2525
publicHeadersPath: "."
2626
),
2727
]

Tests/ScipioKitTests/RunnerTests.swift

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ private let clangPackagePath = fixturePath.appendingPathComponent("ClangPackage"
1515
private let clangPackageWithSymbolicLinkHeadersPath = fixturePath.appendingPathComponent("ClangPackageWithSymbolicLinkHeaders")
1616
private let clangPackageWithCustomModuleMapPath = fixturePath.appendingPathComponent("ClangPackageWithCustomModuleMap")
1717
private let clangPackageWithUmbrellaDirectoryPath = fixturePath.appendingPathComponent("ClangPackageWithUmbrellaDirectory")
18-
private let clangPackageWithCustomModulePath = fixturePath.appendingPathComponent("ClangPackageWithCustomModulePath")
18+
private let clangPackageWithRelativePublicHeadersPath = fixturePath.appendingPathComponent("ClangPackageWithRelativePublicHeadersPath")
1919

2020
private struct InfoPlist: Decodable {
2121
var bundleVersion: String
@@ -269,31 +269,31 @@ final class RunnerTests: XCTestCase {
269269
}
270270
}
271271

272-
func testBuildClangPackageWithCustomModulePath() async throws {
272+
func testBuildClangPackageWithRelativePublicHeadersPath() async throws {
273273
defer {
274-
try? fileManager.removeItem(at: clangPackageWithCustomModulePath.appending(component: ".build"))
274+
try? fileManager.removeItem(at: clangPackageWithRelativePublicHeadersPath.appending(component: ".build"))
275275
}
276276

277277
let runner = Runner(
278278
mode: .createPackage,
279279
options: .init(
280280
baseBuildOptions: .init(isSimulatorSupported: false),
281281
buildOptionsMatrix: [
282-
"ClangPackageWithCustomModulePath": .init(
282+
"ClangPackageWithRelativePublicHeadersPath": .init(
283283
keepPublicHeadersStructure: true
284-
)
284+
),
285285
],
286286
shouldOnlyUseVersionsFromResolvedFile: true
287287
)
288288
)
289289
do {
290-
try await runner.run(packageDirectory: clangPackageWithCustomModulePath,
290+
try await runner.run(packageDirectory: clangPackageWithRelativePublicHeadersPath,
291291
frameworkOutputDir: .custom(frameworkOutputDir))
292292
} catch {
293293
XCTFail("Build should be succeeded. \(error.localizedDescription)")
294294
}
295295

296-
let libraryName = "ClangPackageWithCustomModulePath"
296+
let libraryName = "ClangPackageWithRelativePublicHeadersPath"
297297
let xcFramework = frameworkOutputDir.appendingPathComponent("\(libraryName).xcframework")
298298
let versionFile = frameworkOutputDir.appendingPathComponent(".\(libraryName).version")
299299
let framework = xcFramework.appendingPathComponent("ios-arm64")
@@ -302,7 +302,7 @@ final class RunnerTests: XCTestCase {
302302
XCTAssertTrue(
303303
fileManager.fileExists(
304304
atPath: framework.appending(
305-
components: ["Headers", "ClangPackageWithCustomModulePath", "add.h"]
305+
components: ["Headers", "ClangPackageWithRelativePublicHeadersPath", "add.h"]
306306
)
307307
.path(percentEncoded: false)
308308
),
@@ -320,8 +320,8 @@ final class RunnerTests: XCTestCase {
320320
XCTAssertEqual(
321321
moduleMapContents,
322322
"""
323-
framework module ClangPackageWithCustomModulePath {
324-
header "ClangPackageWithCustomModulePath/add.h"
323+
framework module ClangPackageWithRelativePublicHeadersPath {
324+
header "ClangPackageWithRelativePublicHeadersPath/add.h"
325325
export *
326326
}
327327
""",

0 commit comments

Comments
 (0)