feat(generator): support output_dir and build_extensions config for generated files

Now the code generator supports specifying a custom output directory and extension/name template for generated DI files via build.yaml ( and ). This allows placing all generated code in custom folders and using flexible naming schemes.

docs: update all user docs and tutorials to explain new output_dir/build_extensions config

- Added detailed usage and YAML examples to cherrypick_generator/README.md
- Synced full_tutorial_en.md and full_tutorial_ru.md (advanced codegen section) with explanation of new configuration and impact on imports
- Updated quick_start_en.md and quick_start_ru.md to mention advanced customization and point to tutorials
- Added troubleshooting and tips for custom output/imports in docs
This commit is contained in:
Sergey Penkovsky
2025-07-15 12:07:23 +03:00
parent c722ad0c07
commit a3648209b9
14 changed files with 311 additions and 20 deletions

View File

@@ -15,9 +15,8 @@ import 'package:analyzer/dart/element/element.dart';
import 'package:build/build.dart';
import 'package:source_gen/source_gen.dart';
import 'package:cherrypick_annotations/cherrypick_annotations.dart' as ann;
import 'src/generated_class.dart';
import 'cherrypick_custom_builders.dart' as custom;
/// ---------------------------------------------------------------------------
/// ModuleGenerator for code generation of dependency-injected modules.
///
@@ -89,5 +88,8 @@ class ModuleGenerator extends GeneratorForAnnotation<ann.module> {
/// Возвращает Builder, используемый build_runner для генерации кода для всех
/// файлов, где встречается @module().
/// ---------------------------------------------------------------------------
Builder moduleBuilder(BuilderOptions options) =>
PartBuilder([ModuleGenerator()], '.module.cherrypick.g.dart');
custom.moduleCustomBuilder(options);