提交 3c607d1d 编写于 作者: X xuchenghua09

update

Signed-off-by: Nxuchenghua09 <xuchenghua09@huawei.com>
上级 68781f7d
{
"app": {
"bundleName": "imagearelyhap",
"vendor": "example",
"versionCode": 1000000,
"versionName": "1.0.0",
"icon": "$media:app_icon",
"label": "$string:app_name",
"distributedNotificationEnabled": true,
"keepAlive" : true,
"singleUser": true,
"minAPIVersion": 9,
"targetAPIVersion": 9,
"car": {
"apiCompatibleVersion": 9,
"singleUser": false
}
}
}
# 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("//test/xts/tools/build/suite.gni")
ohos_hap_assist_suite("actsimagearelyhap") {
hap_profile = "entry/src/main/module.json"
js_build_mode = "debug"
hap_name = "actsimagearelyhap"
testonly = true
deps = [
":actsimagearelyhap_js_assets",
":actsimagearelyhap_resources",
]
ets2abc = true
certificate_profile = "signature/openharmony_sx.p7b"
subsystem_name = "ability"
part_name = "ability_runtime"
}
ohos_app_scope("actsimagearelyhap_app_profile") {
app_profile = "AppScope/app.json"
sources = [ "AppScope/resources" ]
}
ohos_js_assets("actsimagearelyhap_js_assets") {
source_dir = "entry/src/main/ets"
}
ohos_resources("actsimagearelyhap_resources") {
sources = [ "entry/src/main/resources" ]
deps = [ ":actsimagearelyhap_app_profile" ]
hap_profile = "entry/src/main/module.json"
}
/*
* 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
/*
* 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'
import commonEvent from '@ohos.commonEvent'
export default class MainAbility extends Ability {
onCreate(want, launchParam) {
console.log("[Demo] MainAbility onCreate")
globalThis.abilityWant = want;
AppStorage.SetOrCreate('bundleName', want.bundleName);
AppStorage.SetOrCreate('abilityName', want.abilityName);
AppStorage.SetOrCreate('type', want.type);
AppStorage.SetOrCreate('uri', want.parameters.uri);
}
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/index", 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")
console.log("[Demo] MainAbility onForeground want: " + JSON.stringify(globalThis.abilityWant))
let commonEventData = {
code: 0,
data: 'imagearelyhap',
parameters: {
abilityName: globalThis.abilityWant.abilityName,
bundleName: globalThis.abilityWant.bundleName,
type: globalThis.abilityWant.type,
uri: globalThis.abilityWant.parameters.uri
}
}
commonEvent.publish('AppSelector', commonEventData, (err) => {
console.log('======>imagearelyhap MainAbility published<======')
})
}
onBackground() {
// Ability has back to background
console.log("[Demo] MainAbility onBackground")
}
};
\ No newline at end of file
/*
* 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 = 'imageAEntryRelyHap'
@StorageLink('bundleName') bundleName: string = null;
@StorageLink('abilityName') abilityName: string = null;
@StorageLink('type') type: string = null;
@StorageLink('uri') uri: string = null;
build() {
Row() {
Column() {
Text(this.message)
.fontSize(50)
.fontWeight(FontWeight.Bold)
Text("bundleName: " + this.bundleName)
.fontSize(25)
.fontWeight(FontWeight.Bold)
Text("abilityName: " + this.abilityName)
.fontSize(25)
.fontWeight(FontWeight.Bold)
Text("type: " + this.type)
.fontSize(25)
.fontWeight(FontWeight.Bold)
Text("uri: " + this.uri)
.fontSize(25)
.fontWeight(FontWeight.Bold)
}
.width('100%')
}
.height('100%')
}
}
\ No newline at end of file
/*
* 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 = 'imageAEntryRelyHap'
@StorageLink('bundleName') bundleName: string = null;
@StorageLink('abilityName') abilityName: string = null;
@StorageLink('type') type: string = null;
@StorageLink('uri') uri: string = null;
build() {
Row() {
Column() {
Text(this.message)
.fontSize(50)
.fontWeight(FontWeight.Bold)
Text("bundleName: " + this.bundleName)
.fontSize(25)
.fontWeight(FontWeight.Bold)
Text("abilityName: " + this.abilityName)
.fontSize(25)
.fontWeight(FontWeight.Bold)
Text("type: " + this.type)
.fontSize(25)
.fontWeight(FontWeight.Bold)
Text("uri: " + this.uri)
.fontSize(25)
.fontWeight(FontWeight.Bold)
}
.width('100%')
}
.height('100%')
}
}
\ No newline at end of file
{
"module": {
"name": "entry",
"type": "entry",
"srcEntrance": "./ets/Application/AbilityStage.ts",
"description": "$string:entry_desc",
"mainElement": "MainAbility",
"deviceTypes": [
"phone"
],
"deliveryWithInstall": true,
"installationFree": false,
"pages": "$profile:main_pages",
"uiSyntax": "ets",
"abilities": [
{
"name": "MainAbility",
"srcEntrance": "./ets/MainAbility/MainAbility.ts",
"description": "$string:MainAbility_desc",
"icon": "$media:icon",
"label": "$string:MainAbility_label",
"visible": true,
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"ohos.want.action.viewData"
],
"uris": [
{
"type": "image/png"
}
]
}
]
}
]
}
}
\ No newline at end of file
{
"string": [
{
"name": "entry_desc",
"value": "description"
},
{
"name": "MainAbility_desc",
"value": "description"
},
{
"name": "MainAbility_label",
"value": "label"
},
{
"name": "app_name",
"value": "actsstartrunnertest"
},
{
"name": "description_application",
"value": "demo for test"
}
]
}
\ No newline at end of file
......@@ -12,7 +12,7 @@
# limitations under the License.
import("//test/xts/tools/build/suite.gni")
ohos_hap("ActsImageBFeatureRelyHap") {
ohos_hap_assist_suite("ActsImageBFeatureRelyHap") {
hap_profile = "entry/src/main/module.json"
js_build_mode = "debug"
hap_name = "ActsImageBFeatureRelyHap"
......
{
"app": {
"bundleName": "imagebrelyhap",
"vendor": "example",
"versionCode": 1000000,
"versionName": "1.0.0",
"icon": "$media:app_icon",
"label": "$string:app_name",
"distributedNotificationEnabled": true,
"keepAlive" : true,
"singleUser": true,
"minAPIVersion": 9,
"targetAPIVersion": 9,
"car": {
"apiCompatibleVersion": 9,
"singleUser": false
}
}
}
# 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("//test/xts/tools/build/suite.gni")
ohos_hap("ActsImageBRelyHap") {
hap_profile = "entry/src/main/module.json"
js_build_mode = "debug"
hap_name = "ActsImageBRelyHap"
testonly = true
deps = [
":actsimagebrelyhap_js_assets",
":actsimagebrelyhap_resources",
]
ets2abc = true
certificate_profile = "signature/openharmony_sx.p7b"
subsystem_name = "ability"
part_name = "ability_runtime"
}
ohos_app_scope("actsimagebrelyhap_app_profile") {
app_profile = "AppScope/app.json"
sources = [ "AppScope/resources" ]
}
ohos_js_assets("actsimagebrelyhap_js_assets") {
source_dir = "entry/src/main/ets"
}
ohos_resources("actsimagebrelyhap_resources") {
sources = [ "entry/src/main/resources" ]
deps = [ ":actsimagebrelyhap_app_profile" ]
hap_profile = "entry/src/main/module.json"
}
/*
* 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
/*
* 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'
// import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
// import { Hypium } from 'hypium/index'
// import testsuite from '../test/List.test'
import commonEvent from '@ohos.commonEvent'
export default class MainAbility extends Ability {
onCreate(want, launchParam) {
console.log('MainAbility onCreate')
globalThis.abilityWant = want;
AppStorage.SetOrCreate('bundleName', want.bundleName);
AppStorage.SetOrCreate('abilityName', want.abilityName);
AppStorage.SetOrCreate('type', want.type);
AppStorage.SetOrCreate('uri', want.parameters.uri);
// globalThis.abilityWant = want;
// 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('MainAbility onDestroy')
}
onWindowStageCreate(windowStage) {
console.log('MainAbility onWindowStageCreate')
windowStage.setUIContent(this.context, 'MainAbility/pages/index', null)
}
onWindowStageDestroy() {
console.log('MainAbility onWindowStageDestroy')
}
onForeground() {
console.log('MainAbility onForeground')
console.log("[Demo] MainAbility onForeground want: " + JSON.stringify(globalThis.abilityWant))
let commonEventData = {
code: 0,
data: 'imagebrelyhap',
parameters: {
abilityName: globalThis.abilityWant.abilityName,
bundleName: globalThis.abilityWant.bundleName,
type: globalThis.abilityWant.type,
uri: globalThis.abilityWant.parameters.uri
}
}
commonEvent.publish('AppSelector', commonEventData, (err) => {
console.log('======>imagebrelyhap MainAbility published<======')
})
}
onBackground() {
console.log('MainAbility onBackground')
}
};
\ No newline at end of file
/*
* 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 router from '@system.router';
import file from '@system.file';
@Entry
@Component
struct Index {
aboutToAppear() {
console.info('MainAbility index aboutToAppear')
}
@State message: string = 'MainAbility'
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%')
}
}
\ No newline at end of file
/*
* 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 = 'imageAEntryRelyHap'
@StorageLink('bundleName') bundleName: string = null;
@StorageLink('abilityName') abilityName: string = null;
@StorageLink('type') type: string = null;
@StorageLink('uri') uri: string = null;
build() {
Row() {
Column() {
Text(this.message)
.fontSize(50)
.fontWeight(FontWeight.Bold)
Text("bundleName: " + this.bundleName)
.fontSize(25)
.fontWeight(FontWeight.Bold)
Text("abilityName: " + this.abilityName)
.fontSize(25)
.fontWeight(FontWeight.Bold)
Text("type: " + this.type)
.fontSize(25)
.fontWeight(FontWeight.Bold)
Text("uri: " + this.uri)
.fontSize(25)
.fontWeight(FontWeight.Bold)
}
.width('100%')
}
.height('100%')
}
}
\ No newline at end of file
{
"module": {
"name": "entry",
"type": "entry",
"srcEntrance": "./ets/Application/AbilityStage.ts",
"description": "$string:entry_desc",
"mainElement": "MainAbility",
"deviceTypes": [
"phone",
"tablet"
],
"deliveryWithInstall": true,
"installationFree": false,
"pages": "$profile:main_pages",
"uiSyntax": "ets",
"abilities": [
{
"name": "MainAbility",
"srcEntrance": "./ets/MainAbility/MainAbility.ts",
"description": "$string:MainAbility_desc",
"icon": "$media:icon",
"label": "$string:MainAbility_label",
"visible": true,
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"ohos.want.action.viewData"
],
"uris": [
{
"type": "image/png"
}
]
}
]
}
]
}
}
\ No newline at end of file
{
"string": [
{
"name": "entry_desc",
"value": "description"
},
{
"name": "MainAbility_desc",
"value": "description"
},
{
"name": "MainAbility_label",
"value": "label"
},
{
"name": "MainAbility2_desc",
"value": "description"
},
{
"name": "MainAbility2_label",
"value": "label"
},
{
"name": "MainAbility3_desc",
"value": "description"
},
{
"name": "MainAbility3_label",
"value": "label"
},
{
"name": "app_name",
"value": "actsstartrunnertest"
},
{
"name": "description_application",
"value": "demo for test"
}
]
}
\ No newline at end of file
......@@ -12,7 +12,7 @@
# limitations under the License.
import("//test/xts/tools/build/suite.gni")
ohos_hap("ActsImageCEntryRelyHap") {
ohos_hap_assist_suite("ActsImageCEntryRelyHap") {
hap_profile = "entry/src/main/module.json"
js_build_mode = "debug"
hap_name = "ActsImageCEntryRelyHap"
......
......@@ -12,7 +12,7 @@
# limitations under the License.
import("//test/xts/tools/build/suite.gni")
ohos_hap("ActsImageCFeatureRelyHap") {
ohos_hap_assist_suite("ActsImageCFeatureRelyHap") {
hap_profile = "entry/src/main/module.json"
js_build_mode = "debug"
hap_name = "ActsImageCFeatureRelyHap"
......
......@@ -12,7 +12,7 @@
# limitations under the License.
import("//test/xts/tools/build/suite.gni")
ohos_hap("ActsImageDRelyHap") {
ohos_hap_assist_suite("ActsImageDRelyHap") {
hap_profile = "entry/src/main/module.json"
js_build_mode = "debug"
hap_name = "ActsImageDRelyHap"
......
......@@ -12,7 +12,7 @@
# limitations under the License.
import("//test/xts/tools/build/suite.gni")
ohos_hap("ActsImageERelyHap") {
ohos_hap_assist_suite("ActsImageERelyHap") {
hap_profile = "entry/src/main/module.json"
js_build_mode = "debug"
hap_name = "ActsImageERelyHap"
......
......@@ -12,7 +12,7 @@
# limitations under the License.
import("//test/xts/tools/build/suite.gni")
ohos_hap("ActsImageFRelyHap") {
ohos_hap_assist_suite("ActsImageFRelyHap") {
hap_profile = "entry/src/main/module.json"
js_build_mode = "debug"
hap_name = "ActsImageFRelyHap"
......
......@@ -12,7 +12,7 @@
# limitations under the License.
import("//test/xts/tools/build/suite.gni")
ohos_hap("ActsImageGRelyHap") {
ohos_hap_assist_suite("ActsImageGRelyHap") {
hap_profile = "entry/src/main/module.json"
js_build_mode = "debug"
hap_name = "ActsImageGRelyHap"
......
......@@ -12,7 +12,7 @@
# limitations under the License.
import("//test/xts/tools/build/suite.gni")
ohos_hap("ActsImageHRelyHap") {
ohos_hap_assist_suite("ActsImageHRelyHap") {
hap_profile = "entry/src/main/module.json"
js_build_mode = "debug"
hap_name = "ActsImageHRelyHap"
......
......@@ -12,7 +12,7 @@
# limitations under the License.
import("//test/xts/tools/build/suite.gni")
ohos_hap("ActsImageIRelyHap") {
ohos_hap_assist_suite("ActsImageIRelyHap") {
hap_profile = "entry/src/main/module.json"
js_build_mode = "debug"
hap_name = "ActsImageIRelyHap"
......
......@@ -12,7 +12,7 @@
# limitations under the License.
import("//test/xts/tools/build/suite.gni")
ohos_hap("ActsImageJRelyHap") {
ohos_hap_assist_suite("ActsImageJRelyHap") {
hap_profile = "entry/src/main/module.json"
js_build_mode = "debug"
hap_name = "ActsImageJRelyHap"
......
......@@ -12,7 +12,7 @@
# limitations under the License.
import("//test/xts/tools/build/suite.gni")
ohos_hap("ActsImageKRelyHap") {
ohos_hap_assist_suite("ActsImageKRelyHap") {
hap_profile = "entry/src/main/module.json"
js_build_mode = "debug"
hap_name = "ActsImageKRelyHap"
......
......@@ -12,7 +12,7 @@
# limitations under the License.
import("//test/xts/tools/build/suite.gni")
ohos_hap("ActsServiceAbilityARelyHap") {
ohos_hap_assist_suite("ActsServiceAbilityARelyHap") {
hap_profile = "entry/src/main/module.json"
js_build_mode = "debug"
hap_name = "ActsServiceAbilityARelyHap"
......
......@@ -12,7 +12,7 @@
# limitations under the License.
import("//test/xts/tools/build/suite.gni")
ohos_hap("ActsServiceAbilityBRelyHap") {
ohos_hap_assist_suite("ActsServiceAbilityBRelyHap") {
hap_profile = "entry/src/main/module.json"
js_build_mode = "debug"
hap_name = "ActsServiceAbilityBRelyHap"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册