mirror of
https://github.com/realm/SwiftLint.git
synced 2026-06-06 20:18:40 +00:00
* Short names for test modules * Lint plugins and `Package.swift` in integration tests * Simplify and merge file groups in Bazel * Move common functions to `TestHelpers`
15 lines
564 B
Swift
15 lines
564 B
Swift
import Foundation
|
|
|
|
public enum TestResources {
|
|
public static func path(_ calleePath: String = #filePath) -> String {
|
|
let folder = URL(fileURLWithPath: calleePath, isDirectory: false).deletingLastPathComponent()
|
|
if let rootProjectDirectory = ProcessInfo.processInfo.environment["BUILD_WORKSPACE_DIRECTORY"] {
|
|
return "\(rootProjectDirectory)/Tests/\(folder.lastPathComponent)/Resources"
|
|
}
|
|
return folder
|
|
.appendingPathComponent("Resources")
|
|
.path
|
|
.absolutePathStandardized()
|
|
}
|
|
}
|