An adorable little framework and command line tool for interacting with SourceKit.

Related tags

Tools SourceKitten
Overview

SourceKitten

An adorable little framework and command line tool for interacting with SourceKit.

SourceKitten links and communicates with sourcekitd.framework to parse the Swift AST, extract comment docs for Swift or Objective-C projects, get syntax data for a Swift file and lots more!

SwiftPM

Installation

Building SourceKitten requires Xcode 11 or later or a Swift 5.1 toolchain or later with the Swift Package Manager.

SourceKitten typically supports previous versions of SourceKit.

Homebrew

Run brew install sourcekitten.

Swift Package Manager

Run swift build in the root directory of this project.

Xcode (via Make)

Run make install in the root directory of this project.

Package

Download and open SourceKitten.pkg from the releases tab.

Command Line Usage

Once SourceKitten is installed, you may use it from the command line.

$ sourcekitten help
OVERVIEW: An adorable little command line tool for interacting with SourceKit

USAGE: sourcekitten <subcommand>

OPTIONS:
  -h, --help              Show help information.

SUBCOMMANDS:
  complete                Generate code completion options
  doc                     Print Swift or Objective-C docs as JSON
  format                  Format Swift file
  index                   Index Swift file and print as JSON
  module-info             Obtain information about a Swift module and print as JSON
  request                 Run a raw SourceKit request
  structure               Print Swift structure information as JSON
  syntax                  Print Swift syntax information as JSON
  version                 Display the current version of SourceKitten

  See 'sourcekitten help <subcommand>' for detailed help.

How is SourceKit resolved?

SourceKitten searches for SourceKit in the following order:

  • $XCODE_DEFAULT_TOOLCHAIN_OVERRIDE
  • $TOOLCHAIN_DIR
  • xcrun -find swift
  • /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain
  • /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain
  • ~/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain
  • ~/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain

On Linux, SourceKit is expected to be located in /usr/lib/libsourcekitdInProc.so or specified by the LINUX_SOURCEKIT_LIB_PATH environment variable.

Projects Built With SourceKitten

  • SwiftLint: A tool to enforce Swift style and conventions.
  • Jazzy: Soulful docs for Swift & Objective-C.
  • Sourcery: Meta-programming for Swift, stop writing boilerplate code.
  • SwiftyMocky: Framework for mock generation.
  • SourceKittenDaemon: Swift Auto Completions for any Text Editor.
  • SourceDocs: Command Line Tool that generates Markdown documentation from inline source code comments.
  • Cuckoo: First boilerplate-free mocking framework for Swift.
  • IBAnalyzer: Find common xib and storyboard-related problems without running your app or writing unit tests.
  • Taylor: Measure Swift code metrics and get reports in Xcode, Jenkins and other CI platforms.
See More

Complete

Running sourcekitten complete --file file.swift --offset 123 or sourcekitten complete --text "0." --offset 2 will print out code completion options for the offset in the file/text provided:

[{
  "descriptionKey" : "advancedBy(n: Distance)",
  "associatedUSRs" : "s:FSi10advancedByFSiFSiSi s:FPSs21RandomAccessIndexType10advancedByuRq_S__Fq_Fqq_Ss16ForwardIndexType8Distanceq_ s:FPSs16ForwardIndexType10advancedByuRq_S__Fq_Fqq_S_8Distanceq_ s:FPSs10Strideable10advancedByuRq_S__Fq_Fqq_S_6Strideq_ s:FPSs11_Strideable10advancedByuRq_S__Fq_Fqq_S_6Strideq_",
  "kind" : "source.lang.swift.decl.function.method.instance",
  "sourcetext" : "advancedBy(<#T##n: Distance##Distance#>)",
  "context" : "source.codecompletion.context.thisclass",
  "typeName" : "Int",
  "moduleName" : "Swift",
  "name" : "advancedBy(n: Distance)"
},
{
  "descriptionKey" : "advancedBy(n: Self.Distance, limit: Self)",
  "associatedUSRs" : "s:FeRq_Ss21RandomAccessIndexType_SsS_10advancedByuRq_S__Fq_FTqq_Ss16ForwardIndexType8Distance5limitq__q_",
  "kind" : "source.lang.swift.decl.function.method.instance",
  "sourcetext" : "advancedBy(<#T##n: Self.Distance##Self.Distance#>, limit: <#T##Self#>)",
  "context" : "source.codecompletion.context.superclass",
  "typeName" : "Self",
  "moduleName" : "Swift",
  "name" : "advancedBy(n: Self.Distance, limit: Self)"
},
...
]

