Matter Code generation questions

Currently the Matter code generation process is a bit confusing to me. Part of the code needs to be generated before building, using west zap-generate. Another part of the code is generated during the build process. Why is this necessary? Wouldn't it make more sense to generate everything during the build process, so we only need the zap-file as input?

A bit more information in the documentation would also be useful in my opinion. For instance:

  • What is the difference between the .zap and .matter file? Do you need both? Which one do you need when?
  • Is it always okay to just use west zap-generate or is it sometimes necessary to also use west zap-generate --full?
  • Does the zap file determine which Matter version is going to be used (using the featureLevel value)?
Related