Skip to content

Commit

Permalink
📑 Javet v4.0.0 (#406)
Browse files Browse the repository at this point in the history
* Upgraded Node.js to `v22.9.0` ([2024-09-17](https://github.com/nodejs/node/blob/main/doc/changelogs/CHANGELOG_V22.md#22.9.0))
* Upgraded V8 to `v13.0.245.16` (2024-10-08)
* Added `NodeI18n`, `V8I18n` to `JSRuntimeType`
* Added `getNodeI18nInstance()`, `getV8I18nInstance()` to `V8Host`
* Renamed `V8Runtime.hasPendingException()` to `V8Runtime.hasException()`
* Removed `V8Runtime.hasScheduledException()` and `V8Runtime.promoteScheduledException()`
* Moved `JavetReflectionObjectFactory` to `JavetBuddy`
* Added `NodeFlags`
* Added `NODE_FLAGS` to `NodeRuntimeOptions`
* Supported `node:sqlite`
  • Loading branch information
caoccao authored Oct 14, 2024
1 parent 2e3470a commit 775049d
Show file tree
Hide file tree
Showing 93 changed files with 2,322 additions and 858 deletions.
109 changes: 86 additions & 23 deletions .github/workflows/android_node_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ on:
workflow_dispatch:

env:
JAVET_NODE_VERSION: 20.17.0
JAVET_VERSION: 3.1.8
JAVET_NODE_VERSION: 22.9.0
JAVET_VERSION: 4.0.0
ROOT: /home/runner/work/Javet

jobs:
Expand All @@ -19,14 +19,36 @@ jobs:
include:
- android_arch: arm
android_abi: armeabi-v7a
i18n_name: non-i18n
cmake_flag:
config_patch:
- android_arch: arm64
android_abi: arm64-v8a
i18n_name: non-i18n
cmake_flag:
config_patch:
- android_arch: x86
android_abi: x86
i18n_name: non-i18n
cmake_flag:
config_patch:
- android_arch: x86_64
android_abi: x86_64
i18n_name: non-i18n
cmake_flag:
config_patch:
- android_arch: arm64
android_abi: arm64-v8a
i18n_name: i18n
cmake_flag: -DENABLE_I18N=1
config_patch: sed -i 's/--with-intl=none/--with-intl=full-icu/g' android_configure.py
- android_arch: x86_64
android_abi: x86_64
i18n_name: i18n
cmake_flag: -DENABLE_I18N=1
config_patch: sed -i 's/--with-intl=none/--with-intl=full-icu/g' android_configure.py

name: Build Javet ${{ matrix.android_arch }}
name: Build Javet ${{ matrix.android_arch }} ${{ matrix.i18n_name }}
runs-on: ubuntu-latest

steps:
Expand Down Expand Up @@ -67,9 +89,16 @@ jobs:
git apply < ../Javet/scripts/patches/android/node/push_registers_asm.cc.patch
git apply < ../Javet/scripts/patches/android/node/trap-handler.h.patch
git apply < ../Javet/scripts/patches/android/node/test_crypto_clienthello.cc.patch
${{ matrix.config_patch }}
./android-configure ${{ steps.setup-ndk.outputs.ndk-path }} 24 ${{ matrix.android_arch }}
make -j4
mv out out.${{ matrix.android_arch }}
mv out out.${{ matrix.android_arch }}.${{ matrix.i18n_name }}
- name: Copy the i18n
if: matrix.i18n_name == 'i18n' && matrix.android_arch == 'arm64'
run: |
mkdir icu-node
cp ../node/deps/icu-tmp/*.dat icu-node
- name: Setup JDK 11
uses: actions/setup-java@v4
Expand All @@ -85,14 +114,21 @@ jobs:
- name: Build Javet JNI
run: |
cd ${{ env.ROOT }}/Javet/cpp
sh ./build-android.sh -DNODE_DIR=${{ env.ROOT }}/node -DCMAKE_ANDROID_NDK=${{ steps.setup-ndk.outputs.ndk-path }} -DCMAKE_ANDROID_ARCH=${{ matrix.android_arch }}
sh ./build-android.sh -DNODE_DIR=${{ env.ROOT }}/node -DCMAKE_ANDROID_NDK=${{ steps.setup-ndk.outputs.ndk-path }} -DCMAKE_ANDROID_ARCH=${{ matrix.android_arch }} ${{ matrix.cmake_flag }}
- name: Upload the Artifact
uses: actions/upload-artifact@v4
with:
name: javet-android-node-${{ matrix.android_arch }}-${{ env.JAVET_VERSION }}
name: javet-android-node-${{ matrix.android_arch }}-${{ env.JAVET_VERSION }}-${{ matrix.i18n_name }}
path: android/javet-android/src/main/jniLibs/${{ matrix.android_abi }}/*.so

- name: Upload the i18n
uses: actions/upload-artifact@v4
if: matrix.i18n_name == 'i18n' && matrix.android_arch == 'arm64'
with:
name: icu-node
path: icu-node/*.dat

build_javet_aar:
needs: [build_javet_lib]
name: Build Javet AAR
Expand All @@ -119,35 +155,52 @@ jobs:
with:
gradle-version: 8.5

- name: Prepare JNI Libs
- name: Prepare JNI Libs i18n
run: |
mkdir -p android/javet-android/src/main/jniLibs/arm64-v8a
mkdir -p android/javet-android/src/main/jniLibs/x86_64
- name: Prepare JNI Libs non-i18n
run: |
mkdir -p android/javet-android/src/main/jniLibs/armeabi-v7a
mkdir -p android/javet-android/src/main/jniLibs/arm64-v8a
mkdir -p android/javet-android/src/main/jniLibs/x86
mkdir -p android/javet-android/src/main/jniLibs/x86_64
- name: Download Javet arm
- name: Download Javet arm64 i18n
uses: actions/download-artifact@v4
with:
name: javet-android-node-arm-${{ env.JAVET_VERSION }}
name: javet-android-node-arm64-${{ env.JAVET_VERSION }}-i18n
path: android/javet-android/src/main/jniLibs/arm64-v8a

- name: Download Javet x86_64 i18n
uses: actions/download-artifact@v4
with:
name: javet-android-node-x86_64-${{ env.JAVET_VERSION }}-i18n
path: android/javet-android/src/main/jniLibs/x86_64

- name: Download Javet arm non-i18n
uses: actions/download-artifact@v4
with:
name: javet-android-node-arm-${{ env.JAVET_VERSION }}-non-i18n
path: android/javet-android/src/main/jniLibs/armeabi-v7a

- name: Download Javet arm64
- name: Download Javet arm64 non-i18n
uses: actions/download-artifact@v4
with:
name: javet-android-node-arm64-${{ env.JAVET_VERSION }}
name: javet-android-node-arm64-${{ env.JAVET_VERSION }}-non-i18n
path: android/javet-android/src/main/jniLibs/arm64-v8a

- name: Download Javet x86
- name: Download Javet x86 non-i18n
uses: actions/download-artifact@v4
with:
name: javet-android-node-x86-${{ env.JAVET_VERSION }}
name: javet-android-node-x86-${{ env.JAVET_VERSION }}-non-i18n
path: android/javet-android/src/main/jniLibs/x86

- name: Download Javet x86_64
- name: Download Javet x86_64 non-i18n
uses: actions/download-artifact@v4
with:
name: javet-android-node-x86_64-${{ env.JAVET_VERSION }}
name: javet-android-node-x86_64-${{ env.JAVET_VERSION }}-non-i18n
path: android/javet-android/src/main/jniLibs/x86_64

- name: Build the Artifact
Expand All @@ -163,22 +216,32 @@ jobs:
name: javet-android-node-${{ env.JAVET_VERSION }}
path: android/javet-android/build/outputs/aar/javet*release.aar

- name: Delete Javet arm
- name: Delete Javet arm64 i18n
uses: geekyeggo/delete-artifact@v4
with:
name: javet-android-node-arm64-${{ env.JAVET_VERSION }}-i18n

- name: Delete Javet x86_64 i18n
uses: geekyeggo/delete-artifact@v4
with:
name: javet-android-node-x86_64-${{ env.JAVET_VERSION }}-i18n

- name: Delete Javet arm non-i18n
uses: geekyeggo/delete-artifact@v4
with:
name: javet-android-node-arm-${{ env.JAVET_VERSION }}
name: javet-android-node-arm-${{ env.JAVET_VERSION }}-non-i18n

- name: Delete Javet arm64
- name: Delete Javet arm64 non-i18n
uses: geekyeggo/delete-artifact@v4
with:
name: javet-android-node-arm64-${{ env.JAVET_VERSION }}
name: javet-android-node-arm64-${{ env.JAVET_VERSION }}-non-i18n

- name: Delete Javet x86
- name: Delete Javet x86 non-i18n
uses: geekyeggo/delete-artifact@v4
with:
name: javet-android-node-x86-${{ env.JAVET_VERSION }}
name: javet-android-node-x86-${{ env.JAVET_VERSION }}-non-i18n

- name: Delete Javet x86_64
- name: Delete Javet x86_64 non-i18n
uses: geekyeggo/delete-artifact@v4
with:
name: javet-android-node-x86_64-${{ env.JAVET_VERSION }}
name: javet-android-node-x86_64-${{ env.JAVET_VERSION }}-non-i18n
Loading

0 comments on commit 775049d

Please sign in to comment.