From 14c0f747074e39c3798ec062d5a4a299a888af90 Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Thu, 1 Sep 2022 14:53:26 -0400 Subject: [PATCH] tools: Update make_cppdocs.bat for Doxygen support (see issue #3384) --- tools/make_cppdocs.bat | 46 +++++++++++++++++++++++++++++++----------- tools/make_distrib.py | 10 +++++++-- 2 files changed, 42 insertions(+), 14 deletions(-) diff --git a/tools/make_cppdocs.bat b/tools/make_cppdocs.bat index dd9809c72..b84367054 100644 --- a/tools/make_cppdocs.bat +++ b/tools/make_cppdocs.bat @@ -1,18 +1,40 @@ @echo off +:: 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. + +set RC= + setlocal -if "%1"=="" ( -set CPPDOC_EXE="C:\Program Files (x86)\richfeit\CppDoc\CppDoc.exe" -set CPPDOC_REV="XXX" -) else ( -set CPPDOC_EXE="C:\Program Files (x86)\richfeit\CppDoc\cppdoc_cmd.exe" -set CPPDOC_REV="%1" +:: Check if DOXYGEN_EXE is already provided via the environment. +if exist "%DOXYGEN_EXE%" goto found_exe +set DOXYGEN_EXE="C:\Program Files\doxygen\bin\doxygen.exe" +if not exist %DOXYGEN_EXE% ( +echo ERROR: Please install Doxygen from https://doxygen.nl/ 1>&2 +set ERRORLEVEL=1 +goto end ) -if not exist %CPPDOC_EXE% ( -echo ERROR: Please install CppDoc from http://www.cppdoc.com/ -) else ( -%CPPDOC_EXE% -overwrite -title="CEF3 C++ API Docs - Revision %CPPDOC_REV%" -footer="
Chromium Embedded Framework (CEF) Copyright © 2016 Marshall A. Greenblatt
" -namespace-as-project -comment-format="///;//;///" -classdir=projects -module="cppdoc-standard" -extensions=h -languages="c=cpp,cc=cpp,cpp=cpp,cs=csharp,cxx=cpp,h=cpp,hpp=cpp,hxx=cpp,java=java" -D"OS_WIN" -D"USING_CEF_SHARED" -D"__cplusplus" -D"CEF_STRING_TYPE_UTF16" -enable-author=false -enable-deprecations=true -enable-since=true -enable-version=false -file-links-for-globals=false -generate-deprecations-list=false -generate-hierarchy=true -header-background-dark="#ccccff" -header-background-light="#eeeeff" -include-private=false -include-protected=true -index-file-base=index -overview-html=overview.html -reduce-summary-font=true -selected-text-background=navy -selected-text-foreground=white -separate-index-pages=false -show-cppdoc-version=false -show-timestamp=false -summary-html=project.html -suppress-details=false -suppress-frames-links=false -table-background=white -wrap-long-lines=false ..\include #capi "..\docs\index.html" -) +:found_exe -endlocal \ No newline at end of file +:: Environment variables inserted into the Doxyfile via `$(VAR_NAME)` syntax. +for /F %%i in ('python.bat %~dp0\cef_version.py current') do set PROJECT_NUMBER=%%i + +:: Run from the top-level CEF directory so that relative paths resolve correctly. +set CURRENT_PATH="%CD%" +cd "%~dp0\.." + +%DOXYGEN_EXE% Doxyfile + +cd "%CURRENT_PATH%" + +:end +endlocal & set RC=%ERRORLEVEL% +goto omega + +:returncode +exit /B %RC% + +:omega +call :returncode %RC% \ No newline at end of file diff --git a/tools/make_distrib.py b/tools/make_distrib.py index 68688f189..0611bd1c6 100644 --- a/tools/make_distrib.py +++ b/tools/make_distrib.py @@ -1004,15 +1004,21 @@ if platform == 'windows': if not options.nodocs: # generate doc files - os.popen('make_cppdocs.bat ' + cef_rev) + 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') + src_dir = os.path.join(cef_dir, 'docs', 'html') 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'