Apple has made the Swift Build code engine of its development platform, Xcode, open-source. This should better align the various build systems currently in Xcode and the existing Swift Package Manager (Swift PM).
Apple’s main reason for making Xcode’s Swift Build engine open-source is that having two different ways to build packages—in addition to Swift PM’s capabilities—could be very confusing for developers, especially when the behaviour of the two implementations does not match.
Swift is Apple’s programming language, and Xcode is its development platform.
Cross-platform
The ultimate goal is to create one unified build execution engine that builds packages for all platforms, enabling better cross-platform development. By “all platforms” is meant not only the proprietary iOS, iPadOS, macOS, tvOS and watchOS platforms, but also Android, Linux, QNX and Windows, for example.
The Swift Build engine is now available as open source on GitHub under an Apache 2.0 license. Plug-ins are also included to support cross-platform targets, such as the operating systems.
In addition, the build system provides support for various project types, such as libraries, command-line and GUI applications. It also features optimization options that maximize efficiency when building Swift and C code.
In the near future, the intention is to further expand the capabilities of a merged platform with the community’s help. Until then, the Swift Package Manager will still use its own build engine by default. By using the flag --build-system swiftbuild
, the new build engine can be enabled.
Tip: Apple programming language Swift is steadily gaining popularity