diff --git a/README.en.md b/README.en.md index 5b97bc023765a120fe72362e2ef31a93c8a73352..54a49d2c95c38c82777868e21830afa9f44da21e 100644 --- a/README.en.md +++ b/README.en.md @@ -1,36 +1,109 @@ -# MultiTarget +# Building a Multi-target Product Project -#### 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**} +### Introduction -#### Software Architecture -Software architecture description +This sample demonstrates how to build a project that generates two application packages: one of the official version and the other of the test version. Through this sample, you can understand the multi-target customization items supported by different types of packages and how to perform differentiated resource customization. This helps you better build multi-target products. +* Official version: The resources of the official version are displayed on the home page of the project, including a short description, an image, and a button. Touching the button implements page redirection. The second page contains a calculator logic for the addition and subtraction operations. When you enter two numbers (each with no more than five digits) and touch the corresponding button, the calculation result is displayed in the pop-up window. +* Test version: The resources of the test version are displayed on the home page of the project, including a short description, an image, and a button. Touching the button implements page redirection. The second page contains a calculator logic only for the subtraction operation. When you enter two numbers (each with no more than five digits) and touch the subtraction button, the calculation result is displayed in the pop-up window. If you touch the addition button, a message is displayed, indicating that the function is not supported. -#### Installation +### Preview -1. xxxx -2. xxxx -3. xxxx +| official version | test version | +|-----------------------------------------|-------------------------------------| +| ![](screenshots/device/official_en.gif) | ![](screenshots/device/test_en.gif) | -#### Instructions +### How to Use -1. xxxx -2. xxxx -3. xxxx +Configure the signature for each product, build the corresponding versions, and check the UI effect. Touch the button to go to the next page. On the second page, set parameters, touch the corresponding buttons, and view the calling result. -#### Contribution +**Precautions** -1. Fork the repository -2. Create Feat_xxx branch -3. Commit your code -4. Create Pull Request +This sample demonstrates only the content comparison between the official version and the test version. The default version does not implement its logic. Do not use the default version. +**Multi-product Signature Configuration** -#### Gitee Feature +1. This sample demonstrates only the content comparison between the official version and the test version. The default version does not implement its logic. Do not use the default version. -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/) +![](screenshots/device/1.png) + +2. On the Signing Configs tab page, click the plus sign (+) to add signing information. + +![](screenshots/device/signingConfigs1.png) + +3. Select the corresponding bundle name and enter the configured signingConfigs information. + +![](screenshots/device/2.png) + +4. Click OK after signing. + +![](screenshots/device/signingConfigs3.png) + +**How to Build** + +Click Product (marked with 1 in the figure) in the upper right corner of DevEco Studio. Select the corresponding product project in the area (marked with 2 in the figure). After the project is selected, the dependent target in the file is automatically mapped. Then, click Apply. After the preceding operations are complete, you can click the run button to view the multi-target product effect. +![](screenshots/device/product_build.png) + +### How to Implement + +1. In the module-level build-profile.json file of each HAP and HAR module, customize the targets corresponding to the official and test versions, and then customize resources for each target. +2. In the project-level build-profile.json file, customize the products corresponding to the official and test versions, customize multiple target resources for each product, and add the targets generated by each module to the product of the corresponding version. + +### High-Performance Knowledge Points + +**N/A** + +### Project Directory +``` +├──entry/src // Entry module +│ ├──main +│ │ ├──ets/pages +│ │ │ └──Index.ets // Home page +│ │ ├──resources // Public resources +│ │ ├──official +│ │ │ └──resources // Custom resources of the official version +│ │ └──test +│ │ └──resources // Custom resources of the test version +│ ├──official_pages +│ │ └──VersionInfo.ets // Custom page information of the official version +│ └──test_pages +│ └──VersionInfo.ets // Custom page information of the test version +└──myhar/src // HAR module + ├──main + │ ├──cpp + │ │ ├──cpp/types // Third-party library API declaration + │ │ └──CmakeLists.txt // CMake configuration file + │ ├──ets/components + │ │ └──MainPage.ets // Main page of the HAR package + │ ├──ets/view + │ │ └──ParamTextInputComponent.ets // Custom component page + │ ├──resources // Public resources + │ ├──official + │ │ └──resources // Custom resources of the official version + │ └──test + │ └──resources // Custom resources of the test version + ├──official_pages + │ └──OfficialSecondPages.ets // Second page of the HAR package of the official version + ├──test_pages + │ └──TestSecondPages.ets // Second page of the HAR package of the test version + └──BuildProfile.ets // Custom parameter file +``` + +### Module Dependencies + +**N/A** + +### Required Permissions + +**N/A** + +### References + +**N/A** + +### Constraints + +1. This sample demonstrates only the content comparison between the official version and the test version. The default version does not implement its logic. Do not use the default version. +2. The sample is only supported on Huawei phones with standard systems. +3. The HarmonyOS version must be HarmonyOS 5.0.0 Release or later. +4. The DevEco Studio version must be DevEco Studio 5.0.0 Release or later. +5. The HarmonyOS SDK version must be HarmonyOS 5.0.0 Release SDK or later. diff --git a/README.md b/README.md index 3209c77ba61dee660f1c080842b1e2a2ef8bd2db..074fb58308b8de38fcf99a0ce9c5e08258d3d90a 100644 --- a/README.md +++ b/README.md @@ -26,20 +26,14 @@ ![](screenshots/device/signingConfigs.png) - - 2. 然后进入到签名配置页面,点击加号,添加签名信息: ![](screenshots/device/signingConfigs1.png) - - 3. 然后选择对应的bundle name,并填写上面配置的"signingConfigs"信息: ![](screenshots/device/signingConfigs2.png) - - 4. 签名之后点击ok即可: ![](screenshots/device/signingConfigs3.png) diff --git a/screenshots/device/1.png b/screenshots/device/1.png new file mode 100644 index 0000000000000000000000000000000000000000..b4283fed18a5c3b5a023b591fe8d1cb143439271 Binary files /dev/null and b/screenshots/device/1.png differ diff --git a/screenshots/device/2.png b/screenshots/device/2.png new file mode 100644 index 0000000000000000000000000000000000000000..205952bca158f07e549c92d36d513368b935e2cc Binary files /dev/null and b/screenshots/device/2.png differ diff --git a/screenshots/device/official_en.gif b/screenshots/device/official_en.gif new file mode 100644 index 0000000000000000000000000000000000000000..78e3746c08ebb01005a5578d90e50134be36b813 Binary files /dev/null and b/screenshots/device/official_en.gif differ diff --git a/screenshots/device/test_en.gif b/screenshots/device/test_en.gif new file mode 100644 index 0000000000000000000000000000000000000000..19a0fd6157b03fe23e0236e119b33022cc662795 Binary files /dev/null and b/screenshots/device/test_en.gif differ