Skip to content
Gregory Berngardt edited this page Jul 10, 2017 · 10 revisions

Generamba Commands

In this section:

General Commands

Basic Generamba configuration

Command:

generamba setup

Description:

Run this command to configure current project to use Generamba. It will ask you series of questions and generate Rambafile as an output. All of your answers can be changed afterwards by manually modifying this file.


Module generation

Command:

generamba gen [MODULE_NAME] [TEMPLATE_NAME]

Description:

Use this command to create new modules from the specified template.

Note that you should run it in the same directory where Rambafile is located.

Required parameters:
  • MODULE_NAME - this is your code module name. It's used in a lot of different places - in subfolders, Xcode groups, filenames, and in your classes names. Choose it wisely!
  • TEMPLATE_NAME - this is a name of the template you want to use for creating new module. Note that this template should be explicitly listed in the Rambafile and installed via generamba template install command.
Optional parameters:
  • --description - Provides a description for generated module. This text will be pasted in place of {{ description }} variable of the selected template.

    Example: generamba gen AuthModule viper_template --description 'Super Awesome VIPER module'

    Note: If no description is provided, the default one will be used: YOUR_MODULE_NAME module

  • --author - Provides an author name for generated module. This text will be pasted in place of {{ developer.name }} variable of the selected template.

    Example: generamba gen AuthModule viper_template --author 'Egor Tolstoy'

  • --project_targets - Specifies a number of project targets for adding new files.

    Example: generamba gen FeedModule viper_template --project_targets 'News,NewsTests,NewsUITests'

  • --project_file_path - A relative path to the folder, where new module will be generated. Don't include your module subfolder in the path - it's created by default.

    Example: generamba gen UserService service_template --project_file_path '/Facebook/Code/Services'

  • --project_group_path - An absolute path in Xcode groups hierarchy to the group, where new module will be generated. Don't include your module subgroup in the path - it's created by default.

    Example: generamba gen UserService service_template --project_group_path 'Facebook/Services'

  • --module_path - This option just combines --project_file_path and --project_group_path . If you use the same paths both in the filesystem and Xcode, you should use this flag.

    Example: generamba gen AppDelegate app_delegate_template --module_path 'Facebook/Code'

  • --test_targets - Specifies a number of test targets for adding new test files.

    Example: generamba gen FeedModule viper_template --test_targets 'NewsTests,NewsUITests'

  • --test_file_path - A relative path to the folder, where new test files will be generated. Don't include your module subfolder in the path - it's created by default.

    Example: generamba gen UserService service_template --test_file_path '/Facebook/Tests/Services'

  • --test_group_path - An absolute path in Xcode groups hierarchy to the group, where new tests will be generated. Don't include your module subgroup in the path - it's created by default.

    Example: generamba gen UserService service_template --test_group_path 'Facebook/Tests/Services'

  • --test_path - This option just combines --test_file_path and --test_group_path. If you use the same paths both in the filesystem and Xcode, you should use this flag.

    Example: generamba gen AppDelegate app_delegate_template --test_path 'Facebook/Tests'

  • --custom_parameters - A hash with custom parameters that will be used in place of {{ custom_parameters.key }} directives in a template.

    Example: generamba gen AppDelegate app_delegate_template --custom_parameters key1:value1 key2:value2


Version information

Command:

generamba version

Description:

Run this command to get an information about current Generamba release. It will show you the current version, release date and a link to release notes.


Template Commands

Template creation

Command:

generamba template create [TEMPLATE_NAME]

Description:

Use this command if you want to create a new template to either use it in your project, or publish it for other people needs. It will ask you some questions and generate a skeleton of the new template with a .rambaspec file and basic template file structure.

This command is project-independent, so you can run it in any directory you want.

Required parameters:
  • TEMPLATE_NAME - this value will be used as a template name during generation process.
Example:

generamba template create hexagonal_module_template


Template installation

Command:

generamba template install

Description:

Run this command in the same directory where Rambafile is located to install the list of templates specified under templates key in the Rambafile. The execution may take some time, because we download and create local copies of templates and catalog repositories.

If you use this command more than one time, the previous content of the /Templates directory would be overwritten.


Exploring templates catalog

Command:

generamba template list

Description:

Prints out the list of all templates available in the shared Generamba GitHub catalog.


Searching templates

Command:

generamba template search [SEARCH_STRING]

Description:

Searches a template with a given name in the shared Generamba GitHub catalog.

Example:

generamba template search viper