-
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 sources anywhere in ./Sources when only one target is present #6294
Allow sources anywhere in ./Sources when only one target is present #6294
Conversation
09a61c9
to
60c3e7b
Compare
@swift-ci Please smoke test |
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.
Love this change
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.
Should this also be mentioned in CHANGELOG.md
?
Do we need a matching behavior for tests? |
60c3e7b
to
15360c5
Compare
Added to the change log. |
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.
Thanks!
@swift-ci smoke test |
@swift-ci test windows |
15360c5
to
a02f461
Compare
@swift-ci Please smoke test |
a02f461
to
44b00a1
Compare
After getting some feedback about the added `path` argument for executable packages generated with `swift package init` (swiftlang#6144), this change allows a target's sources to occupy the entire "predefined sources directory" (e.g. `Sources`, `Tests`, or `Plugins`) when there is only one target of a specific kind occupying one of those directories in the package. All package types can benefit from this. For example, if there is only one library target and one test target, one can put sources directly in `./Sources` and `./Tests`. Adding another library means that one has to put the sources for TargetA in `./Sources/TargetA` and the sources for TargetB in `./Sources/TargetB`, and so on. When there is more than one target of a type in a package, the existing requirements for target sources still apply. This change should be compatible with existing layouts as well. If there is only a single target in a package, then sources can of course continue to exist exclusively in `./Sources/<target>`, or `./Tests/<testTarget>`, etc. Amend the `executable` and `tool` template's generated manifest to not include the `path` argument anymore as it is no longer needed. With this change, the `library` template type can also put its sources and tests directly in the `./Sources` and `./Tests` directories respectively. All of the above only takes place when the tools version is set to 5.9 or higher in the manifest. rdar://106829666
44b00a1
to
aab4c83
Compare
@swift-ci Please smoke test |
@swift-ci Please test Windows platform |
We can now unwrap a target folder when there's only one target since Swift 5.9's [this change](swiftlang/swift-package-manager#6294).
We can now unwrap a target folder when there's only one target since Swift 5.9's [this change](swiftlang/swift-package-manager#6294).
We can now unwrap a target folder when there's only one target since Swift 5.9's [this change](swiftlang/swift-package-manager#6294).
After getting some feedback about the added
path
argument for executable packages generated withswift package init
(#6144), this change allows a target's sources to occupy the entire sources directory when there is only one target in the package. All package types can benefit from this.When there is more than one target in a package, the existing requirements for target sources still apply.
This change should be compatible with existing layouts as well. If there is only a single target in a package, then sources can of course continue to exist in
./Sources/<target>
.Amend the
executable
template's generated manifest to not include thepath
argument anymore.rdar://106829666