creating symlinks

4 views
Skip to first unread message

Aaron VonderHaar

unread,
Apr 14, 2009, 4:48:44 AM4/14/09
to RubiGen
Hi, I've been playing with creating rubigen generators to generate
iPhone and Mac applications, and in doing that I've wanted to make a
generator that will generate a framework bundle. Bundles include
symlinks, and I wasn't able to get rubigen to copy symlinks.

This fails:

# In my generator:
# MyFramework.framework/Headers is a symlink to the folder "Versions/
Current/Headers"
m.file_copy_each ["MyFramework.framework/Headers"]

Attempt #1: I modified rubigen to correctly copy symlinks
http://github.com/avh4/rubigen/commit/d0af0093e8e8303a70c103457ad5057fee90257c

However, this doesn't really solve anything since adding a symlink to
my generator gem's manifest fails to include the symlink in the gem
package. (Perhaps there is a way to include symlinks in a gem package
that I am unaware of?)

So attempt #2: I added a symlink command to rubigen
http://github.com/avh4/rubigen/commit/846b1dacc47813a9cfe29a78a544273a4af8d68d
(Only partially complete-- it doesn't handle error conditions or
destroy commands yet.)

# Now in my generator:
m.symlink "Version/Current/Headers", "MyFramework.framework/Headers"

I'm not sure I like this, since I am now putting in code what I'd
really like to have in the file contents of my template folder.


So, ultimately, I'd like to have some method of generating symlinks
incorporated into rubigen. Is there perhaps already a way to do this
that I've overlooked? And if not, what do you think of my attempts?
I also thought of a third possibility: having an unzip command that
would allow me to have a zip or tgz archive file in my templates
folder which the generator could extract, and the symlinks could be
contained inside the archive.

Cheers,
--Aaron V.


Reply all
Reply to author
Forward
0 new messages