From 8645e88e0e92f48f85e4228e9f038d7c4a47148b Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Fri, 2 Sep 2022 11:22:42 -0700 Subject: [PATCH] tools: Add make_cppdocs.sh for Linux/MacOS (see issue #3385) The make_distrib script will now generate Doxygen docs by default if the doxygen command-line tool is installed. Run with `--no-docs` (`--no-distrib-docs` with automate-git.py) to disable docs generation. --- tools/make_cppdocs.sh | 27 +++++++++++++++++++++++++++ tools/make_distrib.py | 38 ++++++++++++++++++++------------------ 2 files changed, 47 insertions(+), 18 deletions(-) create mode 100755 tools/make_cppdocs.sh diff --git a/tools/make_cppdocs.sh b/tools/make_cppdocs.sh new file mode 100755 index 000000000..724d7b87f --- /dev/null +++ b/tools/make_cppdocs.sh @@ -0,0 +1,27 @@ +#!/bin/bash +# Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights +# reserved. Use of this source code is governed by a BSD-style license +# that can be found in the LICENSE file. + +if ! command -v doxygen &> /dev/null +then + echo "ERROR: Please install Doxygen" 1>&2 + exit 1 +fi + +# Determine the absolute path to the script directory. +SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )" + +# Determine the top-level CEF directory. +CEF_DIR="${SCRIPT_DIR}/.." + +# Environment variables inserted into the Doxyfile via `$(VAR_NAME)` syntax. +export PROJECT_NUMBER=$(python3 ${SCRIPT_DIR}/cef_version.py current) + +# Generate documentation in the docs/html directory. +# Run from the top-level CEF directory so that relative paths resolve correctly. +( cd ${CEF_DIR} && doxygen Doxyfile ) + +# Write a docs/index.html file. +echo "" > ${CEF_DIR}/docs/index.html + diff --git a/tools/make_distrib.py b/tools/make_distrib.py index bb9b2e8a7..04ef5a673 100644 --- a/tools/make_distrib.py +++ b/tools/make_distrib.py @@ -856,6 +856,26 @@ if mode == 'standard': # transfer Doxyfile transfer_doxyfile(output_dir, options.quiet) +if not options.nodocs: + # generate doc files + sys.stdout.write("Generating docs...\n") + result = exec_cmd( + os.path.join('tools', 'make_cppdocs.%s' % + ('bat' if platform == 'windows' else 'sh')), cef_dir) + if (len(result['err']) > 0): + sys.stdout.write(result['err']) + sys.stdout.write(result['out']) + + src_dir = os.path.join(cef_dir, 'docs') + if path_exists(src_dir): + # create the docs output directory + docs_output_dir = create_output_dir(output_dir_base + '_docs', + options.outputdir) + # transfer contents + copy_dir(src_dir, docs_output_dir, options.quiet) + else: + sys.stdout.write("ERROR: No docs generated.\n") + if platform == 'windows': libcef_dll = 'libcef.dll' libcef_dll_lib = '%s.lib' % libcef_dll @@ -1016,24 +1036,6 @@ if platform == 'windows': transfer_gypi_files(cef_dir, cef_paths2['ceftests_sources_resources_win'], \ 'tests/ceftests/', ceftests_dir, options.quiet) - if not options.nodocs: - # generate doc files - sys.stdout.write("Generating docs...\n") - result = exec_cmd(os.path.join('tools', 'make_cppdocs.bat'), cef_dir) - if (len(result['err']) > 0): - sys.stdout.write(result['err']) - sys.stdout.write(result['out']) - - src_dir = os.path.join(cef_dir, 'docs') - if path_exists(src_dir): - # create the docs output directory - docs_output_dir = create_output_dir(output_dir_base + '_docs', - options.outputdir) - # transfer contents - copy_dir(src_dir, docs_output_dir, options.quiet) - else: - sys.stdout.write("ERROR: No docs generated.\n") - elif platform == 'mac': framework_name = 'Chromium Embedded Framework' framework_dsym = '%s.dSYM' % framework_name