徐勤民 1 vuosi sitten
commit
66d26ff62d
41 muutettua tiedostoa jossa 871 lisäystä ja 0 poistoa
  1. +11
    -0
      .gitignore
  2. +11
    -0
      AppScope/app.json5
  3. +8
    -0
      AppScope/resources/base/element/string.json
  4. BIN
      AppScope/resources/base/media/app_icon.png
  5. BIN
      EntryCard/entry/base/snapshot/widget-2x2.png
  6. +44
    -0
      build-profile.json5
  7. +6
    -0
      entry/.gitignore
  8. +15
    -0
      entry/build-profile.json5
  9. +2
    -0
      entry/hvigorfile.ts
  10. +10
    -0
      entry/oh-package.json5
  11. +41
    -0
      entry/src/main/ets/entryability/EntryAbility.ts
  12. +37
    -0
      entry/src/main/ets/entryformability/EntryFormAbility.ts
  13. +17
    -0
      entry/src/main/ets/pages/Index.ets
  14. +72
    -0
      entry/src/main/ets/widget/pages/WidgetCard.ets
  15. +52
    -0
      entry/src/main/module.json5
  16. +12
    -0
      entry/src/main/resources/base/element/color.json
  17. +24
    -0
      entry/src/main/resources/base/element/float.json
  18. +32
    -0
      entry/src/main/resources/base/element/string.json
  19. BIN
      entry/src/main/resources/base/media/ic_widget.png
  20. BIN
      entry/src/main/resources/base/media/icon.png
  21. +23
    -0
      entry/src/main/resources/base/profile/form_config.json
  22. +5
    -0
      entry/src/main/resources/base/profile/main_pages.json
  23. +32
    -0
      entry/src/main/resources/en_US/element/string.json
  24. +32
    -0
      entry/src/main/resources/zh_CN/element/string.json
  25. +35
    -0
      entry/src/ohosTest/ets/test/Ability.test.ets
  26. +5
    -0
      entry/src/ohosTest/ets/test/List.test.ets
  27. +48
    -0
      entry/src/ohosTest/ets/testability/TestAbility.ets
  28. +34
    -0
      entry/src/ohosTest/ets/testability/pages/Index.ets
  29. +49
    -0
      entry/src/ohosTest/ets/testrunner/OpenHarmonyTestRunner.ts
  30. +37
    -0
      entry/src/ohosTest/module.json5
  31. +8
    -0
      entry/src/ohosTest/resources/base/element/color.json
  32. +16
    -0
      entry/src/ohosTest/resources/base/element/string.json
  33. BIN
      entry/src/ohosTest/resources/base/media/icon.png
  34. +5
    -0
      entry/src/ohosTest/resources/base/profile/test_pages.json
  35. +6
    -0
      hvigor/hvigor-config.json5
  36. +2
    -0
      hvigor/hvigor-wrapper.js
  37. +2
    -0
      hvigorfile.ts
  38. +48
    -0
      hvigorw
  39. +64
    -0
      hvigorw.bat
  40. +13
    -0
      oh-package-lock.json5
  41. +13
    -0
      oh-package.json5

+ 11
- 0
.gitignore Näytä tiedosto

@@ -0,0 +1,11 @@
/node_modules
/oh_modules
/local.properties
/.idea
**/build
/.hvigor
.cxx
/.clangd
/.clang-format
/.clang-tidy
**/.test

+ 11
- 0
AppScope/app.json5 Näytä tiedosto

@@ -0,0 +1,11 @@
{
"app": {
"bundleName": "com.szyx.hm.tongrentang",
"bundleType": "atomicService",
"vendor": "example",
"versionCode": 1000000,
"versionName": "1.0.0",
"icon": "$media:app_icon",
"label": "$string:app_name"
}
}

+ 8
- 0
AppScope/resources/base/element/string.json Näytä tiedosto

@@ -0,0 +1,8 @@
{
"string": [
{
"name": "app_name",
"value": "HMTongRenTang"
}
]
}

BIN
AppScope/resources/base/media/app_icon.png Näytä tiedosto

Before After
Width: 114  |  Height: 114  |  Size: 6.6KB

BIN
EntryCard/entry/base/snapshot/widget-2x2.png Näytä tiedosto

Before After
Width: 600  |  Height: 600  |  Size: 16KB

+ 44
- 0
build-profile.json5 Näytä tiedosto