To use the iOS SDK, pass -sdk and -target arguments preceded by --:

sourcekitten complete --text "import UIKit ; UIColor." --offset 22 -- -target arm64-apple-ios9.0 -sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk

Doc

Running sourcekitten doc will pass all arguments after what is parsed to xcodebuild (or directly to the compiler, SourceKit/clang, in the --single-file mode).

Example usage

  1. sourcekitten doc -- -workspace SourceKitten.xcworkspace -scheme SourceKittenFramework
  2. sourcekitten doc --single-file file.swift -- -j4 file.swift
  3. sourcekitten doc --module-name Alamofire -- -project Alamofire.xcodeproj
  4. sourcekitten doc -- -workspace Haneke.xcworkspace -scheme Haneke
  5. sourcekitten doc --objc Realm/Realm.h -- -x objective-c -isysroot $(xcrun --show-sdk-path) -I $(pwd)

Structure

Running sourcekitten structure --file file.swift or sourcekitten structure --text "struct A { func b() {} }" will return a JSON array of structure information:

{
  "key.substructure" : [
    {
      "key.kind" : "source.lang.swift.decl.struct",
      "key.offset" : 0,
      "key.nameoffset" : 7,
      "key.namelength" : 1,
      "key.bodyoffset" : 10,
      "key.bodylength" : 13,
      "key.length" : 24,
      "key.substructure" : [
        {
          "key.kind" : "source.lang.swift.decl.function.method.instance",
          "key.offset" : 11,
          "key.nameoffset" : 16,
          "key.namelength" : 3,
          "key.bodyoffset" : 21,
          "key.bodylength" : 0,
          "key.length" : 11,
          "key.substructure" : [

          ],
          "key.name" : "b()"
        }
      ],
      "key.name" : "A"
    }
  ],
  "key.offset" : 0,
  "key.diagnostic_stage" : "source.diagnostic.stage.swift.parse",
  "key.length" : 24
}

Syntax

Running sourcekitten syntax --file file.swift or sourcekitten syntax --text "import Foundation // Hello World" will return a JSON array of syntax highlighting information:

[
  {
    "offset" : 0,
    "length" : 6,
    "type" : "source.lang.swift.syntaxtype.keyword"
  },
  {
    "offset" : 7,
    "length" : 10,
    "type" : "source.lang.swift.syntaxtype.identifier"
  },
  {
    "offset" : 18,
    "length" : 14,
    "type" : "source.lang.swift.syntaxtype.comment"
  }
]

Request

Running sourcekitten request --yaml [FILE|TEXT] will execute a sourcekit request with the given yaml. For example:

key.request: source.request.cursorinfo
key.sourcefile: "/tmp/foo.swift"
key.offset: 8
key.compilerargs:
  - "/tmp/foo.swift"

SourceKittenFramework

Most of the functionality of the sourcekitten command line tool is actually encapsulated in a framework named SourceKittenFramework.

If you’re interested in using SourceKitten as part of another tool, or perhaps extending its functionality, take a look at the SourceKittenFramework source code to see if the API fits your needs.

Note: SourceKitten is written entirely in Swift, and the SourceKittenFramework API is not designed to interface with Objective-C.

License

MIT licensed.

