Skip to content

Commit 063c9d3

Browse files
coadometa-codesync[bot]
authored andcommitted
Add --xml flag to persist xml artifacts for testing purposes
Summary: Currently, all xml artifacts generated by doxygen are stored in the tmp dir and deleted at the end of the snapshot generation. For debugging reasons, this diff adds `--xml` flag to persist generated artifacts, so that they can be analyzed. Changelog: [Internal] Differential Revision: D98289956
1 parent a79edd1 commit 063c9d3

1 file changed

Lines changed: 18 additions & 1 deletion

File tree

scripts/cxx-api/parser/__main__.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import argparse
1515
import concurrent.futures
1616
import os
17+
import shutil
1718
import subprocess
1819
import sys
1920
import tempfile
@@ -147,6 +148,7 @@ def build_snapshots(
147148
verbose: bool,
148149
view_filter: str | None = None,
149150
is_test: bool = False,
151+
keep_xml: bool = False,
150152
) -> None:
151153
if not is_test:
152154
configs_to_build = [
@@ -205,7 +207,16 @@ def build_snapshots(
205207
input_filter=input_filter,
206208
)
207209

208-
if verbose:
210+
if keep_xml:
211+
xml_src = os.path.join(work_dir, "xml")
212+
xml_dst = os.path.join(output_dir, "xml")
213+
if os.path.exists(xml_dst):
214+
shutil.rmtree(xml_dst)
215+
shutil.copytree(xml_src, xml_dst)
216+
if verbose:
217+
print(f"XML files saved to {xml_dst}")
218+
219+
if verbose:
209220
print(snapshot)
210221

211222

@@ -242,6 +253,11 @@ def main():
242253
action="store_true",
243254
help="Run on the local test directory instead of the react-native directory",
244255
)
256+
parser.add_argument(
257+
"--xml",
258+
action="store_true",
259+
help="Keep the generated Doxygen XML files next to the .api output in a xml/ directory",
260+
)
245261
args = parser.parse_args()
246262

247263
verbose = not args.check
@@ -299,6 +315,7 @@ def main():
299315
input_filter=input_filter,
300316
view_filter=args.view,
301317
is_test=args.test,
318+
keep_xml=args.xml,
302319
)
303320

304321
if args.check:

0 commit comments

Comments
 (0)