diff --git a/tools/test/resource/aa/serviceAbilityBundleForStop/src/main/ets/MainAbility/pages/index.ets b/tools/test/resource/aa/serviceAbilityBundleForStop/AppScope/app.json5 similarity index 64% rename from tools/test/resource/aa/serviceAbilityBundleForStop/src/main/ets/MainAbility/pages/index.ets rename to tools/test/resource/aa/serviceAbilityBundleForStop/AppScope/app.json5 index 54bfa30ae2852e2e97807aebd3918c646d6aad9e..420ca1feb470d3004d22fc82399e51dddb84be15 100644 --- a/tools/test/resource/aa/serviceAbilityBundleForStop/src/main/ets/MainAbility/pages/index.ets +++ b/tools/test/resource/aa/serviceAbilityBundleForStop/AppScope/app.json5 @@ -1,32 +1,25 @@ -/* - * Copyright (c) 2022 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. - */ - -@Entry -@Component -struct Index { - @State message: string = 'Hello World' - - build() { - Row() { - Column() { - Text(this.message) - .fontSize(50) - .fontWeight(FontWeight.Bold) - } - .width('100%') - } - .height('100%') - } -} \ No newline at end of file +/* + * 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.ohos.tools.serviceAbilityBundleForStop", + "vendor": "example", + "versionCode": 1000000, + "versionName": "1.0.0", + "icon": "$media:app_icon", + "label": "$string:app_name" + } +} diff --git a/tools/test/resource/aa/serviceAbilityBundleForStop/AppScope/resources/base/media/app_icon.png b/tools/test/resource/aa/serviceAbilityBundleForStop/AppScope/resources/base/media/app_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..a39445dc87828b76fed6d2ec470dd455c45319e3 Binary files /dev/null and b/tools/test/resource/aa/serviceAbilityBundleForStop/AppScope/resources/base/media/app_icon.png differ diff --git a/tools/test/resource/aa/serviceAbilityBundleForStop/BUILD.gn b/tools/test/resource/aa/serviceAbilityBundleForStop/BUILD.gn index 301f0a504b626c39663caf7e2a22c9444ba665ca..31d9c5d9826edc904aa477188dc2f9ea7261da69 100644 --- a/tools/test/resource/aa/serviceAbilityBundleForStop/BUILD.gn +++ b/tools/test/resource/aa/serviceAbilityBundleForStop/BUILD.gn @@ -13,26 +13,18 @@ import("//build/ohos.gni") -ohos_hap("serviceAbilityBundleForStop") { - hap_profile = "./src/main/config.json" +ohos_app("serviceAbilityBundleForStop") { + certificate_profile = "signature/openharmony_sx.p7b" hap_name = "serviceAbilityBundleForStop" + hap_out_dir = "$root_out_dir/tests/ability/ability_runtime/tools/test/resource/aa/serviceAbilityBundleForStop_test" + subsystem_name = "ability" part_name = "ability_runtime" - final_hap_path = "$root_out_dir/tests/systemtest/ability_tools/tools/resource/aa/${hap_name}.hap" - testonly = true - deps = [ - ":serviceAbilityBundleForStop_ets_assets", - ":serviceAbilityBundleForStop_ets_resources", - ] - ets2abc = true - certificate_profile = "./signature/openharmony_sx.p7b" -} -ohos_js_assets("serviceAbilityBundleForStop_ets_assets") { - source_dir = "./src/main/ets" - hap_profile = "./src/main/config.json" - ets2abc = true -} -ohos_resources("serviceAbilityBundleForStop_ets_resources") { - sources = [ "./src/main/resources" ] - hap_profile = "./src/main/config.json" + + js_build_mode = "release" + sdk_home = "//prebuilts/ohos-sdk/linux" + sdk_type_name = [ "sdk.dir" ] + assemble_type = "assembleHap" + build_level = "module" + build_modules = [ "entry" ] } diff --git a/tools/test/resource/aa/serviceAbilityBundleForStop/build-profile.json5 b/tools/test/resource/aa/serviceAbilityBundleForStop/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..9ac1fafde6b1c82eed850ea9f2c4952737531d35 --- /dev/null +++ b/tools/test/resource/aa/serviceAbilityBundleForStop/build-profile.json5 @@ -0,0 +1,57 @@ +/* + * 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", + "compileSdkVersion": 20, + "compatibleSdkVersion": 20, + "runtimeOS": "OpenHarmony", + "buildOption": { + "strictMode": { + "caseSensitiveCheck": true, + "useNormalizedOHMUrl": true + } + } + } + ], + "buildModeSet": [ + { + "name": "debug", + }, + { + "name": "release" + } + ] + }, + "modules": [ + { + "name": "entry", + "srcPath": "./entry", + "targets": [ + { + "name": "default", + "applyToProducts": [ + "default" + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/tools/test/resource/aa/serviceAbilityBundleForStop/entry/build-profile.json5 b/tools/test/resource/aa/serviceAbilityBundleForStop/entry/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..b4d65d490ef6cbe22d933b9231555210f1555786 --- /dev/null +++ b/tools/test/resource/aa/serviceAbilityBundleForStop/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/tools/test/resource/aa/serviceAbilityBundleForStop/src/main/ets/ServiceAbility/service.ts b/tools/test/resource/aa/serviceAbilityBundleForStop/entry/hvigorfile.ts similarity index 68% rename from tools/test/resource/aa/serviceAbilityBundleForStop/src/main/ets/ServiceAbility/service.ts rename to tools/test/resource/aa/serviceAbilityBundleForStop/entry/hvigorfile.ts index e5043d02cc0505f6f3fe4817b4e670f635c1c920..e4f43d54667f8327c367c8096bd08bb8c75aff54 100644 --- a/tools/test/resource/aa/serviceAbilityBundleForStop/src/main/ets/ServiceAbility/service.ts +++ b/tools/test/resource/aa/serviceAbilityBundleForStop/entry/hvigorfile.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 Huawei Device Co., Ltd. + * 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 @@ -13,14 +13,9 @@ * limitations under the License. */ +import { hapTasks } from '@ohos/hvigor-ohos-plugin'; + export default { - onStart() { - console.info('ServiceAbility onStart'); - }, - onStop() { - console.info('ServiceAbility onStop'); - }, - onCommand(want, startId) { - console.info('ServiceAbility onCommand'); - } -}; \ No newline at end of file + system: hapTasks, /* Built-in plugin of Hvigor. It cannot be modified. */ + plugins:[] /* Custom plugin to extend the functionality of Hvigor. */ +} diff --git a/tools/test/resource/aa/serviceAbilityBundleForStop/entry/obfuscation-rules.txt b/tools/test/resource/aa/serviceAbilityBundleForStop/entry/obfuscation-rules.txt new file mode 100644 index 0000000000000000000000000000000000000000..991a7d617fc7bb8441625fdafeedc5dfe76e5945 --- /dev/null +++ b/tools/test/resource/aa/serviceAbilityBundleForStop/entry/obfuscation-rules.txt @@ -0,0 +1,38 @@ +/* + * 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/tools/test/resource/aa/serviceAbilityBundleForStop/src/main/ets/MainAbility/app.ets b/tools/test/resource/aa/serviceAbilityBundleForStop/entry/oh-package.json5 similarity index 69% rename from tools/test/resource/aa/serviceAbilityBundleForStop/src/main/ets/MainAbility/app.ets rename to tools/test/resource/aa/serviceAbilityBundleForStop/entry/oh-package.json5 index 2eb18d66dc1b9324405a13e48bce34d033da27b2..4bf3e2a9b1ae7381cf9363dff1cbcc1861a41e7b 100644 --- a/tools/test/resource/aa/serviceAbilityBundleForStop/src/main/ets/MainAbility/app.ets +++ b/tools/test/resource/aa/serviceAbilityBundleForStop/entry/oh-package.json5 @@ -1,23 +1,25 @@ -/* - * Copyright (c) 2022 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. - */ - -export default { - onCreate() { - console.info('Application onCreate') - }, - onDestroy() { - console.info('Application onDestroy') - }, -} \ No newline at end of file +/* + * 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/tools/test/resource/aa/serviceAbilityBundleForStop/entry/src/main/ets/MainAbility/app.ets b/tools/test/resource/aa/serviceAbilityBundleForStop/entry/src/main/ets/MainAbility/app.ets new file mode 100644 index 0000000000000000000000000000000000000000..269a961b11f3a84bf08e095b83c081dca86d42b2 --- /dev/null +++ b/tools/test/resource/aa/serviceAbilityBundleForStop/entry/src/main/ets/MainAbility/app.ets @@ -0,0 +1,56 @@ +/* + * 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 { UIAbility } from '@kit.AbilityKit'; +import { hilog } from '@kit.PerformanceAnalysisKit'; +import { window } from '@kit.ArkUI'; + +export default class app extends UIAbility { + onCreate(): void { + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); + } + + onDestroy(): void { + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onDestroy'); + } + + onWindowStageCreate(windowStage: window.WindowStage): void { + // Main window is created, set main page for this ability + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); + + windowStage.loadContent('pages/Index', (err) => { + if (err.code) { + hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); + return; + } + hilog.info(0x0000, 'testTag', 'Succeeded in loading the content.'); + }); + } + + onWindowStageDestroy(): void { + // Main window is destroyed, release UI related resources + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); + } + + onForeground(): void { + // Ability has brought to foreground + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onForeground'); + } + + onBackground(): void { + // Ability has back to background + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onBackground'); + } +} \ No newline at end of file diff --git a/tools/test/resource/aa/serviceAbilityBundleForStop/entry/src/main/ets/ServiceAbility/service.ets b/tools/test/resource/aa/serviceAbilityBundleForStop/entry/src/main/ets/ServiceAbility/service.ets new file mode 100644 index 0000000000000000000000000000000000000000..e68502b9e4de5a3b03845b0c669a6bbb7bedc790 --- /dev/null +++ b/tools/test/resource/aa/serviceAbilityBundleForStop/entry/src/main/ets/ServiceAbility/service.ets @@ -0,0 +1,70 @@ +/* + * 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 { Want } from '@kit.AbilityKit'; +import { rpc } from '@kit.IPCKit'; +import { hilog } from '@kit.PerformanceAnalysisKit'; + +const TAG: string = '[ServiceAbility_Mode]'; +const domain: number = 0xFF00; + +class ServiceAbilityStub extends rpc.RemoteObject { + constructor(des: Object) { + if (typeof des === 'string') { + super(des); + } else { + return; + } + } + + onRemoteMessageRequest(code: number, data: rpc.MessageSequence, reply: rpc.MessageSequence, option: rpc.MessageOption): boolean { + hilog.info(domain, TAG, 'ServiceAbility onRemoteRequest called'); + if (code === 1) { + let string = data.readString(); + hilog.info(domain, TAG, `ServiceAbility string=${string}`); + let result = Array.from(string).sort().join(''); + hilog.info(domain, TAG, `ServiceAbility result=${result}`); + reply.writeString(result); + } else { + hilog.info(domain, TAG, 'ServiceAbility unknown request code'); + } + return true; + } +} + +class ServiceAbility { + onStart(): void { + hilog.info(domain, TAG, 'ServiceAbility onStart'); + } + + onStop(): void { + hilog.info(domain, TAG, 'ServiceAbility onStop'); + } + + onCommand(want: Want, startId: number): void { + hilog.info(domain, TAG, 'ServiceAbility onCommand'); + } + + onConnect(want: Want): rpc.RemoteObject { + hilog.info(domain, TAG, 'ServiceAbility onDisconnect' + want); + return new ServiceAbilityStub('test'); + } + + onDisconnect(want: Want): void { + hilog.info(domain, TAG, 'ServiceAbility onDisconnect' + want); + } +} + +export default new ServiceAbility(); diff --git a/tools/test/resource/aa/serviceAbilityBundleForStop/entry/src/main/ets/pages/Index.ets b/tools/test/resource/aa/serviceAbilityBundleForStop/entry/src/main/ets/pages/Index.ets new file mode 100644 index 0000000000000000000000000000000000000000..a524a899a549432640d35fe5f53c3316a08dbfc7 --- /dev/null +++ b/tools/test/resource/aa/serviceAbilityBundleForStop/entry/src/main/ets/pages/Index.ets @@ -0,0 +1,35 @@ +/* + * 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. + */ + +@Entry +@Component +struct Index { + @State message: string = 'Hello World'; + + build() { + RelativeContainer() { + Text(this.message) + .id('HelloWorld') + .fontSize(50) + .fontWeight(FontWeight.Bold) + .alignRules({ + center: { anchor: '__container__', align: VerticalAlign.Center }, + middle: { anchor: '__container__', align: HorizontalAlign.Center } + }) + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/tools/test/resource/aa/serviceAbilityBundleForStop/entry/src/main/module.json5 b/tools/test/resource/aa/serviceAbilityBundleForStop/entry/src/main/module.json5 new file mode 100644 index 0000000000000000000000000000000000000000..710e4f1a14b6e676b4527fa454bc2940e8183347 --- /dev/null +++ b/tools/test/resource/aa/serviceAbilityBundleForStop/entry/src/main/module.json5 @@ -0,0 +1,62 @@ +/* + * 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", + "type": "entry", + "description": "$string:module_desc", + "mainElement": "MainAbility", + "deviceTypes": [ + "default", + "tablet" + ], + "deliveryWithInstall": true, + "installationFree": false, + "pages": "$profile:main_pages", + "abilities": [ + { + "name": "app", + "srcEntry": "./ets/MainAbility/app.ets", + "description": "$string:MainAbility_desc", + "icon": "$media:icon", + "label": "$string:MainAbility_label", + "startWindowIcon": "$media:startIcon", + "startWindowBackground": "$color:start_window_background", + "exported": true, + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ] + } + ], + "extensionAbilities": [ + { + "name": "ServiceAbility", + "srcEntry": "./ets/ServiceAbility/service.ets", + "label": "$string:ServiceAbility_label", + "description": "$string:ServiceAbility_desc", + "type": "service", + "visible": true + } + ] + } +} \ No newline at end of file diff --git a/tools/test/resource/aa/serviceAbilityBundleForStop/src/main/resources/base/element/color.json b/tools/test/resource/aa/serviceAbilityBundleForStop/entry/src/main/resources/base/element/color.json similarity index 54% rename from tools/test/resource/aa/serviceAbilityBundleForStop/src/main/resources/base/element/color.json rename to tools/test/resource/aa/serviceAbilityBundleForStop/entry/src/main/resources/base/element/color.json index 1bbc9aa9617e97c45440e1d3d66afc1154837012..d66f9a7d4ac61fb8d215239ab3620b7bcd77bf33 100644 --- a/tools/test/resource/aa/serviceAbilityBundleForStop/src/main/resources/base/element/color.json +++ b/tools/test/resource/aa/serviceAbilityBundleForStop/entry/src/main/resources/base/element/color.json @@ -1,8 +1,8 @@ -{ - "color": [ - { - "name": "white", - "value": "#FFFFFF" - } - ] +{ + "color": [ + { + "name": "start_window_background", + "value": "#FFFFFF" + } + ] } \ No newline at end of file diff --git a/tools/test/resource/aa/serviceAbilityBundleForStop/src/main/resources/base/element/string.json b/tools/test/resource/aa/serviceAbilityBundleForStop/entry/src/main/resources/base/element/string.json similarity index 56% rename from tools/test/resource/aa/serviceAbilityBundleForStop/src/main/resources/base/element/string.json rename to tools/test/resource/aa/serviceAbilityBundleForStop/entry/src/main/resources/base/element/string.json index 6a4aa3c917836bcc9a46dbb658588002110f5d5d..5480b42e31e9e4187e90e41accdaae3a734fc361 100644 --- a/tools/test/resource/aa/serviceAbilityBundleForStop/src/main/resources/base/element/string.json +++ b/tools/test/resource/aa/serviceAbilityBundleForStop/entry/src/main/resources/base/element/string.json @@ -1,8 +1,8 @@ { "string": [ { - "name": "entry_desc", - "value": "description" + "name": "module_desc", + "value": "module description" }, { "name": "MainAbility_desc", @@ -14,7 +14,15 @@ }, { "name": "ServiceAbility_desc", - "value": "hap sample empty service" + "value": "description" + }, + { + "name": "ServiceAbility_label", + "value": "label" + }, + { + "name": "app_name", + "value": "label" } ] } \ No newline at end of file diff --git a/tools/test/resource/aa/serviceAbilityBundleForStop/src/main/resources/base/media/icon.png b/tools/test/resource/aa/serviceAbilityBundleForStop/entry/src/main/resources/base/media/icon.png similarity index 100% rename from tools/test/resource/aa/serviceAbilityBundleForStop/src/main/resources/base/media/icon.png rename to tools/test/resource/aa/serviceAbilityBundleForStop/entry/src/main/resources/base/media/icon.png diff --git a/tools/test/resource/aa/serviceAbilityBundleForStop/entry/src/main/resources/base/media/startIcon.png b/tools/test/resource/aa/serviceAbilityBundleForStop/entry/src/main/resources/base/media/startIcon.png new file mode 100644 index 0000000000000000000000000000000000000000..205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b Binary files /dev/null and b/tools/test/resource/aa/serviceAbilityBundleForStop/entry/src/main/resources/base/media/startIcon.png differ diff --git a/tools/test/resource/aa/serviceAbilityBundleForStop/entry/src/main/resources/base/profile/main_pages.json b/tools/test/resource/aa/serviceAbilityBundleForStop/entry/src/main/resources/base/profile/main_pages.json new file mode 100644 index 0000000000000000000000000000000000000000..1898d94f58d6128ab712be2c68acc7c98e9ab9ce --- /dev/null +++ b/tools/test/resource/aa/serviceAbilityBundleForStop/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,5 @@ +{ + "src": [ + "pages/Index" + ] +} diff --git a/tools/test/resource/aa/serviceAbilityBundleForStop/hvigor/hvigor-config.json5 b/tools/test/resource/aa/serviceAbilityBundleForStop/hvigor/hvigor-config.json5 new file mode 100644 index 0000000000000000000000000000000000000000..c61d3eed60978a00d9a67b754ec36c0c9dcde929 --- /dev/null +++ b/tools/test/resource/aa/serviceAbilityBundleForStop/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/tools/test/resource/aa/serviceAbilityBundleForStop/hvigorfile.ts b/tools/test/resource/aa/serviceAbilityBundleForStop/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..2a5e543f190732c159beb574dfc9fa37bc94e156 --- /dev/null +++ b/tools/test/resource/aa/serviceAbilityBundleForStop/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/tools/test/resource/aa/serviceAbilityBundleForStop/oh-package.json5 b/tools/test/resource/aa/serviceAbilityBundleForStop/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..4c8bad9bdbdd8da17793a0e43f29d9e7232dce00 --- /dev/null +++ b/tools/test/resource/aa/serviceAbilityBundleForStop/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/tools/test/resource/aa/serviceAbilityBundleForStop/src/main/config.json b/tools/test/resource/aa/serviceAbilityBundleForStop/src/main/config.json deleted file mode 100644 index a48b731f217f82cd819f48d70380077ab7efb45e..0000000000000000000000000000000000000000 --- a/tools/test/resource/aa/serviceAbilityBundleForStop/src/main/config.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "app": { - "bundleName": "com.ohos.tools.serviceAbilityBundleForStop", - "vendor": "ohos", - "version": { - "code": 1000000, - "name": "1.0.0" - }, - "apiVersion": { - "compatible": 8, - "releaseType": "Betal", - "target": 8 - } - }, - "deviceConfig": {}, - "module": { - "package": "com.ohos.tools.serviceAbilityBundleForStop", - "name": "serviceAbilityBundleForStop", - "mainAbility": ".MainAbility", - "deviceType": [ - "tablet", - "default", - "tv", - "car", - "2in1" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry", - "moduleType": "entry", - "installationFree": false - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "orientation": "unspecified", - "formsEnabled": false, - "name": ".MainAbility", - "srcLanguage": "ets", - "srcPath": "MainAbility", - "icon": "$media:icon", - "description": "$string:MainAbility_desc", - "label": "$string:MainAbility_label", - "type": "page", - "visible": true, - "launchType": "standard" - }, - { - "name": ".ServiceAbility", - "srcLanguage": "ets", - "srcPath": "ServiceAbility", - "icon": "$media:icon", - "description": "$string:ServiceAbility_desc", - "type": "service", - "visible": true - } - ], - "js": [ - { - "mode": { - "syntax": "ets", - "type": "pageAbility" - }, - "pages": [ - "pages/index" - ], - "name": ".MainAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -}