diff --git a/.github/workflows/automation_labels.yml b/.github/workflows/automation_labels.yml deleted file mode 100644 index fe3642ff068..00000000000 --- a/.github/workflows/automation_labels.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: automation-labels - -on: - pull_request_target: - types: [opened] - -jobs: - automate-labels: - concurrency: - group: ${{ github.head_ref }} - cancel-in-progress: true - runs-on: ubuntu-latest - steps: - - name: Check organization - id: get_check_code - run: | - http_code=`curl -s --head -I -H "Authorization: token ${{ secrets.LABEl_TOKEN }}" -H "Accept: application/vnd.github.v3+json" https://api.github.com/orgs/cocos/members/${{ github.event.pull_request.user.login }} | awk '/HTTP/{print $2}'` - echo "::set-output name=http_code::${http_code}" - - name: Echo username organization - run: | - echo ${{ github.event.pull_request.user.login }} - echo ${{ steps.get_check_code.outputs.http_code }} - - name: Add contribution label - if: | - steps.get_check_code.outputs.http_code == 404 - uses: OperationsYU/labeler@master - with: - add-labels: "contribution" - - - name: assignment - if: | - steps.get_check_code.outputs.http_code == 404 - uses: OperationsYU/auto-assignment@v1 - with: - token: ${{ secrets.LABEl_TOKEN }} - users: '["holycanvas"]' diff --git a/.github/workflows/mirror_gitee.yml b/.github/workflows/mirror_gitee.yml deleted file mode 100644 index a2f16c42b13..00000000000 --- a/.github/workflows/mirror_gitee.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: 'GitHub Actions Mirror' - -on: [create, push, delete] - -jobs: - mirror_to_gitee: - runs-on: ubuntu-latest - steps: - - name: 'Checkout' - uses: actions/checkout@v1 - - name: 'Mirror to gitee' - uses: pixta-dev/repository-mirroring-action@v1 - with: - target_repo_url: - git@gitee.com:creator-cocos/engine.git - ssh_private_key: - ${{ secrets.GITEE_KEY }} diff --git a/.github/workflows/native-bindings.yml b/.github/workflows/native-bindings.yml deleted file mode 100644 index 2f3fdb887ff..00000000000 --- a/.github/workflows/native-bindings.yml +++ /dev/null @@ -1,59 +0,0 @@ -name: Glue - -on: - pull_request_target: - types: [closed] - -jobs: - generate-jsb: - if: github.event_name == 'pull_request_target' && github.event.action == 'closed' && github.event.pull_request.merged == true - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Download external libraries - run: | - EXT_VERSION=`node ./.github/workflows/get-native-external-version.js` - git clone --branch $EXT_VERSION --depth 1 https://github.com/cocos-creator/engine-native-external native/external - rm -rf native/external/.git - - - name: Run genbindings.py - run: | - python3 -m pip install PyYAML==5.4.1 Cheetah3 - python3 ./native/tools/tojs/genbindings.py - rm ./native/tools/tojs/userconf.ini - - name: Update builtin-res - run: | - cd native - npm install -g typescript - sh utils/generate_compile_commands_android.sh - cmake --build ./build --target builtin-res - - - name: Create Pull Request - uses: fish9167/create-pull-request@v3 - with: - title: '[ci skip][AUTO]: Automated PR to generate code' - body: | - Automated PR to genbindings & built resources - committer: cocos-robot - author: cocos-robot - commit-message: "[ci skip][AUTO]: Automated code generating update: ${{ github.event.pull_request.head.sha }} (#${{ github.event.number }})" - token: ${{ secrets.PR_TOKEN }} - push-to-fork: cocos-robot/engine - branch: t/bot/genbindings - branch-suffix: short-commit-hash - delete-branch: true - milestone: 1 - - #- name: Make PR - # run: | - # cd native/tools/travis-scripts && bash generate-pr.sh - # env: - # TRAVIS_OS_NAME: linux - # TRAVIS_PULL_REQUEST: "false" - # TRAVIS_BRANCH: ${{github.base_ref}} - # TRAVIS_COMMIT: ${{github.sha}} - # TRAVIS_COMMIT_MESSAGE: ${{github.event.head_commit.message}} - # GH_EMAIL: cocos-robot@cocos.com - # GH_PASSWORD: ${{ secrets.PR_TOKEN }} - # GH_TOKEN: ${{ secrets.PR_TOKEN }} - # GH_USER: cocos-robot diff --git a/.github/workflows/native-clang-format.yml b/.github/workflows/native-clang-format.yml deleted file mode 100644 index a5342fb9047..00000000000 --- a/.github/workflows/native-clang-format.yml +++ /dev/null @@ -1,53 +0,0 @@ -name: Apply clang format - -#on: [push, pull_request] -on: - pull_request_target: - types: [closed] - -jobs: - Clang-Format: - if: github.event_name == 'pull_request_target' && github.event.action == 'closed' && github.event.pull_request.merged == true - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - with: - token: ${{ github.token }} - ref: ${{ github.head_sha }} - - - id: get_change_files - uses: fish9167/file-changes-action@v1.2.3 - with: - output: ' ' - fileOutput: ' ' - - - name: Echo change files - run: | - cat $HOME/files.txt - mv $HOME/files.txt ${{github.workspace}}/files.txt - - - uses: fish9167/clang-format-lint-action@master - with: - source: ./native - exclude: ./native/cocos/bindings/auto - extensions: 'c,h,hpp,cpp,cxx' - style: file - inplace: True - clangFormatVersion: 12 - - - name: Create Pull Request - uses: fish9167/create-pull-request@v3 - with: - title: '[ci skip][AUTO]: Automated PR to fix formatting' - body: | - Automated PR to fix formatting - committer: cocos-robot - author: cocos-robot - commit-message: "[ci skip][AUTO]: Automated clang-format update: ${{ github.event.pull_request.head.sha }} (#${{ github.event.number }})" - token: ${{ secrets.PR_TOKEN }} - push-to-fork: cocos-robot/engine - branch: t/bot/fix-format - branch-suffix: short-commit-hash - delete-branch: true - milestone: 1 diff --git a/.github/workflows/native-compile-linux.yml b/.github/workflows/native-compile-linux.yml deleted file mode 100644 index d79c976216b..00000000000 --- a/.github/workflows/native-compile-linux.yml +++ /dev/null @@ -1,48 +0,0 @@ -name: Linux - -on: [pull_request] - -jobs: - compile_linux: - name: "Linux-Ubuntu" - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Download external libraries - shell: bash - run: | - EXT_VERSION=`node ./.github/workflows/get-native-external-version.js` - git clone --branch $EXT_VERSION --depth 1 https://github.com/cocos-creator/engine-native-external native/external - - name: Generate bindings - run: | - python3 -m pip install PyYAML==5.4.1 Cheetah3 - python3 ./native/tools/tojs/genbindings.py - rm ./native/tools/tojs/userconf.ini - - name: Install dependencies - run: | - sudo apt install libx11-dev -y - sudo apt install libsndio-dev -y - sudo apt install ninja-build -y - - name: Compile - env: - COCOS_ENGINE_DEV: 1 - run: | - NATIVE_ROOT=$GITHUB_WORKSPACE/native - echo "Compiling Linux ... " - cd $GITHUB_WORKSPACE/templates/linux - mkdir -p build-linux/proj - touch build-linux/proj/cfg.cmake - echo "set(CC_USE_VULKAN OFF)" >> build-linux/proj/cfg.cmake - echo "set(CC_USE_GLES2 OFF)" >> build-linux/proj/cfg.cmake - echo "set(CC_USE_GLES3 ON)" >> build-linux/proj/cfg.cmake - echo "set(CC_USE_METAL OFF)" >> build-linux/proj/cfg.cmake - echo "set(USE_WEBSOCKET_SERVER OFF)" >> build-linux/proj/cfg.cmake - echo "set(CMAKE_CXX_STANDARD_REQUIRED ON)" >> build-linux/proj/cfg.cmake - echo "set(USE_PHYSICS_PHYSX OFF)" >> build-linux/proj/cfg.cmake - mkdir build-linux/assets - - RES_DIR=$GITHUB_WORKSPACE/templates/linux/build-linux - cd build-linux - cmake ../ -GNinja -DRES_DIR=$RES_DIR -DCOCOS_X_PATH=$NATIVE_ROOT - set +e - cmake --build . \ No newline at end of file diff --git a/.github/workflows/native-compile-platforms.yml b/.github/workflows/native-compile-platforms.yml deleted file mode 100644 index 3d06d148d63..00000000000 --- a/.github/workflows/native-compile-platforms.yml +++ /dev/null @@ -1,306 +0,0 @@ -name: Compile - -on: [pull_request] - -jobs: - compile_windows: - runs-on: windows-2019 - name: "Windows" - - steps: - - uses: actions/checkout@v2 - - name: Download external libraries - shell: bash - run: | - EXT_VERSION=`node ./.github/workflows/get-native-external-version.js` - git clone --branch $EXT_VERSION --depth 1 https://github.com/cocos-creator/engine-native-external native/external - - name: Install deps - run: | - choco install --forcex86 vulkan-sdk - python -m pip install PyYAML==5.4.1 Cheetah3 - - name: Generate bindings - shell: bash - run: | - python -V - cd ./native/tools/tojs - echo "Create auto-generated jsbinding glue codes." - python ./genbindings.py - rm userconf.ini - - name: Compile win64 - shell: bash - env: - COCOS_ENGINE_DEV: 1 - run: | - cd $GITHUB_WORKSPACE/templates/windows - echo "message(STATUS \"hook before \${CC_TARGET_NAME}\")" >> Pre-Sample.cmake - echo "message(STATUS \"hook after \${CC_TARGET_NAME}\")" >> Post-Sample.cmake - mkdir -p build-win64/proj - touch build-win64/proj/cfg.cmake - echo "set(CC_USE_GLES3 ON)" >> build-win64/proj/cfg.cmake - echo "set(CC_USE_VULKAN ON)" >> build-win64/proj/cfg.cmake - echo "set(CC_USE_GLES2 ON)" >> build-win64/proj/cfg.cmake - echo "set(USE_SPINE OFF)" >> build-win64/proj/cfg.cmake - echo "set(USE_DRAGONBONES OFF)" >> build-win64/proj/cfg.cmake - echo "set(USE_WEBSOCKET_SERVER ON)" >> build-win64/proj/cfg.cmake - echo "set(CMAKE_CXX_STANDARD_REQUIRED ON)" >> build-win64/proj/cfg.cmake - mkdir build-win64/assets - cd build-win64 - RES_DIR=${GITHUB_WORKSPACE//\\//}/templates/windows/build-win64 - COCOS_X_PATH=${GITHUB_WORKSPACE//\\//}/native - cmake ../ -G"Visual Studio 16 2019" -DRES_DIR=$RES_DIR -DCOCOS_X_PATH=$COCOS_X_PATH -Ax64 - cmake --build . --config Release - echo "Compile Win64 Release Done!" - - compile_android: - name: "Android" - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Download external libraries - shell: bash - run: | - EXT_VERSION=`node ./.github/workflows/get-native-external-version.js` - git clone --branch $EXT_VERSION --depth 1 https://github.com/cocos-creator/engine-native-external native/external - - name: Generate bindings - run: | - python3 -m pip install PyYAML==5.4.1 Cheetah3 - python3 ./native/tools/tojs/genbindings.py - rm ./native/tools/tojs/userconf.ini - - name: Compile - env: - COCOS_ENGINE_DEV: 1 - run: | - NATIVE_ROOT=$GITHUB_WORKSPACE/native - ANDORID_NDK=$ANDROID_NDK_LATEST_HOME - NATIVE_DIR=$GITHUB_WORKSPACE/templates/android-template - echo "Compiling Android ... " - cd $GITHUB_WORKSPACE/templates/ - echo "message(STATUS \"hook before \${CC_TARGET_NAME}\")" >> android/template/Pre-Sample.cmake - echo "message(STATUS \"hook after \${CC_TARGET_NAME}\")" >> android/template/Post-Sample.cmake - if [ ! -d android-template ]; then - cp -r android/template android-template - fi - cd $GITHUB_WORKSPACE/templates/android/build - mkdir -p build-android/proj - touch build-android/proj/cfg.cmake - echo "set(CC_USE_GLES3 ON)" >> build-android/proj/cfg.cmake - echo "set(CC_USE_VULKAN ON)" >> build-android/proj/cfg.cmake - echo "set(CC_USE_GLES2 ON)" >> build-android/proj/cfg.cmake - echo "set(USE_WEBSOCKET_SERVER ON)" >> build-android/proj/cfg.cmake - echo "set(CMAKE_CXX_STANDARD_REQUIRED ON)" >> build-android/proj/cfg.cmake - - mkdir -p build-android/assets - - ASSET_DIR=$GITHUB_WORKSPACE/templates/android/build/build-android/ - - sed -i "s@^PROP_NDK_PATH.*@PROP_NDK_PATH=$ANDORID_NDK@g" gradle.properties - sed -i "s@^APPLICATION_ID.*@APPLICATION_ID=com.cocos.android@g" gradle.properties - sed -i "s@^RES_PATH.*@RES_PATH=$ASSET_DIR@g" gradle.properties - sed -i "s@^COCOS_ENGINE_PATH.*@COCOS_ENGINE_PATH=$NATIVE_ROOT@g" gradle.properties - sed -i "s@^NATIVE_DIR.*@NATIVE_DIR=$NATIVE_DIR@g" gradle.properties - - # To speedup CI, compile arm64-v8a only - # sed -i "s@^PROP_APP_ABI.*@PROP_APP_ABI=armeabi-v7a:arm64-v8a:x86@g" gradle.properties - sed -i "s@^PROP_APP_ABI.*@PROP_APP_ABI=arm64-v8a@g" gradle.properties - - echo "Compile Android - cmake ..." - echo "ANDORID_NDK ${ANDROID_NDK} or ${ANDROID_NDK_HOME}" - ./gradlew :CocosGame:assembleDebug --quiet - echo "Compile Android Debug Done!" - - compile_mac_x86_64: - name: "MacOS x86_64" - runs-on: macos-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 - with: - python-version: "3.x" - - name: Download external libraries - shell: bash - run: | - EXT_VERSION=`node ./.github/workflows/get-native-external-version.js` - git clone --branch $EXT_VERSION --depth 1 https://github.com/cocos-creator/engine-native-external native/external - - name: Generate bindings - run: | - python -m pip install PyYAML==5.4.1 Cheetah3 - python ./native/tools/tojs/genbindings.py - rm ./native/tools/tojs/userconf.ini - - name: Compile - env: - COCOS_ENGINE_DEV: 1 - run: | - NUM_OF_CORES=`getconf _NPROCESSORS_ONLN` - NATIVE_ROOT=$GITHUB_WORKSPACE/native - echo "Compiling MacOSX ... " - cd $GITHUB_WORKSPACE/templates/mac - echo "message(STATUS \"hook before \${CC_TARGET_NAME}\")" >> Pre-Sample.cmake - echo "message(STATUS \"hook after \${CC_TARGET_NAME}\")" >> Post-Sample.cmake - mkdir -p build-mac/proj - touch build-mac/proj/cfg.cmake - echo "set(CC_USE_VULKAN OFF)" >> build-mac/proj/cfg.cmake - echo "set(CC_USE_GLES2 OFF)" >> build-mac/proj/cfg.cmake - echo "set(CC_USE_GLES3 OFF)" >> build-mac/proj/cfg.cmake - echo "set(CC_USE_METAL ON)" >> build-mac/proj/cfg.cmake - echo "set(USE_WEBSOCKET_SERVER OFF)" >> build-mac/proj/cfg.cmake - echo "set(CMAKE_CXX_STANDARD_REQUIRED ON)" >> build-mac/proj/cfg.cmake - mkdir build-mac/assets - - RES_DIR=$GITHUB_WORKSPACE/templates/mac/build-mac - cd build-mac - cmake ../ -GXcode -DCMAKE_OSX_ARCHITECTURES=x86_64 -DRES_DIR=$RES_DIR -DCOCOS_X_PATH=$NATIVE_ROOT - set +e - cmake --build . --config Release -- -quiet -jobs $NUM_OF_CORES -arch x86_64 - retcode=$? - set -e - if [ $retcode -ne 0 ]; then - echo "-----------------------------------------------------------------------------------------------" - echo "------------------------------------ recompile without `-quiet` -------------------------------" - echo "-----------------------------------------------------------------------------------------------" - cmake --build . --config Release -- -jobs $NUM_OF_CORES -arch x86_64 - fi - echo "Compile MacOSX x86_64 Release Done!" - - compile_mac_arm64: - name: "MacOS arm64" - runs-on: macos-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 - with: - python-version: "3.x" - - name: Download external libraries - shell: bash - run: | - EXT_VERSION=`node ./.github/workflows/get-native-external-version.js` - git clone --branch $EXT_VERSION --depth 1 https://github.com/cocos-creator/engine-native-external native/external - - name: Generate bindings - run: | - python -m pip install PyYAML==5.4.1 Cheetah3 - python ./native/tools/tojs/genbindings.py - rm ./native/tools/tojs/userconf.ini - - name: Compile - env: - COCOS_ENGINE_DEV: 1 - run: | - NUM_OF_CORES=`getconf _NPROCESSORS_ONLN` - NATIVE_ROOT=$GITHUB_WORKSPACE/native - echo "Compiling MacOSX ... " - cd $GITHUB_WORKSPACE/templates/mac - mkdir -p build-mac/proj - touch build-mac/proj/cfg.cmake - echo "set(CC_USE_VULKAN OFF)" >> build-mac/proj/cfg.cmake - echo "set(CC_USE_GLES2 OFF)" >> build-mac/proj/cfg.cmake - echo "set(CC_USE_GLES3 OFF)" >> build-mac/proj/cfg.cmake - echo "set(CC_USE_METAL ON)" >> build-mac/proj/cfg.cmake - echo "set(USE_WEBSOCKET_SERVER OFF)" >> build-mac/proj/cfg.cmake - echo "set(CMAKE_CXX_STANDARD_REQUIRED ON)" >> build-mac/proj/cfg.cmake - mkdir build-mac/assets - - RES_DIR=$GITHUB_WORKSPACE/templates/mac/build-mac - cd build-mac - cmake ../ -GXcode -DCMAKE_OSX_ARCHITECTURES=arm64 -DRES_DIR=$RES_DIR -DCOCOS_X_PATH=$NATIVE_ROOT - set +e - cmake --build . --config Release -- -quiet -jobs $NUM_OF_CORES -arch arm64 - retcode=$? - set -e - if [ $retcode -ne 0 ]; then - echo "-----------------------------------------------------------------------------------------------" - echo "------------------------------------ recompile without `-quiet` -------------------------------" - echo "-----------------------------------------------------------------------------------------------" - cmake --build . --config Release -- -jobs $NUM_OF_CORES -arch arm64 - fi - echo "Compile MacOSX ARM64 Release Done!" - - compile_iOS: - name: "iOS" - runs-on: macos-latest - steps: - - uses: maxim-lobanov/setup-xcode@v1 - with: - xcode-version: latest-stable - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 - with: - python-version: "3.x" - - name: Download external libraries - shell: bash - run: | - EXT_VERSION=`node ./.github/workflows/get-native-external-version.js` - git clone --branch $EXT_VERSION --depth 1 https://github.com/cocos-creator/engine-native-external native/external - - name: Generate bindings - run: | - python -m pip install PyYAML==5.4.1 Cheetah3 - python ./native/tools/tojs/genbindings.py - rm ./native/tools/tojs/userconf.ini - - name: Compile - env: - COCOS_ENGINE_DEV: 1 - run: | - set -x - NUM_OF_CORES=`getconf _NPROCESSORS_ONLN` - NATIVE_ROOT=$GITHUB_WORKSPACE/native - echo "Compiling iOS ... " - cd $GITHUB_WORKSPACE/templates/ios - echo "message(STATUS \"hook before \${CC_TARGET_NAME}\")" >> Pre-Sample.cmake - echo "message(STATUS \"hook after \${CC_TARGET_NAME}\")" >> Post-Sample.cmake - mkdir -p build-ios/proj - touch build-ios/proj/cfg.cmake - echo "set(CC_USE_GLES3 OFF)" >> build-ios/proj/cfg.cmake - echo "set(CC_USE_VULKAN OFF)" >> build-ios/proj/cfg.cmake - echo "set(CC_USE_GLES2 OFF)" >> build-ios/proj/cfg.cmake - echo "set(CC_USE_METAL ON)" >> build-ios/proj/cfg.cmake - echo "set(TARGET_IOS_VERSION 12.0)" >> build-ios/proj/cfg.cmake - echo "set(USE_WEBSOCKET_SERVER OFF)" >> build-ios/proj/cfg.cmake - echo "set(USE_DRAGONBONES OFF)" >> build-ios/proj/cfg.cmake - echo "set(CMAKE_CXX_STANDARD_REQUIRED OFF)" >> build-ios/proj/cfg.cmake - echo "set(MACOSX_BUNDLE_GUI_IDENTIFIER com.cocos.demo.ios)" >> build-ios/proj/cfg.cmake - mkdir build-ios/assets - cd build-ios - RES_DIR=$GITHUB_WORKSPACE/templates/ios/build-ios - cmake ../ -GXcode -DCMAKE_SYSTEM_NAME=iOS \ - -DCMAKE_OSX_SYSROOT=iphoneos \ - -DCMAKE_OSX_ARCHITECTURES=arm64 \ - -DRES_DIR=$RES_DIR \ - -DCOCOS_X_PATH=$NATIVE_ROOT - set +e - #cmake --build . --config Debug -- -quiet -jobs $NUM_OF_CORES -allowProvisioningUpdates CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO - cmake --build . --config Debug -- -quiet -jobs $NUM_OF_CORES CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO - retcode=$? - set -e - if [ $retcode -ne 0 ]; then - echo "-----------------------------------------------------------------------------------------------" - echo "------------------------------------ recompile without `-quiet` -------------------------------" - echo "-----------------------------------------------------------------------------------------------" - cmake --build . --config Debug -- -jobs $NUM_OF_CORES CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO - fi - echo "Compile iOS Done!" - - compile_wgpu_mac: - name: "Emscripten" - runs-on: macos-latest - if: contains( github.event.head_commit.message, 'WGPU_CI_ON' ) - steps: - - uses: actions/checkout@v2 - - name: Download external libraries - shell: bash - run: | - EXT_VERSION=`node ./.github/workflows/get-native-external-version.js` - git clone --branch $EXT_VERSION --depth 1 https://github.com/cocos-creator/engine-native-external native/external - - name: Setup Emscripten - run: | - git clone https://github.com/emscripten-core/emsdk.git ../emsdk - cd ../emsdk - ./emsdk install latest - ./emsdk activate latest - source ./emsdk_env.sh - emcc -v - - name: Compile - env: - COCOS_ENGINE_DEV: 1 - run: | - NATIVE_ROOT=$GITHUB_WORKSPACE/native - cd $NATIVE_ROOT/cocos/renderer/gfx-wgpu - $NATIVE_ROOT/../emsdk/upstream/emscripten/emcmake cmake . - $NATIVE_ROOT/../emsdk/upstream/emscripten/emmake make - echo "Compile WGPU by ems on MacOS Done!" diff --git a/.github/workflows/native-linter-android.yml b/.github/workflows/native-linter-android.yml index 11fd6c63264..3ab3a3b01d5 100644 --- a/.github/workflows/native-linter-android.yml +++ b/.github/workflows/native-linter-android.yml @@ -1,6 +1,8 @@ name: Linter -on: pull_request +on: [pull_request] +# on: + # pull_request_target jobs: # Set the job key. The key is displayed as the job name @@ -36,37 +38,6 @@ jobs: cd ./native/tools/tojs python ./genbindings.py rm userconf.ini - - name: Get changed files - uses: PatriceJiang/paths-filter@master - id: listchanged - with: - list-files: shell - filters: | - source: - - added|modified: '**/*.cpp' - - added|modified: '**/*.h' - - added|modified: '**/*.hpp' - - added|modified: '**/*.m' - - added|modified: '**/*.mm' - - added|modified: '**/*.c' - - exclude: 'native/cocos/editor-support/**' - - exclude: 'native/cocos/base/etc1.*' - - exclude: 'native/cocos/base/etc2.*' - - exclude: 'native/cocos/bindings/manual/jsb_global.cpp' - - exclude: 'native/cocos/bindings/manual/jsb_dragonbones_manual.cpp' - - exclude: 'native/cocos/bindings/manual/jsb_spine_manual.cpp' - - exclude: 'native/cocos/bindings/manual/jsb_socketio.cpp' - - exclude: 'native/cocos/bindings/manual/jsb_conversions.*' - - exclude: 'native/cocos/bindings/jswrapper/v8/debugger/**' - - exclude: 'native/cocos/audio/android/audio_utils/**' - allChanges: - - added|modified|deleted: '**' - skipedDebug: - - added|modified|deleted: '**' - - exclude: 'native/cocos/editor-support/**' - - name: Install CMake & Clang Tidy - run: | - sudo apt install -y cmake llvm clang-tidy-11 - name: Generate Compile database shell: bash @@ -74,22 +45,48 @@ jobs: cd native ./utils/generate_compile_commands_android.sh - - name: Generate clang-fix.yaml - shell: bash - if: ${{ steps.listchanged.outputs.source == 'true' }} - run: | - CPP="${{ steps.listchanged.outputs.source_files }}" - FILTERED=`node .github/workflows/filter_by_cdb.js $CPP` - if [[ "$FILTERED-xxx" == "-xxx" ]]; then - echo "no source files match" - else - clang-tidy-11 --format-style=file --export-fixes=clang-fixes.yaml $FILTERED - fi - - name: clang-tidy-action - uses: PatriceJiang/clang-tidy-action@master - if: hashFiles('clang-fixes.yaml') != '' + - uses: shenxianpeng/cpp-linter-action@v1 + name: lint action + id: linter + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - fixesFile: clang-fixes.yaml - noFailOnIssue: false - repo-token: ${{ secrets.GITHUB_TOKEN }} - error-limit: 200 + style: file + version: 11 + thread-comments: false + ignore: native/cocos/editor-support|native/cocos/bindings/manual|native/cocos/bindings/jswrapper/v8/debugger|native/cocos/audio/android/audio_utils|native/cocos/renderer/gfx-vulkan/volk|native/cocos/bindings/auto + database: native + + - name: Fail fast! + if: steps.linter.outputs.checks-failed > 0 + run: | + echo "Some files failed the linting checks!" + exit 1 + # for actual deployment + # run: exit 1 + # - name: Generate clang-fix.yaml + # shell: bash + # if: ${{ steps.listchanged.outputs.source == 'true' }} + # run: | + # CPP="${{ steps.listchanged.outputs.source_files }}" + # FILTERED=`node .github/workflows/filter_by_cdb.js $CPP` + # if [[ "$FILTERED-xxx" == "-xxx" ]]; then + # echo "no source files match" + # else + # for src in $FILTERED + # do + # echo "lint file ${src} ..." + # done + # clang-tidy-11 --format-style=file --export-fixes=clang-fixes.yaml $FILTERED + # du -h clang-fixes.yaml + # fi + # - name: clang-tidy-action + # uses: PatriceJiang/clang-tidy-action@github-api + # if: hashFiles('clang-fixes.yaml') != '' + # with: + # fixesFile: clang-fixes.yaml + # useLog: false + # noFailOnIssue: false + # repo-token: ${{ secrets.PR_TOKEN }} + # github-token: ${{ secrets.GITHUB_TOKEN }} + # error-limit: 200 diff --git a/.github/workflows/native-simulator.yml b/.github/workflows/native-simulator.yml deleted file mode 100644 index 1ef0c17cae0..00000000000 --- a/.github/workflows/native-simulator.yml +++ /dev/null @@ -1,88 +0,0 @@ -name: Simulator - -#on: [pull_request] -on: - pull_request: - paths: - - 'native/**' - -jobs: - win_gen_simulator: - runs-on: windows-2019 - name: Windows - defaults: - run: - working-directory: ${{github.workspace}}/native - - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 - with: - python-version: "3.x" - - - name: npm install - run: | - npm install - - name: download external libraries - run: | - node ./utils/download-deps.js - - name: install vulkan-sdk - run: | - choco install vulkan-sdk - - name: pip install - run: | - python -m pip install PyYAML==5.4.1 Cheetah3 - - name: generate bindings glue codes - shell: bash - run: | - python -V - cd ./tools/tojs - echo "Create auto-generated jsbinding glue codes." - python ./genbindings.py - rm userconf.ini - - name: gen simulator - run: | - gulp gen-simulator - - name: check result - run: | - Get-ChildItem ./simulator/Debug -Name SimulatorApp-Win32.exe - if(Test-Path ./simulator/Debug/SimulatorApp-Win32.exe) {exit 0} else {exit 1} - - # mac_gen_simulator: - # runs-on: macos-latest - # name: MacOS - # defaults: - # run: - # working-directory: ${{github.workspace}}/native - # steps: - # - uses: actions/checkout@v2 - # - uses: actions/setup-python@v2 - # with: - # python-version: "3.x" - # - name: npm install - # run: | - # npm install - # npm install gulp -g - # - name: download external libraries - # run: | - # node ./utils/download-deps.js - # - name: pip install - # run: | - # python -m pip install PyYAML Cheetah3 - # - name: generate bindings glue codes - # shell: bash - # run: | - # python -V - # cd ${{github.workspace}}/tools/travis-scripts - # echo "Create auto-generated jsbinding glue codes." - # pushd ${{github.workspace}}/tools/tojs - # python ./genbindings.py - # rm userconf.ini - # popd - # - name: gen simulator - # run: | - # gulp gen-simulator-release - # - name: check result - # run: | - # find ./ -name SimulatorApp-Mac - # [ -f ./simulator/Debug/SimulatorApp-Mac.app/Contents/MacOS/SimulatorApp-Mac ] && exit 0 || exit 1 diff --git a/.github/workflows/native-unit-test.yml b/.github/workflows/native-unit-test.yml deleted file mode 100644 index c10b87c3593..00000000000 --- a/.github/workflows/native-unit-test.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: Run Tests - -on: [pull_request] - -jobs: - unit-test-with-cmake: - name: "Run on windows" - runs-on: windows-latest - defaults: - run: - working-directory: ${{github.workspace}}/native - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 - with: - python-version: "3.x" - - - name: Downlad external libraties - run: | - npm install - npm install gulp -g - node ./utils/download-deps.js - - - name: Generate bindings - shell: bash - run: | - python -m pip install PyYAML==5.4.1 Cheetah3 - python ./tools/tojs/genbindings.py - - - name: Run Unit Tests - shell: bash - run: | - cmake -B tests/unit-test/build -S tests/unit-test - cmake --build tests/unit-test/build --config Release - ./tests/unit-test/build/src/Release/CocosTest.exe - - #### TODO(PatriceJiang): model split - # - name: Run Module Tests - # shell: bash - # run: | - # cd tests/module-tests - # bash run-test-windows.sh diff --git a/.github/workflows/native_compile_self.yml b/.github/workflows/native_compile_self.yml deleted file mode 100644 index e130b003f35..00000000000 --- a/.github/workflows/native_compile_self.yml +++ /dev/null @@ -1,107 +0,0 @@ -name: Compile-self - -on: - pull_request: - paths: - - 'native/**' - -jobs: - compile_android: - name: "Android" - runs-on: aws-linux-action - - steps: - - uses: actions/checkout@v2 - - name: Download external libraries - shell: bash - run: | - EXT_VERSION=`node ./.github/workflows/get-native-external-version.js` - git clone --branch $EXT_VERSION --depth 1 https://github.com/cocos-creator/engine-native-external native/external - - - name: Generate bindings - run: | - NDK_ROOT='/home/tools/android-sdk-linux/ndk-bundle' - ANDROID_NDK_HOME='/home/tools/android-sdk-linux/ndk-bundle' - export NDK_ROOT ANDROID_NDK_HOME - python3 ./native/tools/tojs/genbindings.py - rm ./native/tools/tojs/userconf.ini - - - name: Compile - env: - COCOS_ENGINE_DEV: 1 - run: | - NATIVE_ROOT=$GITHUB_WORKSPACE/native - ANDORID_NDK='/home/tools/android-sdk-linux/ndk-bundle' - ANDROID_NDK_HOME='/home/tools/android-sdk-linux/ndk-bundle' - ANDROID_SDK_ROOT='/home/tools/android-sdk-linux' - export ANDORID_NDK ANDROID_SDK_ROOT ANDROID_NDK_HOME - NATIVE_DIR=$GITHUB_WORKSPACE/templates/android-template - echo "Compiling Android ... " - cd $GITHUB_WORKSPACE/templates/ - if [ ! -d android-template ]; then - cp -r android/template android-template - fi - cd $GITHUB_WORKSPACE/templates/android/build - mkdir -p build-android/proj - touch build-android/proj/cfg.cmake - echo "set(CC_USE_GLES3 ON)" >> build-android/proj/cfg.cmake - echo "set(CC_USE_VULKAN ON)" >> build-android/proj/cfg.cmake - echo "set(CC_USE_GLES2 ON)" >> build-android/proj/cfg.cmake - echo "set(USE_WEBSOCKET_SERVER ON)" >> build-android/proj/cfg.cmake - echo "set(CMAKE_CXX_STANDARD_REQUIRED ON)" >> build-android/proj/cfg.cmake - mkdir -p build-android/assets - ASSET_DIR=$GITHUB_WORKSPACE/templates/android/build/build-android/ - sed -i "s@^PROP_NDK_PATH.*@PROP_NDK_PATH=$ANDORID_NDK@g" gradle.properties - sed -i "s@^APPLICATION_ID.*@APPLICATION_ID=com.cocos.android@g" gradle.properties - sed -i "s@^RES_PATH.*@RES_PATH=$ASSET_DIR@g" gradle.properties - sed -i "s@^COCOS_ENGINE_PATH.*@COCOS_ENGINE_PATH=$NATIVE_ROOT@g" gradle.properties - sed -i "s@^NATIVE_DIR.*@NATIVE_DIR=$NATIVE_DIR@g" gradle.properties - # To speedup CI, compile arm64-v8a only - # sed -i "s@^PROP_APP_ABI.*@PROP_APP_ABI=armeabi-v7a:arm64-v8a:x86@g" gradle.properties - sed -i "s@^PROP_APP_ABI.*@PROP_APP_ABI=arm64-v8a@g" gradle.properties - echo "Compile Android - cmake ..." - echo "ANDORID_NDK ${ANDROID_NDK} or ${ANDROID_NDK_HOME}" - ./gradlew :CocosGame:assembleDebug --quiet - echo "Compile Android Debug Done!" - - compile_windows: - name: "Windows" - runs-on: aws-win-action - - steps: - - uses: actions/checkout@v2 - - name: Download external libraries - shell: bash - run: | - EXT_VERSION=`node ./.github/workflows/get-native-external-version.js` - git clone --branch $EXT_VERSION --depth 1 https://github.com/cocos-creator/engine-native-external native/external - - - name: Generate bindings - shell: bash - run: | - python2 -V - cd ./native/tools/tojs - echo "Create auto-generated jsbinding glue codes." - python2 ./genbindings.py - rm userconf.ini - - - name: Compile win64 - shell: bash - env: - COCOS_ENGINE_DEV: 1 - run: | - cd $GITHUB_WORKSPACE/templates/windows - mkdir -p build-win64/proj - touch build-win64/proj/cfg.cmake - echo "set(CC_USE_GLES3 ON)" >> build-win64/proj/cfg.cmake - echo "set(CC_USE_VULKAN ON)" >> build-win64/proj/cfg.cmake - echo "set(CC_USE_GLES2 ON)" >> build-win64/proj/cfg.cmake - echo "set(USE_WEBSOCKET_SERVER ON)" >> build-win64/proj/cfg.cmake - echo "set(CMAKE_CXX_STANDARD_REQUIRED ON)" >> build-win64/proj/cfg.cmake - mkdir build-win64/assets - cd build-win64 - RES_DIR=${GITHUB_WORKSPACE//\\//}/templates/windows/build-win64 - COCOS_X_PATH=${GITHUB_WORKSPACE//\\//}/native - cmake ../ -G"Visual Studio 15 2017" -DRES_DIR=$RES_DIR -DCOCOS_X_PATH=$COCOS_X_PATH -Ax64 - cmake --build . --config Release - echo "Compile Win64 Release Done!" diff --git a/.github/workflows/run_test_cases.yml b/.github/workflows/run_test_cases.yml deleted file mode 100644 index 55aa672a5a7..00000000000 --- a/.github/workflows/run_test_cases.yml +++ /dev/null @@ -1,65 +0,0 @@ -name: run test cases - -on: - issue_comment: - types: [created, edited] - pull_request_review_comment: - types: [created, edited] - -jobs: - run-test-cases: - if: | - github.event.issue.pull_request && contains(github.event.comment.body, '@cocos-robot run test cases') - runs-on: run-test-win01 - - steps: - - uses: octokit/request-action@v2.x - id: find_pull_request - with: - route: GET /repos/cocos-creator/engine/pulls/${{ github.event.issue.number }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Parse Pull Request - id: parse_pull_request - shell: pwsh - run: | - $pull_request = @" - ${{ steps.find_pull_request.outputs.data }} - "@ | ConvertFrom-Json - Write-Host $pull_request - Write-Host "::set-output name=pr_html_url::$($pull_request.html_url)" - Write-Host "::set-output name=pr_number::$($pull_request.number)" - Write-Host "::set-output name=pr_author::$($pull_request.user.login)" - Write-Host "::set-output name=pr_head_ref::$($pull_request.head.ref)" - Write-Host "::set-output name=pr_head_sha::$($pull_request.head.sha)" - Write-Host "::set-output name=pr_base_ref::$($pull_request.base.ref)" - Write-Host "::set-output name=pr_base_sha::$($pull_request.base.sha)" - - name: Echo pull request - run: | - echo "${{ steps.parse_pull_request.outputs.pr_head_ref }}" - echo "${{ steps.parse_pull_request.outputs.pr_head_sha }}" - echo "${{ steps.parse_pull_request.outputs.pr_base_ref }}" - echo "${{ steps.parse_pull_request.outputs.pr_base_sha }}" - - - name: update comment - uses: peter-evans/create-or-update-comment@v1 - with: - issue-number: ${{ steps.parse_pull_request.outputs.pr_number }} - body: | - @${{ steps.parse_pull_request.outputs.pr_author }},请查阅任务(run test cases)执行结果:https://github.com/cocos-creator/engine/actions/runs/${{ github.run_id }} - - name: 'Checkout engine' - uses: actions/checkout@v2 - with: - ref: ${{ steps.parse_pull_request.outputs.pr_head_sha }} - path: engine - - - name: 'npm install' - run: | - cd engine - npm -v - npm install --registry https://registry.npm.taobao.org - - - name: 'Call run test cases job' - run: | - python3 -u ./pr-test/main.py ${{ steps.parse_pull_request.outputs.pr_base_ref }} diff --git a/.github/workflows/web-build.yml b/.github/workflows/web-build.yml deleted file mode 100644 index f98fbe3914f..00000000000 --- a/.github/workflows/web-build.yml +++ /dev/null @@ -1,28 +0,0 @@ -# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions - -name: build - -on: [pull_request] - -jobs: - build: - - runs-on: ubuntu-latest - - strategy: - matrix: - node-version: [12.x] - # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ - - steps: - - uses: actions/checkout@v2 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 - with: - node-version: ${{ matrix.node-version }} - - run: npm install -g gulp - - run: npm ci - - run: echo "::add-matcher::.github/workflows/build-problem-matcher.json" - - run: gulp build-h5-source - #- run: echo "::remove-matcher owner=circular-reference-check::" diff --git a/.github/workflows/web-check_version.yml b/.github/workflows/web-check_version.yml deleted file mode 100644 index 63dad91928f..00000000000 --- a/.github/workflows/web-check_version.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: Check version - -#on: push -on: [create, pull_request] - -jobs: - Check_pull_request_version: - runs-on: ubuntu-latest - if: github.event_name == 'pull_request' - steps: - - uses: actions/checkout@v2 - - - name: npm install - run: | - node -v - npm install || exit 0 - - - name: check version - run: | - branch=`echo ${{ github.base_ref }} | awk -F'/' '{print $NF}'` - echo "Branch: ${branch}" - npm run varify-engine-version -- ${branch} - - Check_create_version: - runs-on: ubuntu-latest - if: github.event_name == 'create' - steps: - - uses: actions/checkout@v2 - - - name: npm install - run: | - node -v - npm install || exit 0 - - name: check version - run: | - branch=`echo ${{ github.ref }} | awk -F'/' '{print $NF}'` - echo "Branch: ${branch}" - npm run varify-engine-version -- ${branch} - diff --git a/.github/workflows/web-interface-check.yml b/.github/workflows/web-interface-check.yml deleted file mode 100644 index 99f25eab628..00000000000 --- a/.github/workflows/web-interface-check.yml +++ /dev/null @@ -1,74 +0,0 @@ -name: Interface check - -#on: push -on: [pull_request_target] - -jobs: - interface_check: - runs-on: ubuntu-latest - steps: - - name: clone REPO - run: | - git config --global user.name "test" - git config --global user.email "test@test.com" - git clone https://github.com/cocos-creator/engine.git - - - name: checkout BASE branch - working-directory: ./engine - run: | - git fetch origin ${{ github.base_ref }} - git checkout -b ${{ github.base_ref }}_BASE remotes/origin/${{ github.base_ref }} - git branch - - - name: npm install BASE branch - working-directory: ./engine - run: | - npm install --ignore-scripts - - - name: build BASE declaration - working-directory: ./engine - run: | - npm run build-declaration - cp ./bin/.declarations/cc.d.ts ../cc_base.d.ts - - - name: clear dependencies - working-directory: ./engine - run: | - git checkout . - git clean -xfd - ls -la - - - name: merge HEAD branch - working-directory: ./engine - run: | - git remote add HEAD_REPO https://github.com/${{ github.event.pull_request.head.repo.full_name }}.git - git fetch HEAD_REPO ${{ github.head_ref }} - git merge remotes/HEAD_REPO/${{ github.head_ref }} - - - name: npm install HEAD branch - working-directory: ./engine - run: | - npm install --ignore-scripts - - - name: build HEAD declaration - working-directory: ./engine - run: | - npm run build-declaration - - - uses: LouisBrunner/diff-action@v0.1.2 - with: - old: ./cc_base.d.ts - new: ./engine/bin/.declarations/cc.d.ts - mode: addition - tolerance: worse - output: ./engine/interface-diff.txt - - - name: optimize interface check report - working-directory: ./engine - run: | - cat ./interface-diff.txt - node ./.github/workflows/interface-check-report.js - - - uses: marocchino/sticky-pull-request-comment@v2 - with: - path: ./engine/interface-diff.txt diff --git a/.github/workflows/web-npm_test.yml b/.github/workflows/web-npm_test.yml deleted file mode 100644 index c438f46dc54..00000000000 --- a/.github/workflows/web-npm_test.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: npm test - -on: [push, pull_request] - -jobs: - npm_test: - runs-on: ubuntu-18.04 - - steps: - - uses: actions/checkout@v2 - - - uses: actions/setup-node@v2 - with: - node-version: '12.13' - - - name: install gulp - run: | - npm install -g gulp - - - name: npm install - run: | - npm install - - - name: build-debug-infos - run: | - gulp build-debug-infos - - - name: run test - run: | - npm test diff --git a/.github/workflows/web-quality.yml b/.github/workflows/web-quality.yml deleted file mode 100644 index 7a6ee86f55a..00000000000 --- a/.github/workflows/web-quality.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: Quality -on: [push, pull_request] -jobs: - eslint: - name: Run ESLint - if: github.actor!= 'dependabot' # ignore the pull request which comes from user dependabot. See https://github.community/t/how-to-stop-github-actions-workflow-to-trigger-when-the-pull-request-is-from-dependabot-preview/116486/3 - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v1 - with: - node-version: 12 - - run: npm ci - - name: Run ESLint - shell: pwsh - run: ./.github/workflows/eslint.ps1 diff --git a/native/cocos/editor-support/dragonbones/animation/Animation.cpp b/native/cocos/editor-support/dragonbones/animation/Animation.cpp index adb0451902e..fa975aad1f7 100644 --- a/native/cocos/editor-support/dragonbones/animation/Animation.cpp +++ b/native/cocos/editor-support/dragonbones/animation/Animation.cpp @@ -1,19 +1,19 @@ #include "Animation.h" -#include "../model/DisplayData.h" -#include "../model/AnimationConfig.h" -#include "../model/AnimationData.h" #include "../armature/Armature.h" #include "../armature/Bone.h" #include "../armature/Slot.h" +#include "../model/AnimationConfig.h" +#include "../model/AnimationData.h" +#include "../model/DisplayData.h" #include "AnimationState.h" + DRAGONBONES_NAMESPACE_BEGIN void Animation::_onClear() { for (const auto animationState : _animationStates) { animationState->returnToPool(); } - if (_animationConfig != nullptr) { _animationConfig->returnToPool(); } diff --git a/native/cocos/editor-support/dragonbones/animation/TimelineState.cpp b/native/cocos/editor-support/dragonbones/animation/TimelineState.cpp index db7190f1e2a..197e1919264 100644 --- a/native/cocos/editor-support/dragonbones/animation/TimelineState.cpp +++ b/native/cocos/editor-support/dragonbones/animation/TimelineState.cpp @@ -1,20 +1,21 @@ #include "TimelineState.h" -#include "WorldClock.h" -#include "Animation.h" -#include "../model/DragonBonesData.h" -#include "../model/UserData.h" -#include "../model/ArmatureData.h" -#include "../model/ConstraintData.h" -#include "../model/DisplayData.h" -#include "../model/AnimationData.h" -#include "../event/EventObject.h" -#include "../event/IEventDispatcher.h" #include "../armature/Armature.h" #include "../armature/Bone.h" -#include "../armature/Slot.h" #include "../armature/Constraint.h" #include "../armature/DeformVertices.h" +#include "../armature/Slot.h" +#include "../event/EventObject.h" +#include "../event/IEventDispatcher.h" +#include "../model/AnimationData.h" +#include "../model/ArmatureData.h" +#include "../model/ConstraintData.h" +#include "../model/DisplayData.h" +#include "../model/DragonBonesData.h" +#include "../model/UserData.h" +#include "Animation.h" #include "AnimationState.h" +#include "WorldClock.h" + DRAGONBONES_NAMESPACE_BEGIN @@ -29,7 +30,6 @@ void ActionTimelineState::_onCrossFrame(unsigned frameIndex) const { for (std::size_t i = 0; i < actionCount; ++i) { const auto actionIndex = _frameArray[frameOffset + 2 + i]; const auto action = actions[actionIndex]; - if (action->type == ActionType::Play) { const auto eventObject = BaseObject::borrowObject(); // eventObject->time = _frameArray[frameOffset] * _frameRateR; // Precision problem diff --git a/native/cocos/editor-support/dragonbones/animation/WorldClock.cpp b/native/cocos/editor-support/dragonbones/animation/WorldClock.cpp index 8bfc227c68f..d9c6139883d 100644 --- a/native/cocos/editor-support/dragonbones/animation/WorldClock.cpp +++ b/native/cocos/editor-support/dragonbones/animation/WorldClock.cpp @@ -15,7 +15,6 @@ void WorldClock::advanceTime(float passedTime) { if (passedTime < 0.0f) { passedTime = currentTime - _systemTime; } - _systemTime = currentTime; if (timeScale != 1.0f) { diff --git a/native/cocos/editor-support/dragonbones/armature/Armature.cpp b/native/cocos/editor-support/dragonbones/armature/Armature.cpp index f7f810578e6..73008fac2f1 100644 --- a/native/cocos/editor-support/dragonbones/armature/Armature.cpp +++ b/native/cocos/editor-support/dragonbones/armature/Armature.cpp @@ -1,13 +1,13 @@ #include "Armature.h" -#include "../model/TextureAtlasData.h" -#include "../model/UserData.h" -#include "../animation/WorldClock.h" #include "../animation/Animation.h" +#include "../animation/WorldClock.h" #include "../event/EventObject.h" -#include "IArmatureProxy.h" +#include "../model/TextureAtlasData.h" +#include "../model/UserData.h" #include "Bone.h" -#include "Slot.h" #include "Constraint.h" +#include "IArmatureProxy.h" +#include "Slot.h" DRAGONBONES_NAMESPACE_BEGIN @@ -240,7 +240,6 @@ void Armature::invalidUpdate(const std::string& boneName, bool updateSlot) { const auto bone = getBone(boneName); if (bone != nullptr) { bone->invalidUpdate(); - if (updateSlot) { for (const auto slot : _slots) { if (slot->getParent() == bone) { @@ -362,7 +361,6 @@ Bone* Armature::getBone(const std::string& name) const { return bone; } } - return nullptr; } @@ -378,7 +376,6 @@ Slot* Armature::getSlot(const std::string& name) const { return slot; } } - return nullptr; } @@ -390,7 +387,6 @@ Slot* Armature::getSlotByDisplay(void* display) const { } } } - return nullptr; } diff --git a/native/cocos/editor-support/dragonbones/armature/DeformVertices.cpp b/native/cocos/editor-support/dragonbones/armature/DeformVertices.cpp index ca5906a1763..5b474fd8861 100644 --- a/native/cocos/editor-support/dragonbones/armature/DeformVertices.cpp +++ b/native/cocos/editor-support/dragonbones/armature/DeformVertices.cpp @@ -1,8 +1,9 @@ #include "DeformVertices.h" -#include "../model/DragonBonesData.h" -#include "../model/DisplayData.h" #include "../armature/Armature.h" #include "../armature/Bone.h" +#include "../model/DisplayData.h" +#include "../model/DragonBonesData.h" + DRAGONBONES_NAMESPACE_BEGIN @@ -15,7 +16,6 @@ void DeformVertices::_onClear() { void DeformVertices::init(const VerticesData* verticesDataValue, Armature* armature) { verticesData = verticesDataValue; - if (verticesData != nullptr) { unsigned vertexCount = 0; if (verticesData->weight != nullptr) {