Cached Build Runner
Cached Build Runner is a Dart package that optimizes the build_runner by caching generated code for unchanged .dart files. This package can be used as a dev_dependency and provides a cached version of the build_runner, which caches generated files instead of generating them every time.
Usage
cached_build_runner <command> [arguments]
Commands
Global options: -h, --help Print this usage information.
Available commands:
- build: Performs a single build on the specified targets and then exits.
- watch: Builds the specified targets, watching the file system for updates and rebuilding as appropriate.
- cache: Commands for manipulating cache
Available arguments:
- -h, --help: Print out usage instructions.
- -v, --verbose: Enables verbose logs.
- -d, --debug: Enables even more verbose logs.
- -p, --
no
prune: Enable pruning cache directory when pubspec.lock was changed since last build. Defaults true. - -c, --cache-directory: Provide the directory where this tool can keep the caches.
Cache sub-commands
- prune: Clear cache directory.
- list: List table of files with hash (digest) and their dirty state.
arguments
- -h, --help: Print out usage instructions.
- -v, --verbose: Enables verbose logs.
- -c, --cache-directory: Provide the directory where this tool can keep the caches.
Installation
Add the package to your pubspec.yaml file under dev_dependencies:
dev_dependencies:
build_runner: ^latest_version
cached_build_runner: ^latest_version
Please note that you have to add build_runner
as a mandatory dependency in your project for cached_build_runner
to work properly.
Replace latest_version with the latest available version of the package.
Original work done by @jyotirmoy-paul.
Libraries
- args/args_utils
- args/build_and_watch_argument_parser
- commands/build_command
- core/build_runner_wrapper
- args/cache_argument_parser
- commands/cache/cache_command
- core/cache_provider
- commands/cache/cache_prune_sub_command
- cached_build_runner
- This library contains the CachedBuildRunner class that provides an efficient way to run
build_runner build
by determining the files that need code generation and generating only the required code files. It uses caching to avoid unnecessary generation builds and only generates codes for files that don't have cached versions. - model/code_file
- utils/constants
- database/database_factory
- database/database_service
- core/dependency_visitor
- di_container
- utils/digest_utils
- utils/extension
- core/file_parser
- database/hive_database_service
- commands/initializer
- commands/cache/list_cache_sub_command
- utils/logger
- utils/utils
- commands/watch_command