objectbox / objectbox-generator

ObjectBox Generator based on FlatBuffers schema files (fbs) for C and C++ (more languages in the future)
https://objectbox.io
GNU Affero General Public License v3.0
35 stars 11 forks source link

Entity removal #29

Closed vaind closed 3 years ago

vaind commented 3 years ago

Closes #22

Adds support for:

Keeps existing behaviour without change (when called with a single file) - entities are not removed from the model but built-up incrementally (when called on multiple fbs files)

vaind commented 3 years ago

Should it be documented in the command help more clearly that one can remove entities using a directory/glob path?

I've updated the docs a little:

 ./objectbox-generator --help
Usage:
  objectbox-generator [flags] {path}
      * to execute "clean" action (see below) on the path, removing previously generated code and missing entities,
      * and execute code generation on the path afterwards.

      The given {path} can be one of the following:
        * directory - a non-recursive clean and generation is performed on the given directory,
        * a glob path pattern (e.g. contains a "*") - performs clean and generation on the matching paths,
        * a Go-style path pattern (e.g. "./..." - a recursive match of the current dir) - performs clean and generation on the matching paths,

or
  objectbox-generator [flags] {model/file/path.fbs}
      to generate the binding code for a single file

or
  objectbox-generator [flags] clean {path}
      to remove the generated files instead of creating them - this removes *.obx.* and objectbox-model.h but keeps objectbox-model.json

or
  objectbox-generator FLATC [flatc arguments]
      to execute FlatBuffers flatc command line tool Any arguments after the FLATC keyword are passed through.

path:
  * a source file path or a valid path pattern (e.g. ./...)

Available flags:
  -c    generate plain C code
  -cpp
        generate C++ code
  -go
        generate Go code
  -help
        print this help
  -optional string
        C++ wrapper type to use for fields annotated "optional"; one of: std::optional, std::unique_ptr, std::shared_ptr
  -out string
        output path for generated source files
  -persist string
        path to the model information persistence file (JSON)
  -version
        print the generator version info
greenrobot-team commented 3 years ago

I've updated the docs a little:

👍