dart-lang / build

A build system for Dart written in Dart
https://pub.dev/packages/build
BSD 3-Clause "New" or "Revised" License
792 stars 208 forks source link

How do I run the build_runner in a specific order? #2701

Closed yacineblr closed 3 years ago

yacineblr commented 4 years ago

Hi, I use two build_runner ("mobx_codegen" and "sqfentity_gen") on a flutter application.

The files generated by "mobx_codegen" depend on the files generated by "sqfentity_gen", only I have the impression that the files are generated randomly.

How do I run the build_runner in a specific order?

$ flutter packages pub run build_runner build --delete-conflicting-outputs --verbose
[INFO] Generating build script...
[INFO] Generating build script completed, took 485ms

[INFO] Creating build script snapshot......
[INFO] Creating build script snapshot... completed, took 12.4s

[INFO] BuildDefinition:Initializing inputs
[INFO] BuildDefinition:Building new asset graph...
[INFO] BuildDefinition:Building new asset graph completed, took 764ms

[INFO] BuildDefinition:Checking for unexpected pre-existing outputs....
[INFO] BuildDefinition:Deleting 3 declared outputs which already existed on disk.
[INFO] BuildDefinition:Checking for unexpected pre-existing outputs. completed, took 8ms

[INFO] Build:Running build...
[INFO] build_resolvers:Generating SDK summary...
[INFO] Heartbeat:4.5s elapsed, 0/16 actions completed.
[INFO] build_resolvers:Generating SDK summary completed, took 4.7s

[INFO] Heartbeat:5.8s elapsed, 0/16 actions completed.
[FINE] mobx_codegen:mobx_generator on lib/utils.dart:Running StoreGenerator
[FINE] mobx_codegen:mobx_generator on lib/models/user_location.dart:Running StoreGenerator
[FINE] mobx_codegen:mobx_generator on lib/models/example.dart:Running StoreGenerator
[INFO] Heartbeat:7.8s elapsed, 3/19 actions completed.
[INFO] Heartbeat:8.9s elapsed, 3/19 actions completed.
[INFO] Heartbeat:9.9s elapsed, 3/19 actions completed.
[INFO] Heartbeat:11.0s elapsed, 3/19 actions completed.
[FINE] mobx_codegen:mobx_generator on lib/stores/address-recents/address-recents.dart:Running StoreGenerator
[FINE] mobx_codegen:mobx_generator on lib/stores/counter/counter.dart:Running StoreGenerator
[INFO] Heartbeat:13.6s elapsed, 5/20 actions completed.
[INFO] Heartbeat:16.0s elapsed, 5/21 actions completed.
[INFO] Heartbeat:18.6s elapsed, 5/21 actions completed.
[FINE] mobx_codegen:mobx_generator on lib/providers/location-services.dart:Running StoreGenerator
[FINE] mobx_codegen:mobx_generator on lib/i18n.dart:Running StoreGenerator
[FINE] mobx_codegen:mobx_generator on lib/stores/map/map.dart:Running StoreGenerator
[FINE] mobx_codegen:mobx_generator on lib/providers/maps.dart:Running StoreGenerator
[FINE] mobx_codegen:mobx_generator on lib/screens/home/search_section.dart:Running StoreGenerator
[FINE] mobx_codegen:mobx_generator on lib/screens/home/pages/trip-list.dart:Running StoreGenerator
[FINE] mobx_codegen:mobx_generator on lib/screens/home/pages/trip/trip-navigation.dart:Running StoreGenerator
[FINE] mobx_codegen:mobx_generator on lib/screens/home/pages/trip/trip.dart:Running StoreGenerator
[FINE] mobx_codegen:mobx_generator on lib/screens/home/pages/trip/trip-detail.dart:Running StoreGenerator
[FINE] mobx_codegen:mobx_generator on lib/stores/address-favorites/address-favorites.dart:Running StoreGenerator
[FINE] mobx_codegen:mobx_generator on lib/stores/geofence-locations/geofence-locations.dart:Running StoreGenerator
[FINE] mobx_codegen:mobx_generator on lib/root.dart:Running StoreGenerator
[FINE] mobx_codegen:mobx_generator on lib/screens/home/pages/location-list.dart:Running StoreGenerator
[FINE] mobx_codegen:mobx_generator on test/widget_test.dart:Running StoreGenerator
[FINE] mobx_codegen:mobx_generator on lib/screens/home/home.dart:Running StoreGenerator
[FINE] mobx_codegen:mobx_generator on lib/screens/home/pages/address.dart:Running StoreGenerator
[FINE] mobx_codegen:mobx_generator on lib/screens/first-start/intro.dart:Running StoreGenerator
[FINE] mobx_codegen:mobx_generator on lib/screens/first-start/pages/2-intro.dart:Running StoreGenerator
[FINE] mobx_codegen:mobx_generator on lib/screens/first-start/pages/5-intro.dart:Running StoreGenerator
[FINE] mobx_codegen:mobx_generator on lib/screens/first-start/pages/3-intro.dart:Running StoreGenerator
[FINE] mobx_codegen:mobx_generator on lib/screens/first-start/pages/6-intro.dart:Running StoreGenerator
[FINE] mobx_codegen:mobx_generator on lib/screens/first-start/pages/1-intro.dart:Running StoreGenerator
[FINE] mobx_codegen:mobx_generator on lib/screens/first-start/pages/4-intro.dart:Running StoreGenerator
[FINE] mobx_codegen:mobx_generator on lib/screens/preference/preference.dart:Running StoreGenerator
[FINE] mobx_codegen:mobx_generator on lib/screens/preference/steps/6-ask_user_can_put_bicycle_in_vehicle.dart:Running StoreGenerator
[FINE] mobx_codegen:mobx_generator on lib/screens/preference/steps/3-ask_type_energy_vehicle.dart:Running StoreGenerator
[FINE] mobx_codegen:mobx_generator on lib/screens/preference/steps/2-ask_type_vehicle.dart:Running StoreGenerator
[FINE] mobx_codegen:mobx_generator on lib/screens/preference/steps/7-ask_user_has_others_transport.dart:Running StoreGenerator
[FINE] mobx_codegen:mobx_generator on lib/screens/preference/steps/9-finish.dart:Running StoreGenerator
[FINE] mobx_codegen:mobx_generator on lib/screens/preference/steps/5-ask_user_has_bicycle.dart:Running StoreGenerator
[FINE] mobx_codegen:mobx_generator on lib/screens/preference/steps/4-ask_consomation_energy_vehicle.dart:Running StoreGenerator
[FINE] mobx_codegen:mobx_generator on lib/screens/preference/steps/8-ask_user_can_put_others_transport_in_vehicle.dart:Running StoreGenerator
[FINE] mobx_codegen:mobx_generator on lib/screens/preference/steps/1-ask_user_has_vehicle.dart:Running StoreGenerator
[FINE] mobx_codegen:mobx_generator on lib/screens/setting/pages/setting-privacy.dart:Running StoreGenerator
[FINE] mobx_codegen:mobx_generator on lib/screens/setting/pages/setting-home.dart:Running StoreGenerator
[FINE] mobx_codegen:mobx_generator on lib/screens/setting/pages/setting-notification.dart:Running StoreGenerator
[FINE] mobx_codegen:mobx_generator on lib/screens/setting/pages/setting-parameter.dart:Running StoreGenerator
[FINE] mobx_codegen:mobx_generator on lib/screens/setting/pages/setting-mobilitypreference.dart:Running StoreGenerator
[FINE] mobx_codegen:mobx_generator on lib/screens/setting/pages/setting-contact.dart:Running StoreGenerator
[FINE] mobx_codegen:mobx_generator on lib/screens/setting/pages/setting-profile.dart:Running StoreGenerator
[FINE] mobx_codegen:mobx_generator on lib/screens/setting/setting.dart:Running StoreGenerator
[FINE] mobx_codegen:mobx_generator on lib/main.dart:Running StoreGenerator
[FINE] mobx_codegen:mobx_generator on lib/components/list-means-of-transport.dart:Running StoreGenerator
[FINE] mobx_codegen:mobx_generator on lib/components/address-list.dart:Running StoreGenerator
[FINE] mobx_codegen:mobx_generator on lib/components/expanded-section.dart:Running StoreGenerator
[FINE] mobx_codegen:mobx_generator on lib/components/select.dart:Running StoreGenerator
[FINE] mobx_codegen:mobx_generator on lib/components/map.dart:Running StoreGenerator
[FINE] mobx_codegen:mobx_generator on lib/components/button.dart:Running StoreGenerator
[FINE] mobx_codegen:mobx_generator on lib/components/painters/line-painter.dart:Running StoreGenerator
[FINE] mobx_codegen:mobx_generator on lib/components/painters/line-dashed-painter.dart:Running StoreGenerator
[FINE] mobx_codegen:mobx_generator on lib/components/painters/stop-linear-dot-painter.dart:Running StoreGenerator
[FINE] mobx_codegen:mobx_generator on lib/components/neumorphic-circle.dart:Running StoreGenerator
[FINE] mobx_codegen:mobx_generator on lib/components/button-toggle.dart:Running StoreGenerator
[FINE] mobx_codegen:mobx_generator on lib/components/slider.dart:Running StoreGenerator
[FINE] mobx_codegen:mobx_generator on lib/components/custom-switch.dart:Running StoreGenerator
[FINE] mobx_codegen:mobx_generator on lib/components/neu-icon.dart:Running StoreGenerator
[FINE] mobx_codegen:mobx_generator on lib/components/progressbar.dart:Running StoreGenerator
[FINE] mobx_codegen:mobx_generator on lib/components/neu-icon-gradient.dart:Running StoreGenerator
[FINE] mobx_codegen:mobx_generator on lib/style.dart:Running StoreGenerator
[FINE] mobx_codegen:mobx_generator on lib/db/model.dart:Running StoreGenerator
[FINE] mobx_codegen:mobx_generator on lib/test.dart:Running StoreGenerator
[FINE] sqfentity_gen:property_sqfentity on test/widget_test.dart:Running SqfEntityGenerator
[FINE] sqfentity_gen:property_sqfentity on lib/root.dart:Running SqfEntityGenerator
[FINE] sqfentity_gen:property_sqfentity on lib/utils.dart:Running SqfEntityGenerator
[FINE] sqfentity_gen:property_sqfentity on lib/providers/maps.dart:Running SqfEntityGenerator
[FINE] sqfentity_gen:property_sqfentity on lib/providers/location-services.dart:Running SqfEntityGenerator
[FINE] sqfentity_gen:property_sqfentity on lib/stores/address-favorites/address-favorites.dart:Running SqfEntityGenerator
[FINE] sqfentity_gen:property_sqfentity on lib/stores/map/map.dart:Running SqfEntityGenerator
[FINE] sqfentity_gen:property_sqfentity on lib/stores/geofence-locations/geofence-locations.dart:Running SqfEntityGenerator
[FINE] sqfentity_gen:property_sqfentity on lib/stores/address-recents/address-recents.dart:Running SqfEntityGenerator
[FINE] sqfentity_gen:property_sqfentity on lib/stores/counter/counter.dart:Running SqfEntityGenerator
[FINE] sqfentity_gen:property_sqfentity on lib/models/example.dart:Running SqfEntityGenerator
[FINE] sqfentity_gen:property_sqfentity on lib/models/user_location.dart:Running SqfEntityGenerator
[FINE] sqfentity_gen:property_sqfentity on lib/i18n.dart:Running SqfEntityGenerator
[FINE] sqfentity_gen:property_sqfentity on lib/screens/home/home.dart:Running SqfEntityGenerator
[FINE] sqfentity_gen:property_sqfentity on lib/screens/home/search_section.dart:Running SqfEntityGenerator
[FINE] sqfentity_gen:property_sqfentity on lib/screens/home/pages/location-list.dart:Running SqfEntityGenerator
[FINE] sqfentity_gen:property_sqfentity on lib/screens/home/pages/address.dart:Running SqfEntityGenerator
[FINE] sqfentity_gen:property_sqfentity on lib/screens/home/pages/trip-list.dart:Running SqfEntityGenerator
[FINE] sqfentity_gen:property_sqfentity on lib/screens/home/pages/trip/trip-navigation.dart:Running SqfEntityGenerator
[FINE] sqfentity_gen:property_sqfentity on lib/screens/home/pages/trip/trip.dart:Running SqfEntityGenerator
[FINE] sqfentity_gen:property_sqfentity on lib/screens/home/pages/trip/trip-detail.dart:Running SqfEntityGenerator
[FINE] sqfentity_gen:property_sqfentity on lib/screens/first-start/intro.dart:Running SqfEntityGenerator
[FINE] sqfentity_gen:property_sqfentity on lib/screens/first-start/pages/2-intro.dart:Running SqfEntityGenerator
[FINE] sqfentity_gen:property_sqfentity on lib/screens/first-start/pages/5-intro.dart:Running SqfEntityGenerator
[FINE] sqfentity_gen:property_sqfentity on lib/screens/first-start/pages/3-intro.dart:Running SqfEntityGenerator
[FINE] sqfentity_gen:property_sqfentity on lib/screens/first-start/pages/6-intro.dart:Running SqfEntityGenerator
[FINE] sqfentity_gen:property_sqfentity on lib/screens/first-start/pages/1-intro.dart:Running SqfEntityGenerator
[FINE] sqfentity_gen:property_sqfentity on lib/screens/first-start/pages/4-intro.dart:Running SqfEntityGenerator
[FINE] sqfentity_gen:property_sqfentity on lib/screens/preference/preference.dart:Running SqfEntityGenerator
[FINE] sqfentity_gen:property_sqfentity on lib/screens/preference/steps/6-ask_user_can_put_bicycle_in_vehicle.dart:Running SqfEntityGenerator
[FINE] sqfentity_gen:property_sqfentity on lib/screens/preference/steps/3-ask_type_energy_vehicle.dart:Running SqfEntityGenerator
[FINE] sqfentity_gen:property_sqfentity on lib/screens/preference/steps/2-ask_type_vehicle.dart:Running SqfEntityGenerator
[FINE] sqfentity_gen:property_sqfentity on lib/screens/preference/steps/7-ask_user_has_others_transport.dart:Running SqfEntityGenerator
[FINE] sqfentity_gen:property_sqfentity on lib/screens/preference/steps/9-finish.dart:Running SqfEntityGenerator
[FINE] sqfentity_gen:property_sqfentity on lib/screens/preference/steps/5-ask_user_has_bicycle.dart:Running SqfEntityGenerator
[FINE] sqfentity_gen:property_sqfentity on lib/screens/preference/steps/4-ask_consomation_energy_vehicle.dart:Running SqfEntityGenerator
[FINE] sqfentity_gen:property_sqfentity on lib/screens/preference/steps/8-ask_user_can_put_others_transport_in_vehicle.dart:Running SqfEntityGenerator
[FINE] sqfentity_gen:property_sqfentity on lib/screens/preference/steps/1-ask_user_has_vehicle.dart:Running SqfEntityGenerator
[FINE] sqfentity_gen:property_sqfentity on lib/screens/setting/pages/setting-privacy.dart:Running SqfEntityGenerator
[FINE] sqfentity_gen:property_sqfentity on lib/screens/setting/pages/setting-home.dart:Running SqfEntityGenerator
[FINE] sqfentity_gen:property_sqfentity on lib/screens/setting/pages/setting-notification.dart:Running SqfEntityGenerator
[FINE] sqfentity_gen:property_sqfentity on lib/screens/setting/pages/setting-parameter.dart:Running SqfEntityGenerator
[FINE] sqfentity_gen:property_sqfentity on lib/screens/setting/pages/setting-mobilitypreference.dart:Running SqfEntityGenerator
[FINE] sqfentity_gen:property_sqfentity on lib/screens/setting/pages/setting-contact.dart:Running SqfEntityGenerator
[FINE] sqfentity_gen:property_sqfentity on lib/screens/setting/pages/setting-profile.dart:Running SqfEntityGenerator
[FINE] sqfentity_gen:property_sqfentity on lib/screens/setting/setting.dart:Running SqfEntityGenerator
[FINE] sqfentity_gen:property_sqfentity on lib/main.dart:Running SqfEntityGenerator
[FINE] sqfentity_gen:property_sqfentity on lib/components/list-means-of-transport.dart:Running SqfEntityGenerator
[FINE] sqfentity_gen:property_sqfentity on lib/components/address-list.dart:Running SqfEntityGenerator
[FINE] sqfentity_gen:property_sqfentity on lib/components/expanded-section.dart:Running SqfEntityGenerator
[FINE] sqfentity_gen:property_sqfentity on lib/components/select.dart:Running SqfEntityGenerator
[FINE] sqfentity_gen:property_sqfentity on lib/components/map.dart:Running SqfEntityGenerator
[FINE] sqfentity_gen:property_sqfentity on lib/components/button.dart:Running SqfEntityGenerator
[FINE] sqfentity_gen:property_sqfentity on lib/components/painters/line-painter.dart:Running SqfEntityGenerator
[FINE] sqfentity_gen:property_sqfentity on lib/components/painters/line-dashed-painter.dart:Running SqfEntityGenerator
[FINE] sqfentity_gen:property_sqfentity on lib/components/painters/stop-linear-dot-painter.dart:Running SqfEntityGenerator
[FINE] sqfentity_gen:property_sqfentity on lib/components/neumorphic-circle.dart:Running SqfEntityGenerator
[FINE] sqfentity_gen:property_sqfentity on lib/components/button-toggle.dart:Running SqfEntityGenerator
[FINE] sqfentity_gen:property_sqfentity on lib/components/slider.dart:Running SqfEntityGenerator
[FINE] sqfentity_gen:property_sqfentity on lib/components/custom-switch.dart:Running SqfEntityGenerator
[FINE] sqfentity_gen:property_sqfentity on lib/components/neu-icon.dart:Running SqfEntityGenerator
[FINE] sqfentity_gen:property_sqfentity on lib/components/progressbar.dart:Running SqfEntityGenerator
[FINE] sqfentity_gen:property_sqfentity on lib/components/neu-icon-gradient.dart:Running SqfEntityGenerator
[FINE] sqfentity_gen:property_sqfentity on lib/style.dart:Running SqfEntityGenerator
[FINE] sqfentity_gen:property_sqfentity on lib/db/model.dart:Running SqfEntityGenerator
[WARNING] sqfentity_gen:property_sqfentity on lib/db/model.dart:
SQFENTITY GENERATOR STARTED... instance Of:databaseModel
[WARNING] sqfentity_gen:property_sqfentity on lib/db/model.dart:
SQFENTITY GENERATOR: builder initialized (databaseModel)...
[WARNING] sqfentity_gen:property_sqfentity on lib/db/model.dart:
SQFENTITY_GEN.DART: recognizing Tables (DatabaseModel)
[WARNING] sqfentity_gen:property_sqfentity on lib/db/model.dart:
-------------------------------------------------------TABLE RECOGNIZING: addresseCollection
[WARNING] sqfentity_gen:property_sqfentity on lib/db/model.dart:
init() -> tableName:addresseCollection
[WARNING] sqfentity_gen:property_sqfentity on lib/db/model.dart:
-------------------------------------------------------TABLE RECOGNIZING: geofenceLocationCollection
[WARNING] sqfentity_gen:property_sqfentity on lib/db/model.dart:
init() -> tableName:geofenceLocationCollection
[WARNING] sqfentity_gen:property_sqfentity on lib/db/model.dart:
DatabaseModel Model recognized succesfuly
[WARNING] sqfentity_gen:property_sqfentity on lib/db/model.dart:
DatabaseModel converted to SqfEntityModelBase successfully
[WARNING] sqfentity_gen:property_sqfentity on lib/db/model.dart:
createEntites() started
[WARNING] sqfentity_gen:property_sqfentity on lib/db/model.dart:
>>> Table addresseCollection(name,) converting to entity
[WARNING] sqfentity_gen:property_sqfentity on lib/db/model.dart:
>>> Table geofenceLocationCollection(uuid,radius,latitude,longitude,) converting to entity
[WARNING] sqfentity_gen:property_sqfentity on lib/db/model.dart:
SQFENTITY: [databaseTables] Model was created successfully.
[WARNING] sqfentity_gen:property_sqfentity on lib/db/model.dart:
DatabaseModel converted to Entities successfully
[WARNING] sqfentity_gen:property_sqfentity on lib/db/model.dart:
DatabaseModel converted to Controller successfully
[FINE] sqfentity_gen:property_sqfentity on lib/test.dart:Running SqfEntityGenerator
[FINE] sqfentity_gen:property_sqfentity_forms on lib/utils.dart:Running SqfEntityFormGenerator
[FINE] sqfentity_gen:property_sqfentity_forms on lib/providers/maps.dart:Running SqfEntityFormGenerator
[FINE] sqfentity_gen:property_sqfentity_forms on lib/providers/location-services.dart:Running SqfEntityFormGenerator
[FINE] sqfentity_gen:property_sqfentity_forms on lib/models/example.dart:Running SqfEntityFormGenerator
[FINE] sqfentity_gen:property_sqfentity_forms on lib/models/user_location.dart:Running SqfEntityFormGenerator
[FINE] sqfentity_gen:property_sqfentity_forms on lib/i18n.dart:Running SqfEntityFormGenerator
[FINE] sqfentity_gen:property_sqfentity_forms on lib/screens/home/search_section.dart:Running SqfEntityFormGenerator
[FINE] sqfentity_gen:property_sqfentity_forms on lib/stores/counter/counter.dart:Running SqfEntityFormGenerator
[FINE] sqfentity_gen:property_sqfentity_forms on lib/stores/address-recents/address-recents.dart:Running SqfEntityFormGenerator
[FINE] sqfentity_gen:property_sqfentity_forms on lib/stores/address-favorites/address-favorites.dart:Running SqfEntityFormGenerator
[FINE] sqfentity_gen:property_sqfentity_forms on test/widget_test.dart:Running SqfEntityFormGenerator
[FINE] sqfentity_gen:property_sqfentity_forms on lib/root.dart:Running SqfEntityFormGenerator
[FINE] sqfentity_gen:property_sqfentity_forms on lib/stores/map/map.dart:Running SqfEntityFormGenerator
[FINE] sqfentity_gen:property_sqfentity_forms on lib/screens/home/home.dart:Running SqfEntityFormGenerator
[FINE] sqfentity_gen:property_sqfentity_forms on lib/screens/home/pages/address.dart:Running SqfEntityFormGenerator
[FINE] sqfentity_gen:property_sqfentity_forms on lib/stores/geofence-locations/geofence-locations.dart:Running SqfEntityFormGenerator
[FINE] sqfentity_gen:property_sqfentity_forms on lib/screens/home/pages/location-list.dart:Running SqfEntityFormGenerator
[FINE] sqfentity_gen:property_sqfentity_forms on lib/screens/home/pages/trip-list.dart:Running SqfEntityFormGenerator
[FINE] sqfentity_gen:property_sqfentity_forms on lib/screens/home/pages/trip/trip-navigation.dart:Running SqfEntityFormGenerator
[FINE] sqfentity_gen:property_sqfentity_forms on lib/screens/home/pages/trip/trip.dart:Running SqfEntityFormGenerator
[FINE] sqfentity_gen:property_sqfentity_forms on lib/screens/home/pages/trip/trip-detail.dart:Running SqfEntityFormGenerator
[FINE] sqfentity_gen:property_sqfentity_forms on lib/screens/first-start/intro.dart:Running SqfEntityFormGenerator
[FINE] sqfentity_gen:property_sqfentity_forms on lib/screens/first-start/pages/2-intro.dart:Running SqfEntityFormGenerator
[FINE] sqfentity_gen:property_sqfentity_forms on lib/screens/first-start/pages/5-intro.dart:Running SqfEntityFormGenerator
[FINE] sqfentity_gen:property_sqfentity_forms on lib/screens/first-start/pages/3-intro.dart:Running SqfEntityFormGenerator
[FINE] sqfentity_gen:property_sqfentity_forms on lib/screens/first-start/pages/6-intro.dart:Running SqfEntityFormGenerator
[FINE] sqfentity_gen:property_sqfentity_forms on lib/screens/first-start/pages/1-intro.dart:Running SqfEntityFormGenerator
[FINE] sqfentity_gen:property_sqfentity_forms on lib/screens/first-start/pages/4-intro.dart:Running SqfEntityFormGenerator
[FINE] sqfentity_gen:property_sqfentity_forms on lib/screens/preference/preference.dart:Running SqfEntityFormGenerator
[FINE] sqfentity_gen:property_sqfentity_forms on lib/screens/preference/steps/6-ask_user_can_put_bicycle_in_vehicle.dart:Running SqfEntityFormGenerator
[FINE] sqfentity_gen:property_sqfentity_forms on lib/screens/preference/steps/3-ask_type_energy_vehicle.dart:Running SqfEntityFormGenerator
[FINE] sqfentity_gen:property_sqfentity_forms on lib/screens/preference/steps/2-ask_type_vehicle.dart:Running SqfEntityFormGenerator
[FINE] sqfentity_gen:property_sqfentity_forms on lib/screens/preference/steps/7-ask_user_has_others_transport.dart:Running SqfEntityFormGenerator
[FINE] sqfentity_gen:property_sqfentity_forms on lib/screens/preference/steps/9-finish.dart:Running SqfEntityFormGenerator
[FINE] sqfentity_gen:property_sqfentity_forms on lib/screens/preference/steps/5-ask_user_has_bicycle.dart:Running SqfEntityFormGenerator
[FINE] sqfentity_gen:property_sqfentity_forms on lib/screens/preference/steps/4-ask_consomation_energy_vehicle.dart:Running SqfEntityFormGenerator
[FINE] sqfentity_gen:property_sqfentity_forms on lib/screens/preference/steps/8-ask_user_can_put_others_transport_in_vehicle.dart:Running SqfEntityFormGenerator
[FINE] sqfentity_gen:property_sqfentity_forms on lib/screens/preference/steps/1-ask_user_has_vehicle.dart:Running SqfEntityFormGenerator
[FINE] sqfentity_gen:property_sqfentity_forms on lib/screens/setting/pages/setting-privacy.dart:Running SqfEntityFormGenerator
[FINE] sqfentity_gen:property_sqfentity_forms on lib/screens/setting/pages/setting-notification.dart:Running SqfEntityFormGenerator
[FINE] sqfentity_gen:property_sqfentity_forms on lib/screens/setting/pages/setting-home.dart:Running SqfEntityFormGenerator
[FINE] sqfentity_gen:property_sqfentity_forms on lib/screens/setting/pages/setting-parameter.dart:Running SqfEntityFormGenerator
[FINE] sqfentity_gen:property_sqfentity_forms on lib/screens/setting/pages/setting-mobilitypreference.dart:Running SqfEntityFormGenerator
[FINE] sqfentity_gen:property_sqfentity_forms on lib/screens/setting/pages/setting-contact.dart:Running SqfEntityFormGenerator
[FINE] sqfentity_gen:property_sqfentity_forms on lib/screens/setting/pages/setting-profile.dart:Running SqfEntityFormGenerator
[FINE] sqfentity_gen:property_sqfentity_forms on lib/screens/setting/setting.dart:Running SqfEntityFormGenerator
[FINE] sqfentity_gen:property_sqfentity_forms on lib/main.dart:Running SqfEntityFormGenerator
[FINE] sqfentity_gen:property_sqfentity_forms on lib/components/list-means-of-transport.dart:Running SqfEntityFormGenerator
[FINE] sqfentity_gen:property_sqfentity_forms on lib/components/address-list.dart:Running SqfEntityFormGenerator
[FINE] sqfentity_gen:property_sqfentity_forms on lib/components/expanded-section.dart:Running SqfEntityFormGenerator
[FINE] sqfentity_gen:property_sqfentity_forms on lib/components/select.dart:Running SqfEntityFormGenerator
[FINE] sqfentity_gen:property_sqfentity_forms on lib/components/map.dart:Running SqfEntityFormGenerator
[FINE] sqfentity_gen:property_sqfentity_forms on lib/components/button.dart:Running SqfEntityFormGenerator
[FINE] sqfentity_gen:property_sqfentity_forms on lib/components/painters/line-painter.dart:Running SqfEntityFormGenerator
[FINE] sqfentity_gen:property_sqfentity_forms on lib/components/painters/line-dashed-painter.dart:Running SqfEntityFormGenerator
[FINE] sqfentity_gen:property_sqfentity_forms on lib/components/painters/stop-linear-dot-painter.dart:Running SqfEntityFormGenerator
[FINE] sqfentity_gen:property_sqfentity_forms on lib/components/neumorphic-circle.dart:Running SqfEntityFormGenerator
[FINE] sqfentity_gen:property_sqfentity_forms on lib/components/button-toggle.dart:Running SqfEntityFormGenerator
[FINE] sqfentity_gen:property_sqfentity_forms on lib/components/slider.dart:Running SqfEntityFormGenerator
[FINE] sqfentity_gen:property_sqfentity_forms on lib/components/custom-switch.dart:Running SqfEntityFormGenerator
[FINE] sqfentity_gen:property_sqfentity_forms on lib/components/neu-icon.dart:Running SqfEntityFormGenerator
[FINE] sqfentity_gen:property_sqfentity_forms on lib/components/progressbar.dart:Running SqfEntityFormGenerator
[FINE] sqfentity_gen:property_sqfentity_forms on lib/components/neu-icon-gradient.dart:Running SqfEntityFormGenerator
[FINE] sqfentity_gen:property_sqfentity_forms on lib/style.dart:Running SqfEntityFormGenerator
[FINE] sqfentity_gen:property_sqfentity_forms on lib/db/model.dart:Running SqfEntityFormGenerator
[WARNING] sqfentity_gen:property_sqfentity_forms on lib/db/model.dart:
-------------------------------------------------------FormBuilder: SqfEntityTable
[WARNING] sqfentity_gen:property_sqfentity_forms on lib/db/model.dart:
SQFENTITY_GEN.DART: recognizing Tables (SqfEntityTable)
[WARNING] sqfentity_gen:property_sqfentity_forms on lib/db/model.dart:
-------------------------------------------------------TABLE RECOGNIZING: addresseCollection
[WARNING] sqfentity_gen:property_sqfentity_forms on lib/db/model.dart:
init() -> tableName:addresseCollection
[WARNING] sqfentity_gen:property_sqfentity_forms on lib/db/model.dart:
-------------------------------------------------------TABLE RECOGNIZING: geofenceLocationCollection
[WARNING] sqfentity_gen:property_sqfentity_forms on lib/db/model.dart:
init() -> tableName:geofenceLocationCollection
[FINE] sqfentity_gen:property_sqfentity_forms on lib/test.dart:Running SqfEntityFormGenerator
[INFO] Build:Running build completed, took 32.0s

[INFO] Build:Caching finalized dependency graph...
[INFO] Build:Caching finalized dependency graph completed, took 89ms

[INFO] Build:Succeeded after 32.1s with 12 outputs (276 actions)
jakemac53 commented 4 years ago

Does the sqfenity_gen builder always generate files for the mobx_codegen builder? If so then we do support that via the runs_before option in the builder configuration.

Otherwise generally the ordering of builders is "random" but consistent. You can split your project into targets in order to deal with this, but it is a pain to do :/. We can give you some help in that area if you need to do it though.

jakemac53 commented 4 years ago

See also this section of the build config readme although it doesn't go into much depth https://github.com/dart-lang/build/blob/07c39cdd05e52c69538b8a7d9c24023caf5686ce/build_config/README.md#adjusting-builder-ordering

yacineblr commented 4 years ago

Thank you for your answer. Yes "sqfenity_gen" generates the classes to be used in the types for "mobx_codegen", but "mobx_codegen" is run first, it doesn't find the classes and type by "dynamic".

I tested :

builders:
  property_sqfentity:
    import: "package:sqfentity_gen/builder.dart"
    builder_factories: ["sqfentityBuilder"]
    build_extensions: {".dart": ["sqfentity.g.part"]}
    runs_before:
      - mobx_generator

