-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Allow any "Tests"-suffixed directories to be ignored from swift build
.
#16
Conversation
If this pull request is merged into the Swift build tool: swiftlang/swift-package-manager#16 This commit can be reverted.
In general, the ability to filter arbitrary directories would be useful - for example, the package manager currently considers a Unless this is intentional, and the desired practice is to put files in |
If this pull request is merged into the Swift build tool: swiftlang/swift-package-manager#16 This commit can be reverted.
The ability to exclude is planned. Probably this is a correct route however, but I'd like to stew on it and involve @ddunbar in the discussion. |
I think it would be interesting for the "Tests" directory to be the canonical location for test targets and source files. |
I agree with @emish, that specifying The logic for checking for the existence of a suffix gets complicated quickly, as it would need to accept or reject different cases ("Tests" / "tests" / "TESTS") in a way that is consistent with substrings ("Contests" vs. "ConTests" vs. "CONTests"... which ones create a module, and which ones become tests?). Rather than go to the trouble of worrying about all of the possible ways this could break, it's much better for both the developer and the end user to set a simple default convention and provide a way to configure around it. |
In the interest of backwards compatibility with how Xcode tends to encourage layout of files, and considering the huge number of Xcode projects out there that are almost in the right shape, I think we should have some support for this, even if it is opt-in in some easy-ish manner. |
Thank you for reply. P.S. |
@mxcl That's a very good point. One possible solution would be to delegate responsibility for migrating Xcode projects to Xcode itself. This has the advantage of allowing Xcode to make better decisions based on its own knowledge of existing test targets and the directories they use. |
I think the way we should do this is to have an exclusion mechanism, and asap. |
If this pull request is merged into the Swift build tool: swiftlang/swift-package-manager#16 This commit can be reverted.
Fix indentation
Sync with SwiftPM trunk
[pull] swiftwasm from master
According to Documentation/SourceLayouts.md, only directory named "Tests" can be ignored from
swift build
, but Xcode normally generates directory name e.g.MyFrameworkTests
, and I want to ignore this as well.BTW, it will be even better if we can specify test directory names in
Package.swift
😊