GetDutchie / brick

An intuitive way to work with persistent data in Dart

Home Page:https://getdutchie.github.io/brick/#/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

brick.g.dart is not generated

Mikhail-Ivanou opened this issue · comments

Hey, I've tried to migrate brick to latest version with dart 3, and face issue that brick.g.dart is not generated.

So I get generated adapters with
part of '../brick.g.dart';
But actually no brick.g.dart exists.

Tried alos samples, they have similar issue.

[√] Flutter (Channel stable, 3.10.5, on Microsoft Windows [Version 10.0.17763.4499], locale ru-RU) (Issue is reproducible on mac too)

PS D:\git\brick\example_rest> flutter --version
Flutter 3.10.5 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 796c8ef792 (6 days ago) • 2023-06-13 15:51:02 -0700
Engine • revision 45f6e00911
Tools • Dart 3.0.5 • DevTools 2.23.1

What can be wrong?

Hi @Mikhail-Ivanou what version of Brick are you migrating from? Are there any build errors in your console when running dart run build_runner build --delete-conflicting-outputs?

initially it was

 brick_sqlite: ^1.1.0
  brick_rest: ^1.1.0
  brick_offline_first: ^1.1.0

than it was updated to

brick_sqlite: ^2.0.0
brick_rest: ^1.1.1
brick_offline_first: ^2.1.2
brick_offline_first_with_rest: ^1.1.0

Now I update to
brick_sqlite: ^3.0.1 brick_rest: ^3.0.2 brick_offline_first: ^3.0.3 brick_offline_first_with_rest: ^3.0.1

Here is what I see in terminal for main project
PS D:\git\xxxx-mobile-app> dart run build_runner build --delete-conflicting-outputs [INFO] Generating build script completed, took 365ms [INFO] Reading cached asset graph completed, took 2.3s [INFO] Checking for updates since last build completed, took 1.2s [INFO] Running build completed, took 2m 3s [INFO] Caching finalized dependency graph completed, took 706ms [INFO] Succeeded after 2m 3s with 75 outputs (1093 actions)

and also no errors or warnings for sample
PS D:\git\brick\example_rest> dart run build_runner build --delete-conflicting-outputs Building package executable... (5.6s) Built build_runner:build_runner. [INFO] Generating build script completed, took 278ms [INFO] Precompiling build script... completed, took 5.8s [INFO] Checking for unexpected pre-existing outputs. completed, took 0ms [INFO] Generating SDK summary completed, took 3.8s [INFO] Running build completed, took 5.1s [INFO] Caching finalized dependency graph completed, took 21ms [INFO] Succeeded after 5.1s with 3 outputs (9 actions)

@Mikhail-Ivanou did you follow the migration guide from 1 -> 2 or did you just change the pub versions? Notably, are your files models/user.dart or user.model.dart?

Yep, v1 -> v2 migration was done. And adapters are generated correctly
image

The most confusing is that https://github.com/GetDutchie/brick/tree/main/example_rest has similar issues for me

@Mikhail-Ivanou I can reproduce. I'm not sure what's going on. Thanks for reporting; it may be a few days before I can get back to you.

@Mikhail-Ivanou please upgrade brick_offline_first_with_rest_build to 3.1.0. I'm going to close this issue for now, but please comment on here if that hasn't resolved your problem and I'll reopen.

It works! Thanks!