Skip to content

Allow declaring directory for generated files #312

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
tomwyr opened this issue Sep 21, 2021 · 3 comments · Fixed by #341
Closed

Allow declaring directory for generated files #312

tomwyr opened this issue Sep 21, 2021 · 3 comments · Fixed by #341
Labels
enhancement New feature or request
Milestone

Comments

@tomwyr
Copy link

tomwyr commented Sep 21, 2021

objectbox-model.json and objectbox.g.dart are generated in lib directory and there's no way of changing it which is inconvenient if you follow some pattern when structuring your project files. Allow ObjectBox users to adjust it in build.yaml configuration e.g.:

targets:
  $default:
    builders:
      objectbox:
        options:
          output_dir: lib/generated/or/wherever/you/want/it/to/be
@tomwyr tomwyr added the enhancement New feature or request label Sep 21, 2021
@buehler
Copy link

buehler commented Sep 29, 2021

Just encountered the same problem. This would definitely be a great addition to the generator! Otherwise the package is one of the better (if not best) storage possibilities in flutter. Currently we use a makefile to move the files where we want them, but it would definitely be better to have a config for this sort of matter (like flutter_intl or the sort)

@SAGARSURI
Copy link

Hope this gets solved soon. For now I will switch to another database

@greenrobot-team
Copy link
Member

This feature is now available in the 1.4.0-dev.0 preview release. We welcome your feedback!

To set a custom output directory, add something like the following to pubspec.yaml of the desired package:

objectbox:
  # Writes objectbox-model.json and objectbox.g.dart to lib/custom (and test/custom).
  output_dir: custom
  # Or optionally specify the lib and test output folder separately.
  # output_dir:
  #   lib: custom
  #   test: other

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants