Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TIMOB-7664] iOS: Allow for custom Info.plist values via tiapp.xml #2053

Merged
merged 5 commits into from Apr 26, 2012
Merged

[TIMOB-7664] iOS: Allow for custom Info.plist values via tiapp.xml #2053

merged 5 commits into from Apr 26, 2012

Conversation

mstepanov
Copy link
Contributor

TIMOB-7664

FT: paste ios section example from JIRA into tiapp.xml. Build/launch in Simulator the app from TiStudio, then open build/iphone/Info.plist file to verify values.

The changes also addresses some Info.plist indentation formatting issues.

@sptramer
Copy link
Contributor

Will CR+FR


plist_props = self.ios['plist']
for prop in plist_props:
self.infoplist_properties[prop] = plist_props[prop]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that doing this does not replace any existing autogenerated values in the property list, or values from the template, such as CFBundleDevelopmentRegion, CFBundleURLName, or CFBundleURLSchemes (neither of which should be replaced). The following values should be considered "static" (immutable) by the <plist> extension, because they are directly controlled by universal tiapp.xml settings:

  • CFBundleURLName
  • CFBundleIdentifier
  • CFBundleInfoDictionaryVersion
  • CFBundlePackageType
  • CFBundleVersion
  • LSRequiresIPhoneOS

The following should be considered "appended to:"

  • CFBundleURLSchemes

The following should be considered "overwrite" (takes precedence over existing deprecated properties):

  • Any value not listed as "static" or "append" above

This list is based upon our existing Info.plist template and tiapp.py#generate_infoplist.

@sptramer
Copy link
Contributor

Code reviewed; please address comments. Our handling of <plist> needs to be significantly more complicated in order to deal with valid autogenerated (or templated) values.

rc.append(node.data)
return ''.join(rc)

ignore_keys = ['CFBundleDevelopmentRegion', 'CFBundleDisplayName', 'CFBundleExecutable', 'CFBundleIconFile',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should be able to toggle CFDevelopmentRegion, since it shouldn't be hardcoded as "English". I'm not sure if this is picked up or modified by tiapp.xml at this time, but it could be at a future point where we improve localization support. For now we'll need to allow modding it.

@sptramer
Copy link
Contributor

Code reviewed; please address comment. This might have to be a temporary change but is necessary until we get better locale support... unless we support it right now and I don't know.

@sptramer
Copy link
Contributor

Code reviewed, APPROVED.

@sptramer
Copy link
Contributor

Functional tested, failed without the <ios> section:

plist_props = self.ios['plist']
KeyError: 'plist'

Left a comment on the source about how to fix this.

'CFBundleIdentifier', 'CFBundleInfoDictionaryVersion', 'CFBundleName', 'CFBundlePackageType', 'CFBundleSignature',
'CFBundleVersion', 'CFBundleShortVersionString', 'LSRequiresIPhoneOS']

self.ios['plist'] = {}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem is if we don't have an <ios> section at all - this doesn't get triggered. One thing that can be done is instead is a has-key check before iterating through the ios plist below.

@sptramer
Copy link
Contributor

Code reviewed, APPROVED.

@sptramer
Copy link
Contributor

Functional tested. Pass. APPROVED.

sptramer pushed a commit that referenced this pull request Apr 26, 2012
[TIMOB-7664] iOS: Allow for custom Info.plist values via tiapp.xml
@sptramer sptramer merged commit 54bac28 into tidev:master Apr 26, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants