diff --git a/services/bundlemgr/test/unittest/bms_bundle_installer_test/bms_bundle_installer_test.cpp b/services/bundlemgr/test/unittest/bms_bundle_installer_test/bms_bundle_installer_test.cpp index a2263777c6476f6ca314810add3578bd4f12fa36..132ceb327f433c2f81f75e763482d490a903e03a 100644 --- a/services/bundlemgr/test/unittest/bms_bundle_installer_test/bms_bundle_installer_test.cpp +++ b/services/bundlemgr/test/unittest/bms_bundle_installer_test/bms_bundle_installer_test.cpp @@ -8067,7 +8067,7 @@ HWTEST_F(BmsBundleInstallerTest, VersionUpdateTest_0010, Function | SmallTest | bool result = dataMgr->GetApplicationInfo(VERSION_UPDATE_BUNDLE_NAME, ApplicationFlag::GET_BASIC_APPLICATION_INFO, USERID, info); EXPECT_TRUE(result); - EXPECT_EQ(info.versionName, "atom_entry_v1"); + EXPECT_EQ(info.versionName, "2.0.0"); bundlePath = RESOURCE_ROOT_PATH + ATOMIC_FEATURE_V2_HAP; installResult = InstallThirdPartyBundle(bundlePath); @@ -8076,7 +8076,7 @@ HWTEST_F(BmsBundleInstallerTest, VersionUpdateTest_0010, Function | SmallTest | result = dataMgr->GetApplicationInfo(VERSION_UPDATE_BUNDLE_NAME, ApplicationFlag::GET_BASIC_APPLICATION_INFO, USERID, info); EXPECT_TRUE(result); - EXPECT_EQ(info.versionName, "atom_feature_v2"); + EXPECT_EQ(info.versionName, "2.1.1"); UnInstallBundle(VERSION_UPDATE_BUNDLE_NAME); } @@ -8102,7 +8102,7 @@ HWTEST_F(BmsBundleInstallerTest, VersionUpdateTest_0020, Function | SmallTest | bool result = dataMgr->GetApplicationInfo(VERSION_UPDATE_BUNDLE_NAME, ApplicationFlag::GET_BASIC_APPLICATION_INFO, USERID, info); EXPECT_TRUE(result); - EXPECT_EQ(info.versionName, "atom_entry_v1"); + EXPECT_EQ(info.versionName, "2.0.0"); bundlePath = RESOURCE_ROOT_PATH + ATOMIC_FEATURE_V2_HAP; installResult = InstallThirdPartyBundle(bundlePath); @@ -8111,7 +8111,7 @@ HWTEST_F(BmsBundleInstallerTest, VersionUpdateTest_0020, Function | SmallTest | result = dataMgr->GetApplicationInfo(VERSION_UPDATE_BUNDLE_NAME, ApplicationFlag::GET_BASIC_APPLICATION_INFO, USERID, info); EXPECT_TRUE(result); - EXPECT_EQ(info.versionName, "atom_feature_v2"); + EXPECT_EQ(info.versionName, "2.1.1"); UnInstallBundle(VERSION_UPDATE_BUNDLE_NAME); } diff --git a/test/sceneProject/unittest/test_bundle/versionUpdateTest5/AppScope/app.json b/test/sceneProject/unittest/test_bundle/versionUpdateTest5/AppScope/app.json5 similarity index 31% rename from test/sceneProject/unittest/test_bundle/versionUpdateTest5/AppScope/app.json rename to test/sceneProject/unittest/test_bundle/versionUpdateTest5/AppScope/app.json5 index f4f7d8a18ec0a513d024a84894e643310f0910a6..20e79ce9bb19712f8f4a1b41e879d6ab338fa9f4 100644 --- a/test/sceneProject/unittest/test_bundle/versionUpdateTest5/AppScope/app.json +++ b/test/sceneProject/unittest/test_bundle/versionUpdateTest5/AppScope/app.json5 @@ -1,17 +1,29 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + { "app": { "bundleName": "com.example.versiontest", "bundleType": "atomicService", "debug": true, "icon": "$media:app_icon", - "iconId": 16777217, "label": "$string:app_name", - "labelId": 16777216, - "apiReleaseType": "Release", "minAPIVersion": 9, "targetAPIVersion": 9, "vendor": "example", "versionCode": 1000000, - "versionName": "atom_entry_v1" + "versionName": "2.0.0" } } diff --git a/test/sceneProject/unittest/test_bundle/versionUpdateTest5/BUILD.gn b/test/sceneProject/unittest/test_bundle/versionUpdateTest5/BUILD.gn index a0034e0affe0172ce58bf1293b9ef0fd8563594b..be61f45eb76df621006a67c8c6a2312b188d7dcb 100644 --- a/test/sceneProject/unittest/test_bundle/versionUpdateTest5/BUILD.gn +++ b/test/sceneProject/unittest/test_bundle/versionUpdateTest5/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2024 Huawei Device Co., Ltd. +# Copyright (c) 2024-2025 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -12,32 +12,22 @@ # limitations under the License. import("//build/ohos.gni") +import("//vendor/huawei/build/framework/templates/hmos_app.gni") import("../../../../../appexecfwk.gni") -ohos_hap("versionUpdateTest5") { - hap_profile = "entry/src/main/module.json" +hmos_app("versionUpdateTest5") { + hvigor_home = "//vendor/huawei/binary/artifacts/build/intepgral_hvigor_tools/5.19.0/HvigorAndPlugin-Integration.5.19.0/bin" + sdk_home = "//prebuilts/hmos-sdk/5.1.1.202/harmonyos-sdk-linux" + node_version = "v18.20.1" hap_name = "versionUpdateTest5" - subsystem_name = "bundlemanager" - final_hap_path = "$root_out_dir/tests/unittest/bundle_framework/bundle_framework/resource/test_bundle/versionUpdateTest/${hap_name}.hap" - testonly = true - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] + hap_out_dir = "$root_out_dir/tests/unittest/bundle_framework/bundle_framework/resource/test_bundle/versionUpdateTest" + build_level = "module" + build_modules = [ "entry" ] + assemble_type = "assembleHap" + js_build_mode = "release" + build_profile = "build-profile.json5" certificate_profile = "${bundle_framework_path}/test/sceneProject/signature/com.example.versiontest.p7b" -} - -ohos_app_scope("bmsstagedemoone_app_profile") { - app_profile = "AppScope/app.json" - sources = [ "AppScope/resources" ] -} - -ohos_js_assets("hjs_demo_js_assets") { - source_dir = "entry/src/main/ets" -} - -ohos_resources("hjs_demo_resources") { - sources = [ "entry/src/main/resources" ] - deps = [ ":bmsstagedemoone_app_profile" ] - hap_profile = "entry/src/main/module.json" -} + module_install_dir = "app/com.example.versiontest" + part_name = "bundle_framework" + subsystem_name = "bundlemanager" +} \ No newline at end of file diff --git a/test/sceneProject/unittest/test_bundle/versionUpdateTest5/build-profile.json5 b/test/sceneProject/unittest/test_bundle/versionUpdateTest5/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..dad749c3a000519f3c20a24d4a4238bfe2ae3a31 --- /dev/null +++ b/test/sceneProject/unittest/test_bundle/versionUpdateTest5/build-profile.json5 @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +{ + "app": { + "products": [ + { + "name": "default", + "compatibleSdkVersion": "5.1.1(19)", + "compileSdkVersion": "5.1.1(19)", + "targetSdkVersion": "5.1.1(19)", + "runtimeOS": "HarmonyOS", + "signingConfig": "default" + } + ], + "signingConfigs": [ + ] + }, + "modules": [ + { + "name": "entry", + "srcPath": "./entry", + "targets": [ + { + "name": "default", + "applyToProducts": [ + "default" + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/test/sceneProject/unittest/test_bundle/versionUpdateTest5/entry/build-profile.json5 b/test/sceneProject/unittest/test_bundle/versionUpdateTest5/entry/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..b4d65d490ef6cbe22d933b9231555210f1555786 --- /dev/null +++ b/test/sceneProject/unittest/test_bundle/versionUpdateTest5/entry/build-profile.json5 @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +{ + "apiType": "stageMode", + "buildOption": { + }, + "buildOptionSet": [ + { + "name": "release", + "arkOptions": { + "obfuscation": { + "ruleOptions": { + "enable": false, + "files": [ + "./obfuscation-rules.txt" + ] + } + } + } + }, + ], + "targets": [ + { + "name": "default" + }, + { + "name": "ohosTest", + } + ] +} \ No newline at end of file diff --git a/test/sceneProject/unittest/test_bundle/versionUpdateTest5/entry/hvigorfile.ts b/test/sceneProject/unittest/test_bundle/versionUpdateTest5/entry/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..e4f43d54667f8327c367c8096bd08bb8c75aff54 --- /dev/null +++ b/test/sceneProject/unittest/test_bundle/versionUpdateTest5/entry/hvigorfile.ts @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { hapTasks } from '@ohos/hvigor-ohos-plugin'; + +export default { + system: hapTasks, /* Built-in plugin of Hvigor. It cannot be modified. */ + plugins:[] /* Custom plugin to extend the functionality of Hvigor. */ +} diff --git a/test/sceneProject/unittest/test_bundle/versionUpdateTest5/entry/obfuscation-rules.txt b/test/sceneProject/unittest/test_bundle/versionUpdateTest5/entry/obfuscation-rules.txt new file mode 100644 index 0000000000000000000000000000000000000000..c1d419bdc6fa72c5914cc864ede925c53a2b01c5 --- /dev/null +++ b/test/sceneProject/unittest/test_bundle/versionUpdateTest5/entry/obfuscation-rules.txt @@ -0,0 +1,36 @@ +# Copyright (c) 2025 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Define project specific obfuscation rules here. +# You can include the obfuscation configuration files in the current module's build-profile.json5. +# +# For more details, see +# https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/source-obfuscation-V5 + +# Obfuscation options: +# -disable-obfuscation: disable all obfuscations +# -enable-property-obfuscation: obfuscate the property names +# -enable-toplevel-obfuscation: obfuscate the names in the global scope +# -compact: remove unnecessary blank spaces and all line feeds +# -remove-log: remove all console.* statements +# -print-namecache: print the name cache that contains the mapping from the old names to new names +# -apply-namecache: reuse the given cache file + +# Keep options: +# -keep-property-name: specifies property names that you want to keep +# -keep-global-name: specifies names that you want to keep in the global scope + +-enable-property-obfuscation +-enable-toplevel-obfuscation +-enable-filename-obfuscation +-enable-export-obfuscation \ No newline at end of file diff --git a/test/sceneProject/unittest/test_bundle/versionUpdateTest5/entry/oh-package.json5 b/test/sceneProject/unittest/test_bundle/versionUpdateTest5/entry/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..4bf3e2a9b1ae7381cf9363dff1cbcc1861a41e7b --- /dev/null +++ b/test/sceneProject/unittest/test_bundle/versionUpdateTest5/entry/oh-package.json5 @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +{ + "name": "entry", + "version": "1.0.0", + "description": "Please describe the basic information.", + "main": "", + "author": "", + "license": "", + "dependencies": {} +} + diff --git a/test/sceneProject/unittest/test_bundle/versionUpdateTest5/entry/src/main/module.json b/test/sceneProject/unittest/test_bundle/versionUpdateTest5/entry/src/main/module.json5 similarity index 58% rename from test/sceneProject/unittest/test_bundle/versionUpdateTest5/entry/src/main/module.json rename to test/sceneProject/unittest/test_bundle/versionUpdateTest5/entry/src/main/module.json5 index 821715d33e5912036c1b48aa04c8e53ef6d381f0..5d195cfa34f1c81cc26226200f027a55f2c0ce94 100644 --- a/test/sceneProject/unittest/test_bundle/versionUpdateTest5/entry/src/main/module.json +++ b/test/sceneProject/unittest/test_bundle/versionUpdateTest5/entry/src/main/module.json5 @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + { "module": { "name": "entry", @@ -31,7 +46,8 @@ "action.system.home" ] } - ] + ], + "srcEntry": "" } ] } diff --git a/test/sceneProject/unittest/test_bundle/versionUpdateTest5/hvigor/hvigor-config.json5 b/test/sceneProject/unittest/test_bundle/versionUpdateTest5/hvigor/hvigor-config.json5 new file mode 100644 index 0000000000000000000000000000000000000000..c61d3eed60978a00d9a67b754ec36c0c9dcde929 --- /dev/null +++ b/test/sceneProject/unittest/test_bundle/versionUpdateTest5/hvigor/hvigor-config.json5 @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +{ + "modelVersion": "5.0.0", + "dependencies": { + }, + "execution": { + // "analyze": "normal", /* Define the build analyze mode. Value: [ "normal" | "advanced" | false ]. Default: "normal" */ + // "daemon": true, /* Enable daemon compilation. Value: [ true | false ]. Default: true */ + // "incremental": true, /* Enable incremental compilation. Value: [ true | false ]. Default: true */ + // "parallel": true, /* Enable parallel compilation. Value: [ true | false ]. Default: true */ + // "typeCheck": false, /* Enable typeCheck. Value: [ true | false ]. Default: false */ + }, + "logging": { + // "level": "info" /* Define the log level. Value: [ "debug" | "info" | "warn" | "error" ]. Default: "info" */ + }, + "debugging": { + // "stacktrace": false /* Disable stacktrace compilation. Value: [ true | false ]. Default: false */ + }, + "nodeOptions": { + // "maxOldSpaceSize": 8192 /* Enable nodeOptions maxOldSpaceSize compilation. Unit M. Used for the daemon process. Default: 8192*/ + // "exposeGC": true /* Enable to trigger garbage collection explicitly. Default: true*/ + } +} diff --git a/test/sceneProject/unittest/test_bundle/versionUpdateTest5/hvigorfile.ts b/test/sceneProject/unittest/test_bundle/versionUpdateTest5/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..2a5e543f190732c159beb574dfc9fa37bc94e156 --- /dev/null +++ b/test/sceneProject/unittest/test_bundle/versionUpdateTest5/hvigorfile.ts @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { appTasks } from '@ohos/hvigor-ohos-plugin'; + +export default { + system: appTasks, /* Built-in plugin of Hvigor. It cannot be modified. */ + plugins:[] /* Custom plugin to extend the functionality of Hvigor. */ +} diff --git a/test/sceneProject/unittest/test_bundle/versionUpdateTest5/oh-package.json5 b/test/sceneProject/unittest/test_bundle/versionUpdateTest5/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..15ec86a73e760904339e9269d493e3015429d8a2 --- /dev/null +++ b/test/sceneProject/unittest/test_bundle/versionUpdateTest5/oh-package.json5 @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +{ + "modelVersion": "5.0.0", + "description": "Please describe the basic information.", + "dependencies": { + }, + "devDependencies": { + "@ohos/hypium": "1.0.21" + } +} diff --git a/test/sceneProject/unittest/test_bundle/versionUpdateTest5/signature/com.example.versiontest.p7b b/test/sceneProject/unittest/test_bundle/versionUpdateTest5/signature/com.example.versiontest.p7b new file mode 100644 index 0000000000000000000000000000000000000000..3b2ac44a5ec6272016798022395d9fa9d2fa42c6 Binary files /dev/null and b/test/sceneProject/unittest/test_bundle/versionUpdateTest5/signature/com.example.versiontest.p7b differ diff --git a/test/sceneProject/unittest/test_bundle/versionUpdateTest6/AppScope/app.json b/test/sceneProject/unittest/test_bundle/versionUpdateTest6/AppScope/app.json5 similarity index 30% rename from test/sceneProject/unittest/test_bundle/versionUpdateTest6/AppScope/app.json rename to test/sceneProject/unittest/test_bundle/versionUpdateTest6/AppScope/app.json5 index 6e96ce6fbef1cbc7673637fb6a593ccb05bc430c..a950a4bea3d4966284d545fbe755db2b12c3808f 100644 --- a/test/sceneProject/unittest/test_bundle/versionUpdateTest6/AppScope/app.json +++ b/test/sceneProject/unittest/test_bundle/versionUpdateTest6/AppScope/app.json5 @@ -1,17 +1,29 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + { "app": { "bundleName": "com.example.versiontest", "bundleType": "atomicService", "debug": true, "icon": "$media:app_icon", - "iconId": 16777217, "label": "$string:app_name", - "labelId": 16777216, - "apiReleaseType": "Release", "minAPIVersion": 9, "targetAPIVersion": 9, "vendor": "example", "versionCode": 1000000, - "versionName": "atom_feature_v1" + "versionName": "2.1.0" } } diff --git a/test/sceneProject/unittest/test_bundle/versionUpdateTest6/BUILD.gn b/test/sceneProject/unittest/test_bundle/versionUpdateTest6/BUILD.gn index d812df7700de04f78c567ee893085e7087c96222..08f3103a9201b4953a2f7100757da14c0650ead6 100644 --- a/test/sceneProject/unittest/test_bundle/versionUpdateTest6/BUILD.gn +++ b/test/sceneProject/unittest/test_bundle/versionUpdateTest6/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2024 Huawei Device Co., Ltd. +# Copyright (c) 2024-2025 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -12,32 +12,22 @@ # limitations under the License. import("//build/ohos.gni") +import("//vendor/huawei/build/framework/templates/hmos_app.gni") import("../../../../../appexecfwk.gni") -ohos_hap("versionUpdateTest6") { - hap_profile = "feature/src/main/module.json" +hmos_app("versionUpdateTest6") { + hvigor_home = "//vendor/huawei/binary/artifacts/build/intepgral_hvigor_tools/5.19.0/HvigorAndPlugin-Integration.5.19.0/bin" + sdk_home = "//prebuilts/hmos-sdk/5.1.1.202/harmonyos-sdk-linux" + node_version = "v18.20.1" hap_name = "versionUpdateTest6" - subsystem_name = "bundlemanager" - final_hap_path = "$root_out_dir/tests/unittest/bundle_framework/bundle_framework/resource/test_bundle/versionUpdateTest/${hap_name}.hap" - testonly = true - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] + hap_out_dir = "$root_out_dir/tests/unittest/bundle_framework/bundle_framework/resource/test_bundle/versionUpdateTest" + build_level = "module" + build_modules = [ "feature" ] + assemble_type = "assembleHap" + js_build_mode = "release" + build_profile = "build-profile.json5" certificate_profile = "${bundle_framework_path}/test/sceneProject/signature/com.example.versiontest.p7b" -} - -ohos_app_scope("bmsstagedemoone_app_profile") { - app_profile = "AppScope/app.json" - sources = [ "AppScope/resources" ] -} - -ohos_js_assets("hjs_demo_js_assets") { - source_dir = "feature/src/main/ets" -} - -ohos_resources("hjs_demo_resources") { - sources = [ "feature/src/main/resources" ] - deps = [ ":bmsstagedemoone_app_profile" ] - hap_profile = "feature/src/main/module.json" -} + module_install_dir = "app/com.example.versiontest" + part_name = "bundle_framework" + subsystem_name = "bundlemanager" +} \ No newline at end of file diff --git a/test/sceneProject/unittest/test_bundle/versionUpdateTest6/build-profile.json5 b/test/sceneProject/unittest/test_bundle/versionUpdateTest6/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..6d4843a96edaeb071b52bbaccf35bb75a0c84108 --- /dev/null +++ b/test/sceneProject/unittest/test_bundle/versionUpdateTest6/build-profile.json5 @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +{ + "app": { + "products": [ + { + "name": "default", + "compatibleSdkVersion": "5.1.1(19)", + "compileSdkVersion": "5.1.1(19)", + "targetSdkVersion": "5.1.1(19)", + "runtimeOS": "HarmonyOS", + "signingConfig": "default" + } + ], + "signingConfigs": [ + ] + }, + "modules": [ + { + "name": "feature", + "srcPath": "./feature", + "targets": [ + { + "name": "default", + "applyToProducts": [ + "default" + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/test/sceneProject/unittest/test_bundle/versionUpdateTest6/feature/build-profile.json5 b/test/sceneProject/unittest/test_bundle/versionUpdateTest6/feature/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..f618d798839273eee6e9563ee7dbdb39d008ee4c --- /dev/null +++ b/test/sceneProject/unittest/test_bundle/versionUpdateTest6/feature/build-profile.json5 @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +{ + "apiType": "stageMode", + "buildOption": { + }, + "buildOptionSet": [ + { + "name": "release", + "arkOptions": { + "obfuscation": { + "ruleOptions": { + "enable": false, + "files": [ + "./obfuscation-rules.txt" + ] + } + } + } + }, + ], + "targets": [ + { + "name": "default" + }, + { + "name": "ohosTest", + } + ] +} \ No newline at end of file diff --git a/test/sceneProject/unittest/test_bundle/versionUpdateTest6/feature/hvigorfile.ts b/test/sceneProject/unittest/test_bundle/versionUpdateTest6/feature/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..e042e3f963ab27941d3b34f1f027da9933b81df1 --- /dev/null +++ b/test/sceneProject/unittest/test_bundle/versionUpdateTest6/feature/hvigorfile.ts @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { hapTasks } from '@ohos/hvigor-ohos-plugin'; + +export default { + system: hapTasks, /* Built-in plugin of Hvigor. It cannot be modified. */ + plugins:[] /* Custom plugin to extend the functionality of Hvigor. */ +} diff --git a/test/sceneProject/unittest/test_bundle/versionUpdateTest6/feature/obfuscation-rules.txt b/test/sceneProject/unittest/test_bundle/versionUpdateTest6/feature/obfuscation-rules.txt new file mode 100644 index 0000000000000000000000000000000000000000..c1d419bdc6fa72c5914cc864ede925c53a2b01c5 --- /dev/null +++ b/test/sceneProject/unittest/test_bundle/versionUpdateTest6/feature/obfuscation-rules.txt @@ -0,0 +1,36 @@ +# Copyright (c) 2025 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Define project specific obfuscation rules here. +# You can include the obfuscation configuration files in the current module's build-profile.json5. +# +# For more details, see +# https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/source-obfuscation-V5 + +# Obfuscation options: +# -disable-obfuscation: disable all obfuscations +# -enable-property-obfuscation: obfuscate the property names +# -enable-toplevel-obfuscation: obfuscate the names in the global scope +# -compact: remove unnecessary blank spaces and all line feeds +# -remove-log: remove all console.* statements +# -print-namecache: print the name cache that contains the mapping from the old names to new names +# -apply-namecache: reuse the given cache file + +# Keep options: +# -keep-property-name: specifies property names that you want to keep +# -keep-global-name: specifies names that you want to keep in the global scope + +-enable-property-obfuscation +-enable-toplevel-obfuscation +-enable-filename-obfuscation +-enable-export-obfuscation \ No newline at end of file diff --git a/test/sceneProject/unittest/test_bundle/versionUpdateTest6/feature/oh-package.json5 b/test/sceneProject/unittest/test_bundle/versionUpdateTest6/feature/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..b32d5e12205866768052c6089aefdccf98030728 --- /dev/null +++ b/test/sceneProject/unittest/test_bundle/versionUpdateTest6/feature/oh-package.json5 @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +{ + "name": "feature", + "version": "1.0.0", + "description": "Please describe the basic information.", + "main": "", + "author": "", + "license": "", + "dependencies": {} +} + diff --git a/test/sceneProject/unittest/test_bundle/versionUpdateTest6/feature/src/main/module.json b/test/sceneProject/unittest/test_bundle/versionUpdateTest6/feature/src/main/module.json5 similarity index 55% rename from test/sceneProject/unittest/test_bundle/versionUpdateTest6/feature/src/main/module.json rename to test/sceneProject/unittest/test_bundle/versionUpdateTest6/feature/src/main/module.json5 index 06be28254be2ffb82ee8a1067df9e1e419253418..1319e426f3711ef39eae36af6fbec54af25d948d 100644 --- a/test/sceneProject/unittest/test_bundle/versionUpdateTest6/feature/src/main/module.json +++ b/test/sceneProject/unittest/test_bundle/versionUpdateTest6/feature/src/main/module.json5 @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + { "module": { "name": "feature", @@ -15,7 +30,7 @@ "abilities": [ { "name": "FeatureAbility", - "srcEntrance": "./ets/featureability/FeatureAbility.ts", + "srcEntry": "./ets/featureability/FeatureAbility.ts", "description": "$string:FeatureAbility_desc", "icon": "$media:icon", "label": "$string:FeatureAbility_label", @@ -31,7 +46,7 @@ "action.system.home" ] } - ] + ], } ] } diff --git a/test/sceneProject/unittest/test_bundle/versionUpdateTest6/hvigor/hvigor-config.json5 b/test/sceneProject/unittest/test_bundle/versionUpdateTest6/hvigor/hvigor-config.json5 new file mode 100644 index 0000000000000000000000000000000000000000..b839e9394547af5fced4e6e694d628c9a12b5b35 --- /dev/null +++ b/test/sceneProject/unittest/test_bundle/versionUpdateTest6/hvigor/hvigor-config.json5 @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +{ + "modelVersion": "5.0.0", + "dependencies": { + }, + "execution": { + // "analyze": "normal", /* Define the build analyze mode. Value: [ "normal" | "advanced" | false ]. Default: "normal" */ + // "daemon": true, /* Enable daemon compilation. Value: [ true | false ]. Default: true */ + // "incremental": true, /* Enable incremental compilation. Value: [ true | false ]. Default: true */ + // "parallel": true, /* Enable parallel compilation. Value: [ true | false ]. Default: true */ + // "typeCheck": false, /* Enable typeCheck. Value: [ true | false ]. Default: false */ + }, + "logging": { + // "level": "info" /* Define the log level. Value: [ "debug" | "info" | "warn" | "error" ]. Default: "info" */ + }, + "debugging": { + // "stacktrace": false /* Disable stacktrace compilation. Value: [ true | false ]. Default: false */ + }, + "nodeOptions": { + // "maxOldSpaceSize": 8192 /* Enable nodeOptions maxOldSpaceSize compilation. Unit M. Used for the daemon process. Default: 8192*/ + // "exposeGC": true /* Enable to trigger garbage collection explicitly. Default: true*/ + } +} diff --git a/test/sceneProject/unittest/test_bundle/versionUpdateTest6/hvigorfile.ts b/test/sceneProject/unittest/test_bundle/versionUpdateTest6/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..79d8761856e2996edc0649eca63b96b2c883b28a --- /dev/null +++ b/test/sceneProject/unittest/test_bundle/versionUpdateTest6/hvigorfile.ts @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { appTasks } from '@ohos/hvigor-ohos-plugin'; + +export default { + system: appTasks, /* Built-in plugin of Hvigor. It cannot be modified. */ + plugins:[] /* Custom plugin to extend the functionality of Hvigor. */ +} diff --git a/test/sceneProject/unittest/test_bundle/versionUpdateTest6/oh-package.json5 b/test/sceneProject/unittest/test_bundle/versionUpdateTest6/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..68352f60e6e02cf8c9edb2769dcf0f9adcdca9e4 --- /dev/null +++ b/test/sceneProject/unittest/test_bundle/versionUpdateTest6/oh-package.json5 @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +{ + "modelVersion": "5.0.0", + "description": "Please describe the basic information.", + "dependencies": { + }, + "devDependencies": { + "@ohos/hypium": "1.0.21" + } +} diff --git a/test/sceneProject/unittest/test_bundle/versionUpdateTest6/signature/com.example.versiontest.p7b b/test/sceneProject/unittest/test_bundle/versionUpdateTest6/signature/com.example.versiontest.p7b new file mode 100644 index 0000000000000000000000000000000000000000..3b2ac44a5ec6272016798022395d9fa9d2fa42c6 Binary files /dev/null and b/test/sceneProject/unittest/test_bundle/versionUpdateTest6/signature/com.example.versiontest.p7b differ diff --git a/test/sceneProject/unittest/test_bundle/versionUpdateTest7/AppScope/app.json b/test/sceneProject/unittest/test_bundle/versionUpdateTest7/AppScope/app.json deleted file mode 100644 index 806577658cfe9385e4b3b3b652325f212a45b07b..0000000000000000000000000000000000000000 --- a/test/sceneProject/unittest/test_bundle/versionUpdateTest7/AppScope/app.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "app": { - "bundleName": "com.example.versiontest", - "bundleType": "atomicService", - "debug": true, - "icon": "$media:app_icon", - "iconId": 16777217, - "label": "$string:app_name", - "labelId": 16777216, - "apiReleaseType": "Release", - "minAPIVersion": 9, - "targetAPIVersion": 9, - "vendor": "example", - "versionCode": 2000000, - "versionName": "atom_feature_v2" - } -} diff --git a/test/sceneProject/unittest/test_bundle/versionUpdateTest7/AppScope/app.json5 b/test/sceneProject/unittest/test_bundle/versionUpdateTest7/AppScope/app.json5 new file mode 100644 index 0000000000000000000000000000000000000000..cebe9b4182c82d069da9e918e96b6545ef987c42 --- /dev/null +++ b/test/sceneProject/unittest/test_bundle/versionUpdateTest7/AppScope/app.json5 @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +{ + "app": { + "bundleName": "com.example.versiontest", + "bundleType": "atomicService", + "debug": true, + "icon": "$media:app_icon", + "label": "$string:app_name", + "minAPIVersion": 9, + "targetAPIVersion": 9, + "vendor": "example", + "versionCode": 1000000, + "versionName": "2.1.1" + } +} diff --git a/test/sceneProject/unittest/test_bundle/versionUpdateTest7/BUILD.gn b/test/sceneProject/unittest/test_bundle/versionUpdateTest7/BUILD.gn index 9a1cb0661b774574a7c610d59a8144e41f13e931..d598162c3de60f774032d4cd98865a9d1b19b7e2 100644 --- a/test/sceneProject/unittest/test_bundle/versionUpdateTest7/BUILD.gn +++ b/test/sceneProject/unittest/test_bundle/versionUpdateTest7/BUILD.gn @@ -1,4 +1,4 @@ -# Copyright (c) 2024 Huawei Device Co., Ltd. +# Copyright (c) 2024-2025 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at @@ -12,32 +12,22 @@ # limitations under the License. import("//build/ohos.gni") +import("//vendor/huawei/build/framework/templates/hmos_app.gni") import("../../../../../appexecfwk.gni") -ohos_hap("versionUpdateTest7") { - hap_profile = "feature/src/main/module.json" +hmos_app("versionUpdateTest7") { + hvigor_home = "//vendor/huawei/binary/artifacts/build/intepgral_hvigor_tools/5.19.0/HvigorAndPlugin-Integration.5.19.0/bin" + sdk_home = "//prebuilts/hmos-sdk/5.1.1.202/harmonyos-sdk-linux" + node_version = "v18.20.1" hap_name = "versionUpdateTest7" - subsystem_name = "bundlemanager" - final_hap_path = "$root_out_dir/tests/unittest/bundle_framework/bundle_framework/resource/test_bundle/versionUpdateTest/${hap_name}.hap" - testonly = true - deps = [ - ":hjs_demo_js_assets", - ":hjs_demo_resources", - ] + hap_out_dir = "$root_out_dir/tests/unittest/bundle_framework/bundle_framework/resource/test_bundle/versionUpdateTest" + build_level = "module" + build_modules = [ "feature" ] + assemble_type = "assembleHap" + js_build_mode = "release" + build_profile = "build-profile.json5" certificate_profile = "${bundle_framework_path}/test/sceneProject/signature/com.example.versiontest.p7b" -} - -ohos_app_scope("bmsstagedemoone_app_profile") { - app_profile = "AppScope/app.json" - sources = [ "AppScope/resources" ] -} - -ohos_js_assets("hjs_demo_js_assets") { - source_dir = "feature/src/main/ets" -} - -ohos_resources("hjs_demo_resources") { - sources = [ "feature/src/main/resources" ] - deps = [ ":bmsstagedemoone_app_profile" ] - hap_profile = "feature/src/main/module.json" -} + module_install_dir = "app/com.example.versiontest" + part_name = "bundle_framework" + subsystem_name = "bundlemanager" +} \ No newline at end of file diff --git a/test/sceneProject/unittest/test_bundle/versionUpdateTest7/build-profile.json5 b/test/sceneProject/unittest/test_bundle/versionUpdateTest7/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..0083e44874a0f30108595d9e6a55a6f53eb58982 --- /dev/null +++ b/test/sceneProject/unittest/test_bundle/versionUpdateTest7/build-profile.json5 @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +{ + "app": { + "signingConfigs": [], + "products": [ + { + "name": "default", + "signingConfig": "default", + "compatibleSdkVersion": "5.1.1(19)", + "compileSdkVersion": "5.1.1(19)", + "targetSdkVersion": "5.1.1(19)", + "runtimeOS": "HarmonyOS" + } + ] + }, + "modules": [ + { + "name": "feature", + "srcPath": "./feature", + "targets": [ + { + "name": "default", + "applyToProducts": [ + "default" + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/test/sceneProject/unittest/test_bundle/versionUpdateTest7/feature/build-profile.json5 b/test/sceneProject/unittest/test_bundle/versionUpdateTest7/feature/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..f618d798839273eee6e9563ee7dbdb39d008ee4c --- /dev/null +++ b/test/sceneProject/unittest/test_bundle/versionUpdateTest7/feature/build-profile.json5 @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +{ + "apiType": "stageMode", + "buildOption": { + }, + "buildOptionSet": [ + { + "name": "release", + "arkOptions": { + "obfuscation": { + "ruleOptions": { + "enable": false, + "files": [ + "./obfuscation-rules.txt" + ] + } + } + } + }, + ], + "targets": [ + { + "name": "default" + }, + { + "name": "ohosTest", + } + ] +} \ No newline at end of file diff --git a/test/sceneProject/unittest/test_bundle/versionUpdateTest7/feature/hvigorfile.ts b/test/sceneProject/unittest/test_bundle/versionUpdateTest7/feature/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..e042e3f963ab27941d3b34f1f027da9933b81df1 --- /dev/null +++ b/test/sceneProject/unittest/test_bundle/versionUpdateTest7/feature/hvigorfile.ts @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { hapTasks } from '@ohos/hvigor-ohos-plugin'; + +export default { + system: hapTasks, /* Built-in plugin of Hvigor. It cannot be modified. */ + plugins:[] /* Custom plugin to extend the functionality of Hvigor. */ +} diff --git a/test/sceneProject/unittest/test_bundle/versionUpdateTest7/feature/obfuscation-rules.txt b/test/sceneProject/unittest/test_bundle/versionUpdateTest7/feature/obfuscation-rules.txt new file mode 100644 index 0000000000000000000000000000000000000000..c1d419bdc6fa72c5914cc864ede925c53a2b01c5 --- /dev/null +++ b/test/sceneProject/unittest/test_bundle/versionUpdateTest7/feature/obfuscation-rules.txt @@ -0,0 +1,36 @@ +# Copyright (c) 2025 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Define project specific obfuscation rules here. +# You can include the obfuscation configuration files in the current module's build-profile.json5. +# +# For more details, see +# https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/source-obfuscation-V5 + +# Obfuscation options: +# -disable-obfuscation: disable all obfuscations +# -enable-property-obfuscation: obfuscate the property names +# -enable-toplevel-obfuscation: obfuscate the names in the global scope +# -compact: remove unnecessary blank spaces and all line feeds +# -remove-log: remove all console.* statements +# -print-namecache: print the name cache that contains the mapping from the old names to new names +# -apply-namecache: reuse the given cache file + +# Keep options: +# -keep-property-name: specifies property names that you want to keep +# -keep-global-name: specifies names that you want to keep in the global scope + +-enable-property-obfuscation +-enable-toplevel-obfuscation +-enable-filename-obfuscation +-enable-export-obfuscation \ No newline at end of file diff --git a/test/sceneProject/unittest/test_bundle/versionUpdateTest7/feature/oh-package.json5 b/test/sceneProject/unittest/test_bundle/versionUpdateTest7/feature/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..ed86930d2e78b5e2d461101329555631e0bcf03c --- /dev/null +++ b/test/sceneProject/unittest/test_bundle/versionUpdateTest7/feature/oh-package.json5 @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +{ + "name": "feature", + "version": "1.0.0", + "description": "Please describe the basic information.", + "main": "", + "author": "", + "license": "", + "dependencies": {} +} \ No newline at end of file diff --git a/test/sceneProject/unittest/test_bundle/versionUpdateTest7/feature/src/main/module.json b/test/sceneProject/unittest/test_bundle/versionUpdateTest7/feature/src/main/module.json5 similarity index 55% rename from test/sceneProject/unittest/test_bundle/versionUpdateTest7/feature/src/main/module.json rename to test/sceneProject/unittest/test_bundle/versionUpdateTest7/feature/src/main/module.json5 index 06be28254be2ffb82ee8a1067df9e1e419253418..e64e73e70236f96179f934071b220692fc134b04 100644 --- a/test/sceneProject/unittest/test_bundle/versionUpdateTest7/feature/src/main/module.json +++ b/test/sceneProject/unittest/test_bundle/versionUpdateTest7/feature/src/main/module.json5 @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + { "module": { "name": "feature", @@ -15,7 +30,7 @@ "abilities": [ { "name": "FeatureAbility", - "srcEntrance": "./ets/featureability/FeatureAbility.ts", + "srcEntry": "./ets/featureability/FeatureAbility.ts", "description": "$string:FeatureAbility_desc", "icon": "$media:icon", "label": "$string:FeatureAbility_label", @@ -31,7 +46,7 @@ "action.system.home" ] } - ] + ], } ] } diff --git a/test/sceneProject/unittest/test_bundle/versionUpdateTest7/hvigor/hvigor-config.json5 b/test/sceneProject/unittest/test_bundle/versionUpdateTest7/hvigor/hvigor-config.json5 new file mode 100644 index 0000000000000000000000000000000000000000..b839e9394547af5fced4e6e694d628c9a12b5b35 --- /dev/null +++ b/test/sceneProject/unittest/test_bundle/versionUpdateTest7/hvigor/hvigor-config.json5 @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +{ + "modelVersion": "5.0.0", + "dependencies": { + }, + "execution": { + // "analyze": "normal", /* Define the build analyze mode. Value: [ "normal" | "advanced" | false ]. Default: "normal" */ + // "daemon": true, /* Enable daemon compilation. Value: [ true | false ]. Default: true */ + // "incremental": true, /* Enable incremental compilation. Value: [ true | false ]. Default: true */ + // "parallel": true, /* Enable parallel compilation. Value: [ true | false ]. Default: true */ + // "typeCheck": false, /* Enable typeCheck. Value: [ true | false ]. Default: false */ + }, + "logging": { + // "level": "info" /* Define the log level. Value: [ "debug" | "info" | "warn" | "error" ]. Default: "info" */ + }, + "debugging": { + // "stacktrace": false /* Disable stacktrace compilation. Value: [ true | false ]. Default: false */ + }, + "nodeOptions": { + // "maxOldSpaceSize": 8192 /* Enable nodeOptions maxOldSpaceSize compilation. Unit M. Used for the daemon process. Default: 8192*/ + // "exposeGC": true /* Enable to trigger garbage collection explicitly. Default: true*/ + } +} diff --git a/test/sceneProject/unittest/test_bundle/versionUpdateTest7/hvigorfile.ts b/test/sceneProject/unittest/test_bundle/versionUpdateTest7/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..1f636586238506c4c39795991407a6b6f90fd2de --- /dev/null +++ b/test/sceneProject/unittest/test_bundle/versionUpdateTest7/hvigorfile.ts @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { appTasks } from '@ohos/hvigor-ohos-plugin'; + +export default { + system: appTasks, /* Built-in plugin of Hvigor. It cannot be modified. */ + plugins:[] /* Custom plugin to extend the functionality of Hvigor. */ +} \ No newline at end of file diff --git a/test/sceneProject/unittest/test_bundle/versionUpdateTest7/oh-package.json5 b/test/sceneProject/unittest/test_bundle/versionUpdateTest7/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..23c5ecb7e3d2f0b33c1d8293a74920a47a9ad22f --- /dev/null +++ b/test/sceneProject/unittest/test_bundle/versionUpdateTest7/oh-package.json5 @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +{ + "modelVersion": "5.0.0", + "description": "Please describe the basic information.", + "dependencies": {}, + "devDependencies": { + "@ohos/hypium": "1.0.21" + } +} \ No newline at end of file diff --git a/test/sceneProject/unittest/test_bundle/versionUpdateTest7/signature/com.example.versiontest.p7b b/test/sceneProject/unittest/test_bundle/versionUpdateTest7/signature/com.example.versiontest.p7b new file mode 100644 index 0000000000000000000000000000000000000000..3b2ac44a5ec6272016798022395d9fa9d2fa42c6 Binary files /dev/null and b/test/sceneProject/unittest/test_bundle/versionUpdateTest7/signature/com.example.versiontest.p7b differ