Skip to content

Commit

Permalink
⛈️ Javet v4.1.0 (#416)
Browse files Browse the repository at this point in the history
* Upgraded Node.js to `v22.11.0` ([2024-10-29](https://github.com/nodejs/node/blob/main/doc/changelogs/CHANGELOG_V22.md#22.11.0))
* Upgraded V8 to `v13.1.201.8` (2024-11-11)
* Upgraded clang to v20 for V8 mode on MacOS
* Switched to core dependency + individual native dependency
* Supported `Float16Array`
* Added `Float16`
* Fixed `JavetJVMInterceptor` to allow arbitrary name
* Added `addCallbackContexts()` to `JavetJVMInterceptor`
  • Loading branch information
caoccao authored Nov 15, 2024
1 parent 96972b0 commit 20c5edd
Show file tree
Hide file tree
Showing 74 changed files with 1,724 additions and 513 deletions.
4 changes: 2 additions & 2 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: 22.9.0
JAVET_VERSION: 4.0.0
JAVET_NODE_VERSION: 22.11.0
JAVET_VERSION: 4.1.0
ROOT: /home/runner/work/Javet

jobs:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/android_v8_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ on:
workflow_dispatch:

env:
JAVET_V8_VERSION: 13.0.245.16
JAVET_VERSION: 4.0.0
JAVET_V8_VERSION: 13.1.201.8
JAVET_VERSION: 4.1.0
ROOT: /home/runner/work/Javet

jobs:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/linux_build_artifact.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ on:
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_REPO_JAVET: ${{ secrets.DOCKERHUB_REPO_JAVET }}
JAVET_NODE_VERSION: 22.9.0
JAVET_V8_VERSION: 13.0.245.16
JAVET_VERSION: 4.0.0
JAVET_NODE_VERSION: 22.11.0
JAVET_V8_VERSION: 13.1.201.8
JAVET_VERSION: 4.1.0

jobs:
javet_linux_x86_64:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/linux_build_node_v8_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ on:
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_REPO_JAVET: ${{ secrets.DOCKERHUB_REPO_JAVET }}
JAVET_NODE_VERSION: 22.9.0
JAVET_V8_VERSION: 13.0.245.16
JAVET_VERSION: 4.0.0
JAVET_NODE_VERSION: 22.11.0
JAVET_V8_VERSION: 13.1.201.8
JAVET_VERSION: 4.1.0

# if we skip a job using a job level `if` condition, then any dependent jobs also don't run.
# we can skip a step of the job, using a step level `if` condition.
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/linux_x86_64_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ on:
workflow_dispatch:

env:
JAVET_NODE_VERSION: 22.9.0
JAVET_V8_VERSION: 13.0.245.16
JAVET_VERSION: 4.0.0
JAVET_NODE_VERSION: 22.11.0
JAVET_V8_VERSION: 13.1.201.8
JAVET_VERSION: 4.1.0
ROOT: /home/runner/work/Javet

jobs:
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/macos_arm64_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ on:
workflow_dispatch:

env:
JAVET_NODE_VERSION: 22.9.0
JAVET_V8_VERSION: 13.0.245.16
JAVET_VERSION: 4.0.0
JAVET_NODE_VERSION: 22.11.0
JAVET_V8_VERSION: 13.1.201.8
JAVET_VERSION: 4.1.0
ROOT: /Users/runner/work/Javet

jobs:
Expand Down Expand Up @@ -85,6 +85,9 @@ jobs:
cmake-version: '3.23.x'

- name: Build Javet JNI
env:
CC: ${{ env.ROOT }}/google/v8/third_party/llvm-build/Release+Asserts/bin/clang
CXX: ${{ env.ROOT }}/google/v8/third_party/llvm-build/Release+Asserts/bin/clang
run: |
cd ${{ env.ROOT }}/Javet/cpp
sed -i '.bak' 's/`nproc`/2/g' build-macos.sh
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/macos_x86_64_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ on:
workflow_dispatch:

env:
JAVET_NODE_VERSION: 22.9.0
JAVET_V8_VERSION: 13.0.245.16
JAVET_VERSION: 4.0.0
JAVET_NODE_VERSION: 22.11.0
JAVET_V8_VERSION: 13.1.201.8
JAVET_VERSION: 4.1.0
ROOT: /Users/runner/work/Javet

jobs:
Expand Down Expand Up @@ -85,6 +85,9 @@ jobs:
cmake-version: '3.23.x'

- name: Build Javet JNI
env:
CC: ${{ env.ROOT }}/google/v8/third_party/llvm-build/Release+Asserts/bin/clang
CXX: ${{ env.ROOT }}/google/v8/third_party/llvm-build/Release+Asserts/bin/clang
run: |
cd ${{ env.ROOT }}/Javet/cpp
sed -i '.bak' 's/`nproc`/2/g' build-macos.sh
Expand Down
24 changes: 13 additions & 11 deletions .github/workflows/windows_x86_64_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ on:
workflow_dispatch:

env:
JAVET_NODE_VERSION: 22.9.0
JAVET_V8_VERSION: 13.0.245.16
JAVET_VERSION: 4.0.0
JAVET_NODE_VERSION: 22.11.0
JAVET_V8_VERSION: 13.1.201.8
JAVET_VERSION: 4.1.0
ROOT: D:\a\Javet

jobs:
Expand Down Expand Up @@ -49,25 +49,27 @@ jobs:
- name: Build V8
env:
DEPOT_TOOLS_WIN_TOOLCHAIN: 0
shell: bash
run: |
cd ${{ env.ROOT }}
cd ..
mkdir google
cd google
git clone --depth=10 --branch=main https://chromium.googlesource.com/chromium/tools/depot_tools.git
cd depot_tools
git checkout remotes/origin/main
cd ..
.\depot_tools\fetch.bat v8
depot_tools/fetch.bat v8
cd v8
git checkout ${{ env.JAVET_V8_VERSION }}
cd ..
.\depot_tools\gclient.bat sync -D
depot_tools/gclient.bat sync -D
cd v8
python3 tools\dev\v8gen.py x64.release -- v8_monolithic=true v8_use_external_startup_data=false is_component_build=false ${{ matrix.v8_flag }} v8_enable_pointer_compression=false v8_static_library=true symbol_level=0 use_custom_libcxx=false v8_enable_sandbox=false
..\depot_tools\gn.bat gen out.gn/x64.release
python3 ${{ env.ROOT }}\Javet\scripts\python\patch_v8_build.py -p .\
..\depot_tools\ninja.bat -C out.gn/x64.release v8_monolith
move out.gn out.gn.${{ matrix.name }}
python3 tools/dev/v8gen.py x64.release -- v8_monolithic=true v8_use_external_startup_data=false is_component_build=false ${{ matrix.v8_flag }} v8_enable_pointer_compression=false v8_static_library=true symbol_level=0 use_custom_libcxx=false v8_enable_sandbox=false
../depot_tools/gn.bat gen out.gn/x64.release
python3 ../../Javet/scripts/python/patch_v8_build.py -p ./
../depot_tools/ninja.bat -C out.gn/x64.release v8_monolith || python3 ../../Javet/scripts/python/patch_v8_build.py -p ./
../depot_tools/ninja.bat -C out.gn/x64.release v8_monolith
mv out.gn out.gn.${{ matrix.name }}
- name: Copy the i18n
if: matrix.name == 'i18n'
Expand Down
107 changes: 88 additions & 19 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ arm ✔️ ❌ ❌ ❌
arm64 ✔️ ✔️ ✔️ ❌
=========== ======= ======= ======= =======

* Node.js ``v22.9.0`` + V8 ``v13.0.245.16``
* Node.js ``v22.11.0`` + V8 ``v13.1.201.8``
* i18n and non-i18n
* Dynamic switch between Node.js and V8 mode
* Polyfill V8 mode with `Javenode <https://github.com/caoccao/Javenode>`_
Expand All @@ -62,6 +62,7 @@ arm64 ✔️ ✔️ ✔️ ❌
* Live debug with Chrome DevTools
* AST analysis with `swc4j <https://github.com/caoccao/swc4j>`_
* JS, TS, JSX, TSX transformation and transpilation with `swc4j <https://github.com/caoccao/swc4j>`_
* Enhance JVM via Byte-code with `JavetBuddy <https://github.com/caoccao/JavetBuddy>`_
* Live interaction with `JavetShell <https://github.com/caoccao/JavetShell>`_

Quick Start
Expand All @@ -75,48 +76,116 @@ Maven

.. code-block:: xml
<!-- Linux and Windows (x86_64) -->
<!-- Core (Must-have) -->
<dependency>
<groupId>com.caoccao.javet</groupId>
<artifactId>javet</artifactId>
<version>4.0.0</version>
<version>4.1.0</version>
</dependency>
<!-- Linux (arm64) -->
<!-- Node.js Linux (x86_64) -->
<dependency>
<groupId>com.caoccao.javet</groupId>
<artifactId>javet-linux-arm64</artifactId>
<version>4.0.0</version>
<artifactId>javet-node-linux-x86_64</artifactId>
<version>4.1.0</version>
</dependency>
<!-- Mac OS (x86_64 and arm64) -->
<!-- Node.js Linux (arm64) -->
<dependency>
<groupId>com.caoccao.javet</groupId>
<artifactId>javet-macos</artifactId>
<version>4.0.0</version>
<artifactId>javet-node-linux-arm64</artifactId>
<version>4.1.0</version>
</dependency>
<!-- Node.js Mac OS (x86_64) -->
<dependency>
<groupId>com.caoccao.javet</groupId>
<artifactId>javet-node-macos-x86_64</artifactId>
<version>4.1.0</version>
</dependency>
<!-- Node.js Mac OS (arm64) -->
<dependency>
<groupId>com.caoccao.javet</groupId>
<artifactId>javet-node-macos-arm64</artifactId>
<version>4.1.0</version>
</dependency>
<!-- Node.js Windows (x86_64) -->
<dependency>
<groupId>com.caoccao.javet</groupId>
<artifactId>javet-node-windows-x86_64</artifactId>
<version>4.1.0</version>
</dependency>
<!-- V8 Linux (x86_64) -->
<dependency>
<groupId>com.caoccao.javet</groupId>
<artifactId>javet-v8-linux-x86_64</artifactId>
<version>4.1.0</version>
</dependency>
<!-- V8 Linux (arm64) -->
<dependency>
<groupId>com.caoccao.javet</groupId>
<artifactId>javet-v8-linux-arm64</artifactId>
<version>4.1.0</version>
</dependency>
<!-- V8 Mac OS (x86_64) -->
<dependency>
<groupId>com.caoccao.javet</groupId>
<artifactId>javet-v8-macos-x86_64</artifactId>
<version>4.1.0</version>
</dependency>
<!-- V8 Mac OS (arm64) -->
<dependency>
<groupId>com.caoccao.javet</groupId>
<artifactId>javet-v8-macos-arm64</artifactId>
<version>4.1.0</version>
</dependency>
<!-- V8 Windows (x86_64) -->
<dependency>
<groupId>com.caoccao.javet</groupId>
<artifactId>javet-v8-windows-x86_64</artifactId>
<version>4.1.0</version>
</dependency>
Gradle Kotlin DSL
^^^^^^^^^^^^^^^^^

.. code-block:: kotlin
implementation("com.caoccao.javet:javet:4.0.0") // Linux and Windows (x86_64)
implementation("com.caoccao.javet:javet-linux-arm64:4.0.0") // Linux (arm64)
implementation("com.caoccao.javet:javet-macos:4.0.0") // Mac OS (x86_64 and arm64)
implementation("com.caoccao.javet:javet-node-android:4.0.0") // Android Node (arm, arm64, x86 and x86_64)
implementation("com.caoccao.javet:javet-v8-android:4.0.0") // Android V8 (arm, arm64, x86 and x86_64)
implementation("com.caoccao.javet:javet:4.1.0") // Core (Must-have)
implementation("com.caoccao.javet:javet-node-linux-arm64:4.1.0")
implementation("com.caoccao.javet:javet-node-linux-x86_64:4.1.0")
implementation("com.caoccao.javet:javet-node-macos-arm64:4.1.0")
implementation("com.caoccao.javet:javet-node-macos-x86_64:4.1.0")
implementation("com.caoccao.javet:javet-node-windows-x86_64:4.1.0")
implementation("com.caoccao.javet:javet-v8-linux-arm64:4.1.0")
implementation("com.caoccao.javet:javet-v8-linux-x86_64:4.1.0")
implementation("com.caoccao.javet:javet-v8-macos-arm64:4.1.0")
implementation("com.caoccao.javet:javet-v8-macos-x86_64:4.1.0")
implementation("com.caoccao.javet:javet-v8-windows-x86_64:4.1.0")
Gradle Groovy DSL
^^^^^^^^^^^^^^^^^

.. code-block:: groovy
implementation 'com.caoccao.javet:javet:4.0.0' // Linux and Windows (x86_64)
implementation 'com.caoccao.javet:javet-linux-arm64:4.0.0' // Linux (arm64)
implementation 'com.caoccao.javet:javet-macos:4.0.0' // Mac OS (x86_64 and arm64)
implementation 'com.caoccao.javet:javet-node-android:4.0.0' // Android Node (arm, arm64, x86 and x86_64)
implementation 'com.caoccao.javet:javet-v8-android:4.0.0' // Android V8 (arm, arm64, x86 and x86_64)
implementation 'com.caoccao.javet:javet:4.1.0' // Core (Must-have)
implementation 'com.caoccao.javet:javet-node-linux-arm64:4.1.0'
implementation 'com.caoccao.javet:javet-node-linux-x86_64:4.1.0'
implementation 'com.caoccao.javet:javet-node-macos-arm64:4.1.0'
implementation 'com.caoccao.javet:javet-node-macos-x86_64:4.1.0'
implementation 'com.caoccao.javet:javet-node-windows-x86_64:4.1.0'
implementation 'com.caoccao.javet:javet-v8-linux-arm64:4.1.0'
implementation 'com.caoccao.javet:javet-v8-linux-x86_64:4.1.0'
implementation 'com.caoccao.javet:javet-v8-macos-arm64:4.1.0'
implementation 'com.caoccao.javet:javet-v8-macos-x86_64:4.1.0'
implementation 'com.caoccao.javet:javet-v8-windows-x86_64:4.1.0'
For more detail, please visit the `installation <https://www.caoccao.com/Javet/tutorial/basic/installation.html>`_ page.

Expand Down
2 changes: 1 addition & 1 deletion android/javet-android/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ object Config {
const val ANDROIDX_TEST = "1.1.5"
const val APPCOMPAT = "1.3.1"
const val DESUGAR_JDK_LIBS = "2.0.4"
const val JAVET = "4.0.0"
const val JAVET = "4.1.0"
const val JUNIT = "5.10.1"
}
}
Expand Down
2 changes: 1 addition & 1 deletion android/javet-android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
android:versionCode="1"
android:versionName="4.0.0"
android:versionName="4.1.0"
>

</manifest>
4 changes: 2 additions & 2 deletions android/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

<groupId>com.caoccao.javet</groupId>
<artifactId>javet-android</artifactId>
<version>4.0.0</version>
<version>4.1.0</version>
<name>javet</name>
<packaging>aar</packaging>
<description>Javet is Java + V8 (JAVa + V + EighT). It is an awesome way of embedding V8 in Java.</description>
Expand All @@ -29,7 +29,7 @@
<connection>scm:git:git://github.com/caoccao/Javet.git</connection>
<developerConnection>scm:git:git@github.com:caoccao/caoccao.git</developerConnection>
<url>https://github.com/caoccao/Javet</url>
<tag>4.0.0</tag>
<tag>4.1.0</tag>
</scm>

<properties>
Expand Down
Loading

0 comments on commit 20c5edd

Please sign in to comment.