From 35bf3b2cb68ff34e1e9e5dc70afe0354414ed915 Mon Sep 17 00:00:00 2001 From: qinchangbiao Date: Mon, 13 Jun 2022 19:01:15 +0800 Subject: [PATCH] switch to api9 --- .gitignore | 2 +- AppScope/app.json5 | 11 +++ AppScope/resources/base/element/string.json | 8 ++ AppScope/resources/base/media/app_icon.png | Bin 0 -> 6790 bytes OAT.xml | 24 ++++-- build-profile.json5 | 7 +- entry/.gitignore | 3 +- entry/build-profile.json5 | 2 +- entry/hvigorfile.js | 2 +- entry/package.json | 27 +++--- entry/src/main/config.json | 75 ----------------- .../src/main/ets/Application/AbilityStage.ts | 21 +++++ entry/src/main/ets/MainAbility/MainAbility.ts | 48 +++++++++++ .../pages/bilibili/BilibiliPage.ets | 6 +- .../{MainAbility => }/pages/bilibili/Post.ets | 0 .../pages/common/CategoryHolderInflater.ets | 0 .../pages/common/TitleBar.ets | 0 .../CommunicateWithBinderPage.ets | 0 .../pages/more/MoreApisPlaygroundPage.ets | 0 .../pages/normal/ItemType.ets | 0 .../pages/normal/NormalPage.ets | 0 .../pages/normal/TextItem.ets | 0 .../pages/one2many/OneDataToManPage.ets | 0 .../pages/payload/TestPayloadPage.ets | 0 .../pages/selectable/MultiSelectablePage.ets | 0 .../pages/selectable/Square.ets | 0 .../pages/weibo/WeiboPage.ets | 0 entry/src/main/module.json5 | 39 +++++++++ .../main/resources/base/element/color.json | 4 + .../resources/base/profile/main_pages.json | 12 +++ entry/src/ohosTest/config.json | 68 --------------- .../ets/Application/AbilityStage.ts} | 12 ++- .../TestAbility/{app.ets => TestAbility.ts} | 58 +++++++++---- .../ohosTest/ets/TestAbility/pages/index.ets | 4 +- .../ets/TestRunner/OpenHarmonyTestRunner.ts | 78 ++++++++++++++++++ entry/src/ohosTest/ets/module.json5.ftl | 34 ++++++++ entry/src/ohosTest/ets/test/Ability.test.ets | 3 +- entry/src/ohosTest/ets/test/List.test.ets | 1 - entry/src/ohosTest/module.json5 | 39 +++++++++ .../resources/base/element/color.json | 8 ++ .../resources/base/element/string.json | 12 ++- .../resources/base/profile/test_pages.json | 5 ++ hvigorfile.js | 2 +- multitype/.gitignore | 3 +- multitype/build-profile.json5 | 2 +- multitype/hvigorfile.js | 2 +- multitype/index.ets | 1 - multitype/package.json | 35 +++----- multitype/src/main/config.json | 24 ------ multitype/src/main/module.json5 | 11 +++ package.json | 31 +++---- 51 files changed, 450 insertions(+), 274 deletions(-) create mode 100644 AppScope/app.json5 create mode 100644 AppScope/resources/base/element/string.json create mode 100644 AppScope/resources/base/media/app_icon.png delete mode 100644 entry/src/main/config.json create mode 100644 entry/src/main/ets/Application/AbilityStage.ts create mode 100644 entry/src/main/ets/MainAbility/MainAbility.ts rename entry/src/main/ets/{MainAbility => }/pages/bilibili/BilibiliPage.ets (96%) rename entry/src/main/ets/{MainAbility => }/pages/bilibili/Post.ets (100%) rename entry/src/main/ets/{MainAbility => }/pages/common/CategoryHolderInflater.ets (100%) rename entry/src/main/ets/{MainAbility => }/pages/common/TitleBar.ets (100%) rename entry/src/main/ets/{MainAbility => }/pages/communication/CommunicateWithBinderPage.ets (100%) rename entry/src/main/ets/{MainAbility => }/pages/more/MoreApisPlaygroundPage.ets (100%) rename entry/src/main/ets/{MainAbility => }/pages/normal/ItemType.ets (100%) rename entry/src/main/ets/{MainAbility => }/pages/normal/NormalPage.ets (100%) rename entry/src/main/ets/{MainAbility => }/pages/normal/TextItem.ets (100%) rename entry/src/main/ets/{MainAbility => }/pages/one2many/OneDataToManPage.ets (100%) rename entry/src/main/ets/{MainAbility => }/pages/payload/TestPayloadPage.ets (100%) rename entry/src/main/ets/{MainAbility => }/pages/selectable/MultiSelectablePage.ets (100%) rename entry/src/main/ets/{MainAbility => }/pages/selectable/Square.ets (100%) rename entry/src/main/ets/{MainAbility => }/pages/weibo/WeiboPage.ets (100%) create mode 100644 entry/src/main/module.json5 create mode 100644 entry/src/main/resources/base/profile/main_pages.json delete mode 100644 entry/src/ohosTest/config.json rename entry/src/{main/ets/MainAbility/app.ets => ohosTest/ets/Application/AbilityStage.ts} (74%) rename entry/src/ohosTest/ets/TestAbility/{app.ets => TestAbility.ts} (33%) create mode 100644 entry/src/ohosTest/ets/TestRunner/OpenHarmonyTestRunner.ts create mode 100644 entry/src/ohosTest/ets/module.json5.ftl create mode 100644 entry/src/ohosTest/module.json5 create mode 100644 entry/src/ohosTest/resources/base/element/color.json create mode 100644 entry/src/ohosTest/resources/base/profile/test_pages.json delete mode 100644 multitype/src/main/config.json create mode 100644 multitype/src/main/module.json5 diff --git a/.gitignore b/.gitignore index a4e0bbe..2d5fa39 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,4 @@ /local.properties /.idea **/build -.gradle +/package-lock.json \ No newline at end of file diff --git a/AppScope/app.json5 b/AppScope/app.json5 new file mode 100644 index 0000000..60e5237 --- /dev/null +++ b/AppScope/app.json5 @@ -0,0 +1,11 @@ +{ + "app": { + "bundleName": "cn.openharmony.multitype", + "vendor": "example", + "versionCode": 1000000, + "versionName": "1.0.0", + "icon": "$media:app_icon", + "label": "$string:app_name", + "distributedNotificationEnabled": true + } +} diff --git a/AppScope/resources/base/element/string.json b/AppScope/resources/base/element/string.json new file mode 100644 index 0000000..abae752 --- /dev/null +++ b/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "MultiType" + } + ] +} diff --git a/AppScope/resources/base/media/app_icon.png b/AppScope/resources/base/media/app_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ce307a8827bd75456441ceb57d530e4c8d45d36c GIT binary patch literal 6790 zcmX|G1ymHk)?T_}Vd;>R?p|tHQo6fg38|$UVM!6BLrPFWk?s;$LOP{GmJpBl$qoSA!PUg~PA65-S00{{S`XKG6NkG0RgjEntPrmV+?0|00mu7;+5 zrdpa{2QLqPJ4Y{j7=Mrl{BaxrkdY69+c~(w{Fv-v&aR%aEI&JYSeRTLWm!zbv;?)_ ziZB;fwGbbeL5Q}YLx`J$lp~A09KK8t_z}PZ=4Z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OxgFdG>O@+XHy z9#;|&vBCPXH5Mon^I`jSuR$&~ZWtyB67ujzFSj!51>#C}C17~TffQ{c-!QFQkTQ%! zIR^b1`zHx|*1GU?tbBx23weFLz5H?y_Q%N&t$}k?w+``2A=aotj0;2v$~AL z{scF-cL{wsdrmPvf#a9OHyYLcwQD4Kcm)`LLwMh4WT~p29f7M!iafJSU`IV}QY5Wa z(n44-9oA}?J{a+ah*@31WTs#&J#o1`H98#6IQf;Wv0N_!);f&9g7o-k(lW5rWnDUR zQBFIRG+X=6NnsI@mxnwm;tf5;_Uxg?jZ8m-m0}&6+DA!qam(p$mN5R})yA_7m$q@| zFEd|dpS595rxQr-n#GjI5i-AhnUE>Cr;jpCqSrD~EwK_DqI^7%3#p5)%T_od!t3SOmH9MyXeeGO2(UQL;ax|x?Ncixmeo1=$ z{-);Au{*tfzOG?KQ~K|ak8-HQ?`Pekhe2WM(8s{xv-p>Zmu_6{G!-oE$7$mY`MOJorI=+mMx?H;`pr!;fVYz?5~yXBACruWB`Ph zZM}90_<^OBxIhyZ9BW$`>6JvO;%VFpqVr8|7t3~AmxYak6?`Pp#c;**_SYmi`&z23 z`p6_~ePvH)C6x-G9$hgL=eVALq`-AiamN>!3~Lxw&{H(b{B(7xSRm6<3<{%{yXiH# zos5Rv1L+8fUKJLo%P>4I&$}y + + @@ -14,19 +16,23 @@ - - - - - - - - - + + + + + + + + + + + + + diff --git a/build-profile.json5 b/build-profile.json5 index 1daa57e..6e48c87 100644 --- a/build-profile.json5 +++ b/build-profile.json5 @@ -1,8 +1,9 @@ { "app": { - "signingConfigs": [], - "compileSdkVersion": 8, - "compatibleSdkVersion": 8, + "signingConfigs": [ + ], + "compileSdkVersion": 9, + "compatibleSdkVersion": 9, "products": [ { "name": "default", diff --git a/entry/.gitignore b/entry/.gitignore index 4f9a973..10cfd88 100644 --- a/entry/.gitignore +++ b/entry/.gitignore @@ -1,3 +1,4 @@ /node_modules /.preview -/build \ No newline at end of file +/build +/package-lock.json \ No newline at end of file diff --git a/entry/build-profile.json5 b/entry/build-profile.json5 index ae58d1d..7dc37bb 100644 --- a/entry/build-profile.json5 +++ b/entry/build-profile.json5 @@ -1,5 +1,5 @@ { - "apiType": 'faMode', + "apiType": 'stageMode', "buildOption": { }, "targets": [ diff --git a/entry/hvigorfile.js b/entry/hvigorfile.js index bcec4c9..d7720ee 100644 --- a/entry/hvigorfile.js +++ b/entry/hvigorfile.js @@ -1,2 +1,2 @@ // Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently. -module.exports = require('@ohos/hvigor-ohos-plugin').legacyHapTasks +module.exports = require('@ohos/hvigor-ohos-plugin').hapTasks diff --git a/entry/package.json b/entry/package.json index 78046c6..5c6122c 100644 --- a/entry/package.json +++ b/entry/package.json @@ -1,15 +1,16 @@ { - "name": "entry", - "version": "1.0.0", - "ohos": { - "org": "huawei", - "buildTool": "hvigor", - "directoryLevel": "module" - }, - "description":"example description", - "repository":{}, - "license":"Apache-2.0", - "dependencies": { - "@ohos/multitype" : "file:../multitype" - } + "license":"Apache-2.0", + "devDependencies":{}, + "name":"entry", + "ohos":{ + "org":"huawei", + "directoryLevel":"module", + "buildTool":"hvigor" + }, + "description":"example description", + "repository":{}, + "version":"1.0.0", + "dependencies":{ + "@ohos/multitype":"file:../multitype" + } } \ No newline at end of file diff --git a/entry/src/main/config.json b/entry/src/main/config.json deleted file mode 100644 index 7761121..0000000 --- a/entry/src/main/config.json +++ /dev/null @@ -1,75 +0,0 @@ -{ - "app": { - "vendor": "example", - "bundleName": "cn.openharmony.multitype", - "version": { - "code": 1000000, - "name": "1.0.0" - } - }, - "deviceConfig": {}, - "module": { - "mainAbility": ".MainAbility", - "deviceType": [ - "phone", - "tablet" - ], - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "orientation": "unspecified", - "visible": true, - "srcPath": "MainAbility", - "name": ".MainAbility", - "srcLanguage": "ets", - "icon": "$media:icon", - "description": "$string:app_name", - "formsEnabled": false, - "label": "$string:app_name", - "type": "page", - "launchType": "standard" - } - ], - "distro": { - "moduleType": "entry", - "installationFree": false, - "deliveryWithInstall": true, - "moduleName": "entry" - }, - "package": "com.example.entry", - "srcPath": "", - "name": ".entry", - "js": [ - { - "mode": { - "syntax": "ets", - "type": "pageAbility" - }, - "pages": [ - "pages/bilibili/BilibiliPage", - "pages/more/MoreApisPlaygroundPage", - "pages/payload/TestPayloadPage", - "pages/one2many/OneDataToManPage", - "pages/weibo/WeiboPage", - "pages/communication/CommunicateWithBinderPage", - "pages/selectable/MultiSelectablePage", - "pages/normal/NormalPage" - ], - "name": ".MainAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} \ No newline at end of file diff --git a/entry/src/main/ets/Application/AbilityStage.ts b/entry/src/main/ets/Application/AbilityStage.ts new file mode 100644 index 0000000..0ec61b0 --- /dev/null +++ b/entry/src/main/ets/Application/AbilityStage.ts @@ -0,0 +1,21 @@ +/* + * 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. + */ +import AbilityStage from "@ohos.application.AbilityStage" + +export default class MyAbilityStage extends AbilityStage { + onCreate() { + console.log("[Demo] MyAbilityStage onCreate") + } +} \ No newline at end of file diff --git a/entry/src/main/ets/MainAbility/MainAbility.ts b/entry/src/main/ets/MainAbility/MainAbility.ts new file mode 100644 index 0000000..de5965a --- /dev/null +++ b/entry/src/main/ets/MainAbility/MainAbility.ts @@ -0,0 +1,48 @@ +/* + * 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. + */ +import Ability from '@ohos.application.Ability' + +export default class MainAbility extends Ability { + onCreate(want, launchParam) { + console.log("[Demo] MainAbility onCreate") + globalThis.abilityWant = want; + } + + onDestroy() { + console.log("[Demo] MainAbility onDestroy") + } + + onWindowStageCreate(windowStage) { + // Main window is created, set main page for this ability + console.log("[Demo] MainAbility onWindowStageCreate") + + windowStage.setUIContent(this.context, "pages/bilibili/BilibiliPage", null) + } + + onWindowStageDestroy() { + // Main window is destroyed, release UI related resources + console.log("[Demo] MainAbility onWindowStageDestroy") + } + + onForeground() { + // Ability has brought to foreground + console.log("[Demo] MainAbility onForeground") + } + + onBackground() { + // Ability has back to background + console.log("[Demo] MainAbility onBackground") + } +}; diff --git a/entry/src/main/ets/MainAbility/pages/bilibili/BilibiliPage.ets b/entry/src/main/ets/pages/bilibili/BilibiliPage.ets similarity index 96% rename from entry/src/main/ets/MainAbility/pages/bilibili/BilibiliPage.ets rename to entry/src/main/ets/pages/bilibili/BilibiliPage.ets index 19b9605..ec58e96 100644 --- a/entry/src/main/ets/MainAbility/pages/bilibili/BilibiliPage.ets +++ b/entry/src/main/ets/pages/bilibili/BilibiliPage.ets @@ -12,9 +12,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import {Post} from './Post' -import {TitleBar} from '../common/TitleBar' -import {TitleMore} from '../common/CategoryHolderInflater' +import {Post} from './post' +import {TitleBar} from '../common/titlebar' +import {TitleMore} from '../common/categoryholderinflater' @Entry @Component diff --git a/entry/src/main/ets/MainAbility/pages/bilibili/Post.ets b/entry/src/main/ets/pages/bilibili/Post.ets similarity index 100% rename from entry/src/main/ets/MainAbility/pages/bilibili/Post.ets rename to entry/src/main/ets/pages/bilibili/Post.ets diff --git a/entry/src/main/ets/MainAbility/pages/common/CategoryHolderInflater.ets b/entry/src/main/ets/pages/common/CategoryHolderInflater.ets similarity index 100% rename from entry/src/main/ets/MainAbility/pages/common/CategoryHolderInflater.ets rename to entry/src/main/ets/pages/common/CategoryHolderInflater.ets diff --git a/entry/src/main/ets/MainAbility/pages/common/TitleBar.ets b/entry/src/main/ets/pages/common/TitleBar.ets similarity index 100% rename from entry/src/main/ets/MainAbility/pages/common/TitleBar.ets rename to entry/src/main/ets/pages/common/TitleBar.ets diff --git a/entry/src/main/ets/MainAbility/pages/communication/CommunicateWithBinderPage.ets b/entry/src/main/ets/pages/communication/CommunicateWithBinderPage.ets similarity index 100% rename from entry/src/main/ets/MainAbility/pages/communication/CommunicateWithBinderPage.ets rename to entry/src/main/ets/pages/communication/CommunicateWithBinderPage.ets diff --git a/entry/src/main/ets/MainAbility/pages/more/MoreApisPlaygroundPage.ets b/entry/src/main/ets/pages/more/MoreApisPlaygroundPage.ets similarity index 100% rename from entry/src/main/ets/MainAbility/pages/more/MoreApisPlaygroundPage.ets rename to entry/src/main/ets/pages/more/MoreApisPlaygroundPage.ets diff --git a/entry/src/main/ets/MainAbility/pages/normal/ItemType.ets b/entry/src/main/ets/pages/normal/ItemType.ets similarity index 100% rename from entry/src/main/ets/MainAbility/pages/normal/ItemType.ets rename to entry/src/main/ets/pages/normal/ItemType.ets diff --git a/entry/src/main/ets/MainAbility/pages/normal/NormalPage.ets b/entry/src/main/ets/pages/normal/NormalPage.ets similarity index 100% rename from entry/src/main/ets/MainAbility/pages/normal/NormalPage.ets rename to entry/src/main/ets/pages/normal/NormalPage.ets diff --git a/entry/src/main/ets/MainAbility/pages/normal/TextItem.ets b/entry/src/main/ets/pages/normal/TextItem.ets similarity index 100% rename from entry/src/main/ets/MainAbility/pages/normal/TextItem.ets rename to entry/src/main/ets/pages/normal/TextItem.ets diff --git a/entry/src/main/ets/MainAbility/pages/one2many/OneDataToManPage.ets b/entry/src/main/ets/pages/one2many/OneDataToManPage.ets similarity index 100% rename from entry/src/main/ets/MainAbility/pages/one2many/OneDataToManPage.ets rename to entry/src/main/ets/pages/one2many/OneDataToManPage.ets diff --git a/entry/src/main/ets/MainAbility/pages/payload/TestPayloadPage.ets b/entry/src/main/ets/pages/payload/TestPayloadPage.ets similarity index 100% rename from entry/src/main/ets/MainAbility/pages/payload/TestPayloadPage.ets rename to entry/src/main/ets/pages/payload/TestPayloadPage.ets diff --git a/entry/src/main/ets/MainAbility/pages/selectable/MultiSelectablePage.ets b/entry/src/main/ets/pages/selectable/MultiSelectablePage.ets similarity index 100% rename from entry/src/main/ets/MainAbility/pages/selectable/MultiSelectablePage.ets rename to entry/src/main/ets/pages/selectable/MultiSelectablePage.ets diff --git a/entry/src/main/ets/MainAbility/pages/selectable/Square.ets b/entry/src/main/ets/pages/selectable/Square.ets similarity index 100% rename from entry/src/main/ets/MainAbility/pages/selectable/Square.ets rename to entry/src/main/ets/pages/selectable/Square.ets diff --git a/entry/src/main/ets/MainAbility/pages/weibo/WeiboPage.ets b/entry/src/main/ets/pages/weibo/WeiboPage.ets similarity index 100% rename from entry/src/main/ets/MainAbility/pages/weibo/WeiboPage.ets rename to entry/src/main/ets/pages/weibo/WeiboPage.ets diff --git a/entry/src/main/module.json5 b/entry/src/main/module.json5 new file mode 100644 index 0000000..4ef29ea --- /dev/null +++ b/entry/src/main/module.json5 @@ -0,0 +1,39 @@ +{ + "module": { + "name": "entry", + "type": "entry", + "srcEntrance": "./ets/Application/AbilityStage.ts", + "description": "$string:app_name", + "mainElement": "MainAbility", + "deviceTypes": [ + "default", + "tablet" + ], + "deliveryWithInstall": true, + "installationFree": false, + "pages": "$profile:main_pages", + "uiSyntax": "ets", + "abilities": [ + { + "name": "MainAbility", + "srcEntrance": "./ets/MainAbility/MainAbility.ts", + "description": "$string:app_name", + "icon": "$media:icon", + "label": "$string:app_name", + "startWindowIcon": "$media:icon", + "startWindowBackground": "$color:white", + "visible": true, + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ] + } + ] + } +} \ No newline at end of file diff --git a/entry/src/main/resources/base/element/color.json b/entry/src/main/resources/base/element/color.json index ce1119f..f66c0f6 100644 --- a/entry/src/main/resources/base/element/color.json +++ b/entry/src/main/resources/base/element/color.json @@ -3,6 +3,10 @@ { "name": "color_text", "value": "#000000" + }, + { + "name": "white", + "value": "#FFFFFF" } ] } \ No newline at end of file diff --git a/entry/src/main/resources/base/profile/main_pages.json b/entry/src/main/resources/base/profile/main_pages.json new file mode 100644 index 0000000..a6f00d4 --- /dev/null +++ b/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,12 @@ +{ + "src": [ + "pages/bilibili/BilibiliPage", + "pages/more/MoreApisPlaygroundPage", + "pages/payload/TestPayloadPage", + "pages/one2many/OneDataToManPage", + "pages/weibo/WeiboPage", + "pages/communication/CommunicateWithBinderPage", + "pages/selectable/MultiSelectablePage", + "pages/normal/NormalPage" + ] +} diff --git a/entry/src/ohosTest/config.json b/entry/src/ohosTest/config.json deleted file mode 100644 index 3d62cd2..0000000 --- a/entry/src/ohosTest/config.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "app": { - "bundleName": "com.drakeet.multitype.sample", - "vendor": "example", - "version": { - "code": 1000000, - "name": "1.0.0" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.entry_test", - "name": ".entry_test", - "mainAbility": ".TestAbility", - "srcPath": "", - "deviceType": [ - "phone", - "tablet" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "entry_test", - "moduleType": "feature", - "installationFree": false - }, - "abilities": [ - { - "skills": [ - { - "entities": [ - "entity.system.home" - ], - "actions": [ - "action.system.home" - ] - } - ], - "orientation": "unspecified", - "visible": true, - "srcPath": "TestAbility", - "name": ".TestAbility", - "srcLanguage": "ets", - "icon": "$media:icon", - "description": "$string:description_TestAbility", - "formsEnabled": false, - "label": "$string:entry_TestAbility", - "type": "page", - "launchType": "standard" - } - ], - "js": [ - { - "mode": { - "syntax": "ets", - "type": "pageAbility" - }, - "pages": [ - "pages/index" - ], - "name": ".TestAbility", - "window": { - "designWidth": 720, - "autoDesignWidth": false - } - } - ] - } -} \ No newline at end of file diff --git a/entry/src/main/ets/MainAbility/app.ets b/entry/src/ohosTest/ets/Application/AbilityStage.ts similarity index 74% rename from entry/src/main/ets/MainAbility/app.ets rename to entry/src/ohosTest/ets/Application/AbilityStage.ts index 6e469e9..04272e2 100644 --- a/entry/src/main/ets/MainAbility/app.ets +++ b/entry/src/ohosTest/ets/Application/AbilityStage.ts @@ -12,12 +12,10 @@ 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 AbilityStage from "@ohos.application.AbilityStage" -export default { - onCreate() { - console.info('Application onCreate') - }, - onDestroy() { - console.info('Application onDestroy') - }, +export default class TestAbilityStage extends AbilityStage { + onCreate() { + console.log("[Demo] TestAbilityStage onCreate") + } } \ No newline at end of file diff --git a/entry/src/ohosTest/ets/TestAbility/app.ets b/entry/src/ohosTest/ets/TestAbility/TestAbility.ts similarity index 33% rename from entry/src/ohosTest/ets/TestAbility/app.ets rename to entry/src/ohosTest/ets/TestAbility/TestAbility.ts index 4d14a89..1deccab 100644 --- a/entry/src/ohosTest/ets/TestAbility/app.ets +++ b/entry/src/ohosTest/ets/TestAbility/TestAbility.ts @@ -12,22 +12,48 @@ 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 Ability from '@ohos.application.Ability' import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' -import { Hypium } from 'hypium/index' +import { Hypium } from '@ohos/hypium' import testsuite from '../test/List.test' -export default { - onCreate() { - console.info('Application onCreate') - var abilityDelegator: any - abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() - var abilityDelegatorArguments: any - abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - console.info('start run testcase!!!') - Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) - }, - onDestroy() { - console.info('Application onDestroy') - }, -} \ No newline at end of file +export default class TestAbility extends Ability { + onCreate(want, launchParam) { + console.log('TestAbility onCreate') + var abilityDelegator: any + abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() + var abilityDelegatorArguments: any + abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() + console.info('start run testcase!!!') + Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) + } + + onDestroy() { + console.log('TestAbility onDestroy') + } + + onWindowStageCreate(windowStage) { + console.log('TestAbility onWindowStageCreate') + windowStage.loadContent("TestAbility/pages/index", (err, data) => { + if (err.code) { + console.error('Failed to load the content. Cause:' + JSON.stringify(err)); + return; + } + console.info('Succeeded in loading the content. Data: ' + JSON.stringify(data)) + }); + + globalThis.abilityContext = this.context; + } + + onWindowStageDestroy() { + console.log('TestAbility onWindowStageDestroy') + } + + onForeground() { + console.log('TestAbility onForeground') + } + + onBackground() { + console.log('TestAbility onBackground') + } +}; \ No newline at end of file diff --git a/entry/src/ohosTest/ets/TestAbility/pages/index.ets b/entry/src/ohosTest/ets/TestAbility/pages/index.ets index fbf6d2f..a92e99c 100644 --- a/entry/src/ohosTest/ets/TestAbility/pages/index.ets +++ b/entry/src/ohosTest/ets/TestAbility/pages/index.ets @@ -12,8 +12,7 @@ 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 router from '@system.router'; +import router from '@ohos.router'; @Entry @Component @@ -21,7 +20,6 @@ struct Index { aboutToAppear() { console.info('TestAbility index aboutToAppear') } - @State message: string = 'Hello World' build() { Row() { diff --git a/entry/src/ohosTest/ets/TestRunner/OpenHarmonyTestRunner.ts b/entry/src/ohosTest/ets/TestRunner/OpenHarmonyTestRunner.ts new file mode 100644 index 0000000..8b60933 --- /dev/null +++ b/entry/src/ohosTest/ets/TestRunner/OpenHarmonyTestRunner.ts @@ -0,0 +1,78 @@ +/* +Copyright (c) 2021 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 TestRunner from '@ohos.application.testRunner' +import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' + +var abilityDelegator = undefined +var abilityDelegatorArguments = undefined + +function translateParamsToString(parameters) { + const keySet = new Set([ + '-s class', '-s notClass', '-s suite', '-s it', + '-s level', '-s testType', '-s size', '-s timeout', + '-s dryRun' + ]) + let targetParams = ''; + for (const key in parameters) { + if (keySet.has(key)) { + targetParams = `${targetParams} ${key} ${parameters[key]}` + } + } + return targetParams.trim() +} + +async function onAbilityCreateCallback() { + console.log("onAbilityCreateCallback"); +} + +async function addAbilityMonitorCallback(err: any) { + console.info("addAbilityMonitorCallback : " + JSON.stringify(err)) +} + +export default class OpenHarmonyTestRunner implements TestRunner { + constructor() { + } + + onPrepare() { + console.info("OpenHarmonyTestRunner OnPrepare ") + } + + async onRun() { + console.log('OpenHarmonyTestRunner onRun run') + abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() + abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() + var testAbilityName = abilityDelegatorArguments.bundleName + '.TestAbility' + let lMonitor = { + abilityName: testAbilityName, + onAbilityCreate: onAbilityCreateCallback, + }; + abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback) + var cmd = 'aa start -d 0 -a TestAbility' + ' -b ' + abilityDelegatorArguments.bundleName + cmd += ' '+translateParamsToString(abilityDelegatorArguments.parameters) + var debug = abilityDelegatorArguments.parameters["-D"] + if (debug == 'true') + { + cmd += ' -D' + } + console.info('cmd : '+cmd) + abilityDelegator.executeShellCommand(cmd, + (err: any, d: any) => { + console.info('executeShellCommand : err : ' + JSON.stringify(err)); + console.info('executeShellCommand : data : ' + d.stdResult); + console.info('executeShellCommand : data : ' + d.exitCode); + }) + console.info('OpenHarmonyTestRunner onRun end') + } +}; \ No newline at end of file diff --git a/entry/src/ohosTest/ets/module.json5.ftl b/entry/src/ohosTest/ets/module.json5.ftl new file mode 100644 index 0000000..73bc4cf --- /dev/null +++ b/entry/src/ohosTest/ets/module.json5.ftl @@ -0,0 +1,34 @@ +{ + "module": { + "name": "${moduleName}_test", + "type": "feature", + "srcEntrance": "./ets/Application/AbilityStage.ts", + "description": "$string:entry_test_desc", + "mainElement": "TestAbility", + "deviceTypes": [${deviceTypes ?replace("[","")?replace("]","")}], + "deliveryWithInstall": true, + "installationFree": false, + "pages": "$profile:test_pages", + "uiSyntax": "ets", + "abilities": [ + { + "name": "TestAbility", + "srcEntrance": "./ets/TestAbility/TestAbility.ts", + "description": "$string:TestAbility_desc", + "icon": "$media:icon", + "label": "$string:TestAbility_label", + "visible": true, + "skills": [ + { + "actions": [ + "action.system.home" + ], + "entities": [ + "entity.system.home" + ] + } + ] + } + ] + } +} diff --git a/entry/src/ohosTest/ets/test/Ability.test.ets b/entry/src/ohosTest/ets/test/Ability.test.ets index 7c7a12b..d850ed4 100644 --- a/entry/src/ohosTest/ets/test/Ability.test.ets +++ b/entry/src/ohosTest/ets/test/Ability.test.ets @@ -12,8 +12,7 @@ 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 { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from 'hypium/index' +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' export default function abilityTest() { describe('ActsAbilityTest', function () { diff --git a/entry/src/ohosTest/ets/test/List.test.ets b/entry/src/ohosTest/ets/test/List.test.ets index d66beba..d3f20aa 100644 --- a/entry/src/ohosTest/ets/test/List.test.ets +++ b/entry/src/ohosTest/ets/test/List.test.ets @@ -12,7 +12,6 @@ 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 abilityTest from './Ability.test' export default function testsuite() { diff --git a/entry/src/ohosTest/module.json5 b/entry/src/ohosTest/module.json5 new file mode 100644 index 0000000..956fc59 --- /dev/null +++ b/entry/src/ohosTest/module.json5 @@ -0,0 +1,39 @@ +{ + "module": { + "name": "entry_test", + "type": "feature", + "srcEntrance": "./ets/TestAbility/TestAbility.ts", + "description": "$string:entry_test_desc", + "mainElement": "TestAbility", + "deviceTypes": [ + "default", + "tablet" + ], + "deliveryWithInstall": true, + "installationFree": false, + "pages": "$profile:test_pages", + "uiSyntax": "ets", + "abilities": [ + { + "name": "TestAbility", + "srcEntrance": "./ets/TestAbility/TestAbility.ts", + "description": "$string:TestAbility_desc", + "icon": "$media:icon", + "label": "$string:TestAbility_label", + "startWindowIcon": "$media:icon", + "startWindowBackground": "$color:white", + "visible": true, + "skills": [ + { + "actions": [ + "action.system.home" + ], + "entities": [ + "entity.system.home" + ] + } + ] + } + ] + } +} diff --git a/entry/src/ohosTest/resources/base/element/color.json b/entry/src/ohosTest/resources/base/element/color.json new file mode 100644 index 0000000..1bbc9aa --- /dev/null +++ b/entry/src/ohosTest/resources/base/element/color.json @@ -0,0 +1,8 @@ +{ + "color": [ + { + "name": "white", + "value": "#FFFFFF" + } + ] +} \ No newline at end of file diff --git a/entry/src/ohosTest/resources/base/element/string.json b/entry/src/ohosTest/resources/base/element/string.json index a0901cf..36d4230 100644 --- a/entry/src/ohosTest/resources/base/element/string.json +++ b/entry/src/ohosTest/resources/base/element/string.json @@ -1,12 +1,16 @@ { "string": [ { - "name": "description_TestAbility", - "value": "eTS_Empty Ability" + "name": "entry_test_desc", + "value": "test ability description" }, { - "name": "entry_TestAbility", - "value": "entry_TestAbility" + "name": "TestAbility_desc", + "value": "the test ability" + }, + { + "name": "TestAbility_label", + "value": "test label" } ] } \ No newline at end of file diff --git a/entry/src/ohosTest/resources/base/profile/test_pages.json b/entry/src/ohosTest/resources/base/profile/test_pages.json new file mode 100644 index 0000000..fcef82b --- /dev/null +++ b/entry/src/ohosTest/resources/base/profile/test_pages.json @@ -0,0 +1,5 @@ +{ + "src": [ + "TestAbility/pages/index" + ] +} diff --git a/hvigorfile.js b/hvigorfile.js index cff9f0d..5f2735e 100644 --- a/hvigorfile.js +++ b/hvigorfile.js @@ -1,2 +1,2 @@ // Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently. -module.exports = require('@ohos/hvigor-ohos-plugin').legacyAppTasks \ No newline at end of file +module.exports = require('@ohos/hvigor-ohos-plugin').appTasks \ No newline at end of file diff --git a/multitype/.gitignore b/multitype/.gitignore index 4f9a973..10cfd88 100644 --- a/multitype/.gitignore +++ b/multitype/.gitignore @@ -1,3 +1,4 @@ /node_modules /.preview -/build \ No newline at end of file +/build +/package-lock.json \ No newline at end of file diff --git a/multitype/build-profile.json5 b/multitype/build-profile.json5 index 107d8c7..35dff6d 100644 --- a/multitype/build-profile.json5 +++ b/multitype/build-profile.json5 @@ -1,5 +1,5 @@ { - "apiType": "faMode", + "apiType": "stageMode", "buildOption": { } } diff --git a/multitype/hvigorfile.js b/multitype/hvigorfile.js index 3a7c40c..42ed4b4 100644 --- a/multitype/hvigorfile.js +++ b/multitype/hvigorfile.js @@ -1,3 +1,3 @@ // Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently. -module.exports = require('@ohos/hvigor-ohos-plugin').legacyHarTasks +module.exports = require('@ohos/hvigor-ohos-plugin').harTasks diff --git a/multitype/index.ets b/multitype/index.ets index fd60aad..56a8aba 100644 --- a/multitype/index.ets +++ b/multitype/index.ets @@ -12,5 +12,4 @@ 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 { MultiTypeAdapter } from './src/main/ets/components/MainPage/MultiTypeAdapter' diff --git a/multitype/package.json b/multitype/package.json index 02b6e63..2c1a933 100644 --- a/multitype/package.json +++ b/multitype/package.json @@ -1,23 +1,14 @@ { - "types": "", - "name": "@ohos/multitype", - "description": "更轻松、更灵活地为 List 创建多种类型布局", - "keywords":[ - "OpenHarmony", - "multitype" - ], - "ohos": { - "org": "opensource" - }, - "author": "hihope", - "version": "1.0.3", - "main": "index.ets", - "repository": "https://gitee.com/openharmony-sig/MultiType", - "license": "Apache-2.0", - "tags":[ - "OpenHarmony", - "multitype" - ], - "dependencies": {}, - "devDependencies": {} -} + "license":"Apache-2.0", + "types":"", + "devDependencies":{}, + "name":"@ohos/multitype", + "description":"更轻松、更灵活地为 List 创建多种类型布局", + "ohos":{ + "org":"" + }, + "main":"index.ets", + "repository":{}, + "version":"1.0.0", + "dependencies":{} +} \ No newline at end of file diff --git a/multitype/src/main/config.json b/multitype/src/main/config.json deleted file mode 100644 index 8ec5b49..0000000 --- a/multitype/src/main/config.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "app": { - "bundleName": "cn.openharmony.multitype", - "vendor": "example", - "version": { - "code": 1000000, - "name": "1.0.0" - } - }, - "deviceConfig": {}, - "module": { - "package": "com.example.multitype", - "deviceType": [ - "phone", - "tablet" - ], - "distro": { - "deliveryWithInstall": true, - "moduleName": "multitype", - "moduleType": "har" - }, - "uiSyntax": "ets" - } -} diff --git a/multitype/src/main/module.json5 b/multitype/src/main/module.json5 new file mode 100644 index 0000000..1d23faa --- /dev/null +++ b/multitype/src/main/module.json5 @@ -0,0 +1,11 @@ +{ + "module": { + "name": "multitype", + "type": "har", + "deviceTypes": [ + "default", + "tablet" + ], + "uiSyntax": "ets" + } +} diff --git a/package.json b/package.json index de35db8..c52be64 100644 --- a/package.json +++ b/package.json @@ -1,17 +1,18 @@ { - "name": "ohos_app_multitype", - "version": "1.0.0", - "ohos": { - "org": "huawei", - "buildTool": "hvigor", - "directoryLevel": "project" - }, - "description":"example description", - "repository":{}, - "license":"Apache-2.0", - "dependencies": { - "hypium": "^1.0.0", - "@ohos/hvigor": "1.0.6", - "@ohos/hvigor-ohos-plugin": "1.0.6" - } + "license":"Apache-2.0", + "devDependencies":{}, + "name":"multitype", + "ohos":{ + "org":"huawei", + "directoryLevel":"project", + "buildTool":"hvigor" + }, + "description":"example description", + "repository":{}, + "version":"1.0.0", + "dependencies":{ + "@ohos/hypium":"1.0.0", + "@ohos/hvigor-ohos-plugin":"1.1.3", + "@ohos/hvigor":"1.1.3" + } } \ No newline at end of file -- Gitee