pubspec_generator
5.0.2, released 5 months ago by plugfox.dev
Generates a Dart class containing information from pubspec.yaml.
What it does
Auto-generates a Dart class from your pubspec.yaml file, containing app description, dependencies, and version. This keeps application metadata up-to-date across your project via build_runner or a CLI utility.
AI-written summary of version 5.0.2, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to access app version and description programmatically in your code.
- You want consistent app metadata across multiple platforms automatically.
Skip it when
- You do not use build_runner or code generation in your project workflow.
- You only need standard package info without generated files.
Strengths
- Automates keeping app metadata synchronized with pubspec.yaml.
- Supports cross-platform compatibility and command-line usage.
Weaknesses
- Requires setting up build_runner configuration in a build.yaml file.
- Adds an extra generated file to your codebase.
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- Yes (build_runner)
- Direct dependencies
- 7
Add build_runner and pubspec_generator to dev_dependencies, create a build.yaml file for output path configuration, and run build_runner.
dev_dependencies:
build_runner: ^2.4.0
pubspec_generator: ^5.0.2
# Run:
# dart run build_runner build --delete-conflicting-outputsAlternatives
Packages that do the same job and could replace pubspec_generator.
- pubspec_parse
Parses pubspec.yaml files programmatically without requiring code generation.
93Compare
Works with
Packages commonly used together with pubspec_generator: ones it builds on, ones built on it, and its own family.
- analyzerpubspec_generator depends on itPerforms static analysis of Dart code for tool integration and embedding.
- yamlpubspec_generator depends on itA Dart library for parsing YAML documents into Dart data structures.
- pub_semverpubspec_generator depends on itVersions and version constraints implementing pub's versioning policy.
- argspubspec_generator depends on itLibrary for parsing raw command-line arguments into options and values using GNU and POSIX styles.
- buildpubspec_generator depends on itPackage for authoring build_runner compatible code generators.
- build_runnerUsed togetherA build system for Dart code generation and modular compilation.