-
Notifications
You must be signed in to change notification settings - Fork 134
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat ya-make: add support for DOCS_LIBRARY in PROTO_LIBRARY
commit_hash:8f3498b2a434c3f72e0f5789ee69ae2aad71a05a
- Loading branch information
aserebriyskiy
committed
Mar 10, 2025
1 parent
d707226
commit 65edc48
Showing
5 changed files
with
83 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import argparse | ||
import subprocess | ||
import sys | ||
import pathlib | ||
|
||
|
||
def parse_args(): | ||
parser = argparse.ArgumentParser() | ||
parser.add_argument('--docs-output', required=True) | ||
parser.add_argument('args', nargs='+') | ||
|
||
return parser.parse_args() | ||
|
||
|
||
def main(args): | ||
cmd = list(args.args) | ||
# interface is like this: | ||
# --doc_out=TARGET_DIR | ||
# --doc_opt=markdon,TARGET_FILE_NAME | ||
|
||
target_file = pathlib.Path(args.docs_output) | ||
cmd.append(f'--doc_opt=markdown,{target_file.name}') | ||
cmd.append(f'--doc_out={target_file.parent}') | ||
|
||
try: | ||
subprocess.check_output(cmd, stdin=None, stderr=subprocess.STDOUT, text=True) | ||
except subprocess.CalledProcessError as e: | ||
sys.stderr.write(f'{e.cmd} returned non-zero exit code {e.returncode}.\n{e.output}\n') | ||
return e.returncode | ||
|
||
return 0 | ||
|
||
|
||
if __name__ == '__main__': | ||
sys.exit(main(parse_args())) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -88,4 +88,6 @@ SRCS( | |
|
||
EXCLUDE_TAGS(GO_PROTO) | ||
|
||
INCLUDE_TAGS(DOCS_PROTO) | ||
|
||
END() |