modelsbuilder/ModelsBuilder.Original

Feature Request - only build doc types that have been amended

Closed this issue · 7 comments

Apologies if this cannot be done or HAS been created and I just can't find the setting, but it would be nice to only build the generated doc types that have been amended. At the moment, the tool builds every doc type, regardless of whether it has been amended or not.

i.e. I update doc type X with a new property. Run ModelsBuilder. Tool picks up that only doc type X has been changed since last build and completes task, doesn't bother trying to generate doc types that haven't been changed.

Could you elaborate on the use case? We do not track the state of each content type, only a global state of all content types. Therefore... in order to only generate code for the changed content types, we would need to implement an additional layer of state tracking (per content type). Wondering what the benefits would be. Is it only for faster generation, or do you have something else in mind?

Ideally, faster generation but also when I go to commit my code, I prefer to only commit the generated models that have been changed, so I need to spend a minute or so discarding the models that have not. It would make it a bit cleaner for others, so that at-a-glance you can see what has been changed.
If the work involved would outweigh the benefits then I understand, it would just be a nice feature. Perhaps it could be something you could switch on and off if you didn't need it?

Mmm... in theory the generated files, if nothing has changed, should be identical. What changes are you seeing?

There are no changes, but the model is generated anyway

Well then... maybe it's me having a slow Monday morning, but if nothing has changed, wouldn't a tool such as Git not report changes, and thus only want you to commit the changed files?

I haven't yet had a coffee, so I'm probably waffling :) I'll take a look at git and see if I can configure git to automatically disregard the unchanged generated files

If using Git... Git should disregard files that haven't changed. Going to close this issue. Don't hesitate to open another issue if you have more details.