Closed janosroden closed 5 years ago
Hi!
Nice catch. I forgot to update the build configuration YAML to include the json files in the "watch"-ed assets. The build.yaml in the project root should contain the path to the translation files like this:
targets:
$default:
sources:
include:
- i18n/**
- lib/**
builders:
rosetta:
Can you check if this solves the issue? I will also try it out, but I currently don't have enough time for it.
Hi, no, this doesn't solve.
I'm afraid I missed a repro step:
flutter pub get
flutter packages pub run build_runner build --delete-conflicting-outputs --verbose
flutter packages pub run build_runner build --delete-conflicting-outputs --verbose
Hi,
Yes using build_runner build
will never update the generated file on dependent changes. If you would like to have immeditate code generation, you should use build_runner watch
, and of course, the correct build.yaml config described above is also needed.
So, if using the stable branch:
build.yaml
as described aboveflutter pub get
flutter packages pub run build_runner clean
(just to make sure everything is clean)flutter packages pub run build_runner watch
(this will do the initial build, and then watch for dependant filesystem changes, dont kill the process let it run while you edit the source files)I see, okay, so build runner unable to recognize which inputs are changed without watch (like a make). I don't want to watch, but it's okay, I can live with the clean && build commands.
Thank you for your help! Cheers
Describe the bug I've added a new key to jsons in your flutter_example and the .g.dart file didn't change.
To Reproduce Steps to reproduce the behavior:
flutter pub get
flutter packages pub run build_runner build --delete-conflicting-outputs --verbose
flutter packages pub run build_runner build --delete-conflicting-outputs --verbose
Expected behavior The new key should appear in the generated file
Desktop (please complete the following information):