-
-
Notifications
You must be signed in to change notification settings - Fork 4
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
Support Swift 6 #91
Support Swift 6 #91
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #91 +/- ##
==========================================
- Coverage 99.66% 99.66% -0.01%
==========================================
Files 47 47
Lines 11520 11519 -1
==========================================
- Hits 11481 11480 -1
Misses 39 39
|
@@ -11,45 +11,85 @@ struct SafeDIGenerateDependencyTree: BuildToolPlugin { | |||
return [] | |||
} | |||
|
|||
let outputSwiftFile = context.pluginWorkDirectory.appending(subpath: "SafeDI.swift") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changes to this file are best viewed with whitespace changes turned off. Apple deprecated a ton of the path-based APIs in Swift 6 / Xcode 16.
@@ -101,9 +158,7 @@ extension Target { | |||
func createBuildCommands( | |||
context: XcodeProjectPlugin.XcodePluginContext, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
somewhat annoyingly, XcodeProjectPlugin.XcodePluginContext
has not been updated at all, and all of its APIs are deprecated. Hopefully an oversight that'll be fixed before Xcode 16.0 goes live.
@@ -417,7 +417,7 @@ actor ScopeGenerator: CustomStringConvertible { | |||
|
|||
private enum GenerationError: Error, CustomStringConvertible { | |||
case erasedInstantiatorGenericDoesNotMatch(property: Property, instantiable: Instantiable) | |||
case dependencyCycleDetected(any Collection<Property>, scope: ScopeGenerator) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any Collection
is not Sendable
, but Array
is
@@ -299,4 +300,4 @@ protocol FileFinder { | |||
|
|||
extension FileManager: FileFinder {} | |||
|
|||
var fileFinder: FileFinder = FileManager.default | |||
@MainActor var fileFinder: FileFinder = FileManager.default |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is still a gross hack... one day we'll fix it.
@@ -38,7 +38,6 @@ final class SafeDIToolCodeGenerationErrorTests: XCTestCase { | |||
for fileToDelete in filesToDelete { | |||
try FileManager.default.removeItem(at: fileToDelete) | |||
} | |||
fileFinder = FileManager.default |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since fileFinder
is bound to the main actor we can't set it in this method.
Happy to take feedback post-merge. We'll also be iterating here as we get closer to Swift 6's actual release + when Xcode 16 is available in CI. |
Gets us running well in Swift 6 language mode.
We'll add CI when Xcode 16 is in CI. For now I'm testing locally.