korsakow/korsakow-editor — pull request #5 by timsutton (2013-12-16 19:59:48+00:00)
Title: Add proper version info to the built OS X app

It's standard practice to define `CFBundleVersion` and/or `CFBundleShortVersionString` in an application bundle's `Info.plist` file. Currently there's a dummy "100.0" value for `CFBundleVersion`.

I've been deploying Korsakow to labs with a software management system, and it's helpful to have actual versions in the app's metadata for comparison purposes. Without this, I resort to taking checksums of jar files in order to be able to uniquely identify an installed version

I've been able to add a couple exec tasks to the build.xml file in order to extract version info from the `build` file in the `resources` directory. I'm not well-versed with Ant or Java in general, so I used the 'property' task to first load in the properties from the `build` properties file, so that I could use the version in a call to `PlistBuddy` afterwards. I did not have any success using proper exec and args for `PlistBuddy`, which has a bizarre syntax requiring a "command string" be passed to the `-c` option. Using `defaults` for manipulating plists instead is possible, but it's not meant to be a plist manipulation tool.

I chose to set `CFBundleShortVersion` because according to [this](https://developer.apple.com/library/ios/documentation/general/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html#//apple_ref/doc/uid/20001431-102364), `CFBundleVersion` shouldn't be longer than 3 digits.