From e5d22893d38e806ac4e0647640ce5d264effba4f Mon Sep 17 00:00:00 2001 From: Eason Date: Wed, 2 Jun 2021 18:38:06 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E5=86=85=E5=AE=B9?= =?UTF-8?q?=E3=80=91=EF=BC=9A=E6=96=B0=E5=A2=9E=E5=8D=95=E5=85=83=E6=B5=8B?= =?UTF-8?q?=E8=AF=95=E7=94=A8=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- audiovisualizer/src/main/config.json | 6 +-- build.gradle | 3 +- entry/build.gradle | 4 +- entry/src/main/config.json | 6 +-- entry/src/ohosTest/config.json | 40 +++++++++++++++++++ .../chibde/visualizer/ExampleOhosTest.java | 15 +++++++ local.properties | 2 +- 8 files changed, 67 insertions(+), 11 deletions(-) create mode 100644 entry/src/ohosTest/config.json create mode 100644 entry/src/ohosTest/java/com/chibde/visualizer/ExampleOhosTest.java diff --git a/README.md b/README.md index 2624efb..0cbefa3 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ - 功能:实现音频可视化 - 项目移植状态:主功能完成 - 调用差异:无 -- 开发版本:sdk5,DevEco Studio2.1 beta4(实时更新以当前最新版本为准) +- 开发版本:sdk5,DevEco Studio2.1 beta4 - 基线版本:Release v2.2.0 #### 效果演示 diff --git a/audiovisualizer/src/main/config.json b/audiovisualizer/src/main/config.json index fe967a4..b5379c5 100644 --- a/audiovisualizer/src/main/config.json +++ b/audiovisualizer/src/main/config.json @@ -3,11 +3,11 @@ "bundleName": "com.chibde.visualizer", "vendor": "chibde", "version": { - "code": 1, - "name": "1.0" + "code": 1000000, + "name": "1.0.0" }, "apiVersion": { - "compatible": 5, + "compatible": 4, "target": 5, "releaseType": "Release" } diff --git a/build.gradle b/build.gradle index e57a5c8..e6f4c5f 100644 --- a/build.gradle +++ b/build.gradle @@ -23,8 +23,7 @@ buildscript { } dependencies { classpath 'com.huawei.ohos:hap:2.4.2.7' - classpath 'com.huawei.ohos:decctest:1.0.0.6' - + classpath 'com.huawei.ohos:decctest:1.0.0.7' } } diff --git a/entry/build.gradle b/entry/build.gradle index d2a7fab..2d5a1cc 100644 --- a/entry/build.gradle +++ b/entry/build.gradle @@ -1,6 +1,7 @@ apply plugin: 'com.huawei.ohos.hap' -ohos { +apply plugin: 'com.huawei.ohos.decctest' +ohos { compileSdkVersion 5 defaultConfig { compatibleSdkVersion 5 @@ -11,6 +12,7 @@ dependencies { implementation fileTree(dir: 'libs', include: ['*.jar', '*.har']) testCompile 'junit:junit:4.12' compile project(path: ':audiovisualizer') + ohosTestImplementation 'com.huawei.ohos.testkit:runner:1.0.0.100' } diff --git a/entry/src/main/config.json b/entry/src/main/config.json index 6f70082..efd1b12 100644 --- a/entry/src/main/config.json +++ b/entry/src/main/config.json @@ -3,11 +3,11 @@ "bundleName": "com.chibde.visualizer", "vendor": "chibde", "version": { - "code": 1, - "name": "1.0" + "code": 1000000, + "name": "1.0.0" }, "apiVersion": { - "compatible": 5, + "compatible": 4, "target": 5, "releaseType": "Release" } diff --git a/entry/src/ohosTest/config.json b/entry/src/ohosTest/config.json new file mode 100644 index 0000000..9f172a7 --- /dev/null +++ b/entry/src/ohosTest/config.json @@ -0,0 +1,40 @@ +{ + "app": { + "bundleName": "com.chibde.visualizer", + "vendor": "chibde", + "version": { + "code": 1000000, + "name": "1.0.0" + }, + "apiVersion": { + "compatible": 4, + "target": 5, + "releaseType": "Release" + } + }, + "deviceConfig": {}, + "module": { + "package": "com.chibde.visualizer", + "name": "testModule", + "deviceType": [ + "phone" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry_test", + "moduleType": "feature", + "installationFree": true + }, + "abilities": [ + { + "name": "decc.testkit.runner.EntryAbility", + "description": "Test Entry Ability", + "icon": "$media:icon", + "launchType": "standard", + "orientation": "landscape", + "visible": true, + "type": "page" + } + ] + } +} \ No newline at end of file diff --git a/entry/src/ohosTest/java/com/chibde/visualizer/ExampleOhosTest.java b/entry/src/ohosTest/java/com/chibde/visualizer/ExampleOhosTest.java new file mode 100644 index 0000000..1951630 --- /dev/null +++ b/entry/src/ohosTest/java/com/chibde/visualizer/ExampleOhosTest.java @@ -0,0 +1,15 @@ +package com.chibde.visualizer; + +import ohos.aafwk.ability.delegation.AbilityDelegatorRegistry; +import org.junit.Test; + +import static org.junit.Assert.assertEquals; + +public class ExampleOhosTest { + //纯UI组件,暂无单元测试 + @Test + public void testBundleName() { + final String actualBundleName = AbilityDelegatorRegistry.getArguments().getTestBundleName(); + assertEquals("com.chibde.visualizer", actualBundleName); + } +} \ No newline at end of file diff --git a/local.properties b/local.properties index 6dd9c8a..cc33532 100644 --- a/local.properties +++ b/local.properties @@ -7,6 +7,6 @@ # Location of the SDK. This is only used by Gradle. # For customization when using a Version Control System, please read the # header note. -#Sun May 30 18:23:37 CST 2021 +#Wed Jun 02 18:34:33 CST 2021 nodejs.dir=C\:\\Program Files\\nodejs hwsdk.dir=C\:\\Users\\Administrator\\AppData\\Local\\Huawei\\Sdk -- Gitee