os_xcode
os_xcode makes the latest installed Xcode toolchain and macOS SDK available to dependent tasks. It is a dependency, not a function, and takes no arguments.
On macOS, xx inspects Xcode applications in /Applications and ~/Applications, along with the Xcode application selected by xcode-select when it is elsewhere. It checks each installation with its own xcodebuild, then uses the installation reporting the latest Xcode version. xx sets DEVELOPER_DIR and SDKROOT, adds the Xcode developer and default toolchain binaries to PATH, and exposes /usr/bin/xcrun through an xx-owned command-scoped binary directory. It does not add /usr/bin to PATH.
xx reports an error when no complete Xcode installation is available. Apple Command Line Tools alone are not sufficient. Automatic installation and explicit version selection are not currently supported.
The symbol is safe to load on Linux and Windows, but activating it reports that Xcode is only available on macOS.
Example
load("@os@1", "os_run", "os_xcode")
os_run(
("xcodebuild", "-project", "MyApp.xcodeproj", "-scheme", "MyApp", "build"),
deps=[os_xcode],
)