Skip to content

Commit

Permalink
🎉 Javet v1.0.7 (#136)
Browse files Browse the repository at this point in the history
* Upgraded Node.js to `v16.13.1` ([2021-12-01](https://github.com/nodejs/node/blob/master/doc/changelogs/CHANGELOG_V16.md#16.13.1))
* Upgraded V8 to `v9.7.106.18` ([2021-12-14](https://v8.dev/blog/v8-release-97))
* Relayed inner exception for `JavetCompilationException` and `JavetExecutionException`
* Changed JNI library naming convention to be arch agnostic for Android.
* Added `getDetailedMessage()`, `getStack()` and `getContext()` to `JavetScriptingError`
* Updated all V8 values to take `V8Runtime` in the constructor
  • Loading branch information
caoccao authored Jan 5, 2022
1 parent 4d57f90 commit 4a0e0cc
Show file tree
Hide file tree
Showing 484 changed files with 3,927 additions and 3,169 deletions.
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 ``v16.13.0`` + V8 ``v9.6.180.8``
* Node.js ``v16.13.1`` + V8 ``v9.7.106.18``
* 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>1.0.6</version>
<version>1.0.7</version>
</dependency>
<!-- Mac OS (x86_64 and arm64) -->
<dependency>
<groupId>com.caoccao.javet</groupId>
<artifactId>javet-macos</artifactId>
<version>1.0.6</version>
<version>1.0.7</version>
</dependency>
Gradle Kotlin DSL
^^^^^^^^^^^^^^^^^

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

.. code-block:: groovy
implementation 'com.caoccao.javet:javet:1.0.6' // Linux and Windows (x86_64)
implementation 'com.caoccao.javet:javet-macos:1.0.6' // Mac OS (x86_64 and arm64)
implementation 'com.caoccao.javet:javet-android:1.0.6' // Android (arm, arm64, x86 and x86_64)
implementation 'com.caoccao.javet:javet:1.0.7' // Linux and Windows (x86_64)
implementation 'com.caoccao.javet:javet-macos:1.0.7' // Mac OS (x86_64 and arm64)
implementation 'com.caoccao.javet:javet-android:1.0.7' // 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 = "1.0.6"
version = "1.0.7"

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="1.0.6"
android:versionName="1.0.7"
>

</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>1.0.6</version>
<version>1.0.7</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>1.0.6</tag>
<tag>1.0.7</tag>
</scm>

<properties>
Expand Down
10 changes: 5 additions & 5 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ repositories {
}

group = "com.caoccao.javet"
version = "1.0.6"
version = "1.0.7"

dependencies {
testImplementation("org.eclipse.jetty.websocket:websocket-server:9.4.38.v20210224")
testImplementation("org.eclipse.jetty.websocket:javax-websocket-server-impl:9.4.38.v20210224")
testImplementation("com.fasterxml.jackson.core:jackson-databind:2.12.2")
testImplementation("org.junit.jupiter:junit-jupiter-api:5.7.0")
testImplementation("org.eclipse.jetty.websocket:websocket-server:9.4.44.v20210927")
testImplementation("org.eclipse.jetty.websocket:javax-websocket-server-impl:9.4.44.v20210927")
testImplementation("com.fasterxml.jackson.core:jackson-databind:2.13.1")
testImplementation("org.junit.jupiter:junit-jupiter-api:5.8.2")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine")
}

Expand Down
20 changes: 13 additions & 7 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,13 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Android")
message(FATAL_ERROR "CMAKE_ANDROID_ARCH needs to be defined.")
elseif(CMAKE_ANDROID_ARCH STREQUAL "arm64")
set(CMAKE_ANDROID_ARCH_ABI arm64-v8a)
set(JAVET_LIB_ARCH arm64)
elseif(CMAKE_ANDROID_ARCH STREQUAL "arm")
set(CMAKE_ANDROID_ARCH_ABI armeabi-v7a)
set(CMAKE_ANDROID_ARM_NEON 1)
set(JAVET_LIB_ARCH arm)
elseif(CMAKE_ANDROID_ARCH STREQUAL "x86")
set(CMAKE_ANDROID_ARCH_ABI x86)
set(JAVET_LIB_ARCH x86)
elseif(CMAKE_ANDROID_ARCH STREQUAL "x86_64")
set(CMAKE_ANDROID_ARCH_ABI x86_64)
set(JAVET_LIB_ARCH x86_64)
else()
message(FATAL_ERROR "CMAKE_ANDROID_ARCH must be one of arm, arm64, x86, x86_64.")
endif()
Expand All @@ -63,7 +59,6 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Android")
set(JAVA_RESOURCES_DIR ${CMAKE_SOURCE_DIR}/../android/javet-android/src/main/jniLibs/${CMAKE_ANDROID_ARCH_ABI})
else()
set(JAVA_RESOURCES_DIR ${CMAKE_SOURCE_DIR}/../src/main/resources)
set(JAVET_LIB_ARCH x86_64)
endif()

# Initialization
Expand Down Expand Up @@ -135,6 +130,7 @@ endforeach(importLibrary)
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
set(JAVET_LIB_PREFIX "libjavet")
set(JAVET_LIB_SYSTEM "windows")
set(JAVET_LIB_ARCH x86_64)
# Generate PDB file
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Zi")
set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} /DEBUG /OPT:REF /OPT:ICF")
Expand Down Expand Up @@ -170,6 +166,7 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR CMAKE_SYSTEM_NAME STREQUAL "Android
add_library(JavetStatic STATIC ${sourceFiles})
if(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "x86_64")
set(JAVET_LIB_SYSTEM "linux")
set(JAVET_LIB_ARCH x86_64)
add_definitions(-D__x86_64__)
add_definitions(-D__linux__)
list(APPEND includeDirs $ENV{JAVA_HOME}/include/linux)
Expand Down Expand Up @@ -222,6 +219,7 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR CMAKE_SYSTEM_NAME STREQUAL "Android
set(JAVET_LIB_ARCH arm64)
add_definitions(-D__arm64__)
else()
set(JAVET_LIB_ARCH x86_64)
add_definitions(-D__x86_64__)
endif()
add_definitions(-D__APPLE__)
Expand Down Expand Up @@ -254,11 +252,19 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR CMAKE_SYSTEM_NAME STREQUAL "Android
else()
message(FATAL_ERROR "Linux or Windows (arm64) have not been supported yet.")
endif()
set_target_properties(JavetStatic PROPERTIES OUTPUT_NAME "${JAVET_LIB_PREFIX}-${JAVET_LIB_TYPE}-${JAVET_LIB_SYSTEM}-${JAVET_LIB_ARCH}.v.${JAVET_VERSION}")
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.")
endif()

set_target_properties(Javet PROPERTIES OUTPUT_NAME "${JAVET_LIB_PREFIX}-${JAVET_LIB_TYPE}-${JAVET_LIB_SYSTEM}-${JAVET_LIB_ARCH}.v.${JAVET_VERSION}")
if(DEFINED JAVET_LIB_ARCH)
set_target_properties(Javet PROPERTIES OUTPUT_NAME "${JAVET_LIB_PREFIX}-${JAVET_LIB_TYPE}-${JAVET_LIB_SYSTEM}-${JAVET_LIB_ARCH}.v.${JAVET_VERSION}")
else()
set_target_properties(Javet PROPERTIES OUTPUT_NAME "${JAVET_LIB_PREFIX}-${JAVET_LIB_TYPE}-${JAVET_LIB_SYSTEM}.v.${JAVET_VERSION}")
endif()
include_directories(${includeDirs})
add_custom_command(TARGET Javet POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:Javet> "${JAVA_RESOURCES_DIR}/$<TARGET_FILE_NAME:Javet>")
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=1.0.6
JAVET_VERSION=1.0.7
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=1.0.6
JAVET_VERSION=1.0.7
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=1.0.6
JAVET_VERSION=1.0.7
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=1.0.6
SET JAVET_VERSION=1.0.7
rd /s/q build
mkdir build
cd build
Expand Down
Loading

0 comments on commit 4a0e0cc

Please sign in to comment.