Recently I needed to update the reflectable file because a property in one of my classes changed.
I had to update the pubspec.yaml because I was using build_runner 1.0.0 and it is not supported anymore.
So I'm using reflectable 2.1.0 and latest version of build_runner.
I remember that, some months ago, the same file was built in a couple of seconds.
Now it last more than two minutes for the same file.
I have discovered that, the more capabilities you add to the class, the delay is greater.
class Reflector extends Reflectable {
const Reflector()
: super(
newInstanceCapability,
invokingCapability,
reflectedTypeCapability,
typingCapability,
declarationsCapability,
);
}
[INFO] 2m 29s elapsed, 0/1 actions completed.
[INFO] 2m 30s elapsed, 0/1 actions completed.
[WARNING] No actions completed for 15.1s, waiting on:
- reflectable:reflectable on lib/parser/ReflectableClasses.dart
[INFO] 2m 31s elapsed, 0/1 actions completed.
[INFO] 2m 32s elapsed, 0/1 actions completed.
[INFO] 2m 33s elapsed, 0/1 actions completed.
[INFO] 2m 34s elapsed, 0/1 actions completed.
[INFO] 2m 35s elapsed, 0/1 actions completed.
[INFO] Running build completed, took 2m 36s
[INFO] Caching finalized dependency graph...
[INFO] Caching finalized dependency graph completed, took 32ms
[INFO] Succeeded after 2m 36s with 1 outputs (1 actions)
build.yaml
targets:
$default:
builders:
reflectable:
generate_for:
- lib/parser/ReflectableClasses.dart
options:
formatted: false
flutter doctor -v
[✓] Flutter (Channel master, v1.10.7-pre.127, on Mac OS X 10.14.6 18G95, locale en-AR)
• Flutter version 1.10.7-pre.127 at /Users/ernestofreiberg/flutter
• Framework revision 75c07ef1a6 (3 hours ago), 2019-10-02 15:36:07 -0700
• Engine revision aa8fcbb652
• Dart version 2.6.0 (build 2.6.0-dev.0.0 98b286de21)
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
• Android SDK at /Users/ernestofreiberg/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-28, build-tools 28.0.3
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 11.0)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 11.0, Build version 11A420a
• CocoaPods version 1.7.2
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 3.4)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 37.1.1
• Dart plugin version 183.6270
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)
[✓] VS Code (version 1.38.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.5.1
[✓] Connected device (4 available)
• Android SDK built for x86 64 • emulator-5554 • android-x64 • Android 9 (API 28) (emulator)
• macOS • macOS • darwin-x64 • Mac OS X 10.14.6 18G95
• Chrome • chrome • web-javascript • Google Chrome 77.0.3865.90
• Headless Server • headless-server • web-javascript • Flutter Tools
• No issues found!