Skip to content

Commit

Permalink
Use older API for linux compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
mattmassicotte committed Oct 23, 2023
1 parent 7f0c8eb commit 3911a09
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Sources/XCLinting/XCLinter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions Sources/clitool/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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")
Expand Down
4 changes: 2 additions & 2 deletions Tests/XCLintTests/EmbeddedBuildSettingsRuleTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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()
)

Expand All @@ -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()
)

Expand Down

0 comments on commit 3911a09

Please sign in to comment.