SourceKitten icon indicating copy to clipboard operation
SourceKitten copied to clipboard

How do I include Sourcekitten in Command Line tool

Open KarthikS941 opened this issue 6 years ago • 2 comments

I am trying to integrate Sourcekitten to a Command Line Tool in Xcode 9. I am getting, Library not found error.

Checked with a couple of links online, I came to know that there is a difference in how frameworks are included in app bundles and tool bundles.

Is there a way in Source Kitten workspace, that we can generate a framework that's compatible with command line tools?

KarthikS941 avatar May 09 '18 15:05 KarthikS941

You're right that there are a number of ways to include a Swift library in a command line tool. You'll want to link SourceKittenFramework to your binary, preferably statically for simpler deployments.

Take a look at any number of the projects included in the README's "Projects Built With SourceKitten" section to see how different projects have done this.

jpsim avatar May 09 '18 17:05 jpsim

thanks this helped. Started with Swift Package manager and it works like a charm.

KarthikS941 avatar May 09 '18 17:05 KarthikS941