owncloud / protoc-gen-microweb

Protoc generator for Micro web services
Apache License 2.0
7 stars 6 forks source link

Include an option to add an ignore list not to generate some packages #10

Closed jvillafanez closed 2 years ago

jvillafanez commented 2 years ago

Added the ignore_packages option to exclude those packages from being generated with this microweb generator.

The list is ";"-separated, such as ignore_packages=pkg1;pkg2;pkg3. The list will be split having the ";" as separator. Note that having a trailing ";" will cause an empty package name to be part of the ignored list, which will mean that proto files without a declared package name will be ignored. Since this is usually an unwanted behavior, avoid that trailing ";"

The generator will perform an exact match against the declared package name. There is no fancy regex match in place, so you might need to list a long list of packages

Example usage with "buf" (buf.gen.yaml):

  - name: microweb
    path: ../../../protoc-gen-microweb/protoc-gen-microweb
    out: ../gen/
    opt:
      - paths=source_relative
      - "ignore_packages=\
         ocis.services.thumbnails.v1;\
         ocis.messages.thumbnails.v1"