and :

targets:
  $default:
    builders:
      mobx_codegen:
        options:
          runs_before:
            - sqfentity_gen

but it doesn't change anything.

yacineblr commented 4 years ago

Duplicate of #https://github.com/hhtokpinar/sqfEntity/issues/116

natebosch commented 4 years ago

When you refer to a generator from another package the builder name needs to be prefixed with the package name.

Try:

builders:
  property_sqfentity:
    import: "package:sqfentity_gen/builder.dart"
    builder_factories: ["sqfentityBuilder"]
    build_extensions: {".dart": ["sqfentity.g.part"]}
    runs_before:
      - mobx_codegen:mobx_generator
yacineblr commented 4 years ago

Thanks a lot but that didn't solve the problem. mobx always launches before the other builder ("sqfEntity").

I have created a project if you want to test the problem.

https://github.com/yacineblr/flutter-testbuilder

frencojobs commented 3 years ago

Otherwise generally the ordering of builders is "random" but consistent.

Is it possible to make build_runner get the ordering from the pubspec.yaml? It must be really nice. For example,

dev_dependencies:
    a_generator: any # this will run first
    b_generator: any # and second
    c_generator: any # and third

It can possibly collide with APIs like required_inputs and runs_before. But if those configurations aren't specified, build_runner should use the order as per pubspec.yaml.

