Closed stryder123451 closed 2 days ago
This isn't enough info to go off of, we will need reproduction instructions or more information. It looks like the clean
command didn't clean anything up because it didn't have an asset graph from a previous build, which is a requirement to do so.
This isn't enough info to go off of, we will need reproduction instructions or more information. It looks like the
clean
command didn't clean anything up because it didn't have an asset graph from a previous build, which is a requirement to do so.
Sorry, i just don't know , what info i could give. What can i show you else?
What are the negative effects you are experiencing? These warnings alone are not anything to really worry about - it is mostly just telling you "I don't have a previous build so I don't know what to delete". Did you have a previous build, or maybe you just checked out a new repo and then ran a clean
command? If so, there isn't anything we can do here, it is working as intended.
If you really want to clean up the generated files, you can run a new build
command (will have to pass --delete-conflicting-outputs I think), and then a clean
.
What are the negative effects you are experiencing? These warnings alone are not anything to really worry about - it is mostly just telling you "I don't have a previous build so I don't know what to delete". Did you have a previous build, or maybe you just checked out a new repo and then ran a
clean
command? If so, there isn't anything we can do here, it is working as intended.If you really want to clean up the generated files, you can run a new
build
command (will have to pass --delete-conflicting-outputs I think), and then aclean
.
Yes , i have generated file, and after checked a new repo , build_runner doesn't detect any changes. So, yes i want restore detecting function. I've already tried delete all files and run build again , but it also doesn't work. Is there any ways to set new asset path?
Yes , i have generated file, and after checked a new repo , build_runner doesn't detect any changes. So, yes i want restore detecting function. I've already tried delete all files and run build again , but it also doesn't work. Is there any ways to set new asset path?
All you should have to do in order to get an up to date build from a new checkout is run the dart run build_runner build --delete-conflicting-outputs
.
If that isn't working, then I would need a full reproduction case or something in order to diagnose the issue.
Most likely, there are some misbehaving builders which are using dart:io
to read files directly, so we don't know about their inputs and can't detect changes to them.
Yes , i have generated file, and after checked a new repo , build_runner doesn't detect any changes. So, yes i want restore detecting function. I've already tried delete all files and run build again , but it also doesn't work. Is there any ways to set new asset path?
All you should have to do in order to get an up to date build from a new checkout is run the
dart run build_runner build --delete-conflicting-outputs
.If that isn't working, then I would need a full reproduction case or something in order to diagnose the issue.
Most likely, there are some misbehaving builders which are using
dart:io
to read files directly, so we don't know about their inputs and can't detect changes to them.
I've already tried it's not working, it was drift library. Interesting thing that codegen with drift commands works, but codegen with build runner don't
cc @simolus3 idk if you are aware of anything that would cause that
It works on old repo build runner + drift , after install on new repo from git , build runner stop generate files
This is surprising to me as well, drift shouldn't use direct IO APIs to read assets in builds.
@stryder123451, some general troubleshooting questions that come to mind: Do you have a dev-dependency on drift_dev
in the directory where you're running build_runner
? Does the new repo happen to have a build.yaml
file in that directory and if so, could you share it?
Since you have it working in another repo, it might be interesting to check for configuration changes (which would mostly be the pubspec and build.yaml
files). And to be sure, you don't have any Dart code outside of the "regular" folders like lib/
, test/
, bin/
, example/
and so on, right? If you have a completely custom package layout, build_runner
won't recognize that by default.
This is surprising to me as well, drift shouldn't use direct IO APIs to read assets in builds.
If you have a completely custom package layout,
build_runner
won't recognize that by default.
Yes, i suppose my project have different layout, it's similar to : https://sizzle.lazebny.io/essentials/folder-structure/
So, i suppose, i have to setup build_runner to my layout?
No, i don't have build.yaml
my folders hierarchy
database.g.dart being ignored by build_runner.
Yes, outside lib folder i have fork from pub.dev
So just to clarify, your directory layout in relation to pubspec.yaml
looks like this?
sources/
├─ lib/
│ ├─ src/
│ │ ├─ core/
│ │ │ ├─ components/
│ │ │ │ ├─ database/
│ │ │ │ │ ├─ database.dart
lib/
pubspec.yaml
That's not a typical Dart package layout and I suggest you adopt the common conventions to avoid other issues. But you can make build_runner
consider files in sources/
by creating a build.yaml
file next to pubspec.yaml
with the following contents:
additional_public_assets:
- 'sources/**'
So just to clarify, your directory layout in relation to
pubspec.yaml
looks like this?sources/ ├─ lib/ │ ├─ src/ │ │ ├─ core/ │ │ │ ├─ components/ │ │ │ │ ├─ database/ │ │ │ │ │ ├─ database.dart lib/ pubspec.yaml
That's not a typical Dart package layout and I suggest you adopt the common conventions to avoid other issues. But you can make
build_runner
consider files insources/
by creating abuild.yaml
file next topubspec.yaml
with the following contents:additional_public_assets: - 'sources/**'
IT WORKS , THANK YOU MUCH.
During build command , build_runner doesn't locate any changes, and also doesn't doesn't delete generated files during clean command: