针对每个项目设置版权声明?
我是一名独立开发人员,主要从事 iPhone 应用程序的工作,目前正在从事几个不同的项目。 有些是给我自己的,有些是给众多客户之一的。 因此,我希望有一种方法可以让 Xcode 在每个项目的每个源文件的顶部设置版权声明。
我见过这些问题,我了解 Xcode默认情况下,会在用户的地址簿联系人卡片上提取版权声明的组织,并且您可以在地址簿中或在终端上更改该属性。 我正在寻找的是一个设置,允许为每个项目更改默认值,并且让 Xcode 记住版权受让人(即,我不想每次切换项目时都必须更改我的地址簿组织条目)。
I'm an independent developer working primarily with iPhone applications, and I'm currently engaged in several different projects. Some are for myself, and others are for one of a number of clients. Because of this, I'd like to have a way to have Xcode set the copyright notice at the top of each source file on a per-project basis.
I've seen these questions, and I understand that Xcode by default pulls the organization on the user's Address Book contact card for the copyright statement, and that you can change the property either in the Address Book or on the terminal. What I'm looking for is a setting that lets that default be changed for each project, and has Xcode remember the copyright assignee (i.e. I don't want to have to change my Address Book organization entry each time I switch projects).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您可以通过在终端中发出以下命令来更改 Xcode 当前使用的组织:
defaults write com.apple.Xcode PBXCustomTemplateMacroDefinitions '{ORGANIZATIONNAME = "Some Company Name"; 然后
,您可以创建用于切换 Xcode 当前公司的脚本。
You can change the organization Xcode currently uses by issuing the following command in Terminal:
defaults write com.apple.Xcode PBXCustomTemplateMacroDefinitions '{ORGANIZATIONNAME = "Some Company Name"; }'
You can then create scripts that switch the current company for Xcode.
升级到 Xcode 3.2,现在有组织名称的项目设置。
Upgrade to Xcode 3.2, which now has a project setting for organization name.
您可能想要制作自定义模板。 看看这个问题:
更改 Xcode 中的模板
You might want to make custom templates. Have a look at this question:
Change templates in Xcode
查看文本宏部分:
通过设置 FILEHEADER 文本宏的值来更改用于新文件标题的文本。
该示例显示了宏的默认定义。 其他宏通过在宏名称前后包含三个下划线 (___) 字符来包含在定义中。 仅当设置了组织名称时,才会包含 COPYRIGHT 行。
look in text macros section:
Change the text used for the header of a new file by setting the value of the FILEHEADER text macro.
The example shows the default definition for the macro. Other macros are included in the definition by including three underscore (___) characters before and after the name of the macro. The line with COPYRIGHT is included only if an organization name is set.