Swiftpack.co - Package - SDGGiesbrecht/SDGSwift


macOS • Linux



SDGSwift enables use of the Swift compiler as a package dependency.

השֹּׁלֵחַ אִמְרָתוֹ אָרֶץ עַד־מְהֵרָה יָרוּץ דְּבָרוֹ׃
He sends His command to the earth; His word runs swiftly.

                                                                                                    ―a psalmist


  • Compiler operations such as building and testing: SDGSwift, SDGXcode
  • Package Manager operations such as fetching and manifest loading: SDGSwiftPackageManager
  • Utilities for defining configuration files written in Swift (similar to package manifests): SDGSwiftConfiguration, SDGSwiftConfigurationLoading

(For a list of related projects, see here.)


SDGSwift provides libraries for use with the Swift Package Manager.

Simply add SDGSwift as a dependency in Package.swift and specify which of the libraries to use:

let package = Package(
    name: "MyPackage",
    dependencies: [
        .package(url: "https://github.com/SDGGiesbrecht/SDGSwift", .upToNextMinor(from: Version(0, 2, 2))),
    targets: [
        .target(name: "MyTarget", dependencies: [
            .productItem(name: "SDGSwift", package: "SDGSwift"),
            .productItem(name: "SDGSwiftPackageManager", package: "SDGSwift"),
            .productItem(name: "SDGXcode", package: "SDGSwift"),
            .productItem(name: "SDGSwiftConfiguration", package: "SDGSwift"),
            .productItem(name: "SDGSwiftConfigurationLoading", package: "SDGSwift"),
            .productItem(name: "SampleConfiguration", package: "SDGSwift"),

The libraries’ modules can then be imported in source files:

import SDGSwift
import SDGSwiftPackageManager
import SDGXcode
import SDGSwiftConfiguration
import SDGSwiftConfigurationLoading
import SampleConfiguration

Example Usage

do {
    let package = Package(url: URL(string: "https://github.com/apple/example-package-dealer")!)
    try package.build(.version(Version(2, 0, 0)), to: temporaryDirectory)
} catch {


The SDGSwift project is maintained by Jeremy David Giesbrecht.

If SDGSwift saves you money, consider giving some of it as a donation.

If SDGSwift saves you time, consider devoting some of it to contributing back to the project.

Ἄξιος γὰρ ὁ ἐργάτης τοῦ μισθοῦ αὐτοῦ ἐστι.
For the worker is worthy of his wages.



Stars: 2
Help us keep the lights on



0.2.2 - Sep 4, 2018

No changes to the published API.

0.2.1 - Jul 24, 2018

Bug Fixes

  • Coverage checks skip foreign file types instead of failing to parse the respective report.

0.2.0 - Jun 27, 2018

Breaking Changes

  • Versions of Swift and Xcode below 4.1.2 and 9.4 are no longer supported.

0.1.12 - Jun 25, 2018

New Features

  • Version conforms to Codable.
  • Configuration loading provides live progress.

Bug Fixes

  • Progress reporting for test coverage no longer bypasses the provided closure.

0.1.11 - Jun 20, 2018

New Features

  • Compatible with Xcode 9.4.1. (Still compatible with Xcode 9.3.)