#鸿蒙通关秘籍#如何确保HarmonyOS项目中的不同目标应用构建到正确的产品包中?

HarmonyOS
2024-12-02 14:52:12
1235浏览
收藏 0
回答 1
回答 1
按赞同
/
按时间
NoSQL幻影刺客

在HarmonyOS项目中,可以在 build-profile.json5 文件中通过指定 applyToProducts 来确保 target 被打包到正确的 product 中。以下代码展示如何在配置中将target映射到不同的product:

{
  "modules": [
    {
      "name": "entry",
      "srcPath": "./product/entry",
      "targets": [
        {
          "name": "default",
          "applyToProducts": [
            "default"
          ]
        },
        {
          "name": "tablet_target",
          "applyToProducts": [
            "tablet_product"
          ]
        }
      ]
    }
  ]
}
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
分享
微博
QQ
微信
回复
2024-12-02 15:40:35
相关问题