@@ -0,0 +1,44 @@
{
"app": {
"signingConfigs": [],
"compileSdkVersion": 9,
"compatibleSdkVersion": 9,
"products": [
{
"name": "default",
"signingConfig": "default",
//"buildOption": {
// "packOptions": {
// /**
// * If the size of the HAP file of the atomic service's entry module
// * is equal to or greater than the mainPackageLimitSize value, packaging will fail.
// * If the HAP file is equal to or greater than 2 MB, it will fail to be released to AppGallery.
// */
// "mainPackageLimitSize": 2,
//
// /**
// * If the size of the HAP file of the atomic service's non-entry modules
// * is equal to or greater than the normalPackageLimitSize value, packaging will fail.
// * If the HAP file is equal to or greater than 2 MB, it will fail to be released to AppGallery.
// */
// "normalPackageLimitSize": 2
// }
//}
}
]
},
"modules": [
{
"name": "entry",
"srcPath": "./entry",
"targets": [
{
"name": "default",
"applyToProducts": [
"default"
]
}
]
}
]
}

+ 6
- 0
entry/.gitignore Näytä tiedosto

@@ -0,0 +1,6 @@
/node_modules
/oh_modules
/.preview
/build
/.cxx
/.test

+ 15
- 0
entry/build-profile.json5 Näytä tiedosto

@@ -0,0 +1,15 @@
{
"apiType": 'stageMode',
"showInServiceCenter": true,
"buildOption": {
},
"targets": [
{
"name": "default",
"runtimeOS": "HarmonyOS"
},
{
"name": "ohosTest",
}
]
}

+ 2
- 0
entry/hvigorfile.ts Näytä tiedosto

@@ -0,0 +1,2 @@
// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently.
export { hapTasks } from '@ohos/hvigor-ohos-plugin';

+ 10
- 0
entry/oh-package.json5 Näytä tiedosto

@@ -0,0 +1,10 @@
{
"name": "entry",
"version": "1.0.0",
"description": "Please describe the basic information.",
"main": "",
"author": "",
"license": "",
"dependencies": {}
}


+ 41
- 0
entry/src/main/ets/entryability/EntryAbility.ts Näytä tiedosto

@@ -0,0 +1,41 @@
import UIAbility from '@ohos.app.ability.UIAbility';
import hilog from '@ohos.hilog';
import window from '@ohos.window';

export default class EntryAbility extends UIAbility {
onCreate(want, launchParam) {
hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate');
}

onDestroy() {
hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onDestroy');
}

onWindowStageCreate(windowStage: window.WindowStage) {
// Main window is created, set main page for this ability
hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate');

windowStage.loadContent('pages/Index', (err, data) => {
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. Data: %{public}s', JSON.stringify(data) ?? '');
});
}

onWindowStageDestroy() {
// Main window is destroyed, release UI related resources
hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageDestroy');
}

onForeground() {
// Ability has brought to foreground
hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onForeground');
}

onBackground() {
// Ability has back to background
hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onBackground');
}
}

+ 37
- 0
entry/src/main/ets/entryformability/EntryFormAbility.ts Näytä tiedosto

@@ -0,0 +1,37 @@
import formInfo from '@ohos.app.form.formInfo';
import formBindingData from '@ohos.app.form.formBindingData';
import FormExtensionAbility from '@ohos.app.form.FormExtensionAbility';

export default class EntryFormAbility extends FormExtensionAbility {
onAddForm(want) {
// Called to return a FormBindingData object.
let formData = {};
return formBindingData.createFormBindingData(formData);
}

onCastToNormalForm(formId) {
// Called when the form provider is notified that a temporary form is successfully
// converted to a normal form.
}

onUpdateForm(formId) {
// Called to notify the form provider to update a specified form.
}

onChangeFormVisibility(newStatus) {
// Called when the form provider receives form events from the system.
}

onFormEvent(formId, message) {
// Called when a specified message event defined by the form provider is triggered.
}

onRemoveForm(formId) {
// Called to notify the form provider that a specified form has been destroyed.
}

onAcquireFormState(want) {
// Called to return a {@link FormState} object.
return formInfo.FormState.READY;
}
};

+ 17
- 0
entry/src/main/ets/pages/Index.ets Näytä tiedosto

@@ -0,0 +1,17 @@
@Entry
@Component
struct Index {
@State message: string = 'Hello World'

build() {
Row() {
Column() {
Text(this.message)
.fontSize(50)
.fontWeight(FontWeight.Bold)
}
.width('100%')
}
.height('100%')
}
}

