Skip to content

Template Code Generator that can handle creating multiple files at the time

License

Notifications You must be signed in to change notification settings

jmochel/recreate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VIE

A tool designed to generate code from templates both local and global.

Basics

Templates are stored in a hierarchy broken up into three levels. A typical path to a template looks like
<TLC>storehouse-name/storeroom-name/template-name where TLC is the start character.

All of names in the path are case insensitive.

Below we describe the full and unambiguous way to specify the paths to a template. In is much easier in practice. So after you read the section on the different types of storehouses go down to the practical usage area and will discover the simple way this can be used.

Global Storehouses

Global store houses are store houses that are available to anyone who uses the machine. The global store house locations vary with the OS they are typically stored in a folder with the name .recreate/storehouses/

There is one global storehouse it is populated upon start up initialization that is called the master global store house and it is stored on the file system with the name master somthing like: .vie/storehouses/master

Paths to the global storehouses start with the / character. i.e. /storehouse-name/storeroom-name/template-name

To get to the global master store house we can use the name master or just the / character again. i.e. /master/storeroom-name/template-name or //storeroom-name/template-name

Throughout the rest of the document we will use // to reference the master global storehouse

User Storehouses

User store houses are store houses that are available and managed by the specific user. The user store house locations is typically stored in a user folder named ~/username/.vie/storehouses

A specific user storehouse can be designated as the master user store house.

Paths to the user storehouses start with the > character. i.e. >storehouse-name/storeroom-name/template-name

To get to the master user store house we can use the > character again. i.e. >>storeroom-name/template-name

Throughout the rest of the document we will use >> to reference the master user storehouse

Local Storehouses

Local store houses are store houses anywhere in the file system but in order to use them user must register the local store house with Vie.

Paths to the local storehouses start with the . character. i.e. .storehouse-name/storeroom-name/template-name

.storeroom-name/template-name

In Practice

In practice using this is much easier than describing it. You simply specify the name of the template on the command line and Vie will look for the match at the nearest level.

For example to use the msc template you simply specify the name on the command line and Vie will look for the nearest version of that template.

Where it looks

If the user tells Vie to create code using just a template name msc i.e. vie gen -t msc ..additional params..

  1. It starts by looking for any templates named msc in store houses at the same level as the current working directory (cwd).
    1. If there is a local store house immediately below the cwd and it has a single template named msc , use that template 1.If there are multiple local store houses immediately below the cwd with a template named msc
      1. Look for templates named msc in all local, user and global store houses
      2. Print out possible matches
      3. Exit
    2. If there is a local store house immediately below the folders above the cwd and it has a single template named msc , use that template 1.If there are multiple local store houses immediately below the folders above the cwd with a template named msc
      1. Look for templates named msc in all local, user and global store houses
      2. Print out possible matches
      3. Exit
    3. If there is a single user store house with a template named msc, use that template
      1. If there are multiple user store houses with a template named msc
        1. Look for templates named msc in all local, user and global store houses
        2. Print out possible matches
        3. Exit
    4. If there is a single global store house with a template named msc, use that template
      1. If there are multiple global store houses with a template named msc
      2. Look for templates named msc in all local, user and global store houses
        1. Print out possible matches
        2. Exit

Getting Started

Tech Stack

Micronaut 3.2.7 Documentation


Feature lombok documentation

Feature http-client documentation

Feature mockito documentation

About

Template Code Generator that can handle creating multiple files at the time

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published