Also, if I'm not mistaken, the dev_dependencies is a map that can possibly have a problem storing the positions of the entries. Even if that's the case, at least it must be nice to have an API to configure the order (for example, as a List) whether in pubspec.yaml or build.yaml.

jakemac53 commented 3 years ago

Yaml maps do not afaik guarantee ordering when we iterate the entries, although in practice today they are likely ordered. In any case though a decision was made early on to not use that ordering - the other things like runs_before and required_inputs are more stable ways and guarantee things work regardless of ordering in the pubspec.

It would be possible to add some other way of ordering builders explicitly, but we would have to make sure we didn't override the settings from runs_before and required_inputs as those are generally very hard constraints that the builder itself has defined. This ends up getting pretty complicated I think ultimately and the use cases we have seen so far are covered by the existing solutions.

natebosch commented 3 years ago

Can you help us understand why you require an ordering that isn't expressed with required_inputs and runs_before?

I really want to avoid a situation where a builder author starts telling folks they need brand new config like this.

frencojobs commented 3 years ago

Well, I'm lost actually. Let me tell you about the whole situation. I have a builder that I want to run first because it generates a file that is required by another builder.

part 'env.g.dart';
// I need this ^ file to be generated first because I need to use the Env.api
// in an annotation for another builder

@Envify()
abstract class Env {
    static const api = _Env.api;
}

