ts_proto.conf 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. _TS_PROTO_OPT=
  2. _TS_PROTO_IMPL_CMD=$TOUCH_UNIT \
  3. && $_TS_FILES_COPY_CMD \
  4. && $NOTS_TOOL $NOTS_TOOL_BASE_ARGS build-ts-proto $NOTS_TOOL_COMMON_BUILDER_ARGS \
  5. ${_TS_PROTO_OPT} \
  6. --protoc-bin $PROTOC \
  7. --proto-srcs $_TS_PROTO_SRCS_FILES \
  8. --proto-paths ./$PROTO_NAMESPACE $ARCADIA_ROOT/$PROTO_NAMESPACE $_PROTO__INCLUDE $ARCADIA_BUILD_ROOT $PROTOBUF_INCLUDE_PATH \
  9. $_NODE_MODULES_INOUTS \
  10. ${input;hide:"package.json"} ${TS_CONFIG_FILES} $_AS_HIDDEN_INPUTS(IN $TS_INPUT_FILES) \
  11. ${output;hide:"package.json"} \
  12. ${hide:PROTO_FAKEID} \
  13. ${kv;hide:"pc magenta"} ${kv;hide:"p TS_PRO"}
  14. ### # internal
  15. module _TS_PROTO_IMPL: _TS_BASE_UNIT {
  16. .CMD=_TS_PROTO_IMPL_CMD
  17. .IGNORED=GENERATE_ENUM_SERIALIZATION GENERATE_ENUM_SERIALIZATION_WITH_HEADER USE_SKIFF CPP_PROTO_PLUGIN2 PY_PROTO_PLUGIN YMAPS_SPROTO RESOURCE
  18. # We need to collect SRCS paths into list to pass to command
  19. .ALIASES=SRCS=_TS_PROTO_SRCS
  20. # PEERDIR should be resolved to DESC_PROTO submodule
  21. SET(PEERDIR_TAGS DESC_PROTO)
  22. # For users to add some conditional config for TS_PROTO, like
  23. # IF (TS_PROTO)
  24. # MESSAGE(Building TS_PROTO!!!)
  25. ENABLE(TS_PROTO)
  26. # Disable linting
  27. NO_LINT()
  28. SET(MODULE_LANG TS)
  29. _PEERDIR_TS_RESOURCE(typescript)
  30. DISABLE(TS_CONFIG_DEDUCE_OUT)
  31. ENABLE(TS_CONFIG_USE_OUTDIR)
  32. _TS_CONFIGURE()
  33. SET_APPEND(_MAKEFILE_INCLUDE_LIKE_DEPS ${CURDIR}/package.json ${CURDIR}/pnpm-lock.yaml ${CURDIR}/${TS_CONFIG_PATH})
  34. _TS_ADD_NODE_MODULES_FOR_BUILDER()
  35. }
  36. ### @usage: _TS_PROTO_SRCS(path1 path2) # internal
  37. macro _TS_PROTO_SRCS(FILES...) {
  38. _SET_APPEND_WITH_DIRECTIVE(_TS_PROTO_SRCS_FILES input $FILES)
  39. }
  40. ### @usage: TS_PROTO_OPT(key1=value1 key2=value2)
  41. ###
  42. ### Overrides default options for `--ts_proto_opt`
  43. ### ([supported options](https://github.com/stephenh/ts-proto?tab=readme-ov-file#supported-options)).
  44. ###
  45. ### Documentation: https://docs.yandex-team.ru/frontend-in-arcadia/references/PROTO_LIBRARY#ts_proto_opt
  46. ###
  47. ### @example
  48. ###
  49. ### TS_PROTO_OPT(env=browser)
  50. ### TS_PROTO_OPT(
  51. ### useJsonName=true
  52. ### useJsonWireFormat=true
  53. ### )
  54. ###
  55. macro TS_PROTO_OPT(OPTS...) {
  56. SET_APPEND(_TS_PROTO_OPT ${pre=--ts-proto-opt :OPTS})
  57. }