+ 72
- 0
entry/src/main/ets/widget/pages/WidgetCard.ets Näytä tiedosto

@@ -0,0 +1,72 @@
@Entry
@Component
struct WidgetCard {
/*
* The max lines.
*/
readonly MAX_LINES: number = 1;

/*
* The action type.
*/
readonly ACTION_TYPE: string = 'router';

/*
* The message.
*/
readonly MESSAGE: string = 'add detail';

/*
* The ability name.
*/
readonly ABILITY_NAME: string = 'EntryAbility';

/*
* The with percentage setting.
*/
readonly FULL_WIDTH_PERCENT: string = '100%';

/*
* The height percentage setting.
*/
readonly FULL_HEIGHT_PERCENT: string = '100%';

build() {
Stack() {
Image($r("app.media.ic_widget"))
.width(this.FULL_WIDTH_PERCENT)
.height(this.FULL_HEIGHT_PERCENT)
.objectFit(ImageFit.Cover)
Column() {
Text($r('app.string.title_immersive'))
.fontSize($r('app.float.title_immersive_font_size'))
.textOverflow({ overflow: TextOverflow.Ellipsis })
.fontColor($r('app.color.text_font_color'))
.maxLines(this.MAX_LINES)
Text($r('app.string.detail_immersive'))
.fontSize($r('app.float.detail_immersive_font_size'))
.opacity($r('app.float.detail_immersive_opacity'))
.margin({ top: $r('app.float.detail_immersive_margin_top') })
.textOverflow({ overflow: TextOverflow.Ellipsis })
.fontColor($r('app.color.text_font_color'))
.maxLines(this.MAX_LINES)
}
.width(this.FULL_WIDTH_PERCENT)
.height(this.FULL_HEIGHT_PERCENT)
.alignItems(HorizontalAlign.Start)
.justifyContent(FlexAlign.End)
.padding($r('app.float.column_padding'))
}
.width(this.FULL_WIDTH_PERCENT)
.height(this.FULL_HEIGHT_PERCENT)
.onClick(() => {
postCardAction(this, {
"action": this.ACTION_TYPE,
"abilityName": this.ABILITY_NAME,
"params": {
"message": this.MESSAGE
}
});
})
}
}

+ 52
- 0
entry/src/main/module.json5 Näytä tiedosto

@@ -0,0 +1,52 @@
{
"module": {
"name": "entry",
"type": "entry",
"description": "$string:module_desc",
"mainElement": "EntryAbility",
"deviceTypes": [
"phone",
"tablet"
],
"deliveryWithInstall": true,
"installationFree": true,
"pages": "$profile:main_pages",
"abilities": [
{
"name": "EntryAbility",
"srcEntry": "./ets/entryability/EntryAbility.ts",
"description": "$string:EntryAbility_desc",
"icon": "$media:icon",
"label": "$string:EntryAbility_label",
"startWindowIcon": "$media:icon",
"startWindowBackground": "$color:start_window_background",
"exported": true,
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
]
}
],
"extensionAbilities": [
{
"name": "EntryFormAbility",
"srcEntry": "./ets/entryformability/EntryFormAbility.ts",
"label": "$string:EntryFormAbility_label",
"description": "$string:EntryFormAbility_desc",
"type": "form",
"metadata": [
{
"name": "ohos.extension.form",
"resource": "$profile:form_config"
}
]
}
]
}
}

+ 12
- 0
entry/src/main/resources/base/element/color.json Näytä tiedosto

@@ -0,0 +1,12 @@
{
"color": [
{
"name": "start_window_background",
"value": "#FFFFFF"
},
{
"name": "text_font_color",
"value": "#FFFFFF"
}
]
}

+ 24
- 0
entry/src/main/resources/base/element/float.json Näytä tiedosto

@@ -0,0 +1,24 @@
{
"float": [
{
"name": "title_immersive_font_size",
"value": "19fp"
},
{
"name": "detail_immersive_font_size",
"value": "16fp"
},
{
"name": "detail_immersive_margin_top",
"value": "6vp"
},
{
"name": "detail_immersive_opacity",
"value": "0.66"
},
{
"name": "column_padding",
"value": "12vp"
}
]
}

+ 32
- 0
entry/src/main/resources/base/element/string.json Näytä tiedosto

