Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@ import Foundation
// so it's independent of build CWD.
func occtDep(_ name: String, from version: String) -> Package.Dependency {
let manifestDir = URL(fileURLWithPath: #filePath).deletingLastPathComponent().path
if FileManager.default.fileExists(atPath: manifestDir + "/../\(name)/Package.swift") {
// Only trust a sibling checkout for a REAL local dev clone — never when this manifest is itself a
// transitively-resolved checkout under a consumer's `.build/checkouts/` (SwiftPM lays every dep out
// flat there, so `../\(name)` spuriously exists and flips this to a path dep → a SwiftPM identity
// conflict with the URL-based dep. See SecondMouseAU/ecosystem#14.
if !manifestDir.contains("/.build/"),
FileManager.default.fileExists(atPath: manifestDir + "/../\(name)/Package.swift") {
return .package(path: "../\(name)")
}
return .package(url: "https://github.com/SecondMouseAU/\(name).git", from: Version(version)!)
Expand Down