jdee/settings-bundle

Additional content

jdee opened this issue · 0 comments

jdee commented

I noticed an app that has not only a version number but also a build date and release date in the settings bundle. The release date is unspecific ("Nov 2016"), so it's probably not something this app would automate. Otherwise you'd have to have a repackaging job to alter the settings bundle after a release candidate passed QA.

At any rate, there are tons of things that this plugin could conceivably add to a settings bundle, like the current time in a specified format. This could indicate one or more additional actions, but now that the action takes a format, it would be possible to generalize the idea. You have to be able to specify an strftime format for times. It wouldn't be hard to support things like:

update_settings_bundle xcodeproj: "MyProject.xcodeproj", key: "BuildTime", format: ":time(%Y-%m-%d)"
update_settings_bundle xcodeproj: "MyProject.xcodeproj", key: "SDKVersion", format: "iOS SDK :sdk_version"
update_settings_bundle xcodeproj: "MyProject.xcodeproj", key: "APIHost", format: "api.example.com"

And so on. The last example is already possible, meaning the others are also possible if you obtain the information yourself, e.g.

update_settings_bundle xcodeproj: "MyProject.xcodeproj", key: "BuildTime", format: Time.now.strftime "%Y-%m-%d"

As long as the value specified doesn't contain :build or :version, it will be updated in the settings bundle plist specified.

Maybe it makes sense to change format: to value: with the understanding that certain symbols will result in substitutions in the value. The format: argument has been changed to value: in anticipation of this change. Additional content may wait until after the initial release, depending on interest.

It might also make sense to make the value: argument required so that for the current functionality, you would use:

The value: argument is now required:

update_settings_bundle xcodeproj: "MyProject.xcodeproj", key: "CurrentAppVersion", value: ":version (:build)"