Apple announced the open-sourcing of the assembly system Swift Build used in the proprietary integrated development environments Xcode and Swift PlayGround. The system is designed for assembling projects in SWIFT, C, and Objective-C languages but can also be utilized with other languages. An experimental module called “-Build-System SwiftBuild” has been prepared for the Swift Package Manager package, allowing the use of Swift Build as an alternative assembly engine. The Swift Build code is written in Swift and is open under the Apache 2.0 license. It supports project assembly on Linux, MacOS, iOS, Android, QNX, and Windows.
Swift Build follows assembly rules to create an assembly plan and initiate the components of the assembly process. The project aims to provide cross-platform assembly for various operating systems and device types. Its primary purpose is to transform user-provided input data, like project descriptions and source code, into resulting artifacts such as libraries and applications.
The system is structured as a framework over llbuild libraries that handle low-level functions related to dependency graphs, assembly rule formats, object tracking, and tool creation with ninja. Additional capabilities include integration with the Swift compiler for efficient project assembly in the Swift language, support for various product types, and optimization of assembly graph efficiency for parallelization of Swift and C code assembly processes.
At the core of Swift Build is the SWBULDSERVICE process, which is activated when the client (SWBUILD utility, XCode environment, or Swift Package Manager) initiates assembly. Communication between the SWBULDSERVICE and client processes occurs through serialized messages over a named pipe. The client interacts with the assembly system via the SwiftBuild API or the SwBuild command line.
Swift Build offers a range of frameworks including:
- SWBLLBULD – provides access to llbuild functionality;
- swbutil – offers auxiliary functions like ordered lists implementation;
- SWCSUPPORT – supports C, Objective-C, and COBOL;
- SWBCORE – includes engines for macro processing