jamplus/jamplus — pull request #29 by Scraft (2014-08-29 08:48:29+00:00)
Title: Defer adding contents to plist file on C.BundleInfo call

I want to make universal apps; to do this I need UIDeviceFamily to have the array contents 1, 2. If I add:

C.BundleInfo Target : uidevicefamily : 1 2 ;

To my Jamfile, the generated Info.plist has this entry, but higher up in the file it also has UIDeviceFamily set to 1, this is because this gets set by default in macosx.jam - the behaviour of setting this by default is good, as it means the user doesn't have to specify loads of standard Info.plist keys, however the behaviour we want is for the user supplied key/values to override the defaults. This is exactly what this pull request does, instead of building up the Info.plist contents during the C.BundleInfo call, we now just store the key/value/type for each C.BundleInfo call, and then just before writing out the Info.plist we iterate the stored data and write out each key/value - if the same key is specified twice (like in my uidevicefamily case) the second (last) call will take priority.

I have tested this and am now able to make universal apps.

Please let me know if this pull request is a mess; I accidentally created my feature branch from my development branch which was full of other changes; so I had to then rebase my branch, cherry pick the commit, and commit, push and create this pull request. Worse case you really just need to merge/consider this one commit: https://github.com/Scraft/jamplus/commit/27efe664cff61a464a9630a9ea92d068189fc7c7