Xcode Cloud ignores my versioning attempts

Is it possible to control how Xcode Cloud versions the apps it builds? I would like to declare it to use the same template that my build system uses to generate its own Info.plist at build time:

CFBundleVersion: [number of commits since a specific Git tag where I forked the project]

CFBundleShortVersionString: [the same thing]

And I want it to preserve the generated tags that I add to the Info.plist for informational purposes:

GitHash: [the full commit hash that was built]

GitVersion: [number of commits as used above]-g[minimum characters of hash to be unique, currently up to 8 now]

BuildTime: [current date/time when Info.plist was generated near the end of build time]

Is there any way I can automate at least the CFBundleVersion and preserving the rest of the custom tags with Xcode Cloud?

Xcode Cloud unfortunately seems to completely override my version field, and sets it to the first 5 characters of the Git commit hash, which is incompatible with App Store version policy of only being numbers or dots.

Replies

Okay, I figured out what was wrong. Xcode Cloud build system isn't fetching the tags in my repository when pulling it. So I need to add a git fetch --tags to the post clone script.

Okay, nope, it needs to be in the pre xcodebuild script, since the submodules aren't fetched yet.

Oh, drat. I have to --unshallow the repository to get the commit counts. I hope that works.