Skip to content

Commit 775049d

Browse files
authored
📑 Javet v4.0.0 (#406)
* 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`
1 parent 2e3470a commit 775049d

File tree

93 files changed

+2322
-858
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+2322
-858
lines changed

.github/workflows/android_node_build.yml

+86-23
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ on:
88
workflow_dispatch:
99

1010
env:
11-
JAVET_NODE_VERSION: 20.17.0
12-
JAVET_VERSION: 3.1.8
11+
JAVET_NODE_VERSION: 22.9.0
12+
JAVET_VERSION: 4.0.0
1313
ROOT: /home/runner/work/Javet
1414

1515
jobs:
@@ -19,14 +19,36 @@ jobs:
1919
include:
2020
- android_arch: arm
2121
android_abi: armeabi-v7a
22+
i18n_name: non-i18n
23+
cmake_flag:
24+
config_patch:
2225
- android_arch: arm64
2326
android_abi: arm64-v8a
27+
i18n_name: non-i18n
28+
cmake_flag:
29+
config_patch:
2430
- android_arch: x86
2531
android_abi: x86
32+
i18n_name: non-i18n
33+
cmake_flag:
34+
config_patch:
2635
- android_arch: x86_64
2736
android_abi: x86_64
37+
i18n_name: non-i18n
38+
cmake_flag:
39+
config_patch:
40+
- android_arch: arm64
41+
android_abi: arm64-v8a
42+
i18n_name: i18n
43+
cmake_flag: -DENABLE_I18N=1
44+
config_patch: sed -i 's/--with-intl=none/--with-intl=full-icu/g' android_configure.py
45+
- android_arch: x86_64
46+
android_abi: x86_64
47+
i18n_name: i18n
48+
cmake_flag: -DENABLE_I18N=1
49+
config_patch: sed -i 's/--with-intl=none/--with-intl=full-icu/g' android_configure.py
2850

29-
name: Build Javet ${{ matrix.android_arch }}
51+
name: Build Javet ${{ matrix.android_arch }} ${{ matrix.i18n_name }}
3052
runs-on: ubuntu-latest
3153

3254
steps:
@@ -67,9 +89,16 @@ jobs:
6789
git apply < ../Javet/scripts/patches/android/node/push_registers_asm.cc.patch
6890
git apply < ../Javet/scripts/patches/android/node/trap-handler.h.patch
6991
git apply < ../Javet/scripts/patches/android/node/test_crypto_clienthello.cc.patch
92+
${{ matrix.config_patch }}
7093
./android-configure ${{ steps.setup-ndk.outputs.ndk-path }} 24 ${{ matrix.android_arch }}
7194
make -j4
72-
mv out out.${{ matrix.android_arch }}
95+
mv out out.${{ matrix.android_arch }}.${{ matrix.i18n_name }}
96+
97+
- name: Copy the i18n
98+
if: matrix.i18n_name == 'i18n' && matrix.android_arch == 'arm64'
99+
run: |
100+
mkdir icu-node
101+
cp ../node/deps/icu-tmp/*.dat icu-node
73102
74103
- name: Setup JDK 11
75104
uses: actions/setup-java@v4
@@ -85,14 +114,21 @@ jobs:
85114
- name: Build Javet JNI
86115
run: |
87116
cd ${{ env.ROOT }}/Javet/cpp
88-
sh ./build-android.sh -DNODE_DIR=${{ env.ROOT }}/node -DCMAKE_ANDROID_NDK=${{ steps.setup-ndk.outputs.ndk-path }} -DCMAKE_ANDROID_ARCH=${{ matrix.android_arch }}
117+
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 }}
89118
90119
- name: Upload the Artifact
91120
uses: actions/upload-artifact@v4
92121
with:
93-
name: javet-android-node-${{ matrix.android_arch }}-${{ env.JAVET_VERSION }}
122+
name: javet-android-node-${{ matrix.android_arch }}-${{ env.JAVET_VERSION }}-${{ matrix.i18n_name }}
94123
path: android/javet-android/src/main/jniLibs/${{ matrix.android_abi }}/*.so
95124

125+
- name: Upload the i18n
126+
uses: actions/upload-artifact@v4
127+
if: matrix.i18n_name == 'i18n' && matrix.android_arch == 'arm64'
128+
with:
129+
name: icu-node
130+
path: icu-node/*.dat
131+
96132
build_javet_aar:
97133
needs: [build_javet_lib]
98134
name: Build Javet AAR
@@ -119,35 +155,52 @@ jobs:
119155
with:
120156
gradle-version: 8.5
121157

122-
- name: Prepare JNI Libs
158+
- name: Prepare JNI Libs i18n
159+
run: |
160+
mkdir -p android/javet-android/src/main/jniLibs/arm64-v8a
161+
mkdir -p android/javet-android/src/main/jniLibs/x86_64
162+
163+
- name: Prepare JNI Libs non-i18n
123164
run: |
124165
mkdir -p android/javet-android/src/main/jniLibs/armeabi-v7a
125166
mkdir -p android/javet-android/src/main/jniLibs/arm64-v8a
126167
mkdir -p android/javet-android/src/main/jniLibs/x86
127168
mkdir -p android/javet-android/src/main/jniLibs/x86_64
128169
129-
- name: Download Javet arm
170+
- name: Download Javet arm64 i18n
130171
uses: actions/download-artifact@v4
131172
with:
132-
name: javet-android-node-arm-${{ env.JAVET_VERSION }}
173+
name: javet-android-node-arm64-${{ env.JAVET_VERSION }}-i18n
174+
path: android/javet-android/src/main/jniLibs/arm64-v8a
175+
176+
- name: Download Javet x86_64 i18n
177+
uses: actions/download-artifact@v4
178+
with:
179+
name: javet-android-node-x86_64-${{ env.JAVET_VERSION }}-i18n
180+
path: android/javet-android/src/main/jniLibs/x86_64
181+
182+
- name: Download Javet arm non-i18n
183+
uses: actions/download-artifact@v4
184+
with:
185+
name: javet-android-node-arm-${{ env.JAVET_VERSION }}-non-i18n
133186
path: android/javet-android/src/main/jniLibs/armeabi-v7a
134187

135-
- name: Download Javet arm64
188+
- name: Download Javet arm64 non-i18n
136189
uses: actions/download-artifact@v4
137190
with:
138-
name: javet-android-node-arm64-${{ env.JAVET_VERSION }}
191+
name: javet-android-node-arm64-${{ env.JAVET_VERSION }}-non-i18n
139192
path: android/javet-android/src/main/jniLibs/arm64-v8a
140193

141-
- name: Download Javet x86
194+
- name: Download Javet x86 non-i18n
142195
uses: actions/download-artifact@v4
143196
with:
144-
name: javet-android-node-x86-${{ env.JAVET_VERSION }}
197+
name: javet-android-node-x86-${{ env.JAVET_VERSION }}-non-i18n
145198
path: android/javet-android/src/main/jniLibs/x86
146199

147-
- name: Download Javet x86_64
200+
- name: Download Javet x86_64 non-i18n
148201
uses: actions/download-artifact@v4
149202
with:
150-
name: javet-android-node-x86_64-${{ env.JAVET_VERSION }}
203+
name: javet-android-node-x86_64-${{ env.JAVET_VERSION }}-non-i18n
151204
path: android/javet-android/src/main/jniLibs/x86_64
152205

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

166-
- name: Delete Javet arm
219+
- name: Delete Javet arm64 i18n
220+
uses: geekyeggo/delete-artifact@v4
221+
with:
222+
name: javet-android-node-arm64-${{ env.JAVET_VERSION }}-i18n
223+
224+
- name: Delete Javet x86_64 i18n
225+
uses: geekyeggo/delete-artifact@v4
226+
with:
227+
name: javet-android-node-x86_64-${{ env.JAVET_VERSION }}-i18n
228+
229+
- name: Delete Javet arm non-i18n
167230
uses: geekyeggo/delete-artifact@v4
168231
with:
169-
name: javet-android-node-arm-${{ env.JAVET_VERSION }}
232+
name: javet-android-node-arm-${{ env.JAVET_VERSION }}-non-i18n
170233

171-
- name: Delete Javet arm64
234+
- name: Delete Javet arm64 non-i18n
172235
uses: geekyeggo/delete-artifact@v4
173236
with:
174-
name: javet-android-node-arm64-${{ env.JAVET_VERSION }}
237+
name: javet-android-node-arm64-${{ env.JAVET_VERSION }}-non-i18n
175238

176-
- name: Delete Javet x86
239+
- name: Delete Javet x86 non-i18n
177240
uses: geekyeggo/delete-artifact@v4
178241
with:
179-
name: javet-android-node-x86-${{ env.JAVET_VERSION }}
242+
name: javet-android-node-x86-${{ env.JAVET_VERSION }}-non-i18n
180243

181-
- name: Delete Javet x86_64
244+
- name: Delete Javet x86_64 non-i18n
182245
uses: geekyeggo/delete-artifact@v4
183246
with:
184-
name: javet-android-node-x86_64-${{ env.JAVET_VERSION }}
247+
name: javet-android-node-x86_64-${{ env.JAVET_VERSION }}-non-i18n

0 commit comments

Comments
 (0)