1 Star 0 Fork 1.4K

ongood / OpenArkCompiler

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
Developer_Guide.md 2.16 KB
一键复制 编辑 原始数据 按行查看 历史
EugeneChen 提交于 2019-10-31 16:39 . upload en doc,code refactor

Developer Guide

By referring to this document, you can download the OpenArkCompiler source code to compile it.

Prerequisites

Prepare development environment by referring to Environment Configuration.

Downloading Source Code

Download address: https://code.opensource.huaweicloud.com/HarmonyOS/OpenArkCompiler/home You can download the OpenArkCompiler source code in Clone or Download mode.

Note: The download directory of the source code is openarkcompiler by default.

Compiling Source Code

Run the following command in the openarkcompiler directory to compile OpenArkCompiler. The output path is openarkcompiler/out/bin by default.

source build/envsetup.sh
make

Command description:

  • source build/envsetup.sh: Initialize the environment and add the toolchain path openarkcompiler/out/bin of OpenArkCompiler to environment variables.
  • make: Compile the release version of OpenArkCompiler.
  • make BUILD_TYPE=DEBUG: Compile the debug version of OpenArkCompiler.

Compiling Sample

The Java basic library is required for OpenArkCompiler to compile a sample. The following uses the Java basic library provided by the Android OS to describe the sample compilation process.

Preparing basic library

  • Download the Android code and compile it locally to obtain the libcore JAR package. The Android 9.0.0_r45 version is recommended.

  • Gitee also provides the compiled libcore JAR file. Download address: https://gitee.com/mirrors/java-core/

Generating the libjava-core.mplt file

Before compilation, create the libjava-core directory in the openarkcompiler directory, copy the java-core.jar file to the libjava-core directory, and run the following commands in the openarkcompiler directory:

source build/envsetup.sh;
make;
cd libjava-core;
jbc2mpl -injar java-core.jar -out libjava-core;

After the execution is complete, the libjava-core.mplt file is generated in the directory.

Compiling sample code

The sample code is in the openarkcompiler/samples directory.

Take the samples/helloworld/ code as an example. Run the following command in the openarkcompiler/ directory:

source build/envsetup.sh; make; cd samples/helloworld/; make
C++
1
https://gitee.com/ongood/OpenArkCompiler.git
git@gitee.com:ongood/OpenArkCompiler.git
ongood
OpenArkCompiler
OpenArkCompiler
master

搜索帮助