Skip to content

[5.9] Rearrangement in preparation for 5.9 branching #6335

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,21 @@ Note: This is in reverse chronological order, so newer entries are added to the
Swift Next
-----------

* [#5966]

Plugin compilation can be influenced by using `-Xbuild-tools-swiftc` arguments in the SwiftPM command line. This is similar to the existing mechanism for influencing the manifest compilation using `-Xmanifest` arguments. Manifest compilation will also be influenced by `-Xbuild-tools-swiftc`, but only if no other `-Xmanifest` arguments are provided. Using `-Xmanifest` will show a deprecation message. `-Xmanifest` will be removed in the future.

* [#5728]

In packages that specify resources using a future tools version, the generated resource bundle accessor will import `Foundation.Bundle` for its own implementation only. _Clients_ of such packages therefore no longer silently import `Foundation`, preventing inadvertent use of Foundation extensions to standard library APIs, which helps to avoid unexpected code size increases.

* [#6185], [#6200]

Add a new `CompilerPluginSupport` module which contains the definition for macro targets. Macro targets allow authoring and distribution of custom Swift macros such as [expression macros](https://github.com/apple/swift-evolution/blob/main/proposals/0382-expression-macros.md).

Swift 5.9
-----------

* [#5966]

Plugin compilation can be influenced by using `-Xbuild-tools-swiftc` arguments in the SwiftPM command line. This is similar to the existing mechanism for influencing the manifest compilation using `-Xmanifest` arguments. Manifest compilation will also be influenced by `-Xbuild-tools-swiftc`, but only if no other `-Xmanifest` arguments are provided. Using `-Xmanifest` will show a deprecation message. `-Xmanifest` will be removed in the future.

* [#6067]

Basic support for a new `.embedInCode` resource rule which allows embedding the contents of the resource into the executable code by generating a byte array, e.g.
Expand All @@ -21,9 +28,6 @@ Swift Next
}
```

Swift 5.9
-----------

* [#6294]

When a package contains a single target, sources may be distributed anywhere within the `./Sources` directory. If sources are placed in a subdirectory under `./Sources/<target>`, or there is more than one target, the existing expectation for sources apply.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:5.9
// swift-tools-version:999.0
import PackageDescription

let package = Package(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:5.9
// swift-tools-version:999.0
import PackageDescription

let package = Package(
Expand Down
2 changes: 1 addition & 1 deletion Fixtures/Resources/EmbedInCodeSimple/Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version: 999.0
// swift-tools-version: 5.9

import PackageDescription

Expand Down
2 changes: 1 addition & 1 deletion Sources/PackageDescription/Resource.swift
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public struct Resource {
}

/// Applies the embed rule to a resource at the given path.
@available(_PackageDescription, introduced: 999.0)
@available(_PackageDescription, introduced: 5.9)
public static func embedInCode(_ path: String) -> Resource {
return Resource(rule: "embedInCode", path: path, localization: nil)
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/PackageModel/PackageModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ extension Manifest {
return self.toolsVersion >= .v5_8
}
public var usePackageNameFlag: Bool {
return self.toolsVersion >= .v5_9
return self.toolsVersion >= .vNext
}
}

Expand Down