Skip to content

Commit 726eff2

Browse files
neonichuktoso
andauthored
Add release notes for SwiftPM 5.3 (#2956)
* Add release notes for SwiftPM 5.3 * Update Documentation/ReleaseNotes/5.3.md Co-authored-by: Konrad `ktoso` Malawski <[email protected]> * Add link to README Co-authored-by: Konrad `ktoso` Malawski <[email protected]>
1 parent b736a28 commit 726eff2

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed

Diff for: Documentation/ReleaseNotes/5.3.md

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# SwiftPM 5.3 Release Notes
2+
3+
SwiftPM brings several new features in version 5.3, all of which are opt-in based on the tools-version.
4+
5+
### Conditional dependencies
6+
7+
You can now declare conditions for a Swift package’s target dependencies, such as limiting the dependencies by platform. This gives you more flexibility to describe complex target dependencies that support multiple platforms. (40237402)
8+
9+
```swift
10+
// swift-tools-version:5.3
11+
12+
import PackageDescription
13+
14+
let package = Package(
15+
name: "SamplePackage",
16+
dependencies: [
17+
.package(url: "https://github.com/pureswift/bluetooth", .branch("main")),
18+
.package(url: "https://github.com/pureswift/bluetoothlinux", .branch("main")),
19+
],
20+
targets: [
21+
.target(
22+
name: "SampleExecutable",
23+
dependencies: [
24+
.product(name: "Bluetooth", condition: .when(platforms: [.macOS])),
25+
.product(name: "BluetoothLinux", condition: .when(platforms: [.linux])),
26+
]
27+
),
28+
]
29+
)
30+
```
31+
32+
### Resources
33+
34+
Swift packages can now contain resources such as images, asset catalogs, storyboards, and other files. When Xcode builds an app that depends on a package, it adds the package’s code and resources to the app bundle for use at runtime. For more information see [Bundling Resources with a Swift Package](https://developer.apple.com/documentation/swift_packages/bundling_resources_with_a_swift_package). (54361843)
35+
36+
Any resource in the package can now contain localized content. In addition to localized content in asset catalogs, Xcode supports separate localization files in .lproj folders. For more information see [Localizing Package Resources](https://developer.apple.com/documentation/swift_packages/localizing_package_resources). (56925255)
37+
38+
**Important**: The addition of resource support also changed the inclusion behavior for non-source files in packages. Updating a package tools-version to 5.3, means one has to explicitly declare whether to exclude or process any file whose type is unknown to SwiftPM. This can be done at the file or directory level.
39+
40+
### Binary dependencies
41+
42+
Swift packages can now vend prebuilt libraries distributed as XCFrameworks, allowing dependencies on libraries that can’t be distributed as source code. When Xcode builds an app that uses such a package, it embeds the libraries into the app bundle. For more information see [Distributing Binary Frameworks as Swift Packages](https://developer.apple.com/documentation/swift_packages/distributing_binary_frameworks_as_swift_packages). (56592977)

Diff for: README.md

+2
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ For additional documentation on developing the Swift Package Manager itself, see
3939

4040
For detailed documentation on the package manifest API, see [PackageDescription API](https://docs.swift.org/package-manager/PackageDescription/index.html).
4141

42+
For release notes with information about changes between versions, see [Release Notes](Documentation/ReleaseNotes).
43+
4244
---
4345

4446
## System Requirements

0 commit comments

Comments
 (0)