Skip to content

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

Merged
merged 16 commits into from
Apr 27, 2023

Conversation

MaxDesiatov
Copy link
Contributor

@MaxDesiatov MaxDesiatov commented Apr 26, 2023

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.

@MaxDesiatov
Copy link
Contributor Author

@swift-ci smoke test

stream.send(
#"""
"swift-dependencies": "\#(masterDepsPath.nativePathString(escaped: true))"
},
Copy link
Contributor Author

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

@MaxDesiatov MaxDesiatov force-pushed the maxd/fix-stream-operator1 branch from eb1c83b to d2970af Compare April 26, 2023 22:24
@MaxDesiatov
Copy link
Contributor Author

@swift-ci smoke test

@MaxDesiatov
Copy link
Contributor Author

@swift-ci test windows

@MaxDesiatov MaxDesiatov force-pushed the maxd/fix-stream-operator1 branch from d2970af to 35d57c7 Compare April 27, 2023 07:57
@MaxDesiatov
Copy link
Contributor Author

@swift-ci smoke test

@MaxDesiatov
Copy link
Contributor Author

@swift-ci test windows

@MaxDesiatov
Copy link
Contributor Author

@swift-ci smoke test

@MaxDesiatov
Copy link
Contributor Author

@swift-ci test windows

@MaxDesiatov
Copy link
Contributor Author

@swift-ci smoke test

@MaxDesiatov
Copy link
Contributor Author

@swift-ci smoke test

@MaxDesiatov
Copy link
Contributor Author

@swift-ci smoke test

@MaxDesiatov
Copy link
Contributor Author

@swift-ci smoke test

@MaxDesiatov
Copy link
Contributor Author

@swift-ci smoke test

@MaxDesiatov
Copy link
Contributor Author

@swift-ci smoke test

@MaxDesiatov
Copy link
Contributor Author

@swift-ci smoke test

…xd/fix-stream-operator1

# Conflicts:
#	Sources/Workspace/InitPackage.swift
@MaxDesiatov
Copy link
Contributor Author

@swift-ci smoke test

@MaxDesiatov
Copy link
Contributor Author

@swift-ci smoke test

@MaxDesiatov
Copy link
Contributor Author

@swift-ci test windows

@MaxDesiatov
Copy link
Contributor Author

@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() })
Copy link
Contributor Author

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.

@MaxDesiatov
Copy link
Contributor Author

@swift-ci smoke test

@MaxDesiatov MaxDesiatov enabled auto-merge (squash) April 27, 2023 20:28
@MaxDesiatov
Copy link
Contributor Author

@swift-ci test windows

@MaxDesiatov MaxDesiatov merged commit 639f9d1 into main Apr 27, 2023
@MaxDesiatov MaxDesiatov deleted the maxd/fix-stream-operator1 branch April 28, 2023 09:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants