Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wasabeef/version_gen
The Dart code generator for your package versions. 🎯
https://github.com/wasabeef/version_gen
dart flutter
Last synced: 14 days ago
JSON representation
The Dart code generator for your package versions. 🎯
- Host: GitHub
- URL: https://github.com/wasabeef/version_gen
- Owner: wasabeef
- License: mit
- Created: 2021-10-25T06:07:02.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-10-01T19:57:10.000Z (about 1 month ago)
- Last Synced: 2024-10-11T08:10:41.458Z (about 1 month ago)
- Topics: dart, flutter
- Language: Dart
- Homepage:
- Size: 115 KB
- Stars: 16
- Watchers: 4
- Forks: 2
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
The Dart code generator for your package versions.
There is no way to get the package version from the code in the Dart ecosystem.
## Installation
1. Add [build_runner] and [VersionGen] to your package's pubspec.yaml file:
```
dev_dependencies:
build_runner:
version_gen:
```2. Install [VersionGen]
```sh
$ flutter pub get
```3. Use [VersionGen]
```
$ flutter packages pub run build_runner build
```## Configuration file
[VersionGen] generates dart files based on the key **`VersionGen`** of [`pubspec.yaml`](https://dart.dev/tools/pub/pubspec).
Default configuration can be found [here](#default-configuration).```yaml
# pubspec.yaml
# ...dev_dependencies:
build_runner:
version_gen:# Optional (default: lib/gen/)
version_gen:
path: lib/gen/```
## Output file
```dart
/// DO NOT MODIFY BY HAND, Generated by version_gen
String packageVersion = '1.0.0+1';
```## Issues
Please file [FlutterGen] specific issues, bugs, or feature requests in our [issue tracker](https://github.com/FlutterGen/flutter_gen/issues/new).
Plugin issues that are not specific to [FlutterGen] can be filed in the [Flutter issue tracker](https://github.com/flutter/flutter/issues/new).
[build_runner]: https://pub.dev/packages/build_runner
[versiongen]: https://pub.dev/packages/version_gen