@@ -0,0 +1,32 @@
{
"string": [
{
"name": "module_desc",
"value": "module description"
},
{
"name": "EntryAbility_desc",
"value": "description"
},
{
"name": "EntryAbility_label",
"value": "label"
},
{
"name": "EntryFormAbility_desc",
"value": "form_description"
},
{
"name": "EntryFormAbility_label",
"value": "form_label"
},
{
"name": "title_immersive",
"value": "Today's delicious food"
},
{
"name": "detail_immersive",
"value": "A bowl of fragrant fried noodles, back to childhood memories"
}
]
}

BIN
entry/src/main/resources/base/media/ic_widget.png Näytä tiedosto

Before After
Width: 504  |  Height: 216  |  Size: 5.7KB

BIN
entry/src/main/resources/base/media/icon.png Näytä tiedosto

Before After
Width: 114  |  Height: 114  |  Size: 6.6KB

+ 23
- 0
entry/src/main/resources/base/profile/form_config.json Näytä tiedosto

@@ -0,0 +1,23 @@
{
"forms": [
{
"name": "widget",
"description": "This is a service widget.",
"src": "./ets/widget/pages/WidgetCard.ets",
"uiSyntax": "arkts",
"window": {
"designWidth": 720,
"autoDesignWidth": true
},
"colorMode": "auto",
"isDefault": true,
"updateEnabled": false,
"scheduledUpdateTime": "10:30",
"updateDuration": 1,
"defaultDimension": "2*2",
"supportDimensions": [
"2*2"
]
}
]
}

+ 5
- 0
entry/src/main/resources/base/profile/main_pages.json Näytä tiedosto

@@ -0,0 +1,5 @@
{
"src": [
"pages/Index"
]
}

+ 32
- 0
entry/src/main/resources/en_US/element/string.json Näytä tiedosto

@@ -0,0 +1,32 @@
{
"string": [
{
"name": "module_desc",
"value": "module description"
},
{
"name": "EntryAbility_desc",
"value": "description"
},
{
"name": "EntryAbility_label",
"value": "label"
},
{
"name": "EntryFormAbility_desc",
"value": "form_description"
},
{
"name": "EntryFormAbility_label",
"value": "form_label"
},
{
"name": "title_immersive",
"value": "Today's delicious food"
},
{
"name": "detail_immersive",
"value": "A bowl of fragrant fried noodles, back to childhood memories"
}
]
}

+ 32
- 0
entry/src/main/resources/zh_CN/element/string.json Näytä tiedosto

@@ -0,0 +1,32 @@
{
"string": [
{
"name": "module_desc",
"value": "模块描述"
},
{
"name": "EntryAbility_desc",
"value": "description"
},
{
"name": "EntryAbility_label",
"value": "label"
},
{
"name": "EntryFormAbility_desc",
"value": "form_description"
},
{
"name": "EntryFormAbility_label",
"value": "form_label"
},
{
"name": "title_immersive",
"value": "今日美食推荐"
},
{
"name": "detail_immersive",
"value": "一碗香喷喷的炸酱面,回到儿时的青涩回忆"
}
]
}

+ 35
- 0
entry/src/ohosTest/ets/test/Ability.test.ets Näytä tiedosto

@@ -0,0 +1,35 @@
import hilog from '@ohos.hilog';
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium'

export default function abilityTest() {
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)
})
})
}

+ 5
- 0
entry/src/ohosTest/ets/test/List.test.ets Näytä tiedosto

@@ -0,0 +1,5 @@
import abilityTest from './Ability.test'

export default function testsuite() {
abilityTest()
}

+ 48
- 0
entry/src/ohosTest/ets/testability/TestAbility.ets Näytä tiedosto

@@ -0,0 +1,48 @@
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 UIAbility {
onCreate(want, launchParam) {
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()
hilog.info(0x0000, 'testTag', '%{public}s', 'start run testcase!!!');
Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite)
}

onDestroy() {
hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onDestroy');
}

onWindowStageCreate(windowStage: window.WindowStage) {
hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageCreate');
windowStage.loadContent('testability/pages/Index', (err, data) => {
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. Data: %{public}s',
JSON.stringify(data) ?? '');
});
}

onWindowStageDestroy() {
hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onWindowStageDestroy');
}

onForeground() {
hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onForeground');
}

onBackground() {
hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility onBackground');
}
}

+ 34
- 0
entry/src/ohosTest/ets/testability/pages/Index.ets Näytä tiedosto

@@ -0,0 +1,34 @@
import hilog from '@ohos.hilog';

