Skip to content

Commit

Permalink
🏃 Javet v2.2.0 (#245)
Browse files Browse the repository at this point in the history
* Upgraded V8 to `v11.4.183.14` (2023-05-23)
* Improved the performance of `V8FunctionCallback.receiveCallback()`, `IV8ValueObject.forEach()`, `IV8ValueMap.forEach()`, `IV8ValueArray.forEach()`, `IV8ValueArray.push()`, `IV8ValueObject.set()`, `IV8ValueMap.set()`,
* Added `IV8ValueObject.batchGet()`, `IV8ValueMap.batchGet()`, `IV8ValueArray.batchGet()`
* Added `JavetCallbackType`, `IJavetDirectCallable`, `IJavetDirectProxyHandler` to allow callback without reflection
* Redesigned `IV8ValueObject.bindFunction()`, `IV8ValueObject.bindProperty()`, `IV8ValueObject.unbindFunction()`, `IV8ValueObject.unbindProperty()`, `JavetCallbackContext`
* Renamed `JavetDynamicProxy*` to `JavetReflectionProxy*`
* Added error code 408 CallbackTypeNotSupported
* Created [JavetPerf](https://github.com/caoccao/JavetPerf) for tracking the performance among various Javet releases
  • Loading branch information
caoccao authored May 30, 2023
1 parent c3d8919 commit ebe485f
Show file tree
Hide file tree
Showing 542 changed files with 28,982 additions and 10,701 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/linux_build_artifact.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_REPO_JAVET: ${{ secrets.DOCKERHUB_REPO_JAVET }}
JAVET_NODE_VERSION: 18.16.0
JAVET_V8_VERSION: 11.3.244.8
JAVET_VERSION: 2.1.2
JAVET_V8_VERSION: 11.4.183.14
JAVET_VERSION: 2.2.0

jobs:
javet_linux_x86_64:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/linux_build_node_v8_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_REPO_JAVET: ${{ secrets.DOCKERHUB_REPO_JAVET }}
JAVET_NODE_VERSION: 18.16.0
JAVET_V8_VERSION: 11.3.244.8
JAVET_VERSION: 2.1.2
JAVET_V8_VERSION: 11.4.183.14
JAVET_VERSION: 2.2.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
18 changes: 9 additions & 9 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Major Features

* Linux (x86_64) + Mac OS (x86_64, arm64) + ️Windows (x86_64)
* Android (arm, arm64, x86 and x86_64)
* Node.js ``v18.16.0`` + V8 ``v11.3.244.8``
* Node.js ``v18.16.0`` + V8 ``v11.4.183.14``
* Dynamic switch between Node.js and V8 mode (`Which mode do you prefer? <https://github.com/caoccao/Javet/discussions/92>`_)
* Polyfill V8 mode with `Javenode <https://github.com/caoccao/Javenode>`_
* V8 API exposure in JVM
Expand All @@ -58,33 +58,33 @@ Maven
<dependency>
<groupId>com.caoccao.javet</groupId>
<artifactId>javet</artifactId>
<version>2.1.2</version>
<version>2.2.0</version>
</dependency>
<!-- Mac OS (x86_64 and arm64) -->
<dependency>
<groupId>com.caoccao.javet</groupId>
<artifactId>javet-macos</artifactId>
<version>2.1.2</version>
<version>2.2.0</version>
</dependency>
Gradle Kotlin DSL
^^^^^^^^^^^^^^^^^

.. code-block:: kotlin
implementation("com.caoccao.javet:javet:2.1.2") // Linux and Windows (x86_64)
implementation("com.caoccao.javet:javet-macos:2.1.2") // Mac OS (x86_64 and arm64)
implementation("com.caoccao.javet:javet-android:2.1.2") // Android (arm, arm64, x86 and x86_64)
implementation("com.caoccao.javet:javet:2.2.0") // Linux and Windows (x86_64)
implementation("com.caoccao.javet:javet-macos:2.2.0") // Mac OS (x86_64 and arm64)
implementation("com.caoccao.javet:javet-android:2.2.0") // Android (arm, arm64, x86 and x86_64)
Gradle Groovy DSL
^^^^^^^^^^^^^^^^^

.. code-block:: groovy
implementation 'com.caoccao.javet:javet:2.1.2' // Linux and Windows (x86_64)
implementation 'com.caoccao.javet:javet-macos:2.1.2' // Mac OS (x86_64 and arm64)
implementation 'com.caoccao.javet:javet-android:2.1.2' // Android (arm, arm64, x86 and x86_64)
implementation 'com.caoccao.javet:javet:2.2.0' // Linux and Windows (x86_64)
implementation 'com.caoccao.javet:javet-macos:2.2.0' // Mac OS (x86_64 and arm64)
implementation 'com.caoccao.javet:javet-android:2.2.0' // Android (arm, arm64, x86 and x86_64)
Hello Javet
-----------
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 @@ -21,7 +21,7 @@ plugins {
id("com.android.library")
}

version = "2.1.2"
version = "2.2.0"

android {
compileSdk = 30
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
Expand Up @@ -2,7 +2,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.caoccao.javet"
android:versionCode="1"
android:versionName="2.1.2"
android:versionName="2.2.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>2.1.2</version>
<version>2.2.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>2.1.2</tag>
<tag>2.2.0</tag>
</scm>

<properties>
Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ repositories {
}

group = "com.caoccao.javet"
version = "2.1.2"
version = "2.2.0"

dependencies {
testImplementation("org.eclipse.jetty.websocket:websocket-server:9.4.49.v20220914")
Expand Down
10 changes: 7 additions & 3 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
set(JAVET_LIB_ARCH x86_64)
set(JAVET_LIB_ARCH x86_64)
# Generate PDB file
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Zi")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Zi /MP")
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /DEBUG /OPT:REF /OPT:ICF")
add_definitions(-D_ITERATOR_DEBUG_LEVEL=0 -D_WIN32)
list(APPEND includeDirs $ENV{JAVA_HOME}/include/win32)
Expand Down Expand Up @@ -185,6 +185,8 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR CMAKE_SYSTEM_NAME STREQUAL "Android
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
add_library(Javet SHARED ${sourceFiles})
add_library(JavetStatic STATIC ${sourceFiles})
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-invalid-offsetof ")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-invalid-offsetof ")
if(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "(arm64|x86_64|aarch64)")
set(JAVET_LIB_SYSTEM "linux")
if (CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "x86_64")
Expand Down Expand Up @@ -240,6 +242,8 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR CMAKE_SYSTEM_NAME STREQUAL "Android
endif()
elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "(arm64|x86_64)")
set(JAVET_LIB_SYSTEM "macos")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-ambiguous-reversed-operator ")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-ambiguous-reversed-operator ")
if (CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "arm64")
set(JAVET_LIB_ARCH arm64)
add_definitions(-D__arm64__)
Expand Down Expand Up @@ -275,15 +279,15 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR CMAKE_SYSTEM_NAME STREQUAL "Android
# https://caoccao.blogspot.com/2021/08/jni-symbol-conflicts-in-mac-os.html
target_link_libraries(Javet PUBLIC -exported_symbols_list ${CMAKE_SOURCE_DIR}/jni/exported_symbols_list.txt)
else()
message(FATAL_ERROR "Linux or Windows (arm64) have not been supported yet.")
message(FATAL_ERROR "Windows (arm64) is not supported.")
endif()
if(DEFINED JAVET_LIB_ARCH)
set_target_properties(JavetStatic PROPERTIES OUTPUT_NAME "${JAVET_LIB_PREFIX}-${JAVET_LIB_TYPE}-${JAVET_LIB_SYSTEM}-${JAVET_LIB_ARCH}.v.${JAVET_VERSION}")
else()
set_target_properties(JavetStatic PROPERTIES OUTPUT_NAME "${JAVET_LIB_PREFIX}-${JAVET_LIB_TYPE}-${JAVET_LIB_SYSTEM}.v.${JAVET_VERSION}")
endif()
else()
message(FATAL_ERROR "Linux (x86-64), Mac OS (x86-64, arm64), Windows (x86-64) and Android are the only supported Operating Systems.")
message(FATAL_ERROR "Linux (x86-64, arm64), Mac OS (x86-64, arm64), Windows (x86-64) and Android are the only supported Operating Systems.")
endif()

