RuntimeScannerConfiguration constructor
const
RuntimeScannerConfiguration({
- bool reload = false,
- bool updatePackages = false,
- bool updateAssets = false,
- bool skipTests = true,
- List<
String> packagesToScan = const [], - List<
String> packagesToExclude = const [], - List<
File> filesToScan = const [], - List<
File> filesToExclude = const [], - List<
Type> scanClasses = const [], - List<
Type> excludeClasses = const [], - List<
File> additions = const [], - List<
File> removals = const [], - bool enableTreeShaking = false,
- bool writeDeclarationsToFiles = false,
- String outputPath = 'build/generated',
Configuration controller for reflection scanning operations in JetLeaf.
This class provides fine-grained control over how reflection metadata is collected, allowing customization of scanning behavior through various flags and inclusion/exclusion lists. It's used to configure reflection operations in both development and production.
{@template scan_loader_usage}
Typical Use Cases
- Incremental scanning during development
- Full reloads for code generation
- Selective scanning of specific packages/files
- Test environment configuration
Example Configuration
final loader = RuntimeScanLoader(
reload: true, // Force full reload
skipTests: true, // Exclude test files
packagesToScan: ['my_package', 'r:package:my_other.*'],
filesToScan: [
File('lib/main.dart'),
File('lib/src/core.dart'),
],
excludeClasses: [GeneratedClass], // Skip generated code
);
Creates a scan configuration with customizable behavior.
All parameters are optional with sensible defaults for typical use cases.
// Minimal configuration
final minimalLoader = RuntimeScanLoader();
// Full configuration
final fullLoader = RuntimeScanLoader(
reload: true,
updatePackages: true,
skipTests: Platform.environment['CI'] != 'true',
packagesToExclude: ['test_utils'],
filesToScan: [File('lib/main.dart')],
);
Implementation
const RuntimeScannerConfiguration({
this.reload = false,
this.updatePackages = false,
this.updateAssets = false,
this.skipTests = true,
this.packagesToScan = const [],
this.packagesToExclude = const [],
this.filesToScan = const [],
this.filesToExclude = const [],
this.scanClasses = const [],
this.excludeClasses = const [],
this.additions = const [],
this.removals = const [],
this.enableTreeShaking = false,
this.writeDeclarationsToFiles = false,
this.outputPath = 'build/generated',
});