@Entry
@Component
struct Index {
aboutToAppear() {
hilog.info(0x0000, 'testTag', '%{public}s', 'TestAbility index aboutToAppear');
}
@State message: string = 'Hello World'
build() {
Row() {
Column() {
Text(this.message)
.fontSize(50)
.fontWeight(FontWeight.Bold)
Button() {
Text('next page')
.fontSize(20)
.fontWeight(FontWeight.Bold)
}.type(ButtonType.Capsule)
.margin({
top: 20
})
.backgroundColor('#0D9FFB')
.width('35%')
.height('5%')
.onClick(()=>{
})
}
.width('100%')
}
.height('100%')
}
}

+ 49
- 0
entry/src/ohosTest/ets/testrunner/OpenHarmonyTestRunner.ts Näytä tiedosto

@@ -0,0 +1,49 @@
import hilog from '@ohos.hilog';
import TestRunner from '@ohos.application.testRunner';
import AbilityDelegatorRegistry from '@ohos.app.ability.abilityDelegatorRegistry';

var abilityDelegator = undefined
var abilityDelegatorArguments = undefined

async function onAbilityCreateCallback() {
hilog.info(0x0000, 'testTag', '%{public}s', 'onAbilityCreateCallback');
}

async function addAbilityMonitorCallback(err: any) {
hilog.info(0x0000, 'testTag', 'addAbilityMonitorCallback : %{public}s', JSON.stringify(err) ?? '');
}

export default class OpenHarmonyTestRunner implements TestRunner {
constructor() {
}

onPrepare() {
hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner OnPrepare ');
}

async onRun() {
hilog.info(0x0000, 'testTag', '%{public}s', '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
var debug = abilityDelegatorArguments.parameters['-D']
if (debug == 'true')
{
cmd += ' -D'
}
hilog.info(0x0000, 'testTag', 'cmd : %{public}s', cmd);
abilityDelegator.executeShellCommand(cmd,
(err: any, d: any) => {
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 ?? '');
})
hilog.info(0x0000, 'testTag', '%{public}s', 'OpenHarmonyTestRunner onRun end');
}
}

+ 37
- 0
entry/src/ohosTest/module.json5 Näytä tiedosto

@@ -0,0 +1,37 @@
{
"module": {
"name": "entry_test",
"type": "feature",
"description": "$string:module_test_desc",
"mainElement": "TestAbility",
"deviceTypes": [
"phone",
"tablet"
],
"deliveryWithInstall": true,
"installationFree": true,
"pages": "$profile:test_pages",
"abilities": [
{
"name": "TestAbility",
"srcEntry": "./ets/testability/TestAbility.ets",
"description": "$string:TestAbility_desc",
"icon": "$media:icon",
"label": "$string:TestAbility_label",
"exported": true,
"startWindowIcon": "$media:icon",
"startWindowBackground": "$color:start_window_background",
"skills": [
{
"actions": [
"action.system.home"
],
"entities": [
"entity.system.home"
]
}
]
}
]
}
}

+ 8
- 0
entry/src/ohosTest/resources/base/element/color.json Näytä tiedosto

@@ -0,0 +1,8 @@
{
"color": [
{
"name": "start_window_background",
"value": "#FFFFFF"
}
]
}

+ 16
- 0
entry/src/ohosTest/resources/base/element/string.json Näytä tiedosto

@@ -0,0 +1,16 @@
{
"string": [
{
"name": "module_test_desc",
"value": "test ability description"
},
{
"name": "TestAbility_desc",
"value": "the test ability"
},
{
"name": "TestAbility_label",
"value": "test label"
}
]
}

BIN
entry/src/ohosTest/resources/base/media/icon.png Näytä tiedosto

Before After
Width: 114  |  Height: 114  |  Size: 6.6KB

+ 5
- 0
entry/src/ohosTest/resources/base/profile/test_pages.json Näytä tiedosto

@@ -0,0 +1,5 @@
{
"src": [
"testability/pages/Index"
]
}

+ 6
- 0
hvigor/hvigor-config.json5 Näytä tiedosto

@@ -0,0 +1,6 @@
{
"hvigorVersion": "2.4.2",
"dependencies": {
"@ohos/hvigor-ohos-plugin": "2.4.2"
}
}

+ 2
- 0
hvigor/hvigor-wrapper.js
File diff suppressed because it is too large
Näytä tiedosto


+ 2
- 0
hvigorfile.ts Näytä tiedosto

@@ -0,0 +1,2 @@
// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently.
export { appTasks } from '@ohos/hvigor-ohos-plugin';

+ 48
- 0
hvigorw Näytä tiedosto

