Swiftpack.co - Package - SDGGiesbrecht/SDGSwift

macOS • Linux

Documentation

SDGSwift

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

השֹּׁלֵחַ אִמְרָתוֹ אָרֶץ עַד־מְהֵרָה יָרוּץ דְּבָרוֹ׃

He sends His command to the earth; His word runs swiftly.

―a psalmist

Features

  • 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

Versioning note: Most products are already “finalized” at a state comparable to a semantic version one (SDGSwift, SDGSwiftSource, SDGSwiftConfiguration and SDGSwiftConfigurationLoading). The package as a whole remains zero‐versioned because SDGSwiftPackageManager and SDGXcode still rely on hidden implementation details of the package manager and Xcode respectively.

Example Usage

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

Importing

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, 12, 1))),
    ],
    targets: [
        .target(name: "MyTarget", dependencies: [
            .productItem(name: "SDGSwift", package: "SDGSwift"),
            .productItem(name: "SDGSwiftPackageManager", package: "SDGSwift"),
            .productItem(name: "SDGSwiftSource", 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 SDGSwiftSource
import SDGXcode
import SDGSwiftConfiguration
import SDGSwiftConfigurationLoading
import SampleConfiguration

About

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.

―‎ישוע/Yeshuʼa

Github

link
Stars: 11
Help us keep the lights on

Dependencies

Releases

0.12.1 - Jun 14, 2019

Bug Fixes

Dependency updates.

0.12.0 - Jun 12, 2019

Versioning Note

Most products are now “finalized” at a state comparable to a semantic version one (SDGSwift, SDGSwiftSource, SDGSwiftConfiguration and SDGSwiftConfigurationLoading). The package as a whole remains zero‐versioned because SDGSwiftPackageManager and SDGXcode still rely on hidden implementation details of the package manager and Xcode respectively.

Breaking Changes

  • Modules do not export their dependencies. Each must be imported separately.

0.11.0 - Jun 1, 2019

Breaking Changes

  • The documentation property of API elements is now a list of all documentation comments preceding the symbol. To get the one recognized by the Swift compiler (equivalent to the old behaviour), use documentation.last?.documentationComment.
  • releaseProductsDirectory() has been replaced with productsDirectory(releaseConfiguration:).

0.10.1 - May 22, 2019

Bug Fixes

  • Multi‐paragraph markdown quotations are parsed correctly.

0.10.0 - May 16, 2019

Breaking Changes

  • The products directory is no longer hard‐coded but instead queried from the package manager. Since releaseProductsDirectory() and related methods can now fail, their return values have been changed to Result.

New Features

  • The documentation of a package declaration can be retrieved directly without loading all the documentation of the entire module.