-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Add --init mode as proposed in SR-353 #117
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
Good start, thanks. I'll merge soon. |
I really don't like that commands are being slapped on to Some examples to demonstrate my point: Create a new project Create a new project with the name "foo" Create a new project named foo with tests set up These examples may seem convoluted, but they apply in other places as well. Pull dependencies without building Run tests Run the compiled binary Remove build artifacts It's not a huge deal from a user perspective, but as features are added onto SPM, it doesn't make a lot of sense to pile them into a subcommand. Alternatively, Perhaps I should leave my notes elsewhere. |
While I agree that the naming needs some more thought, this commit does not add much more complexity since it's independent of what |
Are there any more concerns related to this commit? Anything I should change? |
Can we move the main code into a new file, call it whatever. |
Sorry, what exactly do you mean by that? Refactor the init case body into its own file, like usage.swift, or do you mean the generated main.swift? |
Yes, refactor the init case into its own file, stick the code in a function. Thanks! 👍🏻 |
which initializes a Swift project with the following structure: ├── .gitignore ├── Package.swift ├── Sources │ └── main.swift └── Tests
Done! |
Add --init mode as proposed in SR-353
[BuildSystem] Directory tree signatures must include path value.
[pull] swiftwasm from master
swift build —initializes a new swift project with the following structure.
.gitignore content:
Package.swift content:
where foo is the name of the working directory
main.swift content:
Discussion points
Naming
maybe —create or —new would work too, but I prefer —init
VCS
the current implementation just creates a .gitignore for convenience, but we might want to discuss that