if(DEFINED JAVET_LIB_ARCH)
Expand Down
2 changes: 1 addition & 1 deletion cpp/build-android.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Usage for V8: sh build-android.sh -DV8_DIR=${HOME}/v8 -DCMAKE_ANDROID_NDK=${HOME}/android -DCMAKE_ANDROID_ARCH=arm64
# Usage for Node: sh build-android.sh -DNODE_DIR=${HOME}/node -DCMAKE_ANDROID_NDK=${HOME}/android -DCMAKE_ANDROID_ARCH=arm64
JAVET_VERSION=2.1.2
JAVET_VERSION=2.2.0
rm -rf build
mkdir build
cd build
Expand Down
2 changes: 1 addition & 1 deletion cpp/build-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Usage for V8: sh build-linux.sh -DV8_DIR=${HOME}/v8
# Usage for Node: sh build-linux.sh -DNODE_DIR=${HOME}/node
JAVET_VERSION=2.1.2
JAVET_VERSION=2.2.0
rm -rf build
mkdir build
cd build
Expand Down
2 changes: 1 addition & 1 deletion cpp/build-macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Usage for V8: sh build-macos.sh -DV8_DIR=${HOME}/v8
# Usage for Node: sh build-macos.sh -DNODE_DIR=${HOME}/node
JAVET_VERSION=2.1.2
JAVET_VERSION=2.2.0
rm -rf build
mkdir build
cd build
Expand Down
2 changes: 1 addition & 1 deletion cpp/build-windows.cmd
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@echo off
REM Usage for V8: build -DV8_DIR=C:\v8
REM Usage for Node: build -DNODE_DIR=C:\node
SET JAVET_VERSION=2.1.2
SET JAVET_VERSION=2.2.0
rd /s/q build
mkdir build
cd build
Expand Down
Loading

0 comments on commit ebe485f

Please sign in to comment.