Skip to content
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

Proposal: auto run xcode gen when a file is created #7

Closed
ceopaludetto opened this issue Apr 12, 2024 · 6 comments
Closed

Proposal: auto run xcode gen when a file is created #7

ceopaludetto opened this issue Apr 12, 2024 · 6 comments

Comments

@ceopaludetto
Copy link

My current workflow is pretty god. But, it's kinda sad to rerun both xcode gen and xcode-build-server on every new file created, so it would be awesome if on every newly created file the extension automatically rerun xcode gen for us (to automatically insert the newly created file into the .xcodeproj stuff)

@hyzyla
Copy link
Collaborator

hyzyla commented Apr 12, 2024

Hello 👋

Thanks for the feedback! When you are saying about xcode gen do you mean this tool https://github.com/yonaskolb/XcodeGen ? I'm thing of introducing automatic sync of files with groups, as I understand it will help Xcode project to see file as part of your project

@ceopaludetto
Copy link
Author

Thank you for the quick support and the amazing job done in the extension

When you are saying about xcode gen do you mean this tool https://github.com/yonaskolb/XcodeGen?

Yes. As far as I know, the only way to include files created outside of Xcode into the project is by using solutions like XcodeGen and Tuist right? So every time I create a new file, I run XcodeGen and xcode-build-server again

I'm thing of introducing automatic sync of files with groups, as I understand it will help Xcode project to see file as part of your project

This would be awesome

@hyzyla
Copy link
Collaborator

hyzyla commented Apr 12, 2024

Yeah, it definitely on my todo list.

First idea is to give option in settings that will start background logic that will monitor for new files in project and will sync groups and files on disk.

Another idea is give some tool for manage groups: add/remove new files to the group, create new group and so on. But I'm not sure how much people use groups that differs from file system structure on disk

@hyzyla
Copy link
Collaborator

hyzyla commented Apr 14, 2024

@ceopaludetto, hello!

I've added a new VSCode command to generate an Xcode project using XcodeGen:

  1. Open the command palette "⌘ + P".
  2. Enter: > SweetPad: Generate Xcode project with XcodeGen

Currently, you have to run it manully, but I'm considering adding some logic to run it automatically when files change in the future. Also, I'm looking for ideas on how to improve XcodeGen integration with VSCode, so let me know if you have any.

⚠️ Additionally, I discovered that the author of xcode-build-server recently added experimental support for indexing new files without rebuilding whole project. You can see my comment on how to setup workflow link and provide some feeback if you have some problems with it.

Let me know, if it works for you 🤝

@ceopaludetto
Copy link
Author

@ceopaludetto, hello!

I've added a new VSCode command to generate an Xcode project using XcodeGen:

  1. Open the command palette "⌘ + P".
  2. Enter: > SweetPad: Generate Xcode project with XcodeGen

Currently, you have to run it manully, but I'm considering adding some logic to run it automatically when files change in the future. Also, I'm looking for ideas on how to improve XcodeGen integration with VSCode, so let me know if you have any.

⚠️ Additionally, I discovered that the author of xcode-build-server recently added experimental support for indexing new files without rebuilding whole project. You can see my comment on how to setup workflow link and provide some feeback if you have some problems with it.

Let me know, if it works for you 🤝

Hello!

Amazing! the command will speed up the things here. But, I was thinking yesterday on some solutions without having to listen the file changes(this seems to be very difficult to implement reliably), so I've remember that almost every developer rebuild his projects to check changes. For now maybe an options to run xcodegen before xcodebuild everytime I hit the start button in the extension panel would be awesome, this combined with the xcode-build-server thing that you mentioned will almost be the same experience xcode users have right? What you think?

Thank you for the support

@hyzyla
Copy link
Collaborator

hyzyla commented Apr 21, 2024

@ceopaludetto I've published a new version of the extension (0.1.11) with the new config sweetpad.xcodegen.autogenerate:

Watch for new .swift files and regenerate the project using XcodeGen. Restart VSCode to apply the settings.

To use it:

  1. Update the extension.
  2. Add "sweetpad.xcodegen.autogenerate": true to your .vscode/settings.json VS Code config file.
  3. Restart VSCode.

The extension will monitor for new **/*.swift files and changes in project.yaml and will regenerate the Xcode project if there are any changes.

@hyzyla hyzyla closed this as completed May 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants