From 3911a09f9277445cc71cc949c97dfacab3c41006 Mon Sep 17 00:00:00 2001 From: Matt <85322+mattmassicotte@users.noreply.github.com> Date: Mon, 23 Oct 2023 15:18:19 -0400 Subject: [PATCH] Use older API for linux compatibility --- Sources/XCLinting/XCLinter.swift | 2 +- Sources/clitool/main.swift | 4 ++-- Tests/XCLintTests/EmbeddedBuildSettingsRuleTests.swift | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Sources/XCLinting/XCLinter.swift b/Sources/XCLinting/XCLinter.swift index d592ccc..9c61c07 100644 --- a/Sources/XCLinting/XCLinter.swift +++ b/Sources/XCLinting/XCLinter.swift @@ -48,7 +48,7 @@ extension XCLinter.Environment { throw XCLintError.noProjectFileSpecified } - let url = URL(filePath: projectPath) + let url = URL(fileURLWithPath: projectPath) let xcodeproj = try XcodeProj(pathString: projectPath) self.init(project: xcodeproj, projectRootURL: url, configuration: configuration) diff --git a/Sources/clitool/main.swift b/Sources/clitool/main.swift index bd16d8f..70786f9 100644 --- a/Sources/clitool/main.swift +++ b/Sources/clitool/main.swift @@ -33,7 +33,7 @@ struct XCLintCommand: ParsableCommand { } // find the effective environment - let config = try resolvedConfiguration(projectRootURL: URL(filePath: projPath)) + let config = try resolvedConfiguration(projectRootURL: URL(fileURLWithPath: projPath)) let env = try XCLinter.Environment(projectPath: projPath, configuration: config) let linter = XCLinter(environment: env) @@ -67,7 +67,7 @@ extension XCLintCommand { private func resolvedConfigFileURL(projectRootURL: URL) -> URL? { if let path = configFilePath { - return URL(filePath: path, directoryHint: .notDirectory) + return URL(fileURLWithPath: path, isDirectory: false) } let defaultURL = projectRootURL.deletingLastPathComponent().appending(component: ".xclint.yml") diff --git a/Tests/XCLintTests/EmbeddedBuildSettingsRuleTests.swift b/Tests/XCLintTests/EmbeddedBuildSettingsRuleTests.swift index ba4e300..615df7a 100644 --- a/Tests/XCLintTests/EmbeddedBuildSettingsRuleTests.swift +++ b/Tests/XCLintTests/EmbeddedBuildSettingsRuleTests.swift @@ -26,7 +26,7 @@ final class EmbeddedBuildSettingsRuleTests: XCTestCase { let env = XCLinter.Environment( project: project, - projectRootURL: URL(filePath: "/dev/null"), + projectRootURL: URL(fileURLWithPath: "/dev/null"), configuration: Configuration() ) @@ -44,7 +44,7 @@ final class EmbeddedBuildSettingsRuleTests: XCTestCase { let env = XCLinter.Environment( project: project, - projectRootURL: URL(filePath: "/dev/null"), + projectRootURL: URL(fileURLWithPath: "/dev/null"), configuration: Configuration() )