Setting copyright statement on a per-project basis?
Asked Answered
C

4

9

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).

Crabby answered 13/6, 2009 at 16:59 Comment(0)
L
3

Upgrade to Xcode 3.2, which now has a project setting for organization name.

Likker answered 6/5, 2010 at 23:37 Comment(0)
K
5

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.

Kooky answered 14/6, 2009 at 8:36 Comment(2)
Can you be more specific? Where would I place these scripts? How would I trigger them to run? I'd really like a system that's as painless as possible - running a script before each project switch is almost as bad as typing the command myself each time.Crabby
You could add the command as a build script so it will be dependent on your Xcode project file. But then you first have to build the project before adding any new files which might not be what you want.Kooky
L
3

Upgrade to Xcode 3.2, which now has a project setting for organization name.

Likker answered 6/5, 2010 at 23:37 Comment(0)
W
2

You might want to make custom templates. Have a look at this question: Change templates in Xcode

Wives answered 14/6, 2009 at 22:4 Comment(0)
C
0

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.

//  ___FILENAME___
//  ___PACKAGENAME___
//
//  Created by ___FULLUSERNAME___ on ___DATE___.
//  ___COPYRIGHT___
//
Coaler answered 9/8, 2017 at 14:22 Comment(1)
Where is the "text macros section" exactly?Neusatz

© 2022 - 2024 — McMap. All rights reserved.