How run flutter 'packages pub run build_runner build' with debug mode in intellij idea? How run flutter 'packages pub run build_runner build' with debug mode in intellij idea? flutter flutter

How run flutter 'packages pub run build_runner build' with debug mode in intellij idea?


  1. run commad flutter packages pub run build_runner build

  2. copy build.dart to root folder of project

enter image description here

3)4) add new run configurationenter image description here5) run debug, now you can debug your code generator!


Ivan's answer worked for me, but every time I changed a file that was using an annotation - the build process outputted:

[SEVERE] Terminating builds due to build script update[INFO] Terminating. No further builds will be scheduled

and then renamed the build script itself from build.dart to build.dart.cached, and then exit with code 75.

After digging through the build_runner code, I discovered that this behavior can be mitigated by using the following Program Arguments:

serve --skip-build-script-check

(i.e. instead of just serve as Ivan suggested).

There may be some negative consequences; in the build_runner source code, in options.dart, I saw this:

// For testing only, skips the build script updates check.bool skipBuildScriptCheck;