yonaskolb / XcodeGen

A Swift command line tool for generating your Xcode project
MIT License
6.9k stars 811 forks source link

File watcher #8

Open yonaskolb opened 6 years ago

yonaskolb commented 6 years ago

An optional file watcher that automatically regenerates the project when file system changes. Should be able to specify watched files with a glob

pepicrft commented 6 years ago

I think you could use this for that purpose https://github.com/facebook/watchman. But thinking about it, don't you think it'd be quite hard to work with the project?

yonaskolb commented 6 years ago

Yes, if it kept re-gening the project from under you when you make any changes in xcode, that would be annoying. It would have to be smart, so that only changes you make to the file system and NOT in xcode would generate the project. It would do this by watching the file system and the project at the same time.

What would probably be more useful is to simply watch the spec file for changes and regen on changes. That could use a simpler file watching dependency like https://github.com/krzysztofzablocki/KZFileWatchers which is what I use in a new open source project https://github.com/yonaskolb/Stylist

yonaskolb commented 6 years ago

This is to support automatically generating the project if you do a git checkout and there are file system or spec changes.

It's either that or run a post-checkout git hook that always generates the project

LinusU commented 6 years ago

I'm currently having problems when adding new files when working. My Makefile cannot (currently) pick up new files being added, and thus doesn't trigger a new generation of the Xcode project.

I would love it if XcodeGen would be able to detect new files in the source directories, and then just regenerate the project automatically 😍