NijiDigital / gyro

Tool to generate Realm.io models for Swift, Java & ObjC from xcdatamodel and its visual Xcode editor
Apache License 2.0
93 stars 15 forks source link

Support alias names for bundled templates #49

Closed AliSoftware closed 6 years ago

AliSoftware commented 6 years ago

This new feature allows us to create alias names for existing templates.

To create an alias template, simply create a text file named <alias_name>.alias whose first line just contains exactly the name of the template to point to. Note: Any text after the first line of this *.alias files is ignored, so the next lines in the file can be used as comments if necessary.

Introducing android-java and swift4 template names

This feature allowed us to:

This PR also closes #29

Terminal Screenshot showing the result of "gyro -l"

StevenWatremez commented 6 years ago

I have a question about alias for custom path. Do you want to authorize creating custom alias for custom templates or not ?

Actually we have two resolution methods for templates. Template.find_by_path(path) and Template.find_by_name(name), this last method implement alias resolution but not the first.

AliSoftware commented 6 years ago

I have a question about alias for custom path. Do you want to authorize creating custom alias for custom templates or not ?

I wondered about that but I don't see how that would work or be useful. I mean, if you have custom templates anyway: they'll only work for your machine / your project because you'll have to have the custom templates you created on the machine to run gyro. So if that's templates that you created yourself, you can give them whatever name you want, right?