SourceKitten icon indicating copy to clipboard operation
SourceKitten copied to clipboard

Issues building with SPM and Xcode 11 (beta 4)

Open borisyurkevich opened this issue 6 years ago • 5 comments

Getting following errors, I have tried latest version (24).

let task = Process()

Use of unresolved identifier 'Process'

if #available(macOS 10.13, *) {
    options = [.prettyPrinted, .sortedKeys]
} else {
    options = .prettyPrinted
}

'sortedKeys' is only available in iOS 11.0 or newer

borisyurkevich avatar Aug 07 '19 11:08 borisyurkevich

SourceKitten doesn’t target iOS.

jpsim avatar Aug 07 '19 15:08 jpsim

Do you find a solution ?

SwiftLint has SourceKitten in dependency and Xcode can't compile.

Xcode 11 beta 6

julienrenier avatar Sep 04 '19 18:09 julienrenier

@julienrenier can you share more about the issue you're facing? Are you trying to compile SwiftLint to run on iOS? That definitely won't work since the Swift compiler and SourceKit aren't readily portable to iOS either.

jpsim avatar Sep 05 '19 19:09 jpsim

@jpsim I'm trying to remove pods from my project, I thought that I can simply add swiftlint package with SwiftPM in my iOS app.

julienrenier avatar Sep 06 '19 07:09 julienrenier

The SwiftLint cocoapod for iOS/tvOS/watchOS targets is a bit of a hack, where it's not meant to target those platforms but rather to be invoked from the macOS machine maintaining the project.

When you add the SwiftLint pod to your Podfile, you just pull in its precompiled macOS CLI binary, which you can then invoke using something like ${PODS_ROOT}/SwiftLint/swiftlint.

This approach won't work if you're trying to build SwiftLint (or SourceKitten) for an iOS target from source.

jpsim avatar Sep 06 '19 20:09 jpsim