You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In our team we have a multi-package application using Objectbox. For a while we had Objectbox and all classes using it in a root package. Now we want to decouple all of that for root package and move to one of our dependencies.
As you know, Objectbox uses generated files to work. In our case we run build_runner in root_package with the following build.yaml file content:
targets:
$default:
sources:
- modules/**
- lib/**
- test/**
# Note that it is important to include these in the default target.
- pubspec.*
- $package$
This allows us to run build_runner only once and have files generated in all our modules (sub-packages). objectbox_generator:resolver handles this nicely as *.objectbox.info files are being generated for our files. objectbox_generator:generator doesn't generate outputs though.
As I see in the generator's source code, It handles files only present in lib of current package, though files of submodules are accessible from buildStep.
Is this behaviour intentional or this can be changed in the future to use files from packages too?
The text was updated successfully, but these errors were encountered:
Thanks for your question! This is currently by design. The recommended architecture approach is to have a separate database for each package and wrap that in a repository class to not expose any internal details to other packages.
But if there are no technical reasons that prevent seeing classes of other packages, then it might be possible to add this as an optional behavior in the future.
In our team we have a multi-package application using Objectbox. For a while we had Objectbox and all classes using it in a root package. Now we want to decouple all of that for root package and move to one of our dependencies.
As you know, Objectbox uses generated files to work. In our case we run build_runner in root_package with the following
build.yaml
file content:This allows us to run build_runner only once and have files generated in all our modules (sub-packages). objectbox_generator:resolver handles this nicely as
*.objectbox.info
files are being generated for our files. objectbox_generator:generator doesn't generate outputs though.As I see in the generator's source code, It handles files only present in
lib
of current package, though files of submodules are accessible frombuildStep
.Is this behaviour intentional or this can be changed in the future to use files from packages too?
The text was updated successfully, but these errors were encountered: