### Install Xcode-Build-Server Source: https://github.com/solawing/xcode-build-server/blob/master/Readme.md Provides instructions for installing the Xcode-Build-Server tool using various package managers or direct cloning. Ensure Python 3.9 is available. ```bash git clone "git@github.com:SolaWing/xcode-build-server.git" && ln -s "$PWD"/xcode-build-server/xcode-build-server /usr/local/bin ``` ```bash git clone "https://github.com/SolaWing/xcode-build-server.git" && ln -s "$PWD"/xcode-build-server/xcode-build-server /usr/local/bin ``` ```bash brew install xcode-build-server ``` ```bash sudo port install xcode-build-server ``` -------------------------------- ### buildServer.json Configuration Example Source: https://github.com/solawing/xcode-build-server/blob/master/Readme.md An example of the buildServer.json file, which is generated by xcode-build-server. This file is crucial for SourceKit-LSP to correctly locate build settings and cross-file references. The 'build_root' property is particularly important for correct indexing. ```json { "build_root": "/Users/yourusername/Library/Developer/Xcode/DerivedData/Simulator_Controller-adadrfjxhdizubdktugddworgvuj" } ``` -------------------------------- ### Integrate Xcode Build Server Post-Action Source: https://github.com/solawing/xcode-build-server/blob/master/Readme.md This snippet shows how to integrate the xcode-build-server into your Xcode project's post-build actions. It automates log parsing and generation of buildServer.json, enabling features like indexing while building. ```shell xcode-build-server postaction | bash & ``` -------------------------------- ### Xcode Build Server Protocol Commands Source: https://github.com/solawing/xcode-build-server/blob/master/Readme.md This section details the commands used by the Xcode-Build-Server tool to configure and parse build information for integration with language servers like sourcekit-lsp. ```APIDOC xcode-build-server config Configures the build server for Xcode integration. Creates or updates `buildServer.json` with `kind: xcode`. Usage: xcode-build-server config -workspace -scheme xcode-build-server config -project -scheme Parameters: -workspace: Path to the Xcode workspace file (*.xcworkspace). -project: Path to the Xcode project file (*.xcodeproj). -scheme: The name of the Xcode scheme to use. Can be omitted if unique. Notes: - The directory where `buildServer.json` is created must be the root/working directory of the LSP. - If compile info is outdated, rebuilding in Xcode refreshes compile flags. - Can use `xcodebuild` with `-resultBundlePath` to generate build logs without opening Xcode. Example: `rm .bundle; xcodebuild -workspace *.xcworkspace -scheme -destination 'generic/platform=iOS Simulator' -resultBundlePath .bundle build` xcode-build-server parse Manually parses xcodebuild logs to extract compile information. Saves compile info in a `.compile` file and updates `buildServer.json` with `kind: manual`. Usage: xcode-build-server parse [-a] | xcode-build-server parse [-a] Parameters: -a: Flag to add new flags incrementally. Recommended for incremental updates (e.g., adding files, switching SDKs). : Path to a file containing the xcodebuild output. Input: Can accept build logs via stdin if no file is specified. Examples: - Parsing a file: `xcodebuild -workspace *.xcworkspace -scheme -configuration Debug build | tee build.log; xcode-build-server parse -a build.log` - Parsing from stdin: `pbpaste | xcode-build-server parse -a` Notes: - For first-time use, ensure the log is complete to obtain correct flags for all files. - After changes (new files, SDK switch, etc.), repeat parsing, preferably with the `-a` flag. - Restart the language server after updating compile info. ``` -------------------------------- ### Release New Version using Git Tags Source: https://github.com/solawing/xcode-build-server/blob/master/Readme.md Steps to release a new version of the xcode-build-server project. This involves creating a Git tag, pushing it to the remote repository, which then triggers a GitHub action to create a release. ```git git tag -a v0.1.0 -m "release v0.1.0" git push origin v0.1.0 ``` -------------------------------- ### Configure Xcode Build Integration Source: https://github.com/solawing/xcode-build-server/blob/master/Readme.md Configures the build server to integrate with Xcode projects by creating or updating a `buildServer.json` file. This method uses Xcode's build logs to derive compile flags. ```bash # *.xcworkspace or *.xcodeproj should be unique. This can be omitted and the build server will automatically choose the unique workspace or project. # -scheme can also be omitted to automatically bind the latest scheme build result. even change it in xcode after the buildServer.json generated xcode-build-server config -workspace *.xcworkspace -scheme ``` ```bash xcode-build-server config -project *.xcodeproj -scheme ``` -------------------------------- ### Manual Parse Xcodebuild Log Source: https://github.com/solawing/xcode-build-server/blob/master/Readme.md Manually parses xcodebuild logs to extract compile information, saving it to a `.compile` file and updating `buildServer.json` with `kind: manual`. This is useful when not building directly with Xcode. ```bash xcode-build-server parse [-a] ``` ```bash | xcode-build-server parse [-a] ``` ```bash xcodebuild -workspace *.xcworkspace -scheme -configuration Debug build | xcode-build-server parse [-a] ``` ```bash pbpaste | xcode-build-server parse [-a] ``` ```bash xcodebuild ... | tee build.log; xcode-build-server parse -a build.log >/dev/null 2>&1 ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.