目录

Implementing Multi-project Builds

Support for multi-project builds is provided to reduce the development complexity of large-scale apps in multi-team collaboration scenarios and improve collaborative development efficiency. Through a multi-project build, a large-scale app can be split into multiple modules, where each module corresponds to an independent project. After each project is built into a HAP, you can then pack all of the HAPs into an App Pack for release to AppGallery.

  1. In the project-level build-profile.json5 file of each project, set multiProjects to true.

    {
      "app": {
        "multiProjects": true,
      }
    }

  2. Prepare the HAP packing tool app_packing_tool.jar, which is located in ${DevEco Studio installation path}/sdk/default/openharmony/toolchains/lib.
  3. In the directory where the HAP packing tool is located, run the following command to pack multiple HAPs. For details about how to use the packing tool, see Packing Tool.

    java -jar app_packing_tool.jar --mode multiApp --hap-list D:\project\MyApplication\1.hap,D:\project\MyApplication1\2.hap --out-path D:\project\final.app
    • hap-list: list of HAP file paths, separated by commas (,).
    • out-path: path where the generated App Pack will be saved, for example, D:\project\final.app.