diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 21d31ecd88..43fad0c4c1 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -19,11 +19,10 @@ jobs: - uses: actions/checkout@v3 # Build the HTML documentation - - name: Doxygen Action - uses: mattnotmitt/doxygen-action@v1.3.1 - with: - doxyfile-path: ./doxygen.config - working-directory: ./docs + - name: Build HTML documentation + # Some projects don't allow in-source building, so create a separate build directory + # We'll use this as our working directory for all + run: tools/unix-ci/generate_docs.sh # Deploy the HTML documentation to GitHub Pages - name: GH Pages Deployment diff --git a/docs/MainPage.h b/docs/MainPage.h index 54ab4ef097..0563833bc0 100644 --- a/docs/MainPage.h +++ b/docs/MainPage.h @@ -19,7 +19,7 @@ This project is based on the famous "coc @section sec2 License Copyright (c) 2010-2012 cocos2d-x.org \n Copyright (c) 2017-2018 Xiamen Yaji Software Co., Ltd. \n -Copyright (c) 2021-2022 Bytedance Inc. \n +Copyright (c) 2021-2023 Bytedance Inc. \n \n Permission is hereby granted, free of charge, to any person obtaining a copy \n of this software and associated documentation files (the "Software"), to deal \n diff --git a/docs/doxygen.config b/docs/doxygen.config index 8c14c2772e..2d8e11df14 100644 --- a/docs/doxygen.config +++ b/docs/doxygen.config @@ -38,7 +38,7 @@ PROJECT_NAME = axmol # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = v1 +PROJECT_NUMBER = v1.0 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a @@ -1994,15 +1994,15 @@ INCLUDE_FILE_PATTERNS = # recursively expanded use the := operator instead of the = operator. # This tag requires that the tag ENABLE_PREPROCESSING is set to YES. -PREDEFINED = "CC_PROPERTY_READONLY(varType, varName, funName)=protected: varType varName;\n /** get##funName*/\n public: virtual varType get##funName(void);" \ - "CC_PROPERTY_READONLY_PASS_BY_REF(varType, varName, funName)=protected: varType varName;\n /** get##funName*/\n public: virtual const varType& get##funName(void);" \ - "CC_PROPERTY(varType, varName, funName)=protected: varType varName;\n /** get##funName*/\n public: virtual varType get##funName(void);\n/** set##funName*/\n public: virtual void set##funName(varType var);" \ - "CC_PROPERTY_PASS_BY_REF(varType, varName, funName)=protected: varType varName;\n /** get##funName*/\n public: virtual const varType& get##funName(void);\n/** set##funName*/\n public: virtual void set##funName(const varType& var);" \ - "CC_SYNTHESIZE(varType, varName, funName)=protected: varType varName;\n /** get##funName */\n public: virtual varType get##funName(void)\n /** set##funName */ \n public: virtual void set##funName(varType var);" \ - "CC_SYNTHESIZE_PASS_BY_REF(varType, varName, funName)=protected: varType varName;\n /** get##funName */\n public: virtual const varType& get##funName(void);\n /** set#funName */\n public: virtual void set##funName(const varType& var);" \ - "CC_SYNTHESIZE_RETAIN(varType, varName, funName)=protected: varType varName;\n /** get##funName */\n public: virtual varType get##funName(void);\n /** set##funName */\n public: virtual void set##funName(varType var);" \ - "CC_SYNTHESIZE_READONLY(varType, varName, funName)=protected: varType varName;\n /** get##funName */\n public: virtual varType get##funName(void);" \ - "CC_SYNTHESIZE_READONLY_PASS_BY_REF(varType, varName, funName)=protected: varType varName;\n /** get##funName */ \n public: virtual const varType& get##funName(void);" \ +PREDEFINED = "AX_PROPERTY_READONLY(varType, varName, funName)=protected: varType varName;\n /** get##funName*/\n public: virtual varType get##funName(void);" \ + "AX_PROPERTY_READONLY_PASS_BY_REF(varType, varName, funName)=protected: varType varName;\n /** get##funName*/\n public: virtual const varType& get##funName(void);" \ + "AX_PROPERTY(varType, varName, funName)=protected: varType varName;\n /** get##funName*/\n public: virtual varType get##funName(void);\n/** set##funName*/\n public: virtual void set##funName(varType var);" \ + "AX_PROPERTY_PASS_BY_REF(varType, varName, funName)=protected: varType varName;\n /** get##funName*/\n public: virtual const varType& get##funName(void);\n/** set##funName*/\n public: virtual void set##funName(const varType& var);" \ + "AX_SYNTHESIZE(varType, varName, funName)=protected: varType varName;\n /** get##funName */\n public: virtual varType get##funName(void)\n /** set##funName */ \n public: virtual void set##funName(varType var);" \ + "AX_SYNTHESIZE_PASS_BY_REF(varType, varName, funName)=protected: varType varName;\n /** get##funName */\n public: virtual const varType& get##funName(void);\n /** set#funName */\n public: virtual void set##funName(const varType& var);" \ + "AX_SYNTHESIZE_RETAIN(varType, varName, funName)=protected: varType varName;\n /** get##funName */\n public: virtual varType get##funName(void);\n /** set##funName */\n public: virtual void set##funName(varType var);" \ + "AX_SYNTHESIZE_READONLY(varType, varName, funName)=protected: varType varName;\n /** get##funName */\n public: virtual varType get##funName(void);" \ + "AX_SYNTHESIZE_READONLY_PASS_BY_REF(varType, varName, funName)=protected: varType varName;\n /** get##funName */ \n public: virtual const varType& get##funName(void);" \ "NS_AX_BEGIN=namespace axmol {" \ "NS_AX_END=}" \ "NS_AX_MATH_BEGIN=namespace axmol {" \ @@ -2012,12 +2012,12 @@ PREDEFINED = "CC_PROPERTY_READONLY(varType, varName, funName)=protec "NS_AX_EXT_BEGIN=namespace axmol { namespace extension {" \ "NS_AX_EXT_END=}}" \ "USING_NS_AX_EXT=using namespace axmol::extension" \ - "CC_USE_PHYSICS" \ - "CC_DEPRECATED_ATTRIBUTE" \ - "CC_CONSTRUCTOR_ACCESS=protected" \ + "AX_USE_PHYSICS" \ + "AX_DEPRECATED_ATTRIBUTE" \ + "AX_CONSTRUCTOR_ACCESS=protected" \ "protected=private" \ - "CC_DLL=" \ - "CC_GUI_DLL=" \ + "AX_DLL=" \ + "AX_GUI_DLL=" \ "_USRDLL=" \ "_EXPORT_DLL_=" \ "EXPORT_DLL_=" \ @@ -2025,8 +2025,8 @@ PREDEFINED = "CC_PROPERTY_READONLY(varType, varName, funName)=protec "_USREXDLL=" \ "_USRSTUDIODLL=" \ "TOLUA_API=extern" \ - "CC_ENABLE_SCRIPT_BINDING=1" \ - "CC_USE_PHYSICS=1" + "AX_ENABLE_SCRIPT_BINDING=1" \ + "AX_USE_PHYSICS=1" # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this # tag can be used to specify a list of macro names that should be expanded. The diff --git a/tools/unix-ci/generate_docs.sh b/tools/unix-ci/generate_docs.sh new file mode 100644 index 0000000000..312c09efdb --- /dev/null +++ b/tools/unix-ci/generate_docs.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +sudo apt install doxygen + +CONFIG_NAME=doxygen +if [ ! -z $1 ]; then + CONFIG_NAME=$1 +fi + +# sed -i .bak '/AX_DEPRECATED_ATTRIBUTE AX_DLL/,/NS_AX_END/d' ../../core/base/ccUTF8.h + +version=`grep -e 'AX_VERSION_STR' $DIR/../../core/axmolver.h.in | awk '{print substr($3,0,length($3))}'` +version=`echo $version|sed "s/\"//g"` # remove quotes +echo $version + +cd $DIR/../../docs +#we should read axmolver.h and retrieve the version number +sed -i .bak "s/1\.0/${version}/g" doxygen.config + +doxygen ${CONFIG_NAME}.config + +#restore the old doxygen.config +mv doxygen.config.bak doxygen.config + +#restore the old ccUTF8.h +# mv ../core/base/ccUTF8.h.bak ../core/base/ccUTF8.h + +# rm debug.txt diff --git a/tools/win-ci/genbindings.ps1 b/tools/win-ci/genbindings.ps1 index 8a8fdd8526..3b34818878 100644 --- a/tools/win-ci/genbindings.ps1 +++ b/tools/win-ci/genbindings.ps1 @@ -41,6 +41,13 @@ curl -L "https://github.com/axmolengine/buildware/releases/download/llvmorg-15.0 Expand-Archive -Path llvmorg-15.0.7.zip -DestinationPath .\ Copy-Item ".\llvmorg-15.0.7\llvm\prebuilt\windows\x64\libclang.dll" -Destination "..\tools\bindings-generator\libclang" +## ensure $env:AX_ROOT/core/axmolver.h exists +$env:AX_ROOT = (Resolve-Path $PSScriptRoot\..\..).Path +echo "AX_ROOT=$env:AX_ROOT" +if (!(Test-Path "$env:AX_ROOT\core\axmolver.h" -PathType Leaf)) { + Copy-Item "$env:AX_ROOT\core\axmolver.h.in" -Destination "$env:AX_ROOT\core\axmolver.h" +} + ## run genbindings.py pwd cd ..\tools\tolua