Skip to content
Mikhail edited this page May 28, 2021 · 10 revisions

This is a plugin for creating a group of files from templates.

IMPORTANT!!! If, when creating a "Template, Files" or adding a file to templates, there were no changes in the Project Catalog. Then remove the focus from the IDEA and return it back, THE PROBLEM IS UNDERSTANDING !!

To create an empty template, click on the "Tools" -> "Create New Template" menu item

In the Dialog box enter the name of the template

The plugin will create an empty template at the root of your project.

All templates are stored in the folder "Your project name"/templates

The heart of the template is the Json file Main

Inside it has a structure

Key Value comment
name Name Template
description Description Template
path Path to Template
param Variables to insert into the template list String
addFile Files to create list object File

param

The parameter is an array of strings. It can be in the File Structure in name and path. And also in the template itself. It is declared in brackets {param} Example

There is a default parameter for Java and Kotlin {package}

When creating files from a template, the plugin will correct to fill in the parameter fields.

File it has a structure

Key Value comment
name Name when creating a file You can use Param in the name
path Additional directories for saving You can use Param in the name. Creates a catalog automatically if it does not exist
fileTemplatePath The name of the template from which the file is created It must be specified with the extension .tm and you can specify the directory where this file is located

Create Template

To create a file from a template, right-click on the gurney in which we want to create and select the template we need from the list

Add File In Template

To add a file to the template, right-click on it and select "Add file in template" The plugin will ask you to choose which template you want to add (if there are several of them) and will ask you to rename the file as it will be named in the template.

Clone this wiki locally