You can explore your package and run the tests by opening the Package.swift that will open your package in Xcode. After running the init command we will see the steps of creating the library printed out in the terminal: Creating library package: SwiftLeePackageĬreating Sources/SwiftLeePackage/SwiftLeePackage.swiftĬreating Tests/SwiftLeePackageTests/SwiftLeePackageTests.swiftĬreating Tests/SwiftLeePackageTests/XCTestManifests.swiftĪs you can see, it creates all the basic files we need for our own Package, including tests.
In this example, we’re creating a Package with the name “SwiftLeePackage”. To create a Package from the terminal you can use the following commands: $ mkdir SwiftLeePackage Creating a Swift Package from the Terminal Note: If you’re looking for a way to create a command-line tool in Swift, take a look at my blog post Creating a command line tool using the Swift Package Manager. You can create your own Swift Package in both the terminal and in Xcode depending on what you like the most. However, it might just be easier to wait for WWDC 2020 that hopefully introduces support for resources as it’s proposal is already accepted in SE-271. You could eventually start using it on the side next to your other dependency manager. strings and png files.Īpart from that, it’s ready to be used. For example, this stops us from adding SPM support to our WeScan framework that includes. At WeTransfer we mostly run into the missing feature of adding resources to a Package. Can we already switch over completely to the Swift Package Manager?Īlthough it has definitely improved a lot over the past few years it’s not covering all use-cases yet. This automation makes it really easy to add and work with external dependencies in your Swift projects. The Package Manager is integrated with the Swift build system to automate the process of downloading, compiling, and linking dependencies. Xcode 11 added integrated support to manage your Swift Packages from within Xcode itself. You can compare it to tools like CocoaPods and Carthage that also allow you to add dependencies to your project. The Swift Package Manager is introduced in Swift 3.0 and enables us to manage Swift dependencies. Glassfy is here to help: It provides an open source SDK & complete backend to integrate monetization properly and the remote configuration to unlock your app's potential. Build, manage, and grow in-app subscriptions You deserve to focus on your app, and stop wasting time on subscription infrastructure and maintenance.