diff --git a/CHANGELOG.md b/CHANGELOG.md index bb6dc6205958e2d8b29edcac040bc20be3928feb..19a2f84b98459fbcd4eae5d11c3b6d91045e48fd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## 1.0.1 + +- 适配DevEco Studio 3.1Beta1及以上版本。 +- 适配OpenHarmony SDK API version 9及以上版本。 + ## 1.0.0 1. 二维码生成器 diff --git a/OAT.xml b/OAT.xml index 4e9cc2d76f892b1b6504d4a24198c1394680835b..af3639e62dc1057b8fd9c6f216b227351262fc72 100644 --- a/OAT.xml +++ b/OAT.xml @@ -3,9 +3,9 @@ - + - + diff --git a/README.md b/README.md index 47e596b6449fe43b5f36599c348d55bcf987da45..3c4ee0db21b87f73ea67115ffb28692aae97281c 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,8 @@ qrcode.drawCanvas(8, 1, this.Context) 4. 解释段的数据位:`qrcodegen.QrSegment.Mode` ## 兼容性 -支持 OpenHarmony API version 9版本。 +- [DevEco Studio版本](https://developer.harmonyos.com/cn/develop/deveco-studio#download):DevEco Studio 3.1Beta1及以上版本。 +- OpenHarmony SDK版本:API version 9及以上版本。 ## 目录结构 ```` diff --git a/hvigorfile.js b/entry/hvigorfile.ts similarity index 63% rename from hvigorfile.js rename to entry/hvigorfile.ts index 5f2735e3deeaf655828407544bbed9365c258278..80e4ec5b81689f238c34614b167a0b9e9c83e8d9 100644 --- a/hvigorfile.js +++ b/entry/hvigorfile.ts @@ -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').appTasks \ No newline at end of file +export { hapTasks } from '@ohos/hvigor-ohos-plugin'; diff --git a/entry/package.json b/entry/package.json index 4ff23ea8951e48e0467db92344645a327a656d8d..40ebb90f6eef1855a93f783a5e0f309e1496b1b3 100644 --- a/entry/package.json +++ b/entry/package.json @@ -1,16 +1,16 @@ { - "license": "MIT", - "devDependencies": {}, - "name": "entry", - "ohos": { - "org": "huawei", - "directoryLevel": "module", - "buildTool": "hvigor" - }, - "description": "example description", - "repository": {}, - "version": "1.0.0", - "dependencies": { - "@ohos/qr-code-generator": "file:../qrcodegen" - } + "license": "MIT", + "devDependencies": {}, + "name": "entry", + "ohos": { + "org": "huawei", + "directoryLevel": "module", + "buildTool": "hvigor" + }, + "description": "example description", + "repository": {}, + "version": "1.0.1", + "dependencies": { + "@ohos/qr-code-generator": "file:../qrcodegen" + } } diff --git a/entry/src/main/ets/Application/MyAbilityStage.ts b/entry/src/main/ets/Application/MyAbilityStage.ts deleted file mode 100644 index 306caf5308de77e8df7bbedb863b994538dcaf59..0000000000000000000000000000000000000000 --- a/entry/src/main/ets/Application/MyAbilityStage.ts +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (C) 2022 Huawei Device Co., Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - The Software is provided "as is", without warranty of any kind, express or - * implied, including but not limited to the warranties of merchantability, - * fitness for a particular purpose and noninfringement. In no event shall the - * authors or copyright holders be liable for any claim, damages or other - * liability, whether in an action of contract, tort or otherwise, arising from, - * out of or in connection with the Software or the use or other dealings in the - * Software. - */ - -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/entryability/EntryAbility.ts similarity index 61% rename from entry/src/main/ets/MainAbility/MainAbility.ts rename to entry/src/main/ets/entryability/EntryAbility.ts index d0a618071da89c7db81dea7fa5f278b1c1d0d188..f606afb320a27c636bd72bdf8227c08c0f3c62fd 100644 --- a/entry/src/main/ets/MainAbility/MainAbility.ts +++ b/entry/src/main/ets/entryability/EntryAbility.ts @@ -17,44 +17,45 @@ * out of or in connection with the Software or the use or other dealings in the * Software. */ + +import UIAbility from '@ohos.app.ability.UIAbility'; +import hilog from '@ohos.hilog'; +import window from '@ohos.window'; -import Ability from '@ohos.application.Ability' - -export default class MainAbility extends Ability { +export default class EntryAbility extends UIAbility { onCreate(want, launchParam) { - console.log("[Demo] MainAbility onCreate") - globalThis.abilityWant = want; + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); } onDestroy() { - console.log("[Demo] MainAbility onDestroy") + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onDestroy'); } - onWindowStageCreate(windowStage) { + onWindowStageCreate(windowStage: window.WindowStage) { // Main window is created, set main page for this ability - console.log("[Demo] MainAbility onWindowStageCreate") + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); - windowStage.loadContent("pages/index", (err, data) => { + windowStage.loadContent('pages/Index', (err, data) => { if (err.code) { - console.error('Failed to load the content. Cause:' + JSON.stringify(err)); + hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); return; } - console.info('Succeeded in loading the content. Data: ' + JSON.stringify(data)) + hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', JSON.stringify(data) ?? ''); }); } onWindowStageDestroy() { // Main window is destroyed, release UI related resources - console.log("[Demo] MainAbility onWindowStageDestroy") + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); } onForeground() { // Ability has brought to foreground - console.log("[Demo] MainAbility onForeground") + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onForeground'); } onBackground() { // Ability has back to background - console.log("[Demo] MainAbility onBackground") + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onBackground'); } } diff --git a/entry/src/main/module.json5 b/entry/src/main/module.json5 index e73e5b800d16cc90feae02eb28cac86de5bcc9d1..684b172c94cc3483466ca52296eb9c6e03e4f44c 100644 --- a/entry/src/main/module.json5 +++ b/entry/src/main/module.json5 @@ -2,25 +2,30 @@ "module": { "name": "entry", "type": "entry", - "srcEntrance": "./ets/Application/MyAbilityStage.ts", - "description": "$string:entry_desc", - "mainElement": "MainAbility", + "description": "$string:module_desc", + "mainElement": "EntryAbility", "deviceTypes": [ "default", "tablet" ], + "metadata": [ + { + "name": "ArkTSPartialUpdate", + "value": "true" + } + ], "deliveryWithInstall": true, "installationFree": false, "pages": "$profile:main_pages", "abilities": [ { - "name": "MainAbility", - "srcEntrance": "./ets/MainAbility/MainAbility.ts", - "description": "$string:MainAbility_desc", + "name": "EntryAbility", + "srcEntrance": "./ets/entryability/EntryAbility.ts", + "description": "$string:EntryAbility_desc", "icon": "$media:icon", - "label": "$string:MainAbility_label", + "label": "$string:EntryAbility_label", "startWindowIcon": "$media:icon", - "startWindowBackground": "$color:white", + "startWindowBackground": "$color:start_window_background", "visible": true, "skills": [ { @@ -35,4 +40,4 @@ } ] } -} +} \ 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 1bbc9aa9617e97c45440e1d3d66afc1154837012..3c712962da3c2751c2b9ddb53559afcbd2b54a02 100644 --- a/entry/src/main/resources/base/element/color.json +++ b/entry/src/main/resources/base/element/color.json @@ -1,7 +1,7 @@ { "color": [ { - "name": "white", + "name": "start_window_background", "value": "#FFFFFF" } ] diff --git a/entry/src/main/resources/base/element/string.json b/entry/src/main/resources/base/element/string.json index 490210a3908f47722dc942d49dacc98b97669a5f..de31c30ac5ee64a22e0d5232082f10bc9d065511 100644 --- a/entry/src/main/resources/base/element/string.json +++ b/entry/src/main/resources/base/element/string.json @@ -1,16 +1,16 @@ { "string": [ { - "name": "entry_desc", - "value": "description" + "name": "module_desc", + "value": "module description" }, { - "name": "MainAbility_desc", + "name": "EntryAbility_desc", "value": "description" }, { - "name": "MainAbility_label", - "value": "label" + "name": "EntryAbility_label", + "value": "qrcodegenerator" } ] } \ 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 index feec276e105eeb8d621c20aaf838f318b0a94150..1898d94f58d6128ab712be2c68acc7c98e9ab9ce 100644 --- a/entry/src/main/resources/base/profile/main_pages.json +++ b/entry/src/main/resources/base/profile/main_pages.json @@ -1,5 +1,5 @@ { "src": [ - "pages/index" + "pages/Index" ] } diff --git a/entry/src/main/resources/en_US/element/string.json b/entry/src/main/resources/en_US/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..de31c30ac5ee64a22e0d5232082f10bc9d065511 --- /dev/null +++ b/entry/src/main/resources/en_US/element/string.json @@ -0,0 +1,16 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "module description" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "qrcodegenerator" + } + ] +} \ No newline at end of file diff --git a/entry/src/main/resources/zh_CN/element/string.json b/entry/src/main/resources/zh_CN/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..a3aadc02177f6a71efc3d9d4c70d5c7d879639fa --- /dev/null +++ b/entry/src/main/resources/zh_CN/element/string.json @@ -0,0 +1,16 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "模块描述" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "qrcodegenerator" + } + ] +} \ No newline at end of file diff --git a/entry/src/ohosTest/ets/Application/TestAbilityStage.ts b/entry/src/ohosTest/ets/Application/TestAbilityStage.ts deleted file mode 100644 index a2b4ac3256825169c6f9acfc77950026786898db..0000000000000000000000000000000000000000 --- a/entry/src/ohosTest/ets/Application/TestAbilityStage.ts +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (C) 2022 Huawei Device Co., Ltd. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - * - The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - The Software is provided "as is", without warranty of any kind, express or - * implied, including but not limited to the warranties of merchantability, - * fitness for a particular purpose and noninfringement. In no event shall the - * authors or copyright holders be liable for any claim, damages or other - * liability, whether in an action of contract, tort or otherwise, arising from, - * out of or in connection with the Software or the use or other dealings in the - * Software. - */ - -import AbilityStage from "@ohos.application.AbilityStage" - -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/TestAbility.ts b/entry/src/ohosTest/ets/TestAbility/TestAbility.ets similarity index 53% rename from entry/src/ohosTest/ets/TestAbility/TestAbility.ts rename to entry/src/ohosTest/ets/TestAbility/TestAbility.ets index 8eb24f54dd515fb8f5022ccdfb547111e61a3682..5806196e9c7a86d354b3d3ec904be46c0f9d879d 100644 --- a/entry/src/ohosTest/ets/TestAbility/TestAbility.ts +++ b/entry/src/ohosTest/ets/TestAbility/TestAbility.ets @@ -18,48 +18,51 @@ * Software. */ -import Ability from '@ohos.application.Ability' -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' -import { Hypium } from '@ohos/hypium' -import testsuite from '../test/List.test' +import UIAbility from '@ohos.app.ability.UIAbility'; +import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry'; +import hilog from '@ohos.hilog'; +import { Hypium } from '@ohos/hypium'; +import testsuite from '../test/List.test'; +import window from '@ohos.window'; -export default class TestAbility extends Ability { +export default class TestAbility extends UIAbility { onCreate(want, launchParam) { - console.log('TestAbility onCreate') + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onCreate'); + hilog.info(0x0000, 'testTag', '%{public}s', 'want param:' + JSON.stringify(want) ?? ''); + hilog.info(0x0000, 'testTag', '%{public}s', 'launchParam:'+ JSON.stringify(launchParam) ?? ''); var abilityDelegator: any abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() var abilityDelegatorArguments: any abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() - console.info('start run testcase!!!') + hilog.info(0x0000, 'testTag', '%{public}s', 'start run testcase!!!'); Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) } onDestroy() { - console.log('TestAbility onDestroy') + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onDestroy'); } - onWindowStageCreate(windowStage) { - console.log('TestAbility onWindowStageCreate') - windowStage.loadContent("TestAbility/pages/index", (err, data) => { + onWindowStageCreate(windowStage: window.WindowStage) { + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageCreate'); + windowStage.loadContent('testability/pages/Index', (err, data) => { if (err.code) { - console.error('Failed to load the content. Cause:' + JSON.stringify(err)); + hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? ''); return; } - console.info('Succeeded in loading the content. Data: ' + JSON.stringify(data)) + hilog.info(0x0000, 'testTag', 'Succeeded in loading the content. Data: %{public}s', + JSON.stringify(data) ?? ''); }); - - globalThis.abilityContext = this.context; } onWindowStageDestroy() { - console.log('TestAbility onWindowStageDestroy') + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageDestroy'); } onForeground() { - console.log('TestAbility onForeground') + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onForeground'); } onBackground() { - console.log('TestAbility onBackground') + hilog.info(0x0000, 'testTag', '%{public}s', '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 408d92512b23f21b0bf59abd664e93baa66e5c3c..60e1d7407639b3ae270fd6f56b99a99232aabd73 100644 --- a/entry/src/ohosTest/ets/TestAbility/pages/index.ets +++ b/entry/src/ohosTest/ets/TestAbility/pages/index.ets @@ -18,13 +18,13 @@ * Software. */ -import router from '@ohos.router'; +import hilog from '@ohos.hilog'; @Entry @Component struct Index { aboutToAppear() { - console.info('TestAbility index aboutToAppear') + hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility index aboutToAppear'); } @State message: string = 'Hello World' build() { diff --git a/entry/src/ohosTest/ets/TestRunner/OpenHarmonyTestRunner.ts b/entry/src/ohosTest/ets/TestRunner/OpenHarmonyTestRunner.ts index e73bbe2310d71079739d1d00572815457b5b42f4..72d33fe9d06fcf708dbfb007613e4439a8accd6d 100644 --- a/entry/src/ohosTest/ets/TestRunner/OpenHarmonyTestRunner.ts +++ b/entry/src/ohosTest/ets/TestRunner/OpenHarmonyTestRunner.ts @@ -18,33 +18,19 @@ * Software. */ -import TestRunner from '@ohos.application.testRunner' -import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' +import hilog from '@ohos.hilog'; +import TestRunner from '@ohos.application.testRunner'; +import AbilityDelegatorRegistry from '@ohos.app.ability.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"); + hilog.info(0x0000, 'testTag', '%{public}s', 'onAbilityCreateCallback'); } async function addAbilityMonitorCallback(err: any) { - console.info("addAbilityMonitorCallback : " + JSON.stringify(err)) + hilog.info(0x0000, 'testTag', 'addAbilityMonitorCallback : %{public}s', JSON.stringify(err) ?? ''); } export default class OpenHarmonyTestRunner implements TestRunner { @@ -52,11 +38,11 @@ export default class OpenHarmonyTestRunner implements TestRunner { } onPrepare() { - console.info("OpenHarmonyTestRunner OnPrepare ") + hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner OnPrepare '); } async onRun() { - console.log('OpenHarmonyTestRunner onRun run') + hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun run'); abilityDelegatorArguments = AbilityDelegatorRegistry.getArguments() abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() var testAbilityName = abilityDelegatorArguments.bundleName + '.TestAbility' @@ -66,19 +52,18 @@ export default class OpenHarmonyTestRunner implements TestRunner { }; abilityDelegator.addAbilityMonitor(lMonitor, addAbilityMonitorCallback) var cmd = 'aa start -d 0 -a TestAbility' + ' -b ' + abilityDelegatorArguments.bundleName - cmd += ' '+translateParamsToString(abilityDelegatorArguments.parameters) - var debug = abilityDelegatorArguments.parameters["-D"] + var debug = abilityDelegatorArguments.parameters['-D'] if (debug == 'true') { cmd += ' -D' } - console.info('cmd : '+cmd) + hilog.info(0x0000, 'testTag', 'cmd : %{public}s', 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); + hilog.info(0x0000, 'testTag', 'executeShellCommand : err : %{public}s', JSON.stringify(err) ?? ''); + hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.stdResult ?? ''); + hilog.info(0x0000, 'testTag', 'executeShellCommand : data : %{public}s', d.exitCode ?? ''); }) - console.info('OpenHarmonyTestRunner onRun end') + hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun end'); } } \ No newline at end of file diff --git a/entry/src/ohosTest/ets/test/Ability.test.ets b/entry/src/ohosTest/ets/test/Ability.test.ets index 1a948c4aa1b567c8b54baf1dce27a8e9235b59f7..4152da9787abc481d4e675f9f480b4e4f95c4cf3 100644 --- a/entry/src/ohosTest/ets/test/Ability.test.ets +++ b/entry/src/ohosTest/ets/test/Ability.test.ets @@ -18,16 +18,38 @@ * Software. */ +import hilog from '@ohos.hilog'; import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium' export default function abilityTest() { - describe('ActsAbilityTest', function () { - it('assertContain',0, function () { - console.info("it begin") - let a = 'abc' - let b = 'b' - expect(a).assertContain(b) - expect(a).assertEqual(a) - }) + describe('ActsAbilityTest', function () { + // Defines a test suite. Two parameters are supported: test suite name and test suite function. + beforeAll(function () { + // Presets an action, which is performed only once before all test cases of the test suite start. + // This API supports only one parameter: preset action function. }) + beforeEach(function () { + // Presets an action, which is performed before each unit test case starts. + // The number of execution times is the same as the number of test cases defined by **it**. + // This API supports only one parameter: preset action function. + }) + afterEach(function () { + // Presets a clear action, which is performed after each unit test case ends. + // The number of execution times is the same as the number of test cases defined by **it**. + // This API supports only one parameter: clear action function. + }) + afterAll(function () { + // Presets a clear action, which is performed after all test cases of the test suite end. + // This API supports only one parameter: clear action function. + }) + it('assertContain',0, function () { + // Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function. + hilog.info(0x0000, 'testTag', '%{public}s', 'it begin'); + let a = 'abc' + let b = 'b' + // Defines a variety of assertion methods, which are used to declare expected boolean conditions. + expect(a).assertContain(b) + expect(a).assertEqual(a) + }) + }) } \ No newline at end of file diff --git a/entry/src/ohosTest/module.json5 b/entry/src/ohosTest/module.json5 index def8ddade8add6b141a12a2527a4bee79d449209..476d15376f43323426498a79fb3d58a658a27a56 100644 --- a/entry/src/ohosTest/module.json5 +++ b/entry/src/ohosTest/module.json5 @@ -2,8 +2,7 @@ "module": { "name": "entry_test", "type": "feature", - "srcEntrance": "./ets/Application/TestAbilityStage.ts", - "description": "$string:entry_test_desc", + "description": "$string:module_test_desc", "mainElement": "TestAbility", "deviceTypes": [ "default", @@ -15,13 +14,13 @@ "abilities": [ { "name": "TestAbility", - "srcEntrance": "./ets/TestAbility/TestAbility.ts", + "srcEntrance": "./ets/testability/TestAbility.ets", "description": "$string:TestAbility_desc", "icon": "$media:icon", "label": "$string:TestAbility_label", "visible": true, "startWindowIcon": "$media:icon", - "startWindowBackground": "$color:white", + "startWindowBackground": "$color:start_window_background", "skills": [ { "actions": [ diff --git a/entry/src/ohosTest/resources/base/element/color.json b/entry/src/ohosTest/resources/base/element/color.json index 1bbc9aa9617e97c45440e1d3d66afc1154837012..3c712962da3c2751c2b9ddb53559afcbd2b54a02 100644 --- a/entry/src/ohosTest/resources/base/element/color.json +++ b/entry/src/ohosTest/resources/base/element/color.json @@ -1,7 +1,7 @@ { "color": [ { - "name": "white", + "name": "start_window_background", "value": "#FFFFFF" } ] diff --git a/entry/src/ohosTest/resources/base/element/string.json b/entry/src/ohosTest/resources/base/element/string.json index 36d4230c53e9f5a07ae343ad8dc9808341975e3b..65d8fa5a7cf54aa3943dcd0214f58d1771bc1f6c 100644 --- a/entry/src/ohosTest/resources/base/element/string.json +++ b/entry/src/ohosTest/resources/base/element/string.json @@ -1,7 +1,7 @@ { "string": [ { - "name": "entry_test_desc", + "name": "module_test_desc", "value": "test ability description" }, { diff --git a/entry/src/ohosTest/resources/base/profile/test_pages.json b/entry/src/ohosTest/resources/base/profile/test_pages.json index fcef82b4dfc18e28106ff9ecd1c8b48ec74d18a4..b7e7343cacb32ce982a45e76daad86e435e054fe 100644 --- a/entry/src/ohosTest/resources/base/profile/test_pages.json +++ b/entry/src/ohosTest/resources/base/profile/test_pages.json @@ -1,5 +1,5 @@ { "src": [ - "TestAbility/pages/index" + "testability/pages/Index" ] } diff --git a/entry/hvigorfile.js b/hvigorfile.ts similarity index 63% rename from entry/hvigorfile.js rename to hvigorfile.ts index d7720ee6a7aad5c617d1fd2f6fc8c87067bfa32c..6478186902c0c1ad7c966a929c7d6b7d8ae7a9f3 100644 --- a/entry/hvigorfile.js +++ b/hvigorfile.ts @@ -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').hapTasks +export { appTasks } from '@ohos/hvigor-ohos-plugin'; \ No newline at end of file diff --git a/package.json b/package.json index 09f47468ab0d40e0ea034d7594de9ce25a6425ad..6e13681c04527ba0089918233e066090155c0db8 100644 --- a/package.json +++ b/package.json @@ -1,18 +1,18 @@ { - "license": "MIT", - "devDependencies": {}, - "name": "qrcodegenerator", - "ohos": { - "org": "huawei", - "directoryLevel": "project", - "buildTool": "hvigor" - }, - "description": "example description", - "repository": {}, - "version": "1.0.0", - "dependencies": { - "@ohos/hypium": "1.0.1", - "@ohos/hvigor-ohos-plugin": "1.1.6", - "@ohos/hvigor": "1.1.6" - } + "license": "MIT", + "devDependencies": {}, + "name": "qrcodegenerator", + "ohos": { + "org": "huawei", + "directoryLevel": "project", + "buildTool": "hvigor" + }, + "description": "example description", + "repository": {}, + "version": "1.0.1", + "dependencies": { + "@ohos/hypium": "1.0.5", + "@ohos/hvigor-ohos-plugin": "1.4.0", + "@ohos/hvigor": "1.4.0" + } } diff --git a/qrcodegen/.gitignore b/qrcodegen/.gitignore index 4f9a973815d0b5e49bc8547681a6b4bc7a178d12..5a6ba80fa3d9498a23ae8ae7d9518f8743fa8a96 100644 --- a/qrcodegen/.gitignore +++ b/qrcodegen/.gitignore @@ -1,3 +1,4 @@ /node_modules /.preview -/build \ No newline at end of file +/build +/.cxx \ No newline at end of file diff --git a/qrcodegen/build-profile.json5 b/qrcodegen/build-profile.json5 index 35dff6d53cb3a241f8de4fb68bd01d38ade0f108..79961f96a6fe0507354b7952a378c3be2ae4bfab 100644 --- a/qrcodegen/build-profile.json5 +++ b/qrcodegen/build-profile.json5 @@ -1,5 +1,10 @@ { "apiType": "stageMode", "buildOption": { - } + }, + "targets": [ + { + "name": "default" + } + ] } diff --git a/qrcodegen/hvigorfile.js b/qrcodegen/hvigorfile.ts similarity index 62% rename from qrcodegen/hvigorfile.js rename to qrcodegen/hvigorfile.ts index 42ed4b4a54a873e2b53441556aae93fab24b794f..47e6e1f81d365872f101585f5dbf816bcad65864 100644 --- a/qrcodegen/hvigorfile.js +++ b/qrcodegen/hvigorfile.ts @@ -1,3 +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').harTasks - +export { harTasks } from '@ohos/hvigor-ohos-plugin'; \ No newline at end of file diff --git a/qrcodegen/package.json b/qrcodegen/package.json index c9494a9b34d69c536ae63b265b0381ee28f1bfeb..0d117e432423c0b99b3358db996c2828fb730641 100644 --- a/qrcodegen/package.json +++ b/qrcodegen/package.json @@ -1,19 +1,26 @@ { - "license": "MIT", - "types": "", - "devDependencies": {}, - "keywords": [ - "qrcode", - "OpenHarmony" - ], - "author": "hihope", - "name": "@ohos/qr-code-generator", - "description": "High-quality QR Code generator library", - "ohos": { - "org": "opensource" - }, - "main": "index.ets", - "repository": "https://gitee.com/openharmony-sig/qr-code-generator", - "version": "1.0.0", - "dependencies": {} + "types": "", + "keywords": [ + "qrcode", + "OpenHarmony", + "HarmonyOS" + ], + "author": "hihope", + "description": "High-quality QR Code generator library", + "ohos": { + "org": "opensource" + }, + "main": "index.ets", + "type": "module", + "repository": "https://gitee.com/openharmony-sig/qr-code-generator", + "version": "1.0.1", + "tags": [ + "OpenHarmony", + "qrcode", + "HarmonyOS" + ], + "dependencies": {}, + "license": "MIT", + "devDependencies": {}, + "name": "@ohos/qr-code-generator" } diff --git a/qrcodegen/src/main/resources/en_US/element/string.json b/qrcodegen/src/main/resources/en_US/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..1e76de0c66777cfe83568615c5c2e68c61d23fed --- /dev/null +++ b/qrcodegen/src/main/resources/en_US/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "page_show", + "value": "page from npm package" + } + ] +} diff --git a/qrcodegen/src/main/resources/zh_CN/element/string.json b/qrcodegen/src/main/resources/zh_CN/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..1e76de0c66777cfe83568615c5c2e68c61d23fed --- /dev/null +++ b/qrcodegen/src/main/resources/zh_CN/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "page_show", + "value": "page from npm package" + } + ] +}