Swift package manifest cheatsheet; Swift Package Manager Usage
From Swift package manifest cheatsheet how to set difines directly in Package.swift
:
swiftSettings: [
.define("DEBUG"),
.define("DEBUG", .when(platforms: [.iOS, .macOS, .tvOS, .watchOS], configuration: .debug)),
.unsafeFlags(["-D EXAMPLE"]),
.unsafeFlags(["-D EXAMPLE"], .when(platforms: [.iOS], configuration: .debug)),
]
Immediately used in in swift-png to pass NO_INTRINSICS
on Windows.
Cool that swift package could depend on libraries which could be installed with brew
or apt
.
Read All about the Swift Package Manager and the Swift toolchain. Mess. But there’re interesting finding:
swift lol
error: unable to invoke subcommand:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-lol
(No such file or directory)
swift build
,run
,test
subcommands are just another Swift binary executables placed inside the toolchain’s binary path. (Named like:swift-package
,swift-build
,swift-run
,swift-test
).
People do things like swift-ci, CI written in Swift.
Browsed Swift Package Manager Usage. I did missed that such documentation exists. Why there’s no direct link to it from README.md? Learned about swift package resolve
.