icerockdev / shaper

File structure generation tool from templates on Handlebars
Apache License 2.0
12 stars 8 forks source link

Add flag 'include' to include/exclude specific files #16

Closed RezMike closed 3 years ago

RezMike commented 3 years ago

It's a simple implementation to support including/excluding files in yaml file based on global params asked during shaper-cli execution.

Example:

globalParams:
  packageName: dev.icerock.app
  feature: auth
  screen: Auth
  addFragment: false

files:
  - pathTemplate: 'android-app/src/main/java/{{dts packageName}}/feature/{{dts feature}}/{{dts screen}}Fragment.kt'
    contentTemplateName: fragment/fragment.kt.hbs
    include: '{{addFragment}}'
  - pathTemplate: 'android-app/src/main/res/layout/fragment_{{cts screen}}.xml'
    contentTemplateName: fragment/layout.xml.hbs
    include: false
Alex009 commented 3 years ago

we should support new directory-templates too. for example use special helper to mark some file-path as excluded

RezMike commented 3 years ago

I had to open a new PR with a similar feature, but other implementation - #23.