-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmigrate.dart
More file actions
847 lines (669 loc) · 21.1 KB
/
migrate.dart
File metadata and controls
847 lines (669 loc) · 21.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
#!/usr/bin/env dart
import 'dart:io';
import 'dart:developer' as developer;
void main(List<String> args) async {
developer.log('');
developer
.log('╔═══════════════════════════════════════════════════════════╗');
developer.log('║ native_workmanager Migration Tool ║');
developer.log('║ workmanager → native_workmanager ║');
developer
.log('╚═══════════════════════════════════════════════════════════╝');
developer.log('');
final dryRun = args.contains('--dry-run');
final pathIndex = args.indexOf('--path');
final projectPath = pathIndex >= 0 && args.length > pathIndex + 1
? args[pathIndex + 1]
: Directory.current.path;
final migrator = MigrationTool(projectPath, dryRun: dryRun);
await migrator.run();
}
class MigrationTool {
final String projectPath;
final bool dryRun;
MigrationTool(this.projectPath, {this.dryRun = false});
Future<void> run() async {
developer.log('📁 Project path: $projectPath');
developer.log('🔍 Scanning for workmanager usage...');
developer.log('');
// Step 1: Scan pubspec.yaml
final pubspecPath = '$projectPath/pubspec.yaml';
if (!File(pubspecPath).existsSync()) {
developer.log('❌ Error: pubspec.yaml not found');
developer.log(
' Make sure you\'re running this from your Flutter project root');
exit(1);
}
final hasDependency = await _checkPubspecDependency(pubspecPath);
if (hasDependency == false) {
developer.log('ℹ️ workmanager not found in dependencies');
developer.log(' Nothing to migrate!');
exit(0);
}
// Step 2: Scan Dart files
final dartFiles = await _findDartFiles();
developer.log('📄 Found ${dartFiles.length} Dart files');
developer.log('');
// Step 3: Analyze usage
final analysis = await _analyzeFiles(dartFiles);
// Step 4: Display report
_displayReport(analysis);
// Step 5: Generate migration code
if (dryRun) {
developer.log('');
developer.log('🏃 DRY RUN MODE - No files will be modified');
developer.log(' Remove --dry-run flag to apply changes');
} else {
developer.log('');
stdout.write('Generate migration code? (y/n): ');
final response = stdin.readLineSync();
if (response?.toLowerCase() == 'y') {
await _generateMigration(analysis);
} else {
developer.log('Migration cancelled');
}
}
}
Future<bool> _checkPubspecDependency(String path) async {
final content = await File(path).readAsString();
return content.contains('workmanager');
}
Future<List<File>> _findDartFiles() async {
final dartFiles = <File>[];
final libDir = Directory('$projectPath/lib');
if (!libDir.existsSync()) {
return dartFiles;
}
await for (final entity
in libDir.list(recursive: true, followLinks: false)) {
if (entity is File && entity.path.endsWith('.dart')) {
dartFiles.add(entity);
}
}
return dartFiles;
}
Future<MigrationAnalysis> _analyzeFiles(List<File> files) async {
final analysis = MigrationAnalysis();
for (final file in files) {
final content = await file.readAsString();
final relativePath = file.path.replaceFirst('$projectPath/', '');
// Check for import
if (content.contains('workmanager')) {
analysis.filesWithImport.add(relativePath);
}
// Check for Workmanager().initialize()
if (content.contains(RegExp(r'Workmanager\(\)\.initialize'))) {
analysis.initializeCalls.add(relativePath);
}
// Check for registerOneOffTask
final oneOffMatches =
RegExp(r'Workmanager\(\)\.registerOneOffTask\(').allMatches(content);
if (oneOffMatches.isNotEmpty) {
analysis.oneOffTasks += oneOffMatches.length;
analysis.filesWithOneOff.add(relativePath);
}
// Check for registerPeriodicTask
final periodicMatches = RegExp(r'Workmanager\(\)\.registerPeriodicTask\(')
.allMatches(content);
if (periodicMatches.isNotEmpty) {
analysis.periodicTasks += periodicMatches.length;
analysis.filesWithPeriodic.add(relativePath);
}
// Check for callback function
if (content.contains('@pragma(\'vm:entry-point\')') &&
content.contains('callbackDispatcher')) {
analysis.callbackFiles.add(relativePath);
}
}
return analysis;
}
void _displayReport(MigrationAnalysis analysis) {
developer
.log('╔═══════════════════════════════════════════════════════════╗');
developer
.log('║ Migration Analysis Report ║');
developer
.log('╚═══════════════════════════════════════════════════════════╝');
developer.log('');
// Summary
developer.log('📊 Summary:');
developer.log(' Files with import: ${analysis.filesWithImport.length}');
developer.log(' Initialize calls: ${analysis.initializeCalls.length}');
developer.log(' One-off tasks: ${analysis.oneOffTasks}');
developer.log(' Periodic tasks: ${analysis.periodicTasks}');
developer.log(' Callback files: ${analysis.callbackFiles.length}');
developer.log('');
// Compatibility
final totalTasks = analysis.oneOffTasks + analysis.periodicTasks;
final compatibilityPercent = totalTasks > 0 ? 90 : 100;
developer.log('✅ Compatibility: $compatibilityPercent%');
developer.log(' $totalTasks tasks → Automatic migration possible');
if (analysis.callbackFiles.isNotEmpty) {
developer.log(
' ⚠️ ${analysis.callbackFiles.length} callback(s) → Manual review needed');
}
developer.log('');
// Detailed breakdown
if (analysis.filesWithImport.isNotEmpty) {
developer.log('📄 Files with workmanager import:');
for (final file in analysis.filesWithImport) {
developer.log(' • $file');
}
developer.log('');
}
if (analysis.initializeCalls.isNotEmpty) {
developer.log('🔧 Files with Workmanager().initialize():');
for (final file in analysis.initializeCalls) {
developer.log(' • $file');
}
developer.log('');
}
if (analysis.filesWithOneOff.isNotEmpty) {
developer.log('⚡ Files with registerOneOffTask():');
for (final file in analysis.filesWithOneOff) {
developer.log(' • $file');
}
developer.log('');
}
if (analysis.filesWithPeriodic.isNotEmpty) {
developer.log('🔄 Files with registerPeriodicTask():');
for (final file in analysis.filesWithPeriodic) {
developer.log(' • $file');
}
developer.log('');
}
if (analysis.callbackFiles.isNotEmpty) {
developer.log('⚠️ Callback files (manual review needed):');
for (final file in analysis.callbackFiles) {
developer.log(' • $file');
}
developer.log('');
}
}
Future<void> _generateMigration(MigrationAnalysis analysis) async {
final migrationDir = Directory('$projectPath/migration');
if (migrationDir.existsSync()) {
migrationDir.deleteSync(recursive: true);
}
migrationDir.createSync();
developer.log('');
developer.log('📝 Generating migration files...');
developer.log('');
// Generate new pubspec.yaml
await _generatePubspec(migrationDir);
// Generate migration guide
await _generateMigrationGuide(migrationDir, analysis);
// Generate code samples
await _generateCodeSamples(migrationDir, analysis);
// Generate checklist
await _generateChecklist(migrationDir, analysis);
developer.log('');
developer.log('✅ Migration files generated in: migration/');
developer.log('');
developer.log('📁 Generated files:');
developer.log(' • pubspec.yaml.new - Updated dependencies');
developer.log(' • MIGRATION_GUIDE.md - Step-by-step guide');
developer.log(' • CODE_SAMPLES.md - Before/after examples');
developer.log(' • CHECKLIST.md - Migration checklist');
developer.log('');
developer.log('📖 Next steps:');
developer.log(' 1. Review migration/MIGRATION_GUIDE.md');
developer.log(' 2. Update pubspec.yaml:');
developer.log(' cp migration/pubspec.yaml.new pubspec.yaml');
developer.log(' flutter pub get');
developer.log(' 3. Follow migration/CHECKLIST.md');
developer.log(' 4. Test thoroughly before deploying');
developer.log('');
}
Future<void> _generatePubspec(Directory dir) async {
final originalPubspec =
await File('$projectPath/pubspec.yaml').readAsString();
final newPubspec = originalPubspec.replaceAll(
RegExp(r'workmanager:\s*[\^\~]?\d+\.\d+\.\d+'),
'native_workmanager: ^1.0.0',
);
await File('${dir.path}/pubspec.yaml.new').writeAsString(newPubspec);
developer.log(' ✅ Generated pubspec.yaml.new');
}
Future<void> _generateMigrationGuide(
Directory dir, MigrationAnalysis analysis) async {
final guide = """
# Migration Guide: workmanager → native_workmanager
**Date:** ${DateTime.now().toString().split(' ')[0]}
## Overview
This guide helps you migrate from workmanager to native_workmanager.
**Your Project:**
- Files to update: ${analysis.filesWithImport.length}
- Tasks to migrate: ${analysis.oneOffTasks + analysis.periodicTasks}
- Compatibility: 90%+
---
## Step 1: Update Dependencies
Replace workmanager with native_workmanager in `pubspec.yaml`:
```yaml
# Before:
dependencies:
workmanager: ^0.5.2
# After:
dependencies:
native_workmanager: ^1.0.0
```
Then run:
```bash
flutter pub get
```
---
## Step 2: Update Imports
Find and replace in all files:
```dart
// Before:
import 'package:workmanager/workmanager.dart';
// After:
import 'package:native_workmanager/native_workmanager.dart';
```
---
## Step 3: Update Initialization
### Before:
```dart
void main() {
WidgetsFlutterBinding.ensureInitialized();
Workmanager().initialize(
callbackDispatcher,
isInDebugMode: true,
);
runApp(MyApp());
}
@pragma('vm:entry-point')
void callbackDispatcher() {
Workmanager().executeTask((task, inputData) {
// Your task logic
return Future.value(true);
});
}
```
### After (Using Native Workers - Recommended):
```dart
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await NativeWorkManager.initialize();
runApp(MyApp());
}
// No callback needed for native workers!
```
### After (Using Dart Workers - If you need Dart code):
```dart
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await NativeWorkManager.initialize();
// Register Dart callbacks
NativeWorkManager.registerCallback('myTask', myTaskCallback);
runApp(MyApp());
}
@pragma('vm:entry-point')
Future<void> myTaskCallback(String? input) async {
// Your existing Dart task logic
}
```
---
## Step 4: Migrate Tasks
### One-Off Tasks
#### Before:
```dart
Workmanager().registerOneOffTask(
"uniqueTaskId",
"simpleTask",
inputData: <String, dynamic>{
'userId': 123,
},
);
```
#### After (Native Worker):
```dart
await NativeWorkManager.enqueue(
taskId: "uniqueTaskId",
trigger: TaskTrigger.oneTime(),
worker: NativeWorker.httpRequest(
url: 'https://api.example.com/sync',
method: HttpMethod.post,
body: '{"userId": 123}',
),
);
```
#### After (Dart Worker):
```dart
await NativeWorkManager.enqueue(
taskId: "uniqueTaskId",
trigger: TaskTrigger.oneTime(),
worker: DartWorker(callbackId: 'myTask'),
);
```
### Periodic Tasks
#### Before:
```dart
Workmanager().registerPeriodicTask(
"periodicTaskId",
"periodicSync",
frequency: Duration(hours: 1),
);
```
#### After:
```dart
await NativeWorkManager.enqueue(
taskId: "periodicTaskId",
trigger: TaskTrigger.periodic(
Duration(hours: 1),
flexInterval: Duration(minutes: 15),
),
worker: NativeWorker.httpRequest(
url: 'https://api.example.com/sync',
),
);
```
---
## Step 5: Update Constraints
### Before:
```dart
Workmanager().registerOneOffTask(
"taskId",
"task",
constraints: Constraints(
networkType: NetworkType.connected,
requiresBatteryNotLow: true,
),
);
```
### After:
```dart
await NativeWorkManager.enqueue(
taskId: "taskId",
trigger: TaskTrigger.oneTime(),
worker: NativeWorker.httpRequest(...),
constraints: Constraints(
requiresNetwork: true, // Changed
requiresBatteryNotLow: true,
),
);
```
---
## Step 6: Test
1. **Remove old code:**
- Delete callback dispatcher if using native workers
- Remove old Workmanager initialization
2. **Test tasks:**
- Verify one-off tasks execute
- Verify periodic tasks run at expected intervals
- Check constraints work as expected
3. **Monitor events:**
```dart
NativeWorkManager.events.listen((event) {
developer.log('Task \${event.taskId}: \${event.state}');
});
```
---
## Common Issues
### Issue: Callback not called
**Solution:** Make sure you registered the callback:
```dart
NativeWorkManager.registerCallback('myTask', myCallback);
```
### Issue: Task not running
**Solution:** Check constraints:
```dart
// Remove constraints for testing
constraints: Constraints(),
```
### Issue: Build errors
**Solution:** Clean and rebuild:
```bash
flutter clean
flutter pub get
flutter run
```
---
## Benefits of Migration
✅ **50MB less memory** per background task
✅ **5x faster startup** (<100ms vs ~500ms)
✅ **Better battery life** (~50% improvement)
✅ **Native workers** for I/O tasks (no Flutter Engine overhead)
✅ **Task chains** for multi-step workflows
✅ **Better error handling** with automatic retry
---
## Need Help?
- 📖 [Documentation](https://github.com/brewkits/native_workmanager)
- 💬 [Discord](https://discord.gg/...)
- 🐛 [GitHub Issues](https://github.com/brewkits/native_workmanager/issues)
---
**Generated:** ${DateTime.now()}
""";
await File('${dir.path}/MIGRATION_GUIDE.md').writeAsString(guide);
developer.log(' ✅ Generated MIGRATION_GUIDE.md');
}
Future<void> _generateCodeSamples(
Directory dir, MigrationAnalysis analysis) async {
final samples = """
# Code Migration Examples
Before and after code samples for common migration scenarios.
---
## Example 1: Simple HTTP Sync
### Before (workmanager):
```dart
import 'package:workmanager/workmanager.dart';
void main() {
WidgetsFlutterBinding.ensureInitialized();
Workmanager().initialize(callbackDispatcher);
// Register task
Workmanager().registerPeriodicTask(
"sync-task",
"apiSync",
frequency: Duration(hours: 1),
);
runApp(MyApp());
}
@pragma('vm:entry-point')
void callbackDispatcher() {
Workmanager().executeTask((task, inputData) async {
// Make HTTP request
final response = await http.get(Uri.parse('https://api.example.com/sync'));
return Future.value(response.statusCode == 200);
});
}
```
### After (native_workmanager):
```dart
import 'package:native_workmanager/native_workmanager.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await NativeWorkManager.initialize();
// Register native worker (no callback needed!)
await NativeWorkManager.enqueue(
taskId: "sync-task",
trigger: TaskTrigger.periodic(Duration(hours: 1)),
worker: NativeWorker.httpRequest(
url: 'https://api.example.com/sync',
method: HttpMethod.get,
),
);
runApp(MyApp());
}
// No callback dispatcher needed!
```
**Benefits:**
- ✅ No callback dispatcher boilerplate
- ✅ 50MB less memory (no Flutter Engine for HTTP request)
- ✅ 5x faster startup
- ✅ Cleaner code
---
## Example 2: File Upload
### Before (workmanager):
```dart
@pragma('vm:entry-point')
void callbackDispatcher() {
Workmanager().executeTask((task, inputData) async {
final file = File(inputData['filePath']);
var request = http.MultipartRequest(
'POST',
Uri.parse('https://api.example.com/upload'),
);
request.files.add(await http.MultipartFile.fromPath('file', file.path));
final response = await request.send();
return Future.value(response.statusCode == 200);
});
}
```
### After (native_workmanager):
```dart
await NativeWorkManager.enqueue(
taskId: 'upload-task',
trigger: TaskTrigger.oneTime(),
worker: NativeWorker.httpUpload(
url: 'https://api.example.com/upload',
filePath: '/path/to/file.jpg',
),
);
```
**Benefits:**
- ✅ Built-in upload worker
- ✅ Progress tracking
- ✅ Automatic retry
- ✅ Much simpler code
---
## Example 3: Constraints
### Before (workmanager):
```dart
Workmanager().registerOneOffTask(
"taskId",
"task",
constraints: Constraints(
networkType: NetworkType.connected,
requiresBatteryNotLow: true,
requiresCharging: true,
),
);
```
### After (native_workmanager):
```dart
await NativeWorkManager.enqueue(
taskId: "taskId",
trigger: TaskTrigger.oneTime(),
worker: NativeWorker.httpRequest(...),
constraints: Constraints(
requiresNetwork: true, // Renamed
requiresBatteryNotLow: true, // Same
requiresCharging: true, // Same
),
);
```
**Changes:**
- `networkType: NetworkType.connected` → `requiresNetwork: true`
- `requiresWifi` added for WiFi-only tasks
---
**Generated:** ${DateTime.now()}
""";
await File('${dir.path}/CODE_SAMPLES.md').writeAsString(samples);
developer.log(' ✅ Generated CODE_SAMPLES.md');
}
Future<void> _generateChecklist(
Directory dir, MigrationAnalysis analysis) async {
final checklist = """
# Migration Checklist
Use this checklist to track your migration progress.
---
## Pre-Migration
- [ ] Backup your code (commit to git)
- [ ] Read MIGRATION_GUIDE.md
- [ ] Review CODE_SAMPLES.md for examples
---
## Dependencies
- [ ] Update pubspec.yaml:
```bash
cp migration/pubspec.yaml.new pubspec.yaml
flutter pub get
```
---
## Code Changes
### Imports (${analysis.filesWithImport.length} files)
${analysis.filesWithImport.map((f) => '- [ ] Update import in $f').join('\n')}
### Initialization (${analysis.initializeCalls.length} files)
${analysis.initializeCalls.map((f) => '- [ ] Update initialization in $f').join('\n')}
### One-Off Tasks (${analysis.oneOffTasks} tasks)
${analysis.filesWithOneOff.map((f) => '- [ ] Migrate one-off tasks in $f').join('\n')}
### Periodic Tasks (${analysis.periodicTasks} tasks)
${analysis.filesWithPeriodic.map((f) => '- [ ] Migrate periodic tasks in $f').join('\n')}
${analysis.callbackFiles.isNotEmpty ? '''
### Callbacks (${analysis.callbackFiles.length} files - Manual Review)
${analysis.callbackFiles.map((f) => '- [ ] Review and migrate callback in $f').join('\n')}
''' : ''}
---
## Testing
- [ ] Clean build:
```bash
flutter clean
flutter pub get
```
- [ ] Build succeeds without errors
- [ ] One-off tasks execute correctly
- [ ] Periodic tasks run at expected intervals
- [ ] Constraints work as expected (WiFi, charging, etc.)
- [ ] Event listeners receive task updates
- [ ] No memory leaks (check with profiler)
---
## Verification
- [ ] All old workmanager code removed
- [ ] No import errors
- [ ] No runtime errors
- [ ] Background tasks work when app is closed
- [ ] Background tasks work after device restart
- [ ] Logs show native workers executing (not Dart callbacks)
---
## Cleanup
- [ ] Remove old callback dispatcher functions
- [ ] Remove workmanager dependency from pubspec.yaml
- [ ] Delete migration/ directory after successful migration
- [ ] Update documentation/comments in code
- [ ] Commit migration changes
---
## Post-Migration
- [ ] Monitor task execution in production
- [ ] Check memory usage improvements
- [ ] Verify battery life improvements
- [ ] Update team documentation
---
## Rollback Plan (If Needed)
If you need to rollback:
1. Restore from git backup:
```bash
git checkout HEAD -- .
```
2. Or manually revert:
- Restore old pubspec.yaml
- flutter pub get
- Revert code changes
---
**Generated:** ${DateTime.now()}
**Estimated Migration Time:** ${_estimateMigrationTime(analysis)}
""";
await File('${dir.path}/CHECKLIST.md').writeAsString(checklist);
developer.log(' ✅ Generated CHECKLIST.md');
}
String _estimateMigrationTime(MigrationAnalysis analysis) {
final totalFiles = analysis.filesWithImport.length;
final totalTasks = analysis.oneOffTasks + analysis.periodicTasks;
if (totalFiles <= 2 && totalTasks <= 5) {
return '30 minutes - 1 hour';
} else if (totalFiles <= 5 && totalTasks <= 15) {
return '1-2 hours';
} else if (totalFiles <= 10 && totalTasks <= 30) {
return '2-4 hours';
} else {
return '4-8 hours';
}
}
}
class MigrationAnalysis {
final List<String> filesWithImport = [];
final List<String> initializeCalls = [];
final List<String> filesWithOneOff = [];
final List<String> filesWithPeriodic = [];
final List<String> callbackFiles = [];
int oneOffTasks = 0;
int periodicTasks = 0;
}