-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Fix some stream operator deprecation warnings #6487
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
Conversation
@swift-ci smoke test |
stream.send( | ||
#""" | ||
"swift-dependencies": "\#(masterDepsPath.nativePathString(escaped: true))" | ||
}, |
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.
some lines in the string output here used 2-space indentation inconsistently, preserving just in case
eb1c83b
to
d2970af
Compare
@swift-ci smoke test |
@swift-ci test windows |
Addresses some of the deprecations introduced in swiftlang/swift-tools-support-core#413
d2970af
to
35d57c7
Compare
@swift-ci smoke test |
@swift-ci test windows |
@swift-ci smoke test |
@swift-ci test windows |
@swift-ci smoke test |
@swift-ci smoke test |
@swift-ci smoke test |
@swift-ci smoke test |
@swift-ci smoke test |
@swift-ci smoke test |
@swift-ci smoke test |
…xd/fix-stream-operator1 # Conflicts: # Sources/Workspace/InitPackage.swift
@swift-ci smoke test |
@swift-ci smoke test |
@swift-ci test windows |
@swift-ci smoke test |
@@ -302,10 +302,6 @@ extension FileSystem { | |||
public func writeFileContents(_ path: AbsolutePath, string: String) throws { | |||
return try self.writeFileContents(path, bytes: .init(encodingAsUTF8: string)) | |||
} | |||
|
|||
public func writeFileContents(_ path: AbsolutePath, provider: () -> String) throws { | |||
return try self.writeFileContents(path, body: { stream in stream <<< provider() }) |
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 version that was using a stream operator created all parent directories of path
if those didn't exist, which is inconsistent with the other overloads. This version feels quite redundant to writeFileContents(_ path: AbsolutePath, string: String)
, so I've cleaned it up and adjusted tests to create parent directories when needed.
@swift-ci smoke test |
@swift-ci test windows |
Addresses some of the deprecations introduced in swiftlang/swift-tools-support-core#413.
Also using this as an opportunity to use string interpolation and raw string literals to make this more readable.
Leaving warnings in
GenerateLinuxMain
untouched and to be addressed in #6490.