build-profile.json5
build-profile.json5文件分为工程级与模块级,其中buildOption在工程级文件和模块级文件均可配置,其中相同字段以模块级的字段为准,不同字段模块级的buildOption配置会继承工程级配置。
为什么记录这个,是在开发中涉及到混淆配置,所以记录下
工程级
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
| { "app": { "signingConfigs": [ { "name": "release", "type": "HarmonyOS", "material": { "storePassword": "...", "certpath": "./signature/release/fc_release.cer", "keyAlias": "beeselect", "keyPassword": "xxx", "profile": "./signature/release/fc_release.p7b", "signAlg": "SHA256withECDSA", "storeFile": "./signature/release/fc_release.p12" } }, ], "products": [ { "name": "default", "signingConfig": "release", "compatibleSdkVersion": "5.0.0(12)", "runtimeOS": "HarmonyOS", "bundleType": "app", "buildOption": { "strictMode": { "useNormalizedOHMUrl": true } } } ], "buildModeSet": [ { "name": "debug", }, { "name": "release" } ] }, "modules": [ { "name": "entry", "srcPath": "./entry", "targets": [ "name": "default", "applyToProducts": [ "default" ] ] }, { "name": "test_lib", "srcPath": "./test_lib" }, ] }
|
模块级
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
| { "apiType": "stageMode", "targets": [ { "name": "default", "runtimeOS": "HarmonyOS", "output": { "artifactName": "beeselect_harmony" } } ], "buildOption": { "arkOptions": { } }, "buildOptionSet": [ { "name": "release", "arkOptions": { "obfuscation": { "ruleOptions": { "enable": true, "files": [ "./obfuscation-rules.txt" ] }, "cunsumerFiles": [ "./consumer-rules.txt" ] } } } ] }
|