This is another file,

part 'api.g.drt';

@RestApi(baseUrl: Env.api)
abstract class Api {}

But baseUrl is always null so I thought ordering is the problem here. But when I tried to inspect the build snapshot, the snapshot seems to be in the correct order actually.

// a chunk from .dart_tool/build/entrypoint/build.dart

final _builders = <_i1.BuilderApplication>[
  _i1.apply('envify_generator:envifyBuilder', [_i2.envifyBuilder],
      _i1.toDependentsOf('envify_generator'),
      hideOutput: true, appliesBuilders: ['source_gen:combining_builder']),
  _i1.apply('retrofit_generator:retrofit', [_i5.retrofitBuilder],
      _i1.toDependentsOf('retrofit_generator'),
      hideOutput: true, appliesBuilders: ['source_gen:combining_builder']),
];

envifyBuilder also got run first when I try to inspect the build_runner output with the --verbose flag too. Then it might not be a problem with the ordering right?

Also, I can confirm that this is not a problem with the way the library implement to consume the annotation value, because I've tested with several other builders and none of them pick the value of Env.api.

jakemac53 commented 3 years ago

Are you sure you have computed the constants? I think the api is computeConstantValue() instead of using the constantValue getter?

frencojobs commented 3 years ago

Hmmm, I read the annotation's values from the ConstantReader of source_gen, not from the metadata of the element. I think computeConstantValue is only available in the analyzer. Do I have to read the annotation as the element's metadata to get it's computed value?

I also opened an issue in the source_gen repo, to check if the ConstantReader is just not being able to read computed values.

jakemac53 commented 3 years ago

Using the ConstantReader from source_gen should be fine

frencojobs commented 3 years ago

Yea, but the value would still be null. For example,

/// ... some code up here
/// ConstantReader annotation

annotation.read('field').literalValue;
// ^ would be null if the value of field comes from a part file
// every other cases are fine
// but, it's not null if I use a file import instead of part file 
// the null case is only with part files
jakemac53 commented 3 years ago

Are you on the latest build_resolvers version? There was an issue like this previously which was resolved...

frencojobs commented 3 years ago

I do use the build_runner version 1.10.4 which depends on the build_resolvers version 1.4.3. So yes, I guess.

jakemac53 commented 3 years ago

Oh wait, are all the builders in this case SharedPartBuilders? None of the actual part files exist until the end if that is the case.

Can you try adding something like print(await buildStep.canRead(<asset-id-of-the-part-file>)); that would confirm whether or not the part file is visible.

natebosch commented 3 years ago

Oh wait, are all the builders in this case SharedPartBuilders? None of the actual part files exist until the end if that is the case.

Ah, that's a good call. In order to make this work the one that needs to write output which works from the resolver will likely need to change to write to a separate part of file instead of using the .g.dart suffix through the combining builder.

