Generated packages in version control

Hello together,

I am developing an application using the AI planner, semantic traits and git version control.
The AI planner and traits package perform code generation which results in new packages being generated in the Packages directory inside the unity project:, generated.semantic.traits, ...

Initially, I decided to exclude those from the version control, as in theory generatable/buildable files should not be included. An additional benefit is that it does not matter if re-generation of the traits/AI planner is forgotten when commiting the changes.

However, this leads to another problem. When pulling/cloning the project on another machine the packages are re-generated with new GUIDs in the .meta files. This leads to missing references, as the generated trait scripts cannot be found due to their new GUID. This does not happen to traits that are already provided by the traits package (e.g. the location trait).

Therefore I am assuming that there must be some way to define the GUIDs in such a way that they are kept on other machines. Unfortunately I dont know how unity packages provided through the package manager deal with this problem.

This leads to my question: is there a better solution than just commiting the generated packages including the.meta files?


I would commit a zip with the meta files only and replace them once the packages are generated.

Similar to the above you could commit the .meta files only for the generated files and just revert any changes to those on new clones. Might require a reimport after though.

1 Like

So it seems that commiting the generated (or at least the corresponding .meta files) is the only option at the moment.
That is also how it is done in the AI planner samples:

Thanks for your comments on this topic!