diff --git a/.travis.yml b/.travis.yml index 471ae27..f13d88e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,6 +14,12 @@ matrix: script: - swift build - swift run package-config-example --verbose + + - os: osx + osx_image: xcode11 + script: + - swift build + - swift run package-config-example --verbose - os: linux language: generic diff --git a/Sources/PackageConfig/Package.swift b/Sources/PackageConfig/Package.swift index 1f9203d..1d30e93 100644 --- a/Sources/PackageConfig/Package.swift +++ b/Sources/PackageConfig/Package.swift @@ -118,15 +118,16 @@ enum Package { let latestVersion = versions.sorted().last! var spmVersionDir = latestVersion + let swiftToolsVersion = getSwiftToolsVersion() - if let swiftToolsVersion = getSwiftToolsVersion(), versions.contains(swiftToolsVersion) { + if let swiftToolsVersion = swiftToolsVersion, versions.contains(swiftToolsVersion) { spmVersionDir = swiftToolsVersion } let libraryPathSPM = swiftPMDir + "/" + spmVersionDir debugLog("Using SPM version: \(libraryPathSPM)") - return ["-L", libraryPathSPM, "-I", libraryPathSPM, "-lPackageDescription", "-package-description-version", getSwiftToolsVersion() ?? "5"] + return ["-L", libraryPathSPM, "-I", libraryPathSPM, "-lPackageDescription", "-package-description-version", swiftToolsVersion ?? "5"] } private static func getSwiftToolsVersion() -> String? {