Skip to content

Commit

Permalink
☮️ Javet v1.1.2 (#150)
Browse files Browse the repository at this point in the history
* Upgraded Node.js to `v16.14.2` ([2022-03-17](https://github.com/nodejs/node/blob/master/doc/changelogs/CHANGELOG_V16.md#16.14.2))
* Upgraded V8 to `v10.0.139.6` ([2022-03-07](https://v8.dev/blog/v8-release-100))
* Fixed a bug in exception handling in JNI callback
  • Loading branch information
caoccao authored Mar 22, 2022
1 parent 1ab0321 commit 2025548
Show file tree
Hide file tree
Showing 692 changed files with 3,374 additions and 3,489 deletions.
22 changes: 11 additions & 11 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@ Javet

If you like my work, please **Star** this project. And, you may follow me `@sjtucaocao <https://twitter.com/sjtucaocao>`_, or visit http://caoccao.blogspot.com/. And the official support channel is at `discord <https://discord.gg/R4vvKU96gw>`_.

💖 If you use Mac OS (x86_64), please be aware that the Mac OS (x86_64) build will discontinue anytime because my `MacBook Air mid-2012 <https://caoccao.blogspot.com/2021/09/macbook-air-mid-2012-from-lion-to-mojave.html>`_ will be soon deprecated by new version of V8. Please `donate <https://opencollective.com/javet>`_ to support me purchasing a new Mac OS (x86_64) device. Or, if you have a retired Mac OS (x86_64) device and are fine with mailing it to me, that will also be great. Thank you for supporting Javet.
💖 If you use Mac OS (x86_64), please be aware that the Mac OS (x86_64) build will discontinue anytime because my `MacBook Air mid-2012 <https://caoccao.blogspot.com/2021/09/macbook-air-mid-2012-from-lion-to-mojave.html>`_ will be soon deprecated by new version of V8. Please `donate <https://opencollective.com/javet>`_ to support me purchasing a new Mac OS (x86_64) device. Or, if you have a retired Mac OS (x86_64) device and are fine with mailing it to me, that will also be great. Thank you for supporting Javet. There is no new official releases after v1.1.0. Please contact the maintainer for the new private releases.

💖 If you use Mac OS (arm64), please thank `@longwa <https://github.com/longwa>`_ for building the M1 version. However, that's a temporary solution because I don't have any Mac OS (arm64) device, so there is no support. Please `donate <https://opencollective.com/javet>`_ to support me purchasing a new Mac OS (arm64) device.
💖 If you use Mac OS (arm64), there is no new releases after v1.1.0. That's because I don't have any Mac OS (arm64) device to produce any new builds. Please `donate <https://opencollective.com/javet>`_ to support me purchasing a new Mac OS (arm64) device.

Major Features
==============

* Linux (x86_64) + Mac OS (x86_64, arm64) + ️Windows (x86_64)
* Android (arm, arm64, x86 and x86_64)
* Node.js ``v16.14.0`` + V8 ``v9.9.115.9``
* Node.js ``v16.14.2`` + V8 ``v10.0.139.6``
* 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.1.1</version>
<version>1.1.2</version>
</dependency>
<!-- Mac OS (x86_64 and arm64) -->
<dependency>
<groupId>com.caoccao.javet</groupId>
<artifactId>javet-macos</artifactId>
<version>1.1.1</version>
<version>1.1.0</version>
</dependency>
Gradle Kotlin DSL
^^^^^^^^^^^^^^^^^

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

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

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.1.1"
android:versionName="1.1.2"
>

</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.1.1</version>
<version>1.1.2</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.1.1</tag>
<tag>1.1.2</tag>
</scm>

<properties>
Expand Down
23 changes: 11 additions & 12 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
/*
* Copyright 2021. caoccao.com Sam Cao
* Copyright (c) 2021-2022. caoccao.com Sam Cao
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

plugins {
Expand All @@ -26,7 +25,7 @@ repositories {
}

group = "com.caoccao.javet"
version = "1.1.1"
version = "1.1.2"

dependencies {
testImplementation("org.eclipse.jetty.websocket:websocket-server:9.4.44.v20210927")
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=1.1.1
JAVET_VERSION=1.1.2
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.1.1
JAVET_VERSION=1.1.2
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.1.1
JAVET_VERSION=1.1.2
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.1.1
SET JAVET_VERSION=1.1.2
rd /s/q build
mkdir build
cd build
Expand Down
1 change: 1 addition & 0 deletions cpp/jni/javet_callbacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ namespace Javet {

void JavetCallbackContextReference::CallFunction(const v8::FunctionCallbackInfo<v8::Value>& args) {
FETCH_JNI_ENV(GlobalJavaVM);
Javet::Exceptions::ClearJNIException(jniEnv);
v8::Isolate* v8Isolate = args.GetIsolate();
V8IsolateScope v8IsolateScope(v8Isolate);
V8HandleScope v8HandleScope(v8Isolate);
Expand Down
15 changes: 8 additions & 7 deletions cpp/jni/javet_converter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -417,15 +417,16 @@ namespace Javet {
std::unique_ptr<v8::ScriptOrigin> ToV8ScriptOringinPointer(JNIEnv* jniEnv, const V8LocalContext& v8Context,
jstring& mResourceName, jint& mResourceLineOffset, jint& mResourceColumnOffset, jint& mScriptId, jboolean& mIsWASM, jboolean& mIsModule) {
return std::make_unique<v8::ScriptOrigin>(
v8Context->GetIsolate(),
ToV8String(jniEnv, v8Context, mResourceName),
ToV8Integer(v8Context, mResourceLineOffset),
ToV8Integer(v8Context, mResourceColumnOffset),
V8LocalBoolean(),
ToV8Integer(v8Context, mScriptId),
(int)mResourceLineOffset,
(int)mResourceColumnOffset,
false,
(int)mScriptId,
V8LocalValue(),
V8LocalBoolean(),
ToV8Boolean(v8Context, mIsWASM),
ToV8Boolean(v8Context, mIsModule),
false,
(bool)mIsWASM,
(bool)mIsModule,
V8LocalPrimitiveArray());
}

Expand Down
12 changes: 6 additions & 6 deletions cpp/jni/javet_resource_node.rc
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
//

VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,1,1,0
PRODUCTVERSION 1,1,1,0
FILEVERSION 1,1,2,0
PRODUCTVERSION 1,1,2,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
Expand All @@ -79,12 +79,12 @@ BEGIN
BEGIN
VALUE "CompanyName", "caoccao.com"
VALUE "FileDescription", "caoccao.com"
VALUE "FileVersion", "1.1.1.0"
VALUE "InternalName", "libjavet-node-windows-x86_64.v.1.1.1.dll"
VALUE "FileVersion", "1.1.2.0"
VALUE "InternalName", "libjavet-node-windows-x86_64.v.1.1.2.dll"
VALUE "LegalCopyright", "Copyright (C) 2021"
VALUE "OriginalFilename", "libjavet-node-windows-x86_64.v.1.1.1.dll"
VALUE "OriginalFilename", "libjavet-node-windows-x86_64.v.1.1.2.dll"
VALUE "ProductName", "Javet Windows"
VALUE "ProductVersion", "1.1.1.0"
VALUE "ProductVersion", "1.1.2.0"
END
END
BLOCK "VarFileInfo"
Expand Down
12 changes: 6 additions & 6 deletions cpp/jni/javet_resource_v8.rc
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
//

VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,1,1,0
PRODUCTVERSION 1,1,1,0
FILEVERSION 1,1,2,0
PRODUCTVERSION 1,1,2,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
Expand All @@ -79,12 +79,12 @@ BEGIN
BEGIN
VALUE "CompanyName", "caoccao.com"
VALUE "FileDescription", "caoccao.com"
VALUE "FileVersion", "1.1.1.0"
VALUE "InternalName", "libjavet-v8-windows-x86_64.v.1.1.1.dll"
VALUE "FileVersion", "1.1.2.0"
VALUE "InternalName", "libjavet-v8-windows-x86_64.v.1.1.2.dll"
VALUE "LegalCopyright", "Copyright (C) 2021"
VALUE "OriginalFilename", "libjavet-v8-windows-x86_64.v.1.1.1.dll"
VALUE "OriginalFilename", "libjavet-v8-windows-x86_64.v.1.1.2.dll"
VALUE "ProductName", "Javet Windows"
VALUE "ProductVersion", "1.1.1.0"
VALUE "ProductVersion", "1.1.2.0"
END
END
BLOCK "VarFileInfo"
Expand Down
8 changes: 4 additions & 4 deletions docker/linux-x86_64/base.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# Usage: docker build -t sjtucaocao/javet:1.1.1 -f docker/linux-x86_64/base.Dockerfile .
# Usage: docker build -t sjtucaocao/javet:1.1.2 -f docker/linux-x86_64/base.Dockerfile .

FROM ubuntu:20.04
WORKDIR /

# Update Ubuntu
ENV DEBIAN_FRONTEND=noninteractive
RUN echo Cache V4
RUN echo Cache V5
RUN apt-get update
RUN apt-get install --upgrade -qq -y --no-install-recommends git curl wget build-essential software-properties-common patchelf maven sudo zip unzip execstack cmake
RUN apt-get install --upgrade -qq -y --no-install-recommends python3 python python3-pip python3-distutils python3-testresources
Expand All @@ -46,7 +46,7 @@ ENV PATH=/google/depot_tools:$PATH
WORKDIR /google
RUN fetch v8
WORKDIR /google/v8
RUN git checkout 9.9.115.9
RUN git checkout 10.0.139.6
RUN sed -i 's/snapcraft/nosnapcraft/g' ./build/install-build-deps.sh
RUN ./build/install-build-deps.sh
RUN sed -i 's/nosnapcraft/snapcraft/g' ./build/install-build-deps.sh
Expand All @@ -67,7 +67,7 @@ RUN echo V8 build is completed.
WORKDIR /
RUN git clone https://github.com/nodejs/node.git
WORKDIR /node
RUN git checkout v16.14.0
RUN git checkout v16.14.2
RUN echo Node.js preparation is completed.

# Build Node.js
Expand Down
2 changes: 1 addition & 1 deletion docker/linux-x86_64/build.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

# Usage: docker build -t javet:local -f docker/linux-x86_64/build.Dockerfile .

FROM sjtucaocao/javet:1.1.1
FROM sjtucaocao/javet:1.1.2
WORKDIR /

# Copy Javet
Expand Down
6 changes: 3 additions & 3 deletions docker/windows-x86_64/base.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
# 2. Restart WSL2
# 3. Restart docker

# Usage: docker build -t sjtucaocao/javet-windows:1.1.1 -m 4G -f docker/windows-x86_64/base.Dockerfile .
# Usage: docker build -t sjtucaocao/javet-windows:1.1.2 -m 4G -f docker/windows-x86_64/base.Dockerfile .

# https://hub.docker.com/_/microsoft-windows
FROM mcr.microsoft.com/windows:20H2-amd64
Expand Down Expand Up @@ -60,7 +60,7 @@ ENV DEPOT_TOOLS_WIN_TOOLCHAIN=0
WORKDIR /google
RUN fetch v8
WORKDIR /google/v8
RUN git checkout 9.9.115.9
RUN git checkout 10.0.139.6
WORKDIR /google
RUN gclient sync
RUN echo V8 preparation is completed.
Expand Down Expand Up @@ -103,7 +103,7 @@ RUN powershell -ExecutionPolicy Bypass -c "iex(New-Object Net.WebClient).Downloa
RUN choco install -y nasm
RUN git clone https://github.com/nodejs/node.git
WORKDIR /node
RUN git checkout v16.14.0
RUN git checkout v16.14.2
RUN echo Node.js preparation is completed.

# Build Node.js
Expand Down
2 changes: 1 addition & 1 deletion docker/windows-x86_64/build.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

# Usage: docker build -t javet:local -f docker/windows-x86_64/build.Dockerfile .

FROM sjtucaocao/javet-windows:1.1.0.1
FROM sjtucaocao/javet-windows:1.1.2

SHELL ["cmd", "/S", "/C"]
WORKDIR /
Expand Down
2 changes: 1 addition & 1 deletion docs/_static/documentation_options.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var DOCUMENTATION_OPTIONS = {
URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'),
VERSION: '1.1.1',
VERSION: '1.1.2',
LANGUAGE: 'en, zh-CN',
COLLAPSE_INDEX: false,
BUILDER: 'html',
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
author = 'Sam Cao'

# The full version, including alpha/beta/rc tags
release = '1.1.1'
release = '1.1.2'


# -- General configuration ---------------------------------------------------
Expand Down
6 changes: 3 additions & 3 deletions docs/development/build.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta name="color-scheme" content="light dark"><link rel="index" title="Index" href="../genindex.html" /><link rel="search" title="Search" href="../search.html" /><link rel="next" title="Build Javet with Docker" href="build_javet_with_docker.html" /><link rel="prev" title="Development Tools" href="tools.html" />

<link rel="shortcut icon" href="../_static/logo.ico"/><meta name="generator" content="sphinx-4.2.0, furo 2021.09.08"/>
<title>Build Javet - Javet 1.1.1 documentation</title>
<title>Build Javet - Javet 1.1.2 documentation</title>
<link rel="stylesheet" type="text/css" href="../_static/pygments.css" />
<link rel="stylesheet" type="text/css" href="../_static/styles/furo.css?digest=c7c65a82b42f6b978e58466c1e9ef2509836d916" />
<link rel="stylesheet" type="text/css" href="../_static/tabs.css" />
Expand Down Expand Up @@ -124,7 +124,7 @@
</label>
</div>
<div class="header-center">
<a href="../index.html"><div class="brand">Javet 1.1.1 documentation</div></a>
<a href="../index.html"><div class="brand">Javet 1.1.2 documentation</div></a>
</div>
<div class="header-right">
<div class="theme-toggle-container theme-toggle-header">
Expand All @@ -150,7 +150,7 @@
<img class="sidebar-logo" src="../_static/logo.png" alt="Logo"/>
</div>

<span class="sidebar-brand-text">Javet 1.1.1 documentation</span>
<span class="sidebar-brand-text">Javet 1.1.2 documentation</span>

</a><form class="sidebar-search-container" method="get" action="../search.html" role="search">
<input class="sidebar-search" placeholder=Search name="q" aria-label="Search">
Expand Down
Loading

0 comments on commit 2025548

Please sign in to comment.