From a7a60586914474170396d75499e164c84e1a830b Mon Sep 17 00:00:00 2001 From: wangyimin Date: Tue, 7 Jan 2025 15:10:00 +0800 Subject: [PATCH] update readme Signed-off-by: wangyimin --- BUILD.gn | 14 +++++++++++++ README.en.md | 44 ++++++++++++++++++++++++----------------- README.md | 48 +++++++++++++++++++++++--------------------- bundle.json | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++ jsvm.gni | 14 +++++++++++++ 5 files changed, 136 insertions(+), 40 deletions(-) create mode 100644 BUILD.gn create mode 100644 bundle.json create mode 100644 jsvm.gni diff --git a/BUILD.gn b/BUILD.gn new file mode 100644 index 0000000..81c455d --- /dev/null +++ b/BUILD.gn @@ -0,0 +1,14 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * 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. + */ diff --git a/README.en.md b/README.en.md index b7df05d..53fb3ff 100644 --- a/README.en.md +++ b/README.en.md @@ -1,22 +1,39 @@ # arkcompiler_jsvm_longque #### Description -{**When you're done, you can delete the content in this README and update the file with details for others getting started with your repository**} +OpenHarmony JSVM-API provides a set of stable APIs based on the standard JavaScript (JS) engine. It provides complete JS engine capabilities, including creating and destroying a JS engine, executing JS code, and implementing interaction between JS and C/C++ modules. -#### Software Architecture -Software architecture description +OpenHarmony JSVM-API provides a set of APIs written in C programming language that complies with C99. + +JSVM-API allows dynamically loaded JS code segment to be directly run during application runtime. With JSVM-API, you can also use C/C++ to implement core functionalities that demand high performance or closely rely on underlying system invocation, register C++ methods in JS code, and directly call the JS code to improve the execution speed. + +#### Directory Structure + +``` +/arkcompiler/jsvm_longque +├── interfaces +│ ├── innerkits # interface used in system component +│ └── kits # interface provided to app developer +├── src # jsvm source code +│ ├── inspector # source code about inspector +│ └── platform # source code related to platform +├── test # jsvm test suit +├── BUILD.gn # jsvm compile script +├── jsvm.gni # jsvm compile script +└── bundle.json # jsvm config file +``` #### Installation -1. xxxx -2. xxxx -3. xxxx +1. compile command + +``` +./build.sh --product-name rk3568 --build-target make_all --target-cpu arm64 --gn-args enable_notice_collection=false --keep-ninja-going +``` #### Instructions -1. xxxx -2. xxxx -3. xxxx +[Using JSVM-API](https://gitee.com/openharmony/docs/tree/master/zh-cn/application-dev/napi/Readme-CN.md) #### Contribution @@ -25,12 +42,3 @@ Software architecture description 3. Commit your code 4. Create Pull Request - -#### Gitee Feature - -1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md -2. Gitee blog [blog.gitee.com](https://blog.gitee.com) -3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore) -4. The most valuable open source project [GVP](https://gitee.com/gvp) -5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help) -6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) diff --git a/README.md b/README.md index 1ea9a6c..906e4c9 100644 --- a/README.md +++ b/README.md @@ -1,25 +1,38 @@ # arkcompiler_jsvm_longque #### 介绍 -{**以下是 Gitee 平台说明,您可以替换此简介** -Gitee 是 OSCHINA 推出的基于 Git 的代码托管平台(同时支持 SVN)。专为开发者提供稳定、高效、安全的云端软件开发协作平台 -无论是个人、团队、或是企业,都能够用 Gitee 实现代码托管、项目管理、协作开发。企业项目请看 [https://gitee.com/enterprises](https://gitee.com/enterprises)} - -#### 软件架构 -软件架构说明 - +OpenHarmony JSVM-API是基于标准JS引擎提供的一套稳定的API,为开发者提供了较为完整的JS引擎能力,包括创建和销毁引擎,执行JS代码,JS/C++交互等关键能力。 + +OpenHarmony JSVM-API是C语言接口,遵循C99标准。 + +通过JSVM-API,开发者可以在应用运行期间直接执行一段动态加载的JS代码。也可以选择将一些对性能、底层系统调用有较高要求的核心功能用C/C++实现并将C++方法注册到JS侧,在JS代码中直接调用,提高应用的执行效率。 + +#### 目录结构 +``` +/arkcompiler/jsvm_longque +├── interfaces +│ ├── innerkits # 系统内接口,部件间使用 +│ └── kits # 应用接口,应用开发者使用 +├── src # jsvm 代码 +│ ├── inspector # inspector 功能实现 +│ └── platform # 平台相关代码 +├── test # jsvm 测试套 +├── BUILD.gn # 部件编译脚本 +├── jsvm.gni # jsvm 源文件定义脚本 +└── bundle.json # 部件配置文件 +``` #### 安装教程 -1. xxxx -2. xxxx -3. xxxx +1. 编译命令 + +``` +./build.sh --product-name rk3568 --build-target make_all --target-cpu arm64 --gn-args enable_notice_collection=false --keep-ninja-going +``` #### 使用说明 -1. xxxx -2. xxxx -3. xxxx +[使用JSVM-API实现JS与C/C++语言交互](https://gitee.com/openharmony/docs/tree/master/zh-cn/application-dev/napi/Readme-CN.md) #### 参与贡献 @@ -28,12 +41,3 @@ Gitee 是 OSCHINA 推出的基于 Git 的代码托管平台(同时支持 SVN 3. 提交代码 4. 新建 Pull Request - -#### 特技 - -1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md -2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com) -3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目 -4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目 -5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) -6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) diff --git a/bundle.json b/bundle.json new file mode 100644 index 0000000..86bb2db --- /dev/null +++ b/bundle.json @@ -0,0 +1,56 @@ +{ + "name": "@ohos/jsvm_longque", + "description": "jsvm_longque is a Javascript virtual machine in ohos", + "version": "1.0", + "license": "Apache 2.0", + "publishAs": "code-segment", + "segment": { + "destPath": "arkcompiler/jsvm_longque" + }, + "dirs": {}, + "scripts": {}, + "component": { + "name": "jsvm_longque", + "subsystem": "arkcompiler", + "syscap": [ + "SystemCapability.ArkCompiler.JSVM" + ], + "features": [], + "adapted_system_type": [ + "standard" + ], + "rom": "5120KB", + "ram": "10240KB", + "deps": { + "components": [ + "bounds_checking_function", + "hilog", + "hisysevent", + "hitrace", + "hiview", + "icu", + "init", + "libuv", + "resource_schedule_service" + ] + }, + "build": { + "sub_component": [ + "//arkcompiler/jsvm_longque:jsvm_package" + ], + "inner_kits": [ + { + "header": { + "header_base": "//arkcompiler/jsvm_longque/interfaces/kits", + "header_files": [ + "jsvm_types.h", + "jsvm.h" + ] + }, + "name": "//arkcompiler/jsvm_longque:jsvm_package" + } + ], + "test": [] + } + } +} \ No newline at end of file diff --git a/jsvm.gni b/jsvm.gni new file mode 100644 index 0000000..81c455d --- /dev/null +++ b/jsvm.gni @@ -0,0 +1,14 @@ +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * 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. + */ -- Gitee