@@ -0,0 +1,48 @@
#!/bin/bash

# ----------------------------------------------------------------------------
# Hvigor startup script, version 1.0.0
#
# Required ENV vars:
# ------------------
# NODE_HOME - location of a Node home dir
# or
# Add /usr/local/nodejs/bin to the PATH environment variable
# ----------------------------------------------------------------------------

HVIGOR_APP_HOME=$(dirname $(readlink -f $0))
HVIGOR_WRAPPER_SCRIPT=${HVIGOR_APP_HOME}/hvigor/hvigor-wrapper.js
warn() {
echo ""
echo -e "\033[1;33m`date '+[%Y-%m-%d %H:%M:%S]'`$@\033[0m"
}

error() {
echo ""
echo -e "\033[1;31m`date '+[%Y-%m-%d %H:%M:%S]'`$@\033[0m"
}

fail() {
error "$@"
exit 1
}

# Determine node to start hvigor wrapper script
if [ -n "${NODE_HOME}" ];then
EXECUTABLE_NODE="${NODE_HOME}/bin/node"
if [ ! -x "$EXECUTABLE_NODE" ];then
fail "ERROR: NODE_HOME is set to an invalid directory,check $NODE_HOME\n\nPlease set NODE_HOME in your environment to the location where your nodejs installed"
fi
else
EXECUTABLE_NODE="node"
which ${EXECUTABLE_NODE} > /dev/null 2>&1 || fail "ERROR: NODE_HOME is not set and not 'node' command found in your path"
fi

# Check hvigor wrapper script
if [ ! -r "$HVIGOR_WRAPPER_SCRIPT" ];then
fail "ERROR: Couldn't find hvigor/hvigor-wrapper.js in ${HVIGOR_APP_HOME}"
fi

# start hvigor-wrapper script
exec "${EXECUTABLE_NODE}" \
"${HVIGOR_WRAPPER_SCRIPT}" "$@"

+ 64
- 0
hvigorw.bat Näytä tiedosto

@@ -0,0 +1,64 @@
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Hvigor startup script for Windows
@rem
@rem ##########################################################################

@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal

set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi

set WRAPPER_MODULE_PATH=%APP_HOME%\hvigor\hvigor-wrapper.js
set NODE_EXE=node.exe

goto start

:start
@rem Find node.exe
if defined NODE_HOME goto findNodeFromNodeHome

%NODE_EXE% --version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto execute

echo.
echo ERROR: NODE_HOME is not set and no 'node' command could be found in your PATH.
echo.
echo Please set the NODE_HOME variable in your environment to match the
echo location of your NodeJs installation.

goto fail

:findNodeFromNodeHome
set NODE_HOME=%NODE_HOME:"=%
set NODE_EXE_PATH=%NODE_HOME%/%NODE_EXE%

if exist "%NODE_EXE_PATH%" goto execute
echo.
echo ERROR: NODE_HOME is not set and no 'node' command could be found in your PATH.
echo.
echo Please set the NODE_HOME variable in your environment to match the
echo location of your NodeJs installation.

goto fail

:execute
@rem Execute hvigor
"%NODE_EXE%" %WRAPPER_MODULE_PATH% %*

if "%ERRORLEVEL%" == "0" goto hvigorwEnd

:fail
exit /b 1

:hvigorwEnd
if "%OS%" == "Windows_NT" endlocal

:end

+ 13
- 0
oh-package-lock.json5 Näytä tiedosto

@@ -0,0 +1,13 @@
{
"lockfileVersion": 1,
"ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.",
"specifiers": {
"@ohos/hypium@1.0.6": "@ohos/hypium@1.0.6"
},
"packages": {
"@ohos/hypium@1.0.6": {
"resolved": "https://repo.harmonyos.com/ohpm/@ohos/hypium/-/hypium-1.0.6.tgz",
"integrity": "sha512-bb3DWeWhYrFqj9mPFV3yZQpkm36kbcK+YYaeY9g292QKSjOdmhEIQR2ULPvyMsgSR4usOBf5nnYrDmaCCXirgQ=="
}
}
}

+ 13
- 0
oh-package.json5 Näytä tiedosto

@@ -0,0 +1,13 @@
{
"name": "hmtongrentang",
"version": "1.0.0",
"description": "Please describe the basic information.",
"main": "",
"author": "",
"license": "",
"dependencies": {
},
"devDependencies": {
"@ohos/hypium": "1.0.6"
}
}

Loading…
Peruuta
Tallenna