Silly question: in Xcode I lost the option to set version and build number for extensions in the app (eg: widgets). I thought this was because they'd be synced automatically, but if I try to build the app I get a warning that their CFBundleVersions don’t match. Do I really have to go into the widget's Build Settings each time and find the line in there to modify now?

@christianselig in case it helps, I have a fastlane action set up to bump the version and build code (it's essentially a shell script)

https://gist.github.com/roostr/35b47a4a4da5a1f3d3894e4d32c7bb6b

Bump the version and build number

Bump the version and build number. GitHub Gist: instantly share code, notes, and snippets.

Gist
@christianselig idk how Xcode expects you to do this but previously we did this by setting a project-scope variable with the base version, and inherited that from all relevant targets
@SmileyKeith @christianselig Ditto. It sucks to go into Build Settings to edit the values, but at least you only have to do it once. (You can also select multiple targets and edit all their Marketing Versions at once, but that’s just an error-prone version of Keith’s suggestion)
@SmileyKeith @christianselig i made this exact change when upgraded to Xcode 15 and it's been working great!
@christianselig best I can tell, yes. I managed to resolve the warning for one extension target by fiddling around in project.pbxproj, but that didn't fix it for everything: https://social.shadowfacts.net/notice/AZhpJaoSvdj7t5Zmds
Ghee Buttersnaps (@[email protected])

I managed to resolve one of the warnings by manually editing the pbxproj and removing all the outdated CURRENT_PROJECT_VERSION's for the extensions. But that didn't fix it for the other extension, ...

@christianselig I ran into the same issue, so added an xcconfig file that just contains MARKETING_VERSION = 1.0.5 to sync it across all targets, then you just need to update it in one place

@finnvoorhees @christianselig I’ve been doing this with all of my apps and it's helped simplify version management.

I also do the same with the build number because I still like having control of it, though it does mean I have to remember to increment it before I archive a new build.

@finnvoorhees Okay I just did this and it's pretty spiffy hahah
@finnvoorhees @christianselig This is the way. You can get ChatGPT to write you a bash one liner, so you can update the xcconfig from the CLI as well.
@christianselig unfortunately the only elegant solution is what @SmileyKeith suggested. I’m not aware of any other way apart from altering all occurrences every time you want to update.
@t0rgh @christianselig we also did this in a xcconfig so it is easy to sed out to bump from a script
@SmileyKeith @t0rgh In the main app target, what do you set the "Version" and "Build” to under General > Identity?
@christianselig @t0rgh to the variable by itself. We split the root version and build number, potentially not required though depending on how you version
@SmileyKeith @christianselig Together with your scripting idea that is actually smarter than what I did.
@christianselig It feels increasingly anachronistic, but I’m still using agvtool to keep versions in sync - https://developer.apple.com/library/archive/qa/qa1827/_index.html.
Technical Q&A QA1827: Automating Version and Build Numbers Using agvtool

QA1827: describes how to auto-increment build and version numbers using agvtool.

@th_in_gs @christianselig same here. Works great. We use this to bump version, build number is set on the fly using agvtool by our CI when archiving.
@christianselig highly recommend using a common xcconfig file for this