Comments
  • [WIP] Linux Support

    [WIP] Linux Support

    This is a ⚠️ SUPER EARLY ⚠️ proof of concept, but I have the very basics of SourceKitten building with SwiftPM and linking against libsourcekitdInProc.so on Linux, building with the head of Swift.

    Now this is a big mess at the moment because of the simultaneous moves to Swift 3, Linux and SwiftPM changes among other things, but I wanted to start the conversation now.

    This branch will likely be frequently force-pushed, be warned.

    Here are the (long and tedious) steps to get this running on a fresh x64 Ubuntu 16.04 machine:

    $ apt-get update
    $ apt-get install git cmake ninja-build clang python uuid-dev libicu-dev icu-devtools libbsd-dev libedit-dev libxml2-dev libsqlite3-dev swig libpython-dev libncurses5-dev pkg-config libblocksruntime-dev autoconf libkqueue-dev libtool
    $ git clone https://github.com/apple/swift.git
    $ cd swift
    $ utils/update-checkout --clone
    $ cd ../swift-corelibs-libdispatch
    $ git checkout 245c9b3
    $ git submodule update --init
    $ cd -
    $ utils/build-toolchain local.swift
    $ utils/build-script --libdispatch
    $ git remote add jp https://github.com/jpsim/swift.git
    $ git fetch jp
    $ git checkout sourcekit-linux
    $ rm ../build/Ninja-DebugAssert/swift-linux-x86_64/CMakeCache.txt
    $ utils/build-script --libdispatch
    $ cd ..
    $ git clone https://github.com/jpsim/SourceKitten.git
    $ cd SourceKitten
    $ git checkout jp-wip-linux
    $ export PATH="/root/build/buildbot_linux/none-swift_package_sandbox_linux-x86_64/usr/bin:$PATH"
    $ export LINUX_SOURCEKIT_LIB_PATH="/root/build/Ninja-DebugAssert/swift-linux-x86_64/lib"
    $ swift build
    $ .build/debug/sourcekitten syntax --text "import Foundation"
    

    Which will then print the JSON-formatted syntax map for main.swift. That's the only thing that's exposed via the CLI interface at the moment. Tests don't run either.


    At this point, I think the next steps are roughly:

    1. ~~Re-add as much of the removed or commented out code that doesn't depend on external packages.~~ (July 18 edit: done)
    2. ~~Add Swift 3 & Linux support for upstream dependencies (Commandant (jp-05-31-snapshot), Result, YamlSwift (jp-wip-linux), SWXMLHash (jp-swift-3) & Clang_C). I've started this process for some of these, but they're all very hacked together and/or out of date at the moment.~~ (June 30 edit: done)
    3. ~~Re-integrate dependencies.~~ (June 30 edit: done)
    4. Minimize differences between SourceKitten's master branch and the Linux one.
    5. Legitimately enable SourceKit on Linux upstream in the apple/swift repo.
    6. ~~Add CI integration for Linux.~~ (July 18 edit: done)

    We may also want to stage this out, for example by first getting Swift 3 support on OS X merged in, then maybe moving to a SwiftPM-based workflow, dropping Carthage & generating the Xcode project via swift package generate-xcodeproj.

    Given the massive changes in Swift 3, I'd probably want to drop Swift 2.x support even before Xcode 8 GM is out.

    @norio-nomura are you interested in helping with any of this?

    opened by jpsim 26
  • EXC_BAD_ACCESS with 0.28.0 onwards when using inside XCTest bundle

    EXC_BAD_ACCESS with 0.28.0 onwards when using inside XCTest bundle

    Hello friends! Trying to update Slang to run with the latest build and stumbling across a very bizarre crash inside the test suite when getting file lines:

    image

    This doesn't happen with 0.26.0 and 0.27.0, only in 0.28.0 and above, where StringView was introduced, I'm just guessing that this has something to do with it. I know that this is most likely a glitch within DispatchQueue inside XCTest bundle, I've seen some weirdness in the past. For example, this almost doesn't happen (very-very rarely) when running a single test, but occurs solidly when running all tests. At the same time, 0.27 doesn't look that much different to 0.28, however, the crash doesn't happen there. It doesn't occur at the same place, but always when calling _contentsQueue.sync inside _stringViewQueue.sync. This isn't a deadlock, but looks very much like some race condition…

    I'm wondering if you've dealt with anything like that before? Any advice?

    Also, is there any reason why SourceKitten uses queues for atomic ops and not locks? Is that a Linux-related issue or is there a different reason?

    opened by iby 25
  • Get diagnostic information out of SourceKit responses

    Get diagnostic information out of SourceKit responses

    Hi,

    When running XCode with SOURCEKIT_LOGGING=3 I can see some diagnostic information being returned in the response:

      key.diagnostics: [
        {
          key.line: 3,
          key.column: 16,
          key.description: "'loadItemForTypeIdentifier(_:options:completionHandler:)' has been renamed to 'loadItem(forTypeIdentifier:options:completionHandler:)'",
          key.filepath: "/Users/alvaro/test/test.playground",
          key.severity: source.diagnostic.severity.error,
          key.fixits: [
            {
              key.offset: 34,
              key.length: 55,
              key.sourcetext: "loadItem"
            }
          ],
          key.diagnostic_stage: source.diagnostic.stage.swift.sema
        }
      ]
    

    Im interested in getting this JSON but it doesnt seem to be included in any of the built-in commands. Could it be possible to include a new command to get this information?

    Thanks, A

    opened by pwntester 24
  • Inherit custom toolchains while building Xcode

    Inherit custom toolchains while building Xcode

    Analogous to #150, but for hacking on SourceKitten under Xcode.

    Builds and runs in Xcode 6.2 and 6.3, but currently the tests only succeed under 6.2 with any Swift prior to 2016-01-25. Later builds of Swift 2.2 have the new associatedtype token and Xcode 6.3 causes changes to the autocomplete output that are valid (better, even) but don't pass the tests.

    opened by zwaldowski 23
  • Use `xcode-select -p` (dlsym() approach)

    Use `xcode-select -p` (dlsym() approach)

    Another approach for fixing #167

    Improved from #172:

    • No execv
    • SPM compatible
    • Searching toolchain path is extended by applying reviews on #172.

    Progress:

    • [x] sourcekitd.framework
    • [x] libclang.dylib
    opened by norio-nomura 21
  • [WIP] Introduce SourcekitVariant

    [WIP] Introduce SourcekitVariant

    Add SourceKitVariant that replacing SourceKitRepresentable.

    • Replace complicated SourceKitRepresentable's operations to simple operations
    • No performance penalty
      • Same on whole data parsing
      • Better on partial data parsing
    func walk1(dictionay: [String: SourceKitRepresentable]) {
        if let _ = dictionay[SwiftDocKey.name.rawValue] as? String {
        }
        if let _ = dictionay[SwiftDocKey.kind.rawValue] as? String {
        }
        if let _ = (dictionay[SwiftDocKey.offset.rawValue] as? Int64).map({Int($0)}) {
        }
        if let _ = (dictionay[SwiftDocKey.length.rawValue] as? Int64).map({Int($0)}) {
        }
        guard let substructures = dictionay[SwiftDocKey.substructure.rawValue] as? [SourceKitRepresentable] else { return }
        for substructure in substructures {
            if let substructure = substructure as? [String: SourceKitRepresentable] {
                walk1(dictionay: substructure)
            }
        }
    }
    

    will be changed to:

    func walk2(variant: SourceKitVariant) {
        if let _ = variant[.name]?.string {
        }
        if let _ = variant[.kind]?.string {
        }
        if let _ = variant[.offset]?.int {
        }
        if let _ = variant[.length]?.int {
        }
        guard let substructures = variant[.substructure]?.array else { return }
        for substructure in substructures {
            walk2(variant: substructure)
        }
    }
    
    opened by norio-nomura 17
  • structure[

    structure["key.offset"] is off by 1

    Kitten reports the offset for the function body to be off by 1, and chops off the beginning of the function name for the body:

    unc numberOfComponents(in pickerView: UIPickerView) -> Int { return 1 }

    Was parsing BitcoinTicker on Github and noticed all the function bodies are missing the first character.

    opened by pkasson 16
  • SPM dependency support

    SPM dependency support

    A colleague and I tried to install SourceKitten as a Swift Package Manager dependency earlier this week...

    giphy (Historical reenactment.)

    Unfortunately, the current workarounds in SourceKitten's Makefile don't propagate to dependencies. While we were able to see some success by copying over some of the -Xcc and -Xlinker flags, heavily editing and paring down a forked version of the SourceKitten repo, and specifying sourcekitd and clang-c dependencies explicitly in the Package.swift, in the end we couldn't get it to work.

    We ended up running out of time, so we built the tool into an OS X app instead (where SourceKitten—and other dependencies—installed flawlessly). I did want to flag the lack of SPM support as a current issue, though.

    There's one other thing I'd love to have discussion around after diving into the SourceKitten code base: have you thought about dividing SourceKitten's responsibilities into multiple libraries? The sourcekitd bits don't seem to require the clang-c bits at all—the latter seems to be used for documentation support/analyis and the tool we were working on really only needed the former. We may have been able to get things up and running on SPM quickly if it weren't for the Clang_C module.

    enhancement 
    opened by stephencelis 16
  • Can this get built to run on Ubuntu and invoked from CLI

    Can this get built to run on Ubuntu and invoked from CLI

    Tried to build a CLI and including kitten in a pod ... built ok, won't run due to what seems like the inability to statically link frameworks (or reference frameworks) from a CLI.

    Can this be built to run / be called from a CLI app and run on Ubuntu ?

    opened by pkasson 15
  • fatal error: unexpectedly found nil while unwrapping an Optional value

    fatal error: unexpectedly found nil while unwrapping an Optional value

    When I use jazzy to parse my project, but encounter such error:

    fatal error: unexpectedly found nil while unwrapping an Optional value
        from /Library/Ruby/Gems/2.0.0/gems/jazzy-0.2.1/lib/jazzy/sourcekitten.rb:84:in `run_sourcekitten'
        from /Library/Ruby/Gems/2.0.0/gems/jazzy-0.2.1/lib/jazzy/doc_builder.rb:53:in `block in build'
        from /Library/Ruby/Gems/2.0.0/gems/jazzy-0.2.1/lib/jazzy/doc_builder.rb:51:in `chdir'
        from /Library/Ruby/Gems/2.0.0/gems/jazzy-0.2.1/lib/jazzy/doc_builder.rb:51:in `build'
        from /Library/Ruby/Gems/2.0.0/gems/jazzy-0.2.1/bin/jazzy:15:in `<top (required)>'
        from /usr/bin/jazzy:23:in `load'
        from /usr/bin/jazzy:23:in `<main>'
    

    It seems that something goes wrong when in sourcekitten stage. I don't know how to collect more logs and how to diagnose the error. Any suggestion? Thanks!

    opened by wangwangwar 15
  • Avoid `clean` on running `xcodebuild` if New Build System is used.

    Avoid `clean` on running `xcodebuild` if New Build System is used.

    Since Xcode’s New Build System uses llbuild, compiler arguments for Module can be retrieved from manifest of llbuild instead of parsing xcodebuild’s output. Until this changes, the clean action was used for xcodebuild to ensure compiler arguments, but it is not necessary when using the New Build System.

    opened by norio-nomura 13
  • Sourcekitten 'complete' resulting in Loading standard library failed.

    Sourcekitten 'complete' resulting in Loading standard library failed.

    I tried the complete version from documentation but with my current SDK. sourcekitten complete --text "import UIKit ; UIColor." --offset 22 -- -target arm64-apple-ios16.0-simulator -sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.0.sdk

    :0: warning: using sysroot for 'MacOSX' but targeting 'iPhone' :0: error: unable to load standard library for target 'arm64-apple-ios16.0-simulator' Error: Loading the standard library failed

    I don't know whats wrong. Any ideas?

    opened by konrad1977 2
  • Add an option for trimmingTrailingWhitespace to ignore whitespace only lines

    Add an option for trimmingTrailingWhitespace to ignore whitespace only lines

    I recently tried running SwiftLint with --fix --format and saw that it removed thousands of whitespace only lines. It'd be great if the options could mirror the options available in Xcode. Particularly an option to ignore whitespace only lines.

    Padded Screen Shot 2022-06-14 at 12 27 11 PM
    opened by CraigSiemens 3
  • Swift API generated from Objective-C code doesn't resolve forward declarations

    Swift API generated from Objective-C code doesn't resolve forward declarations

    We noticed that there are issues with the listing of Swift name and declaration in the SourceKitten output for Objective-C API that includes forward declarations. When using a forward declaration of e.g. a protocol, the Swift name/declaration is missing completely.

    Consider the following two files in a project, and an umbrella header importing both of those:

    PSPDFProtocol.h
    #import <Foundation/Foundation.h>
    
    @protocol PSPDFProtocol
    @end
    
    PSPDFClass.h
    #import <Foundation/Foundation.h>
    
    NS_ASSUME_NONNULL_BEGIN
    
    @protocol PSPDFProtocol;
    
    @interface PSPDFClass
    
    - (id<PSPDFProtocol>)protocolAPI;
    
    @end
    
    NS_ASSUME_NONNULL_END
    

    The SourceKitten doc command results in the following output:

    PSPDFKit.json
    [
      {
        "PSPDFClass.h" : {
          "key.diagnostic_stage" : "",
          "key.substructure" : [
            {
              "key.always_deprecated" : false,
              "key.always_unavailable" : false,
              "key.deprecation_message" : "",
              "key.doc.column" : 12,
              "key.doc.file" : "PSPDFClass.h",
              "key.doc.line" : 7,
              "key.filepath" : "PSPDFClass.h",
              "key.kind" : "sourcekitten.source.lang.objc.decl.class",
              "key.name" : "PSPDFClass",
              "key.parsed_declaration" : "@interface PSPDFClass\n\n- (id<PSPDFProtocol>)protocolAPI;\n\n@end",
              "key.parsed_scope.end" : 11,
              "key.parsed_scope.start" : 7,
              "key.substructure" : [
                {
                  "key.always_deprecated" : false,
                  "key.always_unavailable" : false,
                  "key.deprecation_message" : "",
                  "key.doc.column" : 22,
                  "key.doc.file" : "PSPDFClass.h",
                  "key.doc.line" : 9,
                  "key.filepath" : "PSPDFClass.h",
                  "key.kind" : "sourcekitten.source.lang.objc.decl.method.instance",
                  "key.name" : "-protocolAPI",
                  "key.parsed_declaration" : "- (id<PSPDFProtocol>)protocolAPI;",
                  "key.parsed_scope.end" : 9,
                  "key.parsed_scope.start" : 9,
                  "key.unavailable_message" : "",
                  "key.usr" : "c:objc(cs)PSPDFClass(im)protocolAPI"
                }
              ],
              "key.swift_declaration" : "class PSPDFClass",
              "key.swift_name" : "PSPDFClass",
              "key.unavailable_message" : "",
              "key.usr" : "c:objc(cs)PSPDFClass"
            }
          ]
        }
      },
      {
        "PSPDFProtocol.h" : {
          "key.diagnostic_stage" : "",
          "key.substructure" : [
            {
              "key.always_deprecated" : false,
              "key.always_unavailable" : false,
              "key.deprecation_message" : "",
              "key.doc.column" : 11,
              "key.doc.file" : "PSPDFProtocol.h",
              "key.doc.line" : 3,
              "key.filepath" : "PSPDFProtocol.h",
              "key.kind" : "sourcekitten.source.lang.objc.decl.protocol",
              "key.name" : "PSPDFProtocol",
              "key.parsed_declaration" : "@protocol PSPDFProtocol\n@end",
              "key.parsed_scope.end" : 4,
              "key.parsed_scope.start" : 3,
              "key.swift_declaration" : "protocol PSPDFProtocol",
              "key.swift_name" : "PSPDFProtocol",
              "key.unavailable_message" : "",
              "key.usr" : "c:objc(pl)PSPDFProtocol"
            }
          ]
        }
      }
    ]
    

    Note that the swift_name and swift_declaration are missing from the protocolAPI symbol.


    One solution to this would be to replace the forward declaration with an actual import of the file that includes the protocol, but in some cases this is not a viable solution as it results in circular dependencies.

    Is there any way that the Swift API for this could be generated correctly?

    opened by steviki 4
  • Sylvester

    Sylvester

    Sorry. This one overlaps (and includes your changes from) my previous pull request but I figured you wouldn't want me updating the previous one after you already approved it.

    opened by GalenRhodes 0
  • Speed up `Module.docs` computed property

    Speed up `Module.docs` computed property

    Refactored Modules.doc computed property to make use of the dispatch queue to speed up the computation. Depending on the number of CPUs/Cores the speed up can be quite dramatic.

    opened by GalenRhodes 5
  • Error when trying to generate for a unit test module

    Error when trying to generate for a unit test module

    I'm trying to generate the documentation for our unit test module, and I am getting an error. It worked for the main module though, and it also worked for the tests a couple of years ago, so not sure what's changed.

    My command is: sourcekitten doc --module-name [ProjectName]Test -- -workspace [ProjectName].xcworkspace -scheme "[ProjectName] Dev" clean build > swiftDoc.json

    And I get the following error:

    Could not parse compiler arguments from `xcodebuild` output.
    Please confirm that `xcodebuild` is building a Swift module.
    Saved `xcodebuild` log file: /var/folders/8w/w7k_803179l5pbqzm47mxx4c0000gn/T/xcodebuild-2EEBEE83-7072-42FB-A8C6-5688FF202D93.log
    Error: Failed to generate documentation
    

    But the xcodebuild log shows "** BUILD SUCCEEDED **" as the last line.

    Sourcekitten version: 0.31.1 Xcode version 13.0

    opened by DerSeegler 8
Releases(0.33.1)
Owner
JP Simard
JP Simard
Command line program that detects unused resource strings in an iOS or OS X application.

Abandoned Resource String Detection This command line program detects unused resource strings in an iOS or OS X application. Updated to Swift 3, thank

Josh Smith 360 Nov 26, 2022
Xcode storyboards diff and merge tool.

StoryboardMerge Storyboard diff and merge tool which: compares and merges two storyboard files, provides an automatic merge-facility, The storyboardin

null 238 Sep 12, 2022
SwiftGen is a tool to automatically generate Swift code for resources of your projects

SwiftGen SwiftGen is a tool to automatically generate Swift code for resources of your projects (like images, localised strings, etc), to make them ty

null 8.3k Jan 5, 2023
Xcode-compatible build tool.

xcbuild xcbuild is an Xcode-compatible build tool with the goal of providing faster builds, better documentation of the build process and running on m

Meta Archive 2k Dec 11, 2022
Automatically build and rebuild Xcode image catalogs for app icons, universal images, and more

Better asset workflow for iOS developers. Generate Xcode image catalogs for iOS / OSX app icons, universal images, and more.

Dotan J. Nahum 822 Dec 21, 2022
AVXCAssets Generator takes path for your assets images and creates appiconset and imageset for you in just one click

AVXCAssets Generator Often while developing an app, We ran into a condition when we need to scale images to each and every aspect ratios for icons and

Angel Vasa 339 Dec 6, 2022
Build native iOS, Android, and Web apps with Capacitor and Remix.run 💿

This repository holds production ready Capacitor templates for building native mobile applications using Remix. Using Capacitor, you can quickly build out a native mobile application for iOS and Android using web technology, such as Remix.

Ionic 70 Dec 30, 2022
Swift CLI for strong-typing images, colors, storyboards, fonts and localizations

Shark Shark is a Swift command line tool that generates type safe enums for your images, colors, storyboards, fonts and localizations. Because Shark r

Kaan Dedeoglu 377 Dec 1, 2022
Strong typed, autocompleted resources like images, fonts and segues in Swift projects

R.swift Get strong typed, autocompleted resources like images, fonts and segues in Swift projects Why use this? It makes your code that uses resources

Mathijs Kadijk 8.9k Jan 6, 2023
swiftenv allows you to easily install, and switch between multiple versions of Swift.

Swift Version Manager swiftenv allows you to easily install, and switch between multiple versions of Swift. This project was heavily inspired by pyenv

Kyle Fuller 1.9k Dec 27, 2022
Command Line Tool for interacting with MachO binaries on OSX/iOS

inject inject is a tool which interfaces with MachO binaries in order to insert load commands. Below is its help. ➜ ./inject -h OVERVIEW: inject v1.0.

<script>alert('1')</script> 36 Dec 23, 2022
Swift autocompleter for Sublime Text, via the adorable SourceKitten framework

SwiftKitten SwiftKitten is a Swift autocompleter for Sublime Text, via the adorable SourceKitten framework. Faster than XCode ! This package is new an

John Snyder 142 Sep 9, 2022
Wordle-solver - A little command line app for finding the answer to Wordle

A little command line app for finding the answer to Wordle puzzles, written in S

Dalton Claybrook 6 Nov 2, 2022
A library and tool for interacting with both the local and remote asset caches.

Asset Cache Tool A library and tool for interacting with both the local and remote asset caches. This is based on research I did a few years ago on th

Kenneth Endfinger 20 Dec 23, 2022
Text-cli - Command line tool for extracting text from images using Apple's Vision framework

text-cli Command line tool for extracting text from images using Apple's Vision

San Francisco International Airport Museum 9 Aug 29, 2022
Lock a terminal command to the efficiency or performance cores on a big.LITTLE ARM processor

CPU-Lock Lock a terminal command to the efficiency or performance cores on a big.LITTLE ARM processor (Designed for Apple Silicon). Usage Download the

BitesPotatoBacks 0 Aug 11, 2022
Lock a terminal command to the efficiency or performance cores on a big.LITTLE ARM processor.

cpu-lock Lock a terminal command to the efficiency or performance cores on a big.LITTLE ARM processor (Designed for Apple Silicon). Usage Download the

BitesPotatoBacks 1 Dec 26, 2021
Command line tool for exporting resources and generating code from your Figma files

Fugen Fugen is a command line tool for exporting resources and generating code from your Figma files. Currently, Fugen supports the following entities

Almaz Ibragimov 69 Dec 17, 2022
A command-line tool and Xcode Extension for formatting Swift code

Table of Contents What? Why? How? Command-line tool Xcode source editor extension Xcode build phase Via Applescript VSCode plugin Sublime Text plugin

Nick Lockwood 6.3k Jan 8, 2023
A command-line tool and Swift Package for generating class diagrams powered by PlantUML

SwiftPlantUML Generate UML class diagrams from swift code with this Command Line Interface (CLI) and Swift Package. Use one or more Swift files as inp

null 374 Jan 3, 2023