

Targets are the basic building blocks of a package. Dependencies declare other packages that this package depends on. version of Swift required to build this package. The swift-tools-version declares the minimum The most important file is ‘Package.swift’ which describes the package and consists of dependencies, targets and products, and is declared with the Swift syntax. Source files are put in ‘Sources’ and test files are put in ‘Tests’. SwiftPM created the following package structure. SwiftPM provides the following commands: # Build sources into binary products To install Swift and the SwiftPM on a Mac, open the App Store, search for Xcode, which is free and install it. Some assumptionsīefore we move on, I will assume that you have a Mac, and have some experience with programming languages, Installation You don’t have to know any Swift to follow along. In this blog we are going to create a new application project, and create a small application. SwiftPM is a cross platform build system that is available for MacOS and Linux.Īpple published an introduction video Getting to Know Swift Package Manager – Apple WWDC 2018 and SwiftPM has been documented. SwiftPM provides a standard way to build Swift applications and is a replacement for build tools like CocoaPods and Carthage.

Just like other build tools like Maven or Gradle, SwiftPM manages project dependencies, and can build, test and publish packages. The Swift Package Manager (SwiftPM) is a tool for building your Swift applications.
