Any interest in built-in templates? #79

Closed
wants to merge 1 commit into
from

Projects

None yet

2 participants

@iriz

You may or may not be interested in this update I just commited:

Compile and build the default templates into the mogenerator
executable, to make it standalone for people (like me) who are happy
with the default templates. For custom installed templates everything
of course works as before.

I do this with a custom build rule script that generates a .m file for each template,
containing an NSString with the template text. This string then becomes the
final fallback for the template search.

Ingvar Nedrebo Build default templates into executable
Compile and build the default templates into the mogenerator
executable, to make it standalone for people (like me) who are happy
with the default templates. For custom installed templates everything
works as before.
023cb82
@rentzsch
Owner

Oops, I overlooked this one.

I like the idea of building default templates into the tool itself, but I think a better way would be to house them in mogenerator's binary as a Mach-O section, see http://stackoverflow.com/questions/7780789/reading-data-embedded-plist-linked-to-executable-through-sectcreate-text for how Apple embeds Info.plist's into standalone binaries.

I think we can do the same with mogenerator.

@iriz

Interesting approach. I have implemented your suggestion, using the PlistBuddy tool to add the templates to Info.plist and then link that into the executable. I'll tidy up and commit in the next couple of days, so you can have a look and see what you think.

@rentzsch
Owner

Cool, thanks.

@iriz

I have committed the Info.plist approach. There is an issue there, which is that I cannot find a way in Xcode to make the executable depend on the Info.plist file so that it's relinked when the file changes. Which means that if you make changes to any of the templates, and hit Build, the Info.plist file will be updated but not the tool.

For that reason, rather than pushing to master I created a branch: "infoplist". master still has my first approach, which does not have this dependency issue.

@rentzsch
Owner

Sorry I'm dragging my feet on this one -- I've been rather busy,

FYI I'll take a look at your fork and hopefully it can make v1.25.

@iriz

No worries.

This was referenced Feb 17, 2012
@rentzsch
Owner

Included in 1.26.

@rentzsch rentzsch closed this Apr 13, 2012
@iriz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment