Skip to content

khlopko/xcode-bsp

Repository files navigation

Warning

Alpha software (v0.3.0). It might not be stable yet.

hero

xcode-bsp

Xcode Build Server Protocol implementation in Swift.

Build

Aims to provide support for Xcode projects in editors that rely on sourcekit-lsp.

implemented protocol surface

Incoming requests:

  • build/initialize
  • build/shutdown
  • workspace/buildTargets
  • workspace/waitForBuildSystemUpdates
  • textDocument/registerForChanges
  • buildTarget/sources
  • buildTarget/inverseSources
  • buildTarget/prepare (best-effort cache warmup)
  • textDocument/sourceKitOptions

Incoming notifications:

  • build/initialized
  • workspace/didChangeWatchedFiles
  • build/exit

Outgoing notifications:

  • buildTarget/didChange
  • build/sourceKitOptionsChanged

install

Use the setup script, then generate project config with xcode-bsp config.

  1. Clone the repo.
  2. Run setup:
    ./build_release.sh
    This builds the release binary, asks which directory to install xcode-bsp into, then copies the executable there.
  3. In the root folder of your Xcode project, run:
    xcode-bsp config
    The command:
    • asks which schemes to include as active build targets,
    • asks for executable path (defaults to detected current xcode-bsp path),
    • writes .bsp/xcode-bsp.json.

If you want to skip the executable-path prompt and set it explicitly:

xcode-bsp config --executable-path /absolute/path/to/xcode-bsp

activeSchemes is optional in config. If omitted or empty, xcode-bsp uses all schemes from xcodebuild -list.

Manual config is still supported. Example .bsp/xcode-bsp.json:

{
  "name": "xcode-bsp",
  "argv": ["/absolute/path/to/xcode-bsp"],
  "version": "0.3.0",
  "bspVersion": "2.0.0",
  "languages": ["swift", "objective-c", "objective-cpp"],
  "activeSchemes": []
}

known limitations

  • Diagnostics are not implemented yet.
  • Project-specific edge cases still exist.
  • Cache warmup can make first-response latency noticeably higher.

development

  • Build: swift build
  • Test: swift test

Rest is up to SourceKit's LSP.

alternatives

About

Xcode Build Server

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors