Rebased: grpc/compiler: Respect filename suffix and extension during code generation (#7414)

* grpc/compiler: Respect filename suffix and extension during code generation

grpc compiler is not respecting filename suffix and extension passed to
flatc CLI. This causes compiler to spit out incorrect code, which then
cannot be compiled without modification.

Following patch fixes the problem.

Note, I ended up removing some code introduced #6954 ("Have grpc include
file with correct filename-suffix given to flatc") in favour of keeping
sanity of the generator code.

Signed-off-by: Aman Priyadarshi <aman.eureka@gmail.com>

* tests: Add filename-suffix and filename-ext test files

* Test 1: Filename extension changed to "hpp".
* Test 2: Filename suffix changed to "_suffix".
* Test 3: Filename extension changed to "hpp" and suffix changed to "_suffix"

Signed-off-by: Aman Priyadarshi <aman.eureka@gmail.com>
14 files changed
tree: bc76d2603b9423496113bf341d7b4c156bea71fd
  1. .bazelci/
  2. .github/
  3. android/
  4. bazel/
  5. benchmarks/
  6. CMake/
  7. conan/
  8. dart/
  9. docs/
  10. go/
  11. grpc/
  12. include/
  13. java/
  14. js/
  15. kotlin/
  16. lobster/
  17. lua/
  18. mjs/
  19. net/
  20. php/
  21. python/
  22. reflection/
  23. rust/
  24. samples/
  25. scripts/
  26. snap/
  27. src/
  28. swift/
  29. tests/
  30. ts/
  31. .clang-format
  32. .editorconfig
  33. .eslintrc.js
  34. .gitattributes
  35. .gitignore
  36. .travis.yml
  37. BUILD.bazel
  38. build_defs.bzl
  39. CMakeLists.txt
  40. composer.json
  41. conanfile.py
  42. CONTRIBUTING.md
  43. Formatters.md
  44. LICENSE.txt
  45. package.json
  46. pom.xml
  47. readme.md
  48. SECURITY.md
  49. swift.swiftformat
  50. tsconfig.json
  51. tsconfig.mjs.json
  52. typescript.bzl
  53. WORKSPACE
  54. yarn.lock
readme.md

logo FlatBuffers

Build status Fuzzing Status OpenSSF Scorecard Join the chat at https://gitter.im/google/flatbuffers Discord Chat Twitter Follow Twitter Follow

FlatBuffers is a cross platform serialization library architected for maximum memory efficiency. It allows you to directly access serialized data without parsing/unpacking it first, while still having great forwards/backwards compatibility.

Go to our landing page to browse our documentation.

Supported operating systems

  • Windows
  • MacOS X
  • Linux
  • Android
  • And any others with a recent C++ compiler.

Supported programming languages

  • C++
  • C#
  • C
  • Dart
  • Go
  • Java
  • JavaScript
  • Lobster
  • Lua
  • PHP
  • Python
  • Rust
  • Swift
  • TypeScript

and more in progress...

Contribution

To contribute to this project, see CONTRIBUTING.

Security

Please see our Security Policy for reporting vulnerabilities.

Licensing

Flatbuffers is licensed under the Apache License, Version 2.0. See LICENSE for the full license text.