-
Notifications
You must be signed in to change notification settings - Fork 105
Add support for attachments to the Foundation cross-import overlay. #819
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 test |
This PR adds experimental support for attachments to some types in Foundation via the (non-functional) cross-import overlay. @stmontgomery is working on setting up said overlay so that it can actually be used; until then, the changes here are speculative only.
e432ce2
to
1421970
Compare
@swift-ci test |
@swift-ci test |
… separate library targets
@swift-ci test |
@swift-ci test |
Sources/Overlays/_Testing_Foundation/Attachments/Attachable+Encodable&NSSecureCoding.swift
Outdated
Show resolved
Hide resolved
Sources/Overlays/_Testing_Foundation/Attachments/Attachable+Encodable&NSSecureCoding.swift
Outdated
Show resolved
Hide resolved
Sources/Overlays/_Testing_Foundation/Attachments/Attachable+Encodable.swift
Show resolved
Hide resolved
Sources/Overlays/_Testing_Foundation/Attachments/EncodingFormat.swift
Outdated
Show resolved
Hide resolved
Sources/Overlays/_Testing_Foundation/Attachments/Attachable+NSSecureCoding.swift
Show resolved
Hide resolved
Sources/Overlays/_Testing_Foundation/Attachments/Attachable+NSSecureCoding.swift
Show resolved
Hide resolved
return (preferredName as NSString).appendingPathExtension("tgz") ?? preferredName | ||
}() | ||
|
||
try await self.init(Data(compressedContentsOfDirectoryAt: url), named: preferredName, sourceLocation: sourceLocation) |
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.
Am I interpreting correctly that for directories, it unconditionally compresses the directory's contents? Could we make the compression step an optional parameter, but enabled by default? (Thinking of scenarios where you're attaching a directory containing files which are already highly compressed.) Maybe disabling that would use .tar
instead of .tgz
?
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 consistent with what XCTest does here: https://developer.apple.com/documentation/xctest/xctattachment/2887210-init
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 can be for a future PR, but I'd like to request we revisit that and consider making it configurable. In general, "XCTest did it this way" isn't the most compelling justification 😛
@swift-ci test |
This PR adds experimental support for attachments to some types in Foundation via the (non-functional) cross-import overlay. @stmontgomery is working on setting up said overlay so that it can actually be used; until then, the changes here are speculative only.
Replaces #799.
Checklist: