diff --git a/interfaces/inner_api/appexecfwk_core/src/verify/verify_manager_client.cpp b/interfaces/inner_api/appexecfwk_core/src/verify/verify_manager_client.cpp index 535e69c3b13e62f4503ad1087068c44d4a58151d..5c168c5a5b61f1acf0deb4e55f40ab27f12b0799 100644 --- a/interfaces/inner_api/appexecfwk_core/src/verify/verify_manager_client.cpp +++ b/interfaces/inner_api/appexecfwk_core/src/verify/verify_manager_client.cpp @@ -175,3 +175,6 @@ VerifyManagerClient& VerifyManagerClient::GetInstance() } } // namespace AppExecFwk } // namespace OHOS + + + 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 b2e9835b528ae8b9361091561fec8f7c4d283b69..1eead587a62ef7931ac857bc57d671b8a4c5d425 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/versionUpdateTest3/oh-package.json5 b/test/sceneProject/unittest/test_bundle/versionUpdateTest3/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..d6c6265195f8f013bbaff6160221319abe651ab2 --- /dev/null +++ b/test/sceneProject/unittest/test_bundle/versionUpdateTest3/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. + */ + +{ + "modelVersion": "5.0.0", + "description": "Please describe the basic information.", + "dependencies": { + }, + "devDependencies": { + "@ohos/hypium": "1.0.19", + "@ohos/hamock": "1.0.0" + } +} \ No newline at end of file diff --git a/test/sceneProject/unittest/test_bundle/versionUpdateTest5/AppScope/app.json b/test/sceneProject/unittest/test_bundle/versionUpdateTest5/AppScope/app.json deleted file mode 100644 index f4f7d8a18ec0a513d024a84894e643310f0910a6..0000000000000000000000000000000000000000 --- a/test/sceneProject/unittest/test_bundle/versionUpdateTest5/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": 1000000, - "versionName": "atom_entry_v1" - } -} diff --git a/test/sceneProject/unittest/test_bundle/versionUpdateTest5/AppScope/app.json5 b/test/sceneProject/unittest/test_bundle/versionUpdateTest5/AppScope/app.json5 new file mode 100644 index 0000000000000000000000000000000000000000..2d61b7dfa2c6d5071c1b12beb3e1cdb29227c868 --- /dev/null +++ b/test/sceneProject/unittest/test_bundle/versionUpdateTest5/AppScope/app.json5 @@ -0,0 +1,28 @@ +/* + * 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", + "debug": true, + "icon": "$media:app_icon", + "label": "$string:app_name", + "minAPIVersion": 9, + "targetAPIVersion": 9, + "vendor": "example", + "versionCode": 1000000, + "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..e35930461675c626a592834a4cac1d6d98e7530c 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 @@ -14,30 +14,19 @@ import("//build/ohos.gni") import("../../../../../appexecfwk.gni") -ohos_hap("versionUpdateTest5") { - hap_profile = "entry/src/main/module.json" +ohos_app("versionUpdateTest5") { + certificate_profile = "signature/com.example.versiontest.p7b" hap_name = "versionUpdateTest5" + hap_out_dir = "$root_out_dir/tests/unittest/bundle_framework/bundle_framework/resource/test_bundle/versionUpdateTest" + 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", - ] - 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" ] -} + part_name = "bundle_framework" -ohos_js_assets("hjs_demo_js_assets") { - source_dir = "entry/src/main/ets" + js_build_mode = "release" + sdk_home = "//prebuilts/ohos-sdk/linux" + sdk_type_name = [ "sdk.dir" ] + assemble_type = "assembleHap" + build_level = "module" + build_modules = [ "entry" ] } -ohos_resources("hjs_demo_resources") { - sources = [ "entry/src/main/resources" ] - deps = [ ":bmsstagedemoone_app_profile" ] - hap_profile = "entry/src/main/module.json" -} 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..af5f81ec1c199afe67b586b54ae076fd77c82fd7 --- /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", + "compileSdkVersion": 20, + "compatibleSdkVersion": 20, + "targetSdkVersion": 20, + "runtimeOS": "OpenHarmony", + "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..272efb6ca3f240859091bbbfc7c5802d52793b0b --- /dev/null +++ b/test/sceneProject/unittest/test_bundle/versionUpdateTest5/entry/obfuscation-rules.txt @@ -0,0 +1,23 @@ +# 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-lock.json5 b/test/sceneProject/unittest/test_bundle/versionUpdateTest5/oh-package-lock.json5 new file mode 100644 index 0000000000000000000000000000000000000000..9db0bd9b4f96e6dc80f7f04fe50c13715b9879e8 --- /dev/null +++ b/test/sceneProject/unittest/test_bundle/versionUpdateTest5/oh-package-lock.json5 @@ -0,0 +1,42 @@ +/* + * 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. + */ + +{ + "meta": { + "stableOrder": true + }, + "lockfileVersion": 3, + "ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.", + "specifiers": { + "@ohos/hamock@1.0.0": "@ohos/hamock@1.0.0", + "@ohos/hypium@1.0.19": "@ohos/hypium@1.0.19" + }, + "packages": { + "@ohos/hamock@1.0.0": { + "name": "@ohos/hamock", + "version": "1.0.0", + "integrity": "sha512-K6lDPYc6VkKe6ZBNQa9aoG+ZZMiwqfcR/7yAVFSUGIuOAhPvCJAo9+t1fZnpe0dBRBPxj2bxPPbKh69VuyAtDg==", + "resolved": "https://ohpm.openharmony.cn/ohpm/@ohos/hamock/-/hamock-1.0.0.har", + "registryType": "ohpm" + }, + "@ohos/hypium@1.0.19": { + "name": "@ohos/hypium", + "version": "1.0.19", + "integrity": "sha512-cEjDgLFCm3cWZDeRXk7agBUkPqjWxUo6AQeiu0gEkb3J8ESqlduQLSIXeo3cCsm8U/asL7iKjF85ZyOuufAGSQ==", + "resolved": "https://ohpm.openharmony.cn/ohpm/@ohos/hypium/-/hypium-1.0.19.har", + "registryType": "ohpm" + } + } +} \ No newline at end of file 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..4c8bad9bdbdd8da17793a0e43f29d9e7232dce00 --- /dev/null +++ b/test/sceneProject/unittest/test_bundle/versionUpdateTest5/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. + */ + +{ + "modelVersion": "5.0.0", + "description": "Please describe the basic information.", + "dependencies": { + }, + "devDependencies": { + "@ohos/hypium": "1.0.19", + "@ohos/hamock": "1.0.0" + } +} 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.json deleted file mode 100644 index 6e96ce6fbef1cbc7673637fb6a593ccb05bc430c..0000000000000000000000000000000000000000 --- a/test/sceneProject/unittest/test_bundle/versionUpdateTest6/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": 1000000, - "versionName": "atom_feature_v1" - } -} diff --git a/test/sceneProject/unittest/test_bundle/versionUpdateTest6/AppScope/app.json5 b/test/sceneProject/unittest/test_bundle/versionUpdateTest6/AppScope/app.json5 new file mode 100644 index 0000000000000000000000000000000000000000..079eb7a26bbf959e35c4d0c776bf4ecbab31b8bc --- /dev/null +++ b/test/sceneProject/unittest/test_bundle/versionUpdateTest6/AppScope/app.json5 @@ -0,0 +1,28 @@ +/* + * 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", + "debug": true, + "icon": "$media:app_icon", + "label": "$string:app_name", + "minAPIVersion": 9, + "targetAPIVersion": 9, + "vendor": "example", + "versionCode": 1000000, + "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..8a11f61811fc38d825b0b7d909000092ede88a53 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 @@ -14,30 +14,19 @@ import("//build/ohos.gni") import("../../../../../appexecfwk.gni") -ohos_hap("versionUpdateTest6") { - hap_profile = "feature/src/main/module.json" +ohos_app("versionUpdateTest6") { + certificate_profile = "signature/com.example.versiontest.p7b" hap_name = "versionUpdateTest6" + hap_out_dir = "$root_out_dir/tests/unittest/bundle_framework/bundle_framework/resource/test_bundle/versionUpdateTest" + 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", - ] - 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" ] -} + part_name = "bundle_framework" -ohos_js_assets("hjs_demo_js_assets") { - source_dir = "feature/src/main/ets" + js_build_mode = "release" + sdk_home = "//prebuilts/ohos-sdk/linux" + sdk_type_name = [ "sdk.dir" ] + assemble_type = "assembleHap" + build_level = "module" + build_modules = [ "feature" ] } -ohos_resources("hjs_demo_resources") { - sources = [ "feature/src/main/resources" ] - deps = [ ":bmsstagedemoone_app_profile" ] - hap_profile = "feature/src/main/module.json" -} 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..4ab04eebcfc2b095d2bdcd455539d87a88b9fb03 --- /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", + "compileSdkVersion": 20, + "compatibleSdkVersion": 20, + "targetSdkVersion": 20, + "runtimeOS": "OpenHarmony", + "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..272efb6ca3f240859091bbbfc7c5802d52793b0b --- /dev/null +++ b/test/sceneProject/unittest/test_bundle/versionUpdateTest6/feature/obfuscation-rules.txt @@ -0,0 +1,23 @@ +# 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-lock.json5 b/test/sceneProject/unittest/test_bundle/versionUpdateTest6/oh-package-lock.json5 new file mode 100644 index 0000000000000000000000000000000000000000..3c5e7affe87273511d3b0d9ee9c337bc8dd56f98 --- /dev/null +++ b/test/sceneProject/unittest/test_bundle/versionUpdateTest6/oh-package-lock.json5 @@ -0,0 +1,42 @@ +/* + * 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. + */ + +{ + "meta": { + "stableOrder": true + }, + "lockfileVersion": 3, + "ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.", + "specifiers": { + "@ohos/hamock@1.0.0": "@ohos/hamock@1.0.0", + "@ohos/hypium@1.0.19": "@ohos/hypium@1.0.19" + }, + "packages": { + "@ohos/hamock@1.0.0": { + "name": "@ohos/hamock", + "version": "1.0.0", + "integrity": "sha512-K6lDPYc6VkKe6ZBNQa9aoG+ZZMiwqfcR/7yAVFSUGIuOAhPvCJAo9+t1fZnpe0dBRBPxj2bxPPbKh69VuyAtDg==", + "resolved": "https://ohpm.openharmony.cn/ohpm/@ohos/hamock/-/hamock-1.0.0.har", + "registryType": "ohpm" + }, + "@ohos/hypium@1.0.19": { + "name": "@ohos/hypium", + "version": "1.0.19", + "integrity": "sha512-cEjDgLFCm3cWZDeRXk7agBUkPqjWxUo6AQeiu0gEkb3J8ESqlduQLSIXeo3cCsm8U/asL7iKjF85ZyOuufAGSQ==", + "resolved": "https://ohpm.openharmony.cn/ohpm/@ohos/hypium/-/hypium-1.0.19.har", + "registryType": "ohpm" + } + } +} \ No newline at end of file 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..95bf2b62b5bab47507f62693edb088f7f4cf9a12 --- /dev/null +++ b/test/sceneProject/unittest/test_bundle/versionUpdateTest6/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. + */ + +{ + "modelVersion": "5.0.0", + "description": "Please describe the basic information.", + "dependencies": { + }, + "devDependencies": { + "@ohos/hypium": "1.0.19", + "@ohos/hamock": "1.0.0" + } +} 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..b858f870b61383d74b7b0b5c41279b78cc430a89 --- /dev/null +++ b/test/sceneProject/unittest/test_bundle/versionUpdateTest7/AppScope/app.json5 @@ -0,0 +1,28 @@ +/* + * 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", + "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..5d2506177c1799b78d89587c53ea64293b6ebf61 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 @@ -14,30 +14,19 @@ import("//build/ohos.gni") import("../../../../../appexecfwk.gni") -ohos_hap("versionUpdateTest7") { - hap_profile = "feature/src/main/module.json" +ohos_app("versionUpdateTest7") { + certificate_profile = "signature/com.example.versiontest.p7b" hap_name = "versionUpdateTest7" + hap_out_dir = "$root_out_dir/tests/unittest/bundle_framework/bundle_framework/resource/test_bundle/versionUpdateTest" + 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", - ] - 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" ] -} + part_name = "bundle_framework" -ohos_js_assets("hjs_demo_js_assets") { - source_dir = "feature/src/main/ets" + js_build_mode = "release" + sdk_home = "//prebuilts/ohos-sdk/linux" + sdk_type_name = [ "sdk.dir" ] + assemble_type = "assembleHap" + build_level = "module" + build_modules = [ "feature" ] } -ohos_resources("hjs_demo_resources") { - sources = [ "feature/src/main/resources" ] - deps = [ ":bmsstagedemoone_app_profile" ] - hap_profile = "feature/src/main/module.json" -} 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..acfa135ed1cea61176c95ebebae8bd9cbe48d459 --- /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": 20, + "compileSdkVersion": 20, + "targetSdkVersion": 20, + "runtimeOS": "OpenHarmony" + } + ] + }, + "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..272efb6ca3f240859091bbbfc7c5802d52793b0b --- /dev/null +++ b/test/sceneProject/unittest/test_bundle/versionUpdateTest7/feature/obfuscation-rules.txt @@ -0,0 +1,23 @@ +# 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..b32d5e12205866768052c6089aefdccf98030728 --- /dev/null +++ b/test/sceneProject/unittest/test_bundle/versionUpdateTest7/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/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..79d8761856e2996edc0649eca63b96b2c883b28a --- /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. */ +} diff --git a/test/sceneProject/unittest/test_bundle/versionUpdateTest7/oh-package-lock.json5 b/test/sceneProject/unittest/test_bundle/versionUpdateTest7/oh-package-lock.json5 new file mode 100644 index 0000000000000000000000000000000000000000..3c5e7affe87273511d3b0d9ee9c337bc8dd56f98 --- /dev/null +++ b/test/sceneProject/unittest/test_bundle/versionUpdateTest7/oh-package-lock.json5 @@ -0,0 +1,42 @@ +/* + * 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. + */ + +{ + "meta": { + "stableOrder": true + }, + "lockfileVersion": 3, + "ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.", + "specifiers": { + "@ohos/hamock@1.0.0": "@ohos/hamock@1.0.0", + "@ohos/hypium@1.0.19": "@ohos/hypium@1.0.19" + }, + "packages": { + "@ohos/hamock@1.0.0": { + "name": "@ohos/hamock", + "version": "1.0.0", + "integrity": "sha512-K6lDPYc6VkKe6ZBNQa9aoG+ZZMiwqfcR/7yAVFSUGIuOAhPvCJAo9+t1fZnpe0dBRBPxj2bxPPbKh69VuyAtDg==", + "resolved": "https://ohpm.openharmony.cn/ohpm/@ohos/hamock/-/hamock-1.0.0.har", + "registryType": "ohpm" + }, + "@ohos/hypium@1.0.19": { + "name": "@ohos/hypium", + "version": "1.0.19", + "integrity": "sha512-cEjDgLFCm3cWZDeRXk7agBUkPqjWxUo6AQeiu0gEkb3J8ESqlduQLSIXeo3cCsm8U/asL7iKjF85ZyOuufAGSQ==", + "resolved": "https://ohpm.openharmony.cn/ohpm/@ohos/hypium/-/hypium-1.0.19.har", + "registryType": "ohpm" + } + } +} \ 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..95bf2b62b5bab47507f62693edb088f7f4cf9a12 --- /dev/null +++ b/test/sceneProject/unittest/test_bundle/versionUpdateTest7/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. + */ + +{ + "modelVersion": "5.0.0", + "description": "Please describe the basic information.", + "dependencies": { + }, + "devDependencies": { + "@ohos/hypium": "1.0.19", + "@ohos/hamock": "1.0.0" + } +} 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