frencojobs commented 3 years ago

Oh wait, are all the builders in this case SharedPartBuilders? None of the actual part files exist until the end if that is the case.

Yes, they all are using SharedPartBuilder and combining_builder. It might be the problem I guess.

the resolver will likely need to change to write to a separate part of file instead of using the .g.dart suffix through the combining builder.

Does it mean the one that wants to get generated first can't use combining_builder or does it have to have a different suffix other than .g.dart?

jakemac53 commented 3 years ago

Does it mean the one that wants to get generated first can't use combining_builder or does it have to have a different suffix other than .g.dart?

Yes, it needs to generate its own file, with a different extension. Essentially you use the PartBuilder instead of the SharedPartBuilder. And then yes that builder does not need to apply the combining builder.

frencojobs commented 3 years ago

Okay, I see. Thanks. Then it must also be the culprit of the problem for this issue's OP since both mobx_codegen and sqfentity_gen use combining builder.

jakemac53 commented 3 years ago

Ok, closing this issue then :)

definitelyme commented 3 years ago

So i had a similar issue with floor and freezed in my Flutter project. Where the floor_generator runs before freezed.

What i tried:

What worked for me:

I added the line required_inputs: [".freezed.dart"] to the package:floor_generator/build.yaml file, under builders:. This turned out well after running flutter pub run build_runner. _Below is the package:floor_generator/build.yaml after modifications._

targets:
  $default:
    builders:
      floor_generator:
        enabled: true

builders:
  floor_generator:
    import: "package:floor_generator/builder.dart"
    # The builder function name, which gets called on build/watch
    builder_factories: ["floorBuilder"]
    # The 'partId' argument to 'SharedPartBuilder' is 'floor'
    build_extensions: { ".dart": [".floor.g.part"] }
    # Apply the Builder to the package with a direct dependency on the package exposing the builder
    auto_apply: dependents
    build_to: cache
    required_inputs: [".freezed.dart"] ########### ADDED THIS LINE ############
    # To copy the '.g.dart' content into '.g.dart' in the source tree
    # Combine the output of multiple builders into one output (combining_builder)
    applies_builders: ["source_gen|combining_builder"]

Tip: To use the modified floor_generator in my CI builds, i had to fork the repository, make my change and push to a new ref.

Below is my pubspec.yaml after modification.

...

dev_dependencies:
  ...
  # Code Generators
  build_runner: ^2.1.1
  freezed: ^0.14.5
  # floor_generator: ^1.2.0
  floor_generator:
    git:
      url: git://github.com/Flutter-Fox/floor.git
      ref: ft/require-freezed
      path: floor_generator/
  json_serializable: ^5.0.0
...

That's it! Hope this helps others having similar issues.

ton-An commented 1 year ago

To expand on https://github.com/dart-lang/build/issues/2701#issuecomment-922857918, you don't have to fork and edit the package to which you want to add the required_inputs line. What worked for me is using the build config from the package in my app's build.yaml, adding required_inputs and disabling the old builder

For example:

targets:
  $default:
    builders:
      mockito:mockBuilder:
        enabled: false
      foo:fooMockBuilder:
        enabled: true

builders:
  fooMockBuilder:
    import: "package:mockito/src/builder.dart"
    required_inputs: [".firebase.g.dart"] ########### ADDED THIS LINE ############
    builder_factories: ["buildMocks"]
    build_extensions: { ".dart": [".mocks.dart"] }
    build_to: source
    auto_apply: dependents

_This example makes sure that the code generation by cloud_firestoreodm is completely finished before creating the mocks

chaturadilan commented 1 year ago

Infact you can use runs_before, with PartBuilder. check this out : https://github.com/chaturadilan/riverpod_repo_generator

PROGrand commented 1 year ago

Seems , that _runsbefore stops working...

natebosch commented 1 year ago

Seems , that _runsbefore stops working...

A recent change caused the order of builders which were not constrained by required_inputs or runs_before to change, but nothing has broken the ordering constraints when they are in place. Double check that the configuration is correct or if additional constraints need to be added.

radzish commented 1 year ago

runs_before stopped working for me too. I double checked everything few times and still no luck. I suggest to reopen it.

natebosch commented 1 year ago

runs_before stopped working for me too.

Can you give more information? Do you have a reproduction case?

chaturadilan commented 10 months ago

Yes, now it is having an issue here. https://github.com/chaturadilan/riverpod_repo_generator/blob/main/build.yaml

riverpod_repo does not execute before riverpod_generator here.