Skip to content

Rodsevich/source_gen_cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Generator+ logo

source_gen_cli

Have you ever tried using or extending source_gen? Did you see how tedious it was at first? Have you fought again with it in another project when you needed it again?

This utility library for source_gen tries to solve those problems, with additions on creating easily your own generators in a uniform way.

Installation

Requirements:

To install:

> pub global activate source_gen

To update, run activate again:

> pub global activate source_gen

Generators Usage

> source_gen path/to/file1.dart path/to/file2.dart path/to/directory

Will process file1.g.dart, file2.g.dart and all the generation demanding files of /path/to/directory.

As that command is tedious, you should create a source_gen.yaml that avoids you the need of including those params. As doing that is tedious too, here you have the command:

> source_gen config-file

That configuration file will make your life easier in many ways, including the avoiding of those params previously written.

> source_gen #Build the desired generated code
> source_gen --watch #Watch for file editions and rebuild 'em

Generators Generation

Like with stagehand, here you could create your own Generator repo in a standarized way that helps this package detect its generators. Just create your generator's dir and scaffold:

> mkdir MyGenerator
> source_gen new generator_package

But this package would be a contradiction if it wouldn't include generations for more code apart from the starting one. So here you have the command for those Generator's generation:

> source_gen add generator

About

Hopefully, this repo will be deprecated in favor of the fusion with (PR approval link here) to source_gen original repo (when it comes)

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages