BirjuVachhani / spider

A small dart library to generate Assets dart code from assets folder.
https://spider.birju.dev/
Apache License 2.0
190 stars 19 forks source link

Constants names have no prefixes. #35

Closed vcrash closed 2 years ago

vcrash commented 2 years ago

Constants are generating without prefixes.

Config looks like this

package: resources
path: assets
class_name: Assets
prefix: ic

Expecting 'ic' prefix for each generated constant name in Assets class but there are no prefixes presented.

BirjuVachhani commented 2 years ago

Can you share spider.yaml and and generated dart file?

BirjuVachhani commented 2 years ago

This has been fixed on master and will be available in the next release.

BirjuVachhani commented 2 years ago

This has been released: https://pub.dev/packages/spider/versions/2.1.0

vcrash commented 2 years ago

Great! It works. May be I've trying to use prefix key in a global scope but now I see it works for groups. Exact config is here

# Generated by Spider

# Generates unit tests to verify that the assets exists in assets directory
generate_tests: true

# Use this to remove vcs noise created by the `generated` comments in dart code
no_comments: true

# Exports all the generated file as the one library
export: true

# This allows you to import all the generated references with 1 single import!
use_part_of: true

# Location where all the generated references will be stored
package: resources

groups:
  - paths:
      - assets
      - assets/profile
    class_name: Images
    prefix: ic
    types: [ .png, .jpg, .jpeg, .webp, .webm, .bmp ]