Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to generate files in a different folder #701

Open
bilalrabibi opened this issue Feb 29, 2024 · 0 comments
Open

Unable to generate files in a different folder #701

bilalrabibi opened this issue Feb 29, 2024 · 0 comments

Comments

@bilalrabibi
Copy link

Using PartBuilder
i am not able to generate the files in specific folder.

pubspec.yaml

dependencies:
  material: 1.0.0+2
  meta: 1.10.0
  source_gen: ^1.4.0

I have tried below in my project build.yaml file

auto_models:
        options:
  
          build_extensions:
            "{{}}.dart": '{{dir}}/generated/{{file}}.mapped.g.dart'

full yaml file is

targets:
  $default:
    builders:
      
      
      #general purpose .g.dart builder
      source_gen|combining_builder:
        enabled: true
        
        generate_for:
          - lib/**.dart
        options:
          build_extensions:
            '^{{path}}/{{file}}.dart': '{{path}}/generated/{{file}}.g.dart'

      #chopper
      chopper_generator:
        options:
          # This assumes you want the files to end with `.chopper.g.dart`
          # instead of the default `.chopper.dart`.
          build_extensions:
            "^{{path}}/{{file}}.dart": '{{path}}/generated/{{file}}.chopper.g.dart'
     

My package yaml file

targets:
  $default:
    builders:
      auto_models|auto_models:
        enabled: true

builders:

  auto_models:
    import: "package:auto_models/builder.dart"
    builder_factories: ["dataModalBuilder"]
    
    build_extensions: { ".dart": [ "generated/.mapped.g.dart" ] }
    auto_apply: dependents
    build_to: source          
    runs_before: ["drift_dev|drift_dev"]
    applies_builders: ["source_gen|combining_builder"]

also tried

build_extensions: { ".dart": [ ".mapped.g.dart" ] }

but files are always generating inside same folder

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant