Skip to content

Commit

Permalink
Merge pull request cocos#767 from umbrellaPP/next
Browse files Browse the repository at this point in the history
addon new jsb-adaption customization
  • Loading branch information
jareguo authored Dec 19, 2018
2 parents ba71486 + 203e4fb commit efc7e21
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
10 changes: 7 additions & 3 deletions en/advanced-topics/engine-customization.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,9 @@ In the `jsb-adapter` directory, the following two directory structures are inclu

The `builtin` section also includes a number of related JSB interfaces, such as openGL, audioEngine, in addition to adapting the BOM and DOM runtime environment.

Some changes have taken place in jsb-adapter customization after **Creator 2.0.5** . Please reference to the different guide below according to the current Creator version you are using.
We made some adjustments and optimizations in different versions of Creator. Please reference to the different guide below according to the current Creator version you are using.

#### 3.2.1 Customization before Creator 2.0.5
#### 3.2.1 Customization before Creator v2.0.5

Customization of the `engine` section only requires modification of the code.<br>
Customization of the `builtin` section requires installing the dependencies first, please execute them on the command line:
Expand All @@ -190,7 +190,7 @@ When the command completes, a new `jsb-builtin.js` file is generated in the `jsb

After customizing the `jsb-adapter`, the editor will copy the `jsb-builtin.js` file and the `engine` directory together to the `jsb-adapter` folder in the project when you **build** the native platform in the **Build** panel.

#### 3.2.2 Customization after Creator 2.0.5 (2.0.5 included)
#### 3.2.2 Customization on Creator v2.0.5 and v2.0.6

First of all, you should install the dependencies. Please execute them on the command line:

Expand All @@ -214,6 +214,10 @@ The `gulp` command will pack all the code in **bultin** into file `jsb-builtin.j

After customizing the `jsb-adapter`, the editor will copy files in **dist** folder to the **jsb-adapter** folder in the project when you **build** the native platform in the **Build** panel.

#### 3.2.3 Customization after Creator v2.0.7 (v2.0.7 included)

After Creator v2.0.7, Jsb-adapter abandoned the cumbersome manual compilation operation. You can directly modify the source code in directories **builtin** and **engine**. When the modification is complete, open the editor and the editor will automatically compile this part of the source code at startup.

### 3.3 Customize weapp-adapter and qqplay-adapter

The adaptation layer code for the **Wechat Mini Games** and **QQ Play** is located in the `weapp-adapter` and `qqplay-adapter` in the `resources/builtin` directory.
Expand Down
10 changes: 7 additions & 3 deletions zh/advanced-topics/engine-customization.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,9 @@ Cocos Creator 为了实现跨平台,在 JavaScript 层需要对不同平台做

`builtin` 部分除了适配 BOM 和 DOM 运行环境,还包括了一些相关的 jsb 接口,如 openGL, audioEngine 等。

**Creator 2.0.5** 版本之后,jsb-adapter 的定制流程发生了一些改变。请根据你当前使用的 Creator 版本,参考以下不同的定制指南。
jsb-adapter 的定制流程在不同的 Creator 版本中都做了一些调整和优化。请根据你当前使用的 Creator 版本,参考以下不同的定制指南。

#### 3.2.1 Creator 2.0.5 版本之前的定制流程
#### 3.2.1 Creator v2.0.5 之前的定制流程

`engine` 部分的定制只要对代码进行修改就可以了。<br>
`builtin` 部分的定制需要先安装相关依赖,请在命令行中执行:
Expand All @@ -190,7 +190,7 @@ gulp

定制完 `jsb-adapter` 之后,在编辑器的 **构建面板****构建** 原生项目时,编辑器会将 `jsb-builtin.js` 文件和 `engine` 目录一起拷贝到对应项目工程里的 `jsb-adapter` 文件夹中。

#### 3.2.2 Creator 2.0.5 版本之后的定制流程(包括 2.0.5)
#### 3.2.2 Creator v2.0.5 和 v2.0.6 的定制流程

定制前需要先安装相关依赖,请在命令行中执行:

Expand All @@ -214,6 +214,10 @@ gulp

定制完 `jsb-adapter` 之后,在编辑器的 **构建面板****构建** 原生项目时,编辑器会将 **dist** 目录下的文件一起拷贝到对应项目工程里的 `jsb-adapter` 文件夹中。

#### 3.2.3 Creator v2.0.7 之后的定制流程(包括 v2.0.7)

在 v2.0.7 之后,jsb-adapter 废弃了繁琐的手动编译的操作。可以直接修改 **builtin****engine** 目录下的源码。修改完成后打开编辑器,编辑器会在启动时自动编译这部分源码。

### 3.3 定制 weapp-adapter 和 qqplay-adapter

**小游戏****玩一玩** 的适配层代码分别位于 `resources/builtin` 目录下的 `weapp-adapter``qqplay-adapter`
Expand Down

0 comments on commit efc7e21

Please sign in to comment.