Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new script generate_decorators.sh #15568

Merged
merged 1 commit into from
Jun 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 1 addition & 16 deletions .github/workflows/native-bindings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,7 @@ jobs:
add-to-path: false
- name: Generate decorators
run: |
cd native
echo "Generate compile_commands.json & ninja target"
bash ./utils/generate_compile_commands_android.sh
echo "Generate binding code ..."
ninja -C build genbindings
cd ..
npm install
cd scripts/build-engine
echo "Installing babel dependencies ..."
npm install
echo "Build typescripts ... "
npm run build
cd ../..
echo " parsing ..."
node .github/workflows/gen_decorators.js
echo " generate done!"
bash ./native/utils/generate_decorators.sh
git checkout HEAD package.json package-lock.json
git checkout HEAD scripts # revert all changes within build-engine/

Expand Down
File renamed without changes.
3 changes: 2 additions & 1 deletion native/utils/generate_compile_commands_android.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ elif [ -n "$ANDROID_NDK_ROOT" ]; then
elif [ -n "$NDK_ROOT" ]; then
ndk_path=$NDK_ROOT
else
echo "Cannot find NDK root path"
echo "NDK path not found."
echo "Please set one of the following environment variables: ANDROID_NDK_HOME, ANDROID_NDK_ROOT, or NDK_ROOT."
exit 1
fi

Expand Down
36 changes: 36 additions & 0 deletions native/utils/generate_decorators.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/usr/bin/env bash

set -e

# Get the absolute path of the script
SCRIPT_PATH="$(readlink -f "$0")"

# Extract the directory path from the script path
SCRIPT_DIR="$(dirname "$SCRIPT_PATH")"

cd $SCRIPT_DIR/..
echo "==== Generate compile_commands.json & ninja target"
rm -rf $SCRIPT_DIR/../build/CMakeCache.txt
bash ./utils/generate_compile_commands_android.sh

echo "==== Generate binding code ..."
ninja -C build genbindings


echo "==== npm install in build-engine ..."
cd ..
npm install
cd scripts/build-engine

echo "==== Installing babel dependencies ..."
npm install

echo "==== Build typescripts ... "
npm run build

echo "==== parsing ..."
node $SCRIPT_DIR/gen_decorators.js

echo "==== generate done!"
# git checkout HEAD package.json package-lock.json
# git checkout HEAD scripts # revert all changes within build-engine/