Re: Project templates & encoding
Re: Project templates & encoding
- Subject: Re: Project templates & encoding
- From: Motti Shneor <email@hidden>
- Date: Thu, 19 Nov 2009 08:49:47 -0500
- Acceptlanguage: en-US
- Thread-topic: Project templates & encoding
Hello everyone.
On Wed, Oct 28, 2009 at 7:46 PM, Chris Espinosa <email@hidden<mailto:email@hidden>> wrote:
The old way of building templates used an unusual methodology of embedding MacRoman guillamet characters ( ? and ? ) in otherwise UTF-8 files. This made them illegal in both encodings.
The modern way of building project templates is to use ___MACRONAME___ expansions instead of ?MACRONAME?. This is triggered by using them in the template file itself; see any Xcode 3.2 template for an example. Files using this method don't have embedded MacRoman characters and are implicitly UTF-8.
Chris
I'm trying to decipher the template-compilation mechanism of XCode, as there is absolutely no official documentation anywhere. It's not nice, especially that these templates are such a powerful tool.
I searched the internet and read thoroughly the templates built into XCode, and learned a lot.
Yet, I have no comprehensive list of the AVAILABLE features of the system. For example, I know I can put checkboxes and pop-up menus in the TemplateChooser.plist, I was even able to choose one of my templates using that. but I don't know If I can combine the methods, and what MORE I can put there except checkboxes and pop-up menus.
There isn't even a list of standard Macros supported by XCode anywhere.
Regarding the specific note from Chris, (Well thanks a lot for this clarification! I was going nuts trying to understand why the two different formats of Macro reference in templates, and what are the differences).
My first question: Are these two Macro-Reference formats equivalent?
Specifically, do the new ___MACRONAME___ macro references obey the "FilesToMacroExpand" entry in the TemplateInfo.plist (within a template project bundle)? Can I substitute the original format TemplateInfo.plist (with its strange MacRoman guillamet characters)
{
FilesToRename = {
"TemplateFS.1" = "«PROJECTNAME».1";
"TemplateFS.c" = "«PROJECTNAMEASIDENTIFIER».c";
};
FilesToMacroExpand = (
"«PROJECTNAME».xcodeproj/project.pbxproj",
"«PROJECTNAME».1",
"main.c",
"«PROJECTNAMEASIDENTIFIER».c",
);
Description = "This project builds a command-line MacFUSE file system written in C.";
}
With the new format?
{
FilesToRename = {
"TemplateFS.1" = "___PROJECTNAME___.1";
"TemplateFS.c" = "___PROJECTNAMEASIDENTIFIER___.c";
};
FilesToMacroExpand = (
"___PROJECTNAME___.xcodeproj/project.pbxproj",
"___PROJECTNAME___.1",
"main.c",
"___PROJECTNAMEASIDENTIFIER___.c",
);
Description = "This project builds a command-line MacFUSE file system written in C.";
}
This example comes from some open source template.
My second question. I see that the "FilesToRename" token is completely missing from the new templates in XCode 3.2, in favor of inserting macro references in the template file names. This is not so good for me, because I need to use a living project (from which a product is being built) as my template, and so I need its file names to remain unaltered. For that, the "FilesToRename" serves better than the macro'ed file names.
Thanks for any hint/link/insight.
Motti Shneor
------------------------------------------
Senior Software Engineer
Waves Audio ltd.
Phone: +972-3-6094415
Mobile: +972-54-4470730
[mailto: email@hidden]
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden