Xcode doesn't use PBXCustomTemplateMacroDefinitions anymore

Originator:boredzo
Number:rdar://10625110 Date Originated:2011-12-24T14:58-0800
Status:Open Resolved:
Product:Developer Tools Product Version:4.2.1/4D502
Classification:Other Bug Reproducible:Always
 
Summary:
Xcode no longer uses the ORGANIZATIONNAME variable (which is the only documented variable) in the PBXCustomTemplateMacroDefinitions preference, leaving no alternative to the Address Book company field.

Steps to Reproduce:
1. defaults write com.apple.Xcode PBXCustomTemplateMacroDefinitions '{"ORGANIZATIONNAME" = "Joe Blow";}'
2. Create a new project.

Expected Results:
The organization name of the project is set to, and every instance of the organization name in source files, the Info.plist file, and the InfoPlist.strings file(s) is replaced with, “Joe Blow”.

Actual Results:
If a company name is filled in on the user's “Me” card in Address Book, the organization name in all of those places is filled in with that.

If no company name is filled in, the organization name of the project is set to the empty string, and every instance of the organization name in source files, the Info.plist file, and the InfoPlist.strings file(s) is replaced with “__MyCompanyName__”.

Regression:
Yes. Xcode 3 used the PBXCustomTemplateMacroDefinitions preference.

Notes:
The PBXCustomTemplateMacroDefinitions preference is still documented as supported in the Xcode User Default Reference.

Using the company name in Address Book isn't always appropriate:
- The user may work for a software company but want to create a personal project not owned by the company (so declaring “Copyright 2011 My Employer” would be incorrect and potentially legally risky).
- The user may work for or own a company that doesn't do software. Assigning copyright to such a company would be doubly wrong, and just as potentially legally risky.
- The user may own a software company but want to create a personal project not owned by the company. Particularly for contractors, keeping a clear separation between Personal Stuff and Company Stuff is important.

Changing an incorrect value is a hassle, particularly when creating the project with version control, since Xcode will create an initial commit of all of the files with their (potentially inaccurate) template values and doesn't provide a built-in way to amend the commit.

24-Dec-2011 03:03 PM Peter Hosey:
The other syntax doesn't work, either:

defaults write com.apple.Xcode PBXCustomTemplateMacroDefinitions -dict ORGANIZATIONNAME 'Joe Blow'

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!