Skip to content

This codegenerator is too brilliant to be real!

License

Notifications You must be signed in to change notification settings

surfstudio/Generamba

 
 

Repository files navigation

Build Status Gem Version Code Climate

Generamba is a code generator made for working with Xcode. Primarily it is designed to generate VIPER modules but it is quite easy to customize it for generation of any other classes (both in Objective-C and Swift).

We keep evolving Generamba:

About this fork

Original Generamba cannot create files without adding them to .xcodeproj structure. So it is impossible to generate code inside SPM packages, for example. This fork has these key differences:

  • Fields project_name, xcodeproj_path, project_targets in Rambafile are now optional. It means no Xcode dependency - files can be created anywhere!
  • Separate options project_xcodeproj_path and test_xcodeproj_path instead of single xcodeproj_path. Code files can be located in SPM package while test files – in Xcode project. In this case only test_xcodeproj_path should be present in Rambafile.
  • project_xcodeproj_path, project_targets, test_xcodeproj_path options can now be placed as command line arguments so that different templates in your project can have different generation behavior. It also enables support for projects where child modules are Xcode projects nested in single Xcode Workspace.
  • --no_module_root_directory command line flag. Original Generamba always creates module files in a new directory named same as your module. This flag disables grouping new module files in a separate directory.

Key features

  • Supports work with .xcodeproj files out of the box. All generated class files are automatically placed to specific folders and groups of Xcode project.
  • Can generate both code itself and tests adding them to right targets.
  • Based on work with liquid-templates that have plain and readable syntax in comparison with templates for Xcode.
  • It is very easy to create a new module: generamba gen [MODULE_NAME] [TEMPLATE_NAME]. You do not need to input a bunch of data each time because each project corresponds to only one configuration file that holds standard file system and Xcode-project pathes, names of targets, information about the author.

Installation

Ruby 2.2 or later version is required. To check your current Ruby version run this command in terminal:

$ ruby --version

When necessary you can install the required Ruby version with the help of rvm or rbenv.

Run the command gem install generamba.

Usage

  1. Run generamba setup in the project root folder. This command helps to create Rambafile that define all configuration needed to generate code. You can modify this file directly in future.
  2. Add all templates planned to use in the project to the generated Rambafile. You can begin with one of the templates from our catalog: {name: 'rviper_controller'}.
  3. Run generamba template install. All the templates will be placed in the '/Templates' folder of your current project.
  4. Run generamba gen [MODULE_NAME] [TEMPLATE_NAME] - It creates module with specific name from specific template.

Additional info

Run generamba help to learn more about each of the Generamba features.

Wiki:

Other materials:

Authors

  • Egor Tolstoy, Beniamin Sarkisyan, Andrey Zarembo and the rest of Rambler.iOS team.

License

MIT

About

This codegenerator is too brilliant to be real!

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 95.5%
  • Liquid 4.4%
  • Shell 0.1%