-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Init template cleanup #6144
Init template cleanup #6144
Conversation
@swift-ci Please test |
@swift-ci Please smoke test |
Improve the `swift package init` experience using the following criteria: - Simplify the templates to include only the minimum necessary to get started without making assumptions. - Use documentation links instead of arbitrary template content to teach people about Swift. - Improve the "front door" experience with the help usage. Detailed list of changes: - Remove the `system-module` template. - Remove the `manifest` template - it's emptier than `empty` and isn't providing a lot of value on its own. Make the `empty` template only generate a manifest instead. - Remove README generation. - Don't generate empty directories. - Don't emit empty dependencies array in manifests. - Update `library` template content: - Remove struct definition, use a simple public function instead. - Include documentation links for TSPL and the Standard Library. - Include documentation links for XCTest in the generated test case. - Update `executable` template content - Use simpler top-level code instead of an `@main` struct. - Remove executable tests. - Put sources directly in `./Sources`. - Clean up and align `type` argument help text - Update Usage.md documentation - Update CHANGELOG to reflect init template changes in swiftlang#6144 rdar://98999734
04ef2f3
to
b574df1
Compare
Improve the `swift package init` experience using the following criteria: - Simplify the templates to include only the minimum necessary to get started without making assumptions. - Use documentation links instead of arbitrary template content to teach people about Swift. - Improve the "front door" experience with the help usage. Detailed list of changes: - Remove the `system-module` template. - Remove the `manifest` template - it's emptier than `empty` and isn't providing a lot of value on its own. Make the `empty` template only generate a manifest instead. - Remove README generation. - Don't generate empty directories. - Don't emit empty dependencies array in manifests. - Update `library` template content: - Remove struct definition, use a simple public function instead. - Include documentation links for TSPL and the Standard Library. - Include documentation links for XCTest in the generated test case. - Update `executable` template content - Use simpler top-level code instead of an `@main` struct. - Remove executable tests. - Put sources directly in `./Sources`. - Clean up and align `type` argument help text - Update Usage.md documentation - Update CHANGELOG to reflect init template changes in swiftlang#6144 rdar://98999734
b574df1
to
079a811
Compare
Improve the `swift package init` experience using the following criteria: - Simplify the templates to include only the minimum necessary to get started without making assumptions. - Use documentation links instead of arbitrary template content to teach people about Swift. - Improve the "front door" experience with the help usage. Detailed list of changes: - Remove the `system-module` template. - Remove the `manifest` template - it's emptier than `empty` and isn't providing a lot of value on its own. Make the `empty` template only generate a manifest instead. - Remove README generation. - Don't generate empty directories. - Don't emit empty dependencies array in manifests. - Update `library` template content: - Remove struct definition, use a simple public function instead. - Include documentation links for TSPL and the Standard Library. - Include documentation links for XCTest in the generated test case. - Update `executable` template content - Use simpler top-level code instead of an `@main` struct. - Remove executable tests. - Put sources directly in `./Sources`. - Clean up and align `type` argument help text - Update Usage.md documentation - Update CHANGELOG to reflect init template changes in swiftlang#6144 rdar://98999734
079a811
to
cc0c708
Compare
@swift-ci Please smoke test |
Improve the `swift package init` experience using the following criteria: - Simplify the templates to include only the minimum necessary to get started without making assumptions. - Use documentation links instead of arbitrary template content to teach people about Swift. - Improve the "front door" experience with the help usage. Detailed list of changes: - Remove the `system-module` template. - Remove the `manifest` template - it's emptier than `empty` and isn't providing a lot of value on its own. Make the `empty` template only generate a manifest instead. - Remove README generation. - Don't generate empty directories. - Don't emit empty dependencies array in manifests. - Update `library` template content: - Remove struct definition, use a simple public function instead. - Include documentation links for TSPL and the Standard Library. - Include documentation links for XCTest in the generated test case. - Update `executable` template content - Use simpler top-level code instead of an `@main` struct. - Remove executable tests. - Put sources directly in `./Sources`. - Clean up and align `type` argument help text - Update Usage.md documentation - Update CHANGELOG to reflect init template changes in swiftlang#6144 rdar://98999734
cc0c708
to
ff2ba73
Compare
@swift-ci Please smoke test |
Improve the `swift package init` experience using the following criteria: - Simplify the templates to include only the minimum necessary to get started without making assumptions. - Use documentation links instead of template content to teach people about Swift. - Improve the "front door" experience with the help usage. Detailed list of changes: - Remove the `system-module` template. - Remove the `manifest` template - Add a new `tool` template, an executable that uses ArgumentParser a manifest instead. - Remove README generation. - Don't generate empty directories. - Don't emit empty dependencies array in manifests. - Update `library` template content: - Remove struct definition, use a simple public function instead. - Include documentation links for TSPL and the Standard Library. - Include documentation links for XCTest in the generated test case. - Update `executable` template content - Use simpler top-level code instead of an `@main` struct. - Remove executable tests. - Put sources directly in `./Sources`. - Clean up and align `type` argument help text - Update Usage.md documentation - Update CHANGELOG to reflect init template changes in swiftlang#6144 rdar://98999734
ff2ba73
to
8748e9e
Compare
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, Ashley.
This is looking great, we should give the forum post a couple of days to see if any interesting feedback will be provided by the community, but otherwise good to merge.
@swift-ci Please smoke test |
Looks good - here is the forum thread since I didn't see it referenced here (may have just missed it): https://forums.swift.org/t/update-to-swift-package-init-templates/63145/8 |
@bitjammer @TimTr is this ready to be merged? do you feel we collected enough feedback from the community? |
@tomerd and @bitjammer I think we're good to merge. Post is live for a week now. |
Improve the `swift package init` experience using the following criteria: - Simplify the templates to include only the minimum necessary to get started without making assumptions. - Use documentation links instead of template content to teach people about Swift. - Improve the "front door" experience with the help usage. Detailed list of changes: - Remove the `system-module` template. - Remove the `manifest` template - Add a new `tool` template, an executable that uses ArgumentParser a manifest instead. - Remove README generation. - Don't generate empty directories. - Don't emit empty dependencies array in manifests. - Update `library` template content: - Remove struct definition, use a simple public function instead. - Include documentation links for TSPL and the Standard Library. - Include documentation links for XCTest in the generated test case. - Update `executable` template content - Use simpler top-level code instead of an `@main` struct. - Remove executable tests. - Put sources directly in `./Sources`. - Clean up and align `type` argument help text - Update Usage.md documentation - Update CHANGELOG to reflect init template changes in swiftlang#6144 rdar://98999734
Missed this when it was posted in the forums but I think some of the changes are a bit of a miss-step here. Responded in the forums (https://forums.swift.org/t/update-to-swift-package-init-templates/63145) cc @FranzBusch |
Motivation: SwiftPM has changed its default layout for packages in swiftlang/swift-package-manager#6144. This breaks our CI, which assumes the prior layout. We should work around this. Modifications: Enhance the code to tolerate both layouts. Result: Integration tests run on all platforms
Motivation: SwiftPM has changed its default layout for packages in swiftlang/swift-package-manager#6144. This breaks our CI, which assumes the prior layout. We should work around this. Modifications: Enhance the code to tolerate both layouts. Result: Integration tests run on all platforms
Motivation: SwiftPM has changed its default layout for packages in swiftlang/swift-package-manager#6144. This breaks our CI, which assumes the prior layout. We should work around this. Modifications: Enhance the code to tolerate both layouts. Result: Integration tests run on all platforms
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 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 the `path` argument anymore. rdar://106829666
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 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 the `path` argument anymore. rdar://106829666
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 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 the `path` argument anymore. rdar://106829666
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 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 the `path` argument anymore. rdar://106829666
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 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 the `path` argument anymore. rdar://106829666
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
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
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
…6294) After getting some feedback about the added `path` argument for executable packages generated with `swift package init` (#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
Improve the
swift package init
experience using the following criteria:Detailed list of changes:
system-module
template.manifest
templatetool
template, an executable that usesArgumentParser
library
template content:executable
template content@main
struct../Sources
.type
argument help textrdar://98999734
Example resulting file listing
Resulting command line usage