diff --git a/NdkDrawing/.clang-format b/NdkDrawing/.clang-format new file mode 100644 index 0000000000000000000000000000000000000000..48439ed68073b99be118d374d1ebd43d04d4c4eb --- /dev/null +++ b/NdkDrawing/.clang-format @@ -0,0 +1,64 @@ +Language: Cpp +# BasedOnStyle: LLVM +ColumnLimit: 120 +SortIncludes: CaseSensitive +TabWidth: 4 +IndentWidth: 4 +UseTab: Never +AccessModifierOffset: -4 +ContinuationIndentWidth: 4 +IndentCaseBlocks: false +IndentCaseLabels: false +IndentGotoLabels: true +IndentWrappedFunctionNames: false +SortUsingDeclarations: false +NamespaceIndentation: None +SpaceAfterCStyleCast: false +SpaceAfterLogicalNot: false +SpaceAfterTemplateKeyword: true +SpaceBeforeAssignmentOperators: true +SpaceBeforeCaseColon: false +SpaceBeforeCpp11BracedList: false +SpaceBeforeCtorInitializerColon: true +SpaceBeforeInheritanceColon: true +SpaceBeforeRangeBasedForLoopColon: true +SpaceBeforeSquareBrackets: false +SpaceInEmptyBlock: false +SpaceInEmptyParentheses: false +SpacesInAngles: false +SpacesInCStyleCastParentheses: false +SpacesInConditionalStatement: false +SpacesInParentheses: false +SpacesInSquareBrackets: false +AlignTrailingComments: true +AlignAfterOpenBracket: true +AllowShortCaseLabelsOnASingleLine: false +AllowShortEnumsOnASingleLine: true +AllowShortFunctionsOnASingleLine: All +AllowShortIfStatementsOnASingleLine: Never +AllowShortLambdasOnASingleLine: All +AllowShortLoopsOnASingleLine: false +AlwaysBreakTemplateDeclarations: MultiLine +BinPackArguments: true +BinPackParameters: true +BreakBeforeTernaryOperators: true +BreakConstructorInitializers: BeforeColon +BreakInheritanceList: BeforeColon +BreakStringLiterals: true +InsertBraces: false +IndentExternBlock: NoIndent +BreakBeforeBraces: Custom +BraceWrapping: + AfterCaseLabel: false + AfterClass: false + AfterControlStatement: Never + AfterEnum: false + AfterFunction: false + AfterNamespace: false + AfterStruct: false + AfterUnion: false + AfterExternBlock: false + BeforeCatch: false + BeforeElse: false +ReflowComments: true +MaxEmptyLinesToKeep: 2 \ No newline at end of file diff --git a/NdkDrawing/.hvigor/cache/file-cache.json b/NdkDrawing/.hvigor/cache/file-cache.json new file mode 100644 index 0000000000000000000000000000000000000000..9e26dfeeb6e641a33dae4961196235bdb965b21b --- /dev/null +++ b/NdkDrawing/.hvigor/cache/file-cache.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/NdkDrawing/.hvigor/cache/task-cache.json b/NdkDrawing/.hvigor/cache/task-cache.json new file mode 100644 index 0000000000000000000000000000000000000000..9e26dfeeb6e641a33dae4961196235bdb965b21b --- /dev/null +++ b/NdkDrawing/.hvigor/cache/task-cache.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/NdkDrawing/.hvigor/outputs/build-logs/build.log b/NdkDrawing/.hvigor/outputs/build-logs/build.log new file mode 100644 index 0000000000000000000000000000000000000000..d8ba546132ee0af48465ca1658f5e45d86d2e1b4 --- /dev/null +++ b/NdkDrawing/.hvigor/outputs/build-logs/build.log @@ -0,0 +1,475 @@ +[2025-05-12T09:09:55.866] [DEBUG] debug-file - env: nodejsVersion=v18.20.1 +[2025-05-12T09:09:56.365] [DEBUG] debug-file - Hvigor init with startParameters:{ + hvigorfileTypeCheck: false, + parallelExecution: true, + incrementalExecution: true, + printStackTrace: false, + daemon: false, + analyze: 0, + logLevel: Level { level: 20000, levelStr: 'INFO', colour: 'green' } +} +[2025-05-12T09:09:56.390] [DEBUG] debug-file - hvigorfile, resolving D:\LiuDongHai\FAQ最佳实践资料\BestPractices\BestPractices\DevelopmentPractice\NdkDrawing\hvigorfile.ts +[2025-05-12T09:09:58.010] [DEBUG] debug-file - hvigorfile, require result: { default: { system: [Function: appTasks], plugins: [] } } +[2025-05-12T09:09:58.206] [DEBUG] debug-file - hvigor build process will be closed with an error. +[2025-05-12T09:09:58.215] [WARN] debug-file - BUILD FAILED in 1 s 870 ms +[2025-05-12T09:09:55.869] [DEBUG] debug-file - env: hvigor-config.json5 content = { + modelVersion: '5.0.0', + dependencies: {}, + execution: {}, + logging: {}, + debugging: {}, + nodeOptions: {} +} +[2025-05-12T09:09:58.230] [DEBUG] debug-file - Create resident worker with id: 0. +[2025-05-12T09:09:56.367] [DEBUG] debug-file - Since current hvigor version 5.17.0 differs from last hvigor version + undefined, delete file-cache.json and task-cache.json. +[2025-05-12T09:09:58.011] [DEBUG] debug-file - hvigorfile, binding system plugins [Function: appTasks] +[2025-05-12T09:09:58.208] [DEBUG] debug-file - ERROR: stacktrace = Error: Invalid project path. + Detail: Please move the project to a valid path + at OhosLogger.errorMessageExit (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor\src\base\log\hvigor-log.js:1:3224) + at OhosLogger._printAllExit (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\src\utils\log\ohos-logger.js:1:1274) + at ProjectInspection.exitOnError (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\src\tasks\inspection\project-inspection.js:1:672) + at AppPlugin.doProjectInspection (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\src\plugin\common\abstract-project-plugin.js:1:1585) + at PluginFactory.getAppPlugin (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\src\plugin\factory\plugin-factory.js:1:2159) + at appTasks (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\index.js:1:593) + at bindSystemPlugins (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor\src\base\internal\lifecycle\configuration.js:1:5900) + at evaluateNodeVigorFile (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor\src\base\internal\lifecycle\configuration.js:1:8450) + at evalProject (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor\src\base\internal\lifecycle\configuration.js:1:3495) + at process.processTicksAndRejections (node:internal/process/task_queues:95:5) +[2025-05-12T09:09:58.227] [DEBUG] debug-file - Since there is no instance or instance is terminated, create a new worker pool. +[2025-05-12T09:09:55.871] [DEBUG] debug-file - env: daemon=false +[2025-05-12T09:09:58.232] [DEBUG] debug-file - Create resident worker with id: 1. +[2025-05-12T09:09:56.368] [DEBUG] debug-file - Cache service initialization finished in 2 ms +[2025-05-12T09:09:58.208] [ERROR] debug-file - Error: Invalid project path. + Detail: Please move the project to a valid path + at OhosLogger.errorMessageExit (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor\src\base\log\hvigor-log.js:1:3224) + at OhosLogger._printAllExit (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\src\utils\log\ohos-logger.js:1:1274) + at ProjectInspection.exitOnError (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\src\tasks\inspection\project-inspection.js:1:672) + at AppPlugin.doProjectInspection (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\src\plugin\common\abstract-project-plugin.js:1:1585) + at PluginFactory.getAppPlugin (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\src\plugin\factory\plugin-factory.js:1:2159) + at appTasks (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\index.js:1:593) + at bindSystemPlugins (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor\src\base\internal\lifecycle\configuration.js:1:5900) + at evaluateNodeVigorFile (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor\src\base\internal\lifecycle\configuration.js:1:8450) + at evalProject (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor\src\base\internal\lifecycle\configuration.js:1:3495) + at process.processTicksAndRejections (node:internal/process/task_queues:95:5) +[2025-05-12T09:09:58.228] [DEBUG] debug-file - Worker pool is initialized with config: { + minPoolNum: 2, + maxPoolNum: undefined, + maxCoreSize: undefined, + cacheCapacity: undefined, + cacheTtl: undefined +} +[2025-05-12T09:09:55.871] [DEBUG] debug-file - no-daemon, use the parent process.execArgv --max-old-space-size=8192,--expose-gc +[2025-05-12T09:09:58.234] [DEBUG] debug-file - Current worker pool is stopped or closed. +[2025-05-12T09:09:58.235] [DEBUG] debug-file - Clear worker 0. +[2025-05-12T09:09:58.235] [DEBUG] debug-file - Worker 0 has been cleared. +[2025-05-12T09:09:58.235] [DEBUG] debug-file - Current idle worker size: 1. +[2025-05-12T09:09:58.235] [DEBUG] debug-file - Current busy worker size: 0. +[2025-05-12T09:09:58.235] [DEBUG] debug-file - Clear worker 1. +[2025-05-12T09:09:58.235] [DEBUG] debug-file - Worker 1 has been cleared. +[2025-05-12T09:09:58.235] [DEBUG] debug-file - Current idle worker size: 0. +[2025-05-12T09:09:58.235] [DEBUG] debug-file - Current busy worker size: 0. +[2025-05-12T09:09:58.243] [DEBUG] debug-file - hvigor build process will be closed. +[2025-05-12T09:09:58.247] [DEBUG] debug-file - worker[0] exits with exit code 0. +[2025-05-12T09:09:58.247] [DEBUG] debug-file - worker[1] exits with exit code 0. +[2025-05-12T09:09:58.248] [DEBUG] debug-file - Current worker pool is terminated. +[2025-05-12T09:28:27.100] [DEBUG] debug-file - env: nodejsVersion=v18.20.1 +[2025-05-12T09:28:27.440] [DEBUG] debug-file - env: daemon=true +[2025-05-12T09:28:27.103] [DEBUG] debug-file - env: hvigor-config.json5 content = { + modelVersion: '5.0.0', + dependencies: {}, + execution: {}, + logging: {}, + debugging: {}, + nodeOptions: {} +} +[2025-05-12T09:28:28.304] [DEBUG] debug-file - java daemon tryConnect failed Error: connect ECONNREFUSED 127.0.0.1:45050 +[2025-05-12T09:28:28.314] [DEBUG] debug-file - java daemon started at port 45050 pid 14820 +[2025-05-12T09:28:28.341] [DEBUG] debug-file - session manager: set active socket. socketId=99FxYpNo7JWjbw_6AAAB +[2025-05-12T09:28:29.066] [DEBUG] debug-file - watch worker: worker id should be larger than 0. Nothing will be sent to any worker thread. +[2025-05-12T09:28:29.085] [DEBUG] debug-file - Hvigor init with startParameters:{ + hvigorfileTypeCheck: false, + parallelExecution: true, + incrementalExecution: true, + printStackTrace: false, + daemon: true, + analyze: 0, + logLevel: Level { level: 20000, levelStr: 'INFO', colour: 'green' } +} +[2025-05-12T09:28:29.087] [DEBUG] debug-file - Since current hvigor version 5.17.0 differs from last hvigor version + undefined, delete file-cache.json and task-cache.json. +[2025-05-12T09:28:29.089] [DEBUG] debug-file - Cache service initialization finished in 4 ms +[2025-05-12T09:28:29.102] [DEBUG] debug-file - hvigorfile, resolving D:\LiuDongHai\FAQ最佳实践资料\BestPractices\BestPractices\DevelopmentPractice\NdkDrawing\hvigorfile.ts +[2025-05-12T09:28:30.735] [DEBUG] debug-file - hvigorfile, require result: { default: { plugins: [] } } +[2025-05-12T09:28:30.735] [DEBUG] debug-file - hvigorfile, binding system plugins null +[2025-05-12T09:28:30.935] [DEBUG] debug-file - hvigor build process will be closed with an error. +[2025-05-12T09:28:30.936] [DEBUG] debug-file - ERROR: stacktrace = Error: Invalid project path. + Detail: Please move the project to a valid path + at OhosLogger.errorMessageExit (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor\src\base\log\hvigor-log.js:1:3224) + at OhosLogger._printAllExit (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\src\utils\log\ohos-logger.js:1:1274) + at ProjectInspection.exitOnError (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\src\tasks\inspection\project-inspection.js:1:672) + at AppPlugin.doProjectInspection (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\src\plugin\common\abstract-project-plugin.js:1:1585) + at PluginFactory.getAppPlugin (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\src\plugin\factory\plugin-factory.js:1:2159) + at appTasks (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\index.js:1:593) + at bindSystemPlugins (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor\src\base\internal\lifecycle\configuration.js:1:5900) + at evaluateNodeVigorFile (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor\src\base\internal\lifecycle\configuration.js:1:8450) + at evalProject (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor\src\base\internal\lifecycle\configuration.js:1:3495) + at process.processTicksAndRejections (node:internal/process/task_queues:95:5) +[2025-05-12T09:28:30.936] [ERROR] debug-file - Error: Invalid project path. + Detail: Please move the project to a valid path + at OhosLogger.errorMessageExit (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor\src\base\log\hvigor-log.js:1:3224) + at OhosLogger._printAllExit (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\src\utils\log\ohos-logger.js:1:1274) + at ProjectInspection.exitOnError (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\src\tasks\inspection\project-inspection.js:1:672) + at AppPlugin.doProjectInspection (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\src\plugin\common\abstract-project-plugin.js:1:1585) + at PluginFactory.getAppPlugin (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\src\plugin\factory\plugin-factory.js:1:2159) + at appTasks (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\index.js:1:593) + at bindSystemPlugins (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor\src\base\internal\lifecycle\configuration.js:1:5900) + at evaluateNodeVigorFile (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor\src\base\internal\lifecycle\configuration.js:1:8450) + at evalProject (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor\src\base\internal\lifecycle\configuration.js:1:3495) + at process.processTicksAndRejections (node:internal/process/task_queues:95:5) +[2025-05-12T09:28:30.942] [WARN] debug-file - BUILD FAILED in 1 s 871 ms +[2025-05-12T09:28:30.953] [DEBUG] debug-file - Since there is no instance or instance is terminated, create a new worker pool. +[2025-05-12T09:28:30.953] [DEBUG] debug-file - Worker pool is initialized with config: { + minPoolNum: 2, + maxPoolNum: undefined, + maxCoreSize: undefined, + cacheCapacity: undefined, + cacheTtl: undefined +} +[2025-05-12T09:28:30.955] [DEBUG] debug-file - session manager: send message to worker process. +[2025-05-12T09:28:30.955] [DEBUG] debug-file - session manager: send message to worker process. +[2025-05-12T09:28:30.955] [DEBUG] debug-file - Create resident worker with id: 0. +[2025-05-12T09:28:30.957] [DEBUG] debug-file - Create resident worker with id: 1. +[2025-05-12T09:28:30.960] [DEBUG] debug-file - Cleanup worker 0. +[2025-05-12T09:28:30.960] [DEBUG] debug-file - Worker 0 has been cleaned up. +[2025-05-12T09:28:30.961] [DEBUG] debug-file - Current idle worker size: 1. +[2025-05-12T09:28:30.961] [DEBUG] debug-file - Current resident worker size: 2. +[2025-05-12T09:28:30.961] [DEBUG] debug-file - Cleanup worker 1. +[2025-05-12T09:28:30.961] [DEBUG] debug-file - Worker 1 has been cleaned up. +[2025-05-12T09:28:30.961] [DEBUG] debug-file - Current idle worker size: 0. +[2025-05-12T09:28:30.961] [DEBUG] debug-file - Current resident worker size: 2. +[2025-05-12T09:28:30.968] [DEBUG] debug-file - hvigor build process will be closed. +[2025-05-12T09:28:30.972] [DEBUG] debug-file - watch worker: worker id should be larger than 0. Nothing will be sent to any worker thread. +[2025-05-12T09:28:30.973] [DEBUG] debug-file - watch worker: worker id should be larger than 0. Nothing will be sent to any worker thread. +[2025-05-12T09:28:30.974] [DEBUG] debug-file - worker[0] exits with exit code 0. +[2025-05-12T09:28:30.974] [DEBUG] debug-file - worker[1] exits with exit code 0. +[2025-05-12T15:20:53.342] [DEBUG] debug-file - env: nodejsVersion=v18.20.1 +[2025-05-12T15:20:53.658] [DEBUG] debug-file - env: daemon=true +[2025-05-12T15:20:53.344] [DEBUG] debug-file - env: hvigor-config.json5 content = { + modelVersion: '5.0.0', + dependencies: {}, + execution: {}, + logging: {}, + debugging: {}, + nodeOptions: {} +} +[2025-05-12T15:20:54.589] [DEBUG] debug-file - java daemon tryConnect failed Error: connect ECONNREFUSED 127.0.0.1:45050 +[2025-05-12T15:20:54.595] [DEBUG] debug-file - java daemon started at port 45050 pid 12056 +[2025-05-12T15:20:54.634] [DEBUG] debug-file - session manager: set active socket. socketId=1Ehx_3LSCOceOASVAAAB +[2025-05-12T15:20:55.347] [DEBUG] debug-file - watch worker: worker id should be larger than 0. Nothing will be sent to any worker thread. +[2025-05-12T15:20:55.367] [DEBUG] debug-file - Hvigor init with startParameters:{ + hvigorfileTypeCheck: false, + parallelExecution: true, + incrementalExecution: true, + printStackTrace: false, + daemon: true, + analyze: 0, + logLevel: Level { level: 20000, levelStr: 'INFO', colour: 'green' } +} +[2025-05-12T15:20:55.369] [DEBUG] debug-file - Since current hvigor version 5.17.0 differs from last hvigor version + undefined, delete file-cache.json and task-cache.json. +[2025-05-12T15:20:55.371] [DEBUG] debug-file - Cache service initialization finished in 4 ms +[2025-05-12T15:20:55.384] [DEBUG] debug-file - hvigorfile, resolving D:\LiuDongHai\FAQ最佳实践资料\BestPractices\BestPractices\DevelopmentPractice\NdkDrawing\hvigorfile.ts +[2025-05-12T15:20:57.065] [DEBUG] debug-file - hvigorfile, require result: { default: { plugins: [] } } +[2025-05-12T15:20:57.066] [DEBUG] debug-file - hvigorfile, binding system plugins null +[2025-05-12T15:20:57.260] [DEBUG] debug-file - hvigor build process will be closed with an error. +[2025-05-12T15:20:57.261] [DEBUG] debug-file - ERROR: stacktrace = Error: Invalid project path. + Detail: Please move the project to a valid path + at OhosLogger.errorMessageExit (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor\src\base\log\hvigor-log.js:1:3224) + at OhosLogger._printAllExit (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\src\utils\log\ohos-logger.js:1:1274) + at ProjectInspection.exitOnError (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\src\tasks\inspection\project-inspection.js:1:672) + at AppPlugin.doProjectInspection (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\src\plugin\common\abstract-project-plugin.js:1:1585) + at PluginFactory.getAppPlugin (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\src\plugin\factory\plugin-factory.js:1:2159) + at appTasks (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\index.js:1:593) + at bindSystemPlugins (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor\src\base\internal\lifecycle\configuration.js:1:5900) + at evaluateNodeVigorFile (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor\src\base\internal\lifecycle\configuration.js:1:8450) + at evalProject (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor\src\base\internal\lifecycle\configuration.js:1:3495) + at process.processTicksAndRejections (node:internal/process/task_queues:95:5) +[2025-05-12T15:20:57.261] [ERROR] debug-file - Error: Invalid project path. + Detail: Please move the project to a valid path + at OhosLogger.errorMessageExit (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor\src\base\log\hvigor-log.js:1:3224) + at OhosLogger._printAllExit (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\src\utils\log\ohos-logger.js:1:1274) + at ProjectInspection.exitOnError (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\src\tasks\inspection\project-inspection.js:1:672) + at AppPlugin.doProjectInspection (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\src\plugin\common\abstract-project-plugin.js:1:1585) + at PluginFactory.getAppPlugin (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\src\plugin\factory\plugin-factory.js:1:2159) + at appTasks (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\index.js:1:593) + at bindSystemPlugins (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor\src\base\internal\lifecycle\configuration.js:1:5900) + at evaluateNodeVigorFile (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor\src\base\internal\lifecycle\configuration.js:1:8450) + at evalProject (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor\src\base\internal\lifecycle\configuration.js:1:3495) + at process.processTicksAndRejections (node:internal/process/task_queues:95:5) +[2025-05-12T15:20:57.267] [WARN] debug-file - BUILD FAILED in 1 s 915 ms +[2025-05-12T15:20:57.277] [DEBUG] debug-file - Since there is no instance or instance is terminated, create a new worker pool. +[2025-05-12T15:20:57.278] [DEBUG] debug-file - Worker pool is initialized with config: { + minPoolNum: 2, + maxPoolNum: undefined, + maxCoreSize: undefined, + cacheCapacity: undefined, + cacheTtl: undefined +} +[2025-05-12T15:20:57.279] [DEBUG] debug-file - Create resident worker with id: 0. +[2025-05-12T15:20:57.280] [DEBUG] debug-file - session manager: send message to worker process. +[2025-05-12T15:20:57.280] [DEBUG] debug-file - session manager: send message to worker process. +[2025-05-12T15:20:57.281] [DEBUG] debug-file - Create resident worker with id: 1. +[2025-05-12T15:20:57.284] [DEBUG] debug-file - Cleanup worker 0. +[2025-05-12T15:20:57.284] [DEBUG] debug-file - Worker 0 has been cleaned up. +[2025-05-12T15:20:57.284] [DEBUG] debug-file - Current idle worker size: 1. +[2025-05-12T15:20:57.284] [DEBUG] debug-file - Current resident worker size: 2. +[2025-05-12T15:20:57.284] [DEBUG] debug-file - Cleanup worker 1. +[2025-05-12T15:20:57.284] [DEBUG] debug-file - Worker 1 has been cleaned up. +[2025-05-12T15:20:57.284] [DEBUG] debug-file - Current idle worker size: 0. +[2025-05-12T15:20:57.284] [DEBUG] debug-file - Current resident worker size: 2. +[2025-05-12T15:20:57.291] [DEBUG] debug-file - hvigor build process will be closed. +[2025-05-12T15:20:57.293] [DEBUG] debug-file - watch worker: worker id should be larger than 0. Nothing will be sent to any worker thread. +[2025-05-12T15:20:57.293] [DEBUG] debug-file - watch worker: worker id should be larger than 0. Nothing will be sent to any worker thread. +[2025-05-12T15:20:57.294] [DEBUG] debug-file - worker[0] exits with exit code 0. +[2025-05-12T15:20:57.294] [DEBUG] debug-file - worker[1] exits with exit code 0. +[2025-05-12T16:49:38.980] [DEBUG] debug-file - env: nodejsVersion=v18.20.1 +[2025-05-12T16:49:39.295] [DEBUG] debug-file - env: daemon=true +[2025-05-12T16:49:38.982] [DEBUG] debug-file - env: hvigor-config.json5 content = { + modelVersion: '5.0.0', + dependencies: {}, + execution: {}, + logging: {}, + debugging: {}, + nodeOptions: {} +} +[2025-05-12T16:49:40.139] [DEBUG] debug-file - java daemon tryConnect failed Error: connect ECONNREFUSED 127.0.0.1:45050 +[2025-05-12T16:49:40.145] [DEBUG] debug-file - java daemon started at port 45050 pid 17960 +[2025-05-12T16:49:40.171] [DEBUG] debug-file - session manager: set active socket. socketId=8mIIUNxVHSJtgYsjAAAB +[2025-05-12T16:49:40.863] [DEBUG] debug-file - watch worker: worker id should be larger than 0. Nothing will be sent to any worker thread. +[2025-05-12T16:49:40.881] [DEBUG] debug-file - Hvigor init with startParameters:{ + hvigorfileTypeCheck: false, + parallelExecution: true, + incrementalExecution: true, + printStackTrace: false, + daemon: true, + analyze: 0, + logLevel: Level { level: 20000, levelStr: 'INFO', colour: 'green' } +} +[2025-05-12T16:49:40.883] [DEBUG] debug-file - Since current hvigor version 5.17.0 differs from last hvigor version + undefined, delete file-cache.json and task-cache.json. +[2025-05-12T16:49:40.885] [DEBUG] debug-file - Cache service initialization finished in 4 ms +[2025-05-12T16:49:40.897] [DEBUG] debug-file - hvigorfile, resolving D:\LiuDongHai\FAQ最佳实践资料\BestPractices\BestPractices\DevelopmentPractice\NdkDrawing\hvigorfile.ts +[2025-05-12T16:49:42.484] [DEBUG] debug-file - hvigorfile, require result: { default: { plugins: [] } } +[2025-05-12T16:49:42.485] [DEBUG] debug-file - hvigorfile, binding system plugins null +[2025-05-12T16:49:42.669] [DEBUG] debug-file - hvigor build process will be closed with an error. +[2025-05-12T16:49:42.670] [DEBUG] debug-file - ERROR: stacktrace = Error: Invalid project path. + Detail: Please move the project to a valid path + at OhosLogger.errorMessageExit (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor\src\base\log\hvigor-log.js:1:3224) + at OhosLogger._printAllExit (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\src\utils\log\ohos-logger.js:1:1274) + at ProjectInspection.exitOnError (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\src\tasks\inspection\project-inspection.js:1:672) + at AppPlugin.doProjectInspection (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\src\plugin\common\abstract-project-plugin.js:1:1585) + at PluginFactory.getAppPlugin (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\src\plugin\factory\plugin-factory.js:1:2159) + at appTasks (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\index.js:1:593) + at bindSystemPlugins (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor\src\base\internal\lifecycle\configuration.js:1:5900) + at evaluateNodeVigorFile (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor\src\base\internal\lifecycle\configuration.js:1:8450) + at evalProject (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor\src\base\internal\lifecycle\configuration.js:1:3495) + at process.processTicksAndRejections (node:internal/process/task_queues:95:5) +[2025-05-12T16:49:42.670] [ERROR] debug-file - Error: Invalid project path. + Detail: Please move the project to a valid path + at OhosLogger.errorMessageExit (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor\src\base\log\hvigor-log.js:1:3224) + at OhosLogger._printAllExit (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\src\utils\log\ohos-logger.js:1:1274) + at ProjectInspection.exitOnError (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\src\tasks\inspection\project-inspection.js:1:672) + at AppPlugin.doProjectInspection (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\src\plugin\common\abstract-project-plugin.js:1:1585) + at PluginFactory.getAppPlugin (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\src\plugin\factory\plugin-factory.js:1:2159) + at appTasks (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\index.js:1:593) + at bindSystemPlugins (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor\src\base\internal\lifecycle\configuration.js:1:5900) + at evaluateNodeVigorFile (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor\src\base\internal\lifecycle\configuration.js:1:8450) + at evalProject (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor\src\base\internal\lifecycle\configuration.js:1:3495) + at process.processTicksAndRejections (node:internal/process/task_queues:95:5) +[2025-05-12T16:49:42.676] [WARN] debug-file - BUILD FAILED in 1 s 808 ms +[2025-05-12T16:49:42.686] [DEBUG] debug-file - Since there is no instance or instance is terminated, create a new worker pool. +[2025-05-12T16:49:42.687] [DEBUG] debug-file - Worker pool is initialized with config: { + minPoolNum: 2, + maxPoolNum: undefined, + maxCoreSize: undefined, + cacheCapacity: undefined, + cacheTtl: undefined +} +[2025-05-12T16:49:42.688] [DEBUG] debug-file - Create resident worker with id: 0. +[2025-05-12T16:49:42.689] [DEBUG] debug-file - session manager: send message to worker process. +[2025-05-12T16:49:42.689] [DEBUG] debug-file - session manager: send message to worker process. +[2025-05-12T16:49:42.690] [DEBUG] debug-file - Create resident worker with id: 1. +[2025-05-12T16:49:42.693] [DEBUG] debug-file - Cleanup worker 0. +[2025-05-12T16:49:42.693] [DEBUG] debug-file - Worker 0 has been cleaned up. +[2025-05-12T16:49:42.693] [DEBUG] debug-file - Current idle worker size: 1. +[2025-05-12T16:49:42.693] [DEBUG] debug-file - Current resident worker size: 2. +[2025-05-12T16:49:42.693] [DEBUG] debug-file - Cleanup worker 1. +[2025-05-12T16:49:42.693] [DEBUG] debug-file - Worker 1 has been cleaned up. +[2025-05-12T16:49:42.693] [DEBUG] debug-file - Current idle worker size: 0. +[2025-05-12T16:49:42.693] [DEBUG] debug-file - Current resident worker size: 2. +[2025-05-12T16:49:42.700] [DEBUG] debug-file - hvigor build process will be closed. +[2025-05-12T16:49:42.702] [DEBUG] debug-file - watch worker: worker id should be larger than 0. Nothing will be sent to any worker thread. +[2025-05-12T16:49:42.702] [DEBUG] debug-file - watch worker: worker id should be larger than 0. Nothing will be sent to any worker thread. +[2025-05-12T16:49:42.702] [DEBUG] debug-file - worker[0] exits with exit code 0. +[2025-05-12T16:49:42.703] [DEBUG] debug-file - worker[1] exits with exit code 0. +[2025-05-13T11:01:18.282] [DEBUG] debug-file - env: nodejsVersion=v18.20.1 +[2025-05-13T11:01:18.600] [DEBUG] debug-file - env: daemon=true +[2025-05-13T11:01:18.284] [DEBUG] debug-file - env: hvigor-config.json5 content = { + modelVersion: '5.0.0', + dependencies: {}, + execution: {}, + logging: {}, + debugging: {}, + nodeOptions: {} +} +[2025-05-13T11:01:19.449] [DEBUG] debug-file - java daemon tryConnect failed Error: connect ECONNREFUSED 127.0.0.1:45050 +[2025-05-13T11:01:19.454] [DEBUG] debug-file - java daemon started at port 45050 pid 14996 +[2025-05-13T11:01:19.479] [DEBUG] debug-file - session manager: set active socket. socketId=41bIHUUdx8cw4TxiAAAB +[2025-05-13T11:01:20.195] [DEBUG] debug-file - watch worker: worker id should be larger than 0. Nothing will be sent to any worker thread. +[2025-05-13T11:01:20.212] [DEBUG] debug-file - Hvigor init with startParameters:{ + hvigorfileTypeCheck: false, + parallelExecution: true, + incrementalExecution: true, + printStackTrace: false, + daemon: true, + analyze: 0, + logLevel: Level { level: 20000, levelStr: 'INFO', colour: 'green' } +} +[2025-05-13T11:01:20.214] [DEBUG] debug-file - Since current hvigor version 5.17.0 differs from last hvigor version + undefined, delete file-cache.json and task-cache.json. +[2025-05-13T11:01:20.216] [DEBUG] debug-file - Cache service initialization finished in 4 ms +[2025-05-13T11:01:20.228] [DEBUG] debug-file - hvigorfile, resolving D:\LiuDongHai\FAQ最佳实践资料\BestPractices\BestPractices\DevelopmentPractice\NdkDrawing\hvigorfile.ts +[2025-05-13T11:01:21.853] [DEBUG] debug-file - hvigorfile, require result: { default: { plugins: [] } } +[2025-05-13T11:01:21.853] [DEBUG] debug-file - hvigorfile, binding system plugins null +[2025-05-13T11:01:22.048] [DEBUG] debug-file - hvigor build process will be closed with an error. +[2025-05-13T11:01:22.049] [DEBUG] debug-file - ERROR: stacktrace = Error: Invalid project path. + Detail: Please move the project to a valid path + at OhosLogger.errorMessageExit (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor\src\base\log\hvigor-log.js:1:3224) + at OhosLogger._printAllExit (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\src\utils\log\ohos-logger.js:1:1274) + at ProjectInspection.exitOnError (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\src\tasks\inspection\project-inspection.js:1:672) + at AppPlugin.doProjectInspection (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\src\plugin\common\abstract-project-plugin.js:1:1585) + at PluginFactory.getAppPlugin (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\src\plugin\factory\plugin-factory.js:1:2159) + at appTasks (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\index.js:1:593) + at bindSystemPlugins (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor\src\base\internal\lifecycle\configuration.js:1:5900) + at evaluateNodeVigorFile (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor\src\base\internal\lifecycle\configuration.js:1:8450) + at evalProject (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor\src\base\internal\lifecycle\configuration.js:1:3495) + at process.processTicksAndRejections (node:internal/process/task_queues:95:5) +[2025-05-13T11:01:22.049] [ERROR] debug-file - Error: Invalid project path. + Detail: Please move the project to a valid path + at OhosLogger.errorMessageExit (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor\src\base\log\hvigor-log.js:1:3224) + at OhosLogger._printAllExit (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\src\utils\log\ohos-logger.js:1:1274) + at ProjectInspection.exitOnError (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\src\tasks\inspection\project-inspection.js:1:672) + at AppPlugin.doProjectInspection (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\src\plugin\common\abstract-project-plugin.js:1:1585) + at PluginFactory.getAppPlugin (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\src\plugin\factory\plugin-factory.js:1:2159) + at appTasks (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\index.js:1:593) + at bindSystemPlugins (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor\src\base\internal\lifecycle\configuration.js:1:5900) + at evaluateNodeVigorFile (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor\src\base\internal\lifecycle\configuration.js:1:8450) + at evalProject (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor\src\base\internal\lifecycle\configuration.js:1:3495) + at process.processTicksAndRejections (node:internal/process/task_queues:95:5) +[2025-05-13T11:01:22.056] [WARN] debug-file - BUILD FAILED in 1 s 856 ms +[2025-05-13T11:01:22.068] [DEBUG] debug-file - Since there is no instance or instance is terminated, create a new worker pool. +[2025-05-13T11:01:22.068] [DEBUG] debug-file - Worker pool is initialized with config: { + minPoolNum: 2, + maxPoolNum: undefined, + maxCoreSize: undefined, + cacheCapacity: undefined, + cacheTtl: undefined +} +[2025-05-13T11:01:22.070] [DEBUG] debug-file - Create resident worker with id: 0. +[2025-05-13T11:01:22.072] [DEBUG] debug-file - session manager: send message to worker process. +[2025-05-13T11:01:22.072] [DEBUG] debug-file - session manager: send message to worker process. +[2025-05-13T11:01:22.072] [DEBUG] debug-file - Create resident worker with id: 1. +[2025-05-13T11:01:22.075] [DEBUG] debug-file - Cleanup worker 0. +[2025-05-13T11:01:22.075] [DEBUG] debug-file - Worker 0 has been cleaned up. +[2025-05-13T11:01:22.075] [DEBUG] debug-file - Current idle worker size: 1. +[2025-05-13T11:01:22.075] [DEBUG] debug-file - Current resident worker size: 2. +[2025-05-13T11:01:22.075] [DEBUG] debug-file - Cleanup worker 1. +[2025-05-13T11:01:22.075] [DEBUG] debug-file - Worker 1 has been cleaned up. +[2025-05-13T11:01:22.076] [DEBUG] debug-file - Current idle worker size: 0. +[2025-05-13T11:01:22.076] [DEBUG] debug-file - Current resident worker size: 2. +[2025-05-13T11:01:22.083] [DEBUG] debug-file - hvigor build process will be closed. +[2025-05-13T11:01:22.084] [DEBUG] debug-file - watch worker: worker id should be larger than 0. Nothing will be sent to any worker thread. +[2025-05-13T11:01:22.084] [DEBUG] debug-file - watch worker: worker id should be larger than 0. Nothing will be sent to any worker thread. +[2025-05-13T11:01:22.085] [DEBUG] debug-file - worker[0] exits with exit code 0. +[2025-05-13T11:01:22.086] [DEBUG] debug-file - worker[1] exits with exit code 0. +[2025-05-15T10:43:53.313] [DEBUG] debug-file - env: nodejsVersion=v18.20.1 +[2025-05-15T10:43:53.630] [DEBUG] debug-file - env: daemon=true +[2025-05-15T10:43:53.315] [DEBUG] debug-file - env: hvigor-config.json5 content = { + modelVersion: '5.0.0', + dependencies: {}, + execution: {}, + logging: {}, + debugging: {}, + nodeOptions: {} +} +[2025-05-15T10:43:54.438] [DEBUG] debug-file - java daemon tryConnect failed Error: connect ECONNREFUSED 127.0.0.1:45050 +[2025-05-15T10:43:54.444] [DEBUG] debug-file - java daemon started at port 45050 pid 13896 +[2025-05-15T10:43:54.469] [DEBUG] debug-file - session manager: set active socket. socketId=xFpZRILc3xvjoIiBAAAB +[2025-05-15T10:43:55.170] [DEBUG] debug-file - watch worker: worker id should be larger than 0. Nothing will be sent to any worker thread. +[2025-05-15T10:43:55.188] [DEBUG] debug-file - Hvigor init with startParameters:{ + hvigorfileTypeCheck: false, + parallelExecution: true, + incrementalExecution: true, + printStackTrace: false, + daemon: true, + analyze: 0, + logLevel: Level { level: 20000, levelStr: 'INFO', colour: 'green' } +} +[2025-05-15T10:43:55.190] [DEBUG] debug-file - Since current hvigor version 5.17.0 differs from last hvigor version + undefined, delete file-cache.json and task-cache.json. +[2025-05-15T10:43:55.192] [DEBUG] debug-file - Cache service initialization finished in 4 ms +[2025-05-15T10:43:55.205] [DEBUG] debug-file - hvigorfile, resolving D:\LiuDongHai\FAQ最佳实践资料\BestPractices\BestPractices\DevelopmentPractice\NdkDrawing\hvigorfile.ts +[2025-05-15T10:43:56.803] [DEBUG] debug-file - hvigorfile, require result: { default: { plugins: [] } } +[2025-05-15T10:43:56.803] [DEBUG] debug-file - hvigorfile, binding system plugins null +[2025-05-15T10:43:56.987] [DEBUG] debug-file - hvigor build process will be closed with an error. +[2025-05-15T10:43:56.988] [DEBUG] debug-file - ERROR: stacktrace = Error: Invalid project path. + Detail: Please move the project to a valid path + at OhosLogger.errorMessageExit (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor\src\base\log\hvigor-log.js:1:3224) + at OhosLogger._printAllExit (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\src\utils\log\ohos-logger.js:1:1274) + at ProjectInspection.exitOnError (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\src\tasks\inspection\project-inspection.js:1:672) + at AppPlugin.doProjectInspection (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\src\plugin\common\abstract-project-plugin.js:1:1585) + at PluginFactory.getAppPlugin (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\src\plugin\factory\plugin-factory.js:1:2159) + at appTasks (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\index.js:1:593) + at bindSystemPlugins (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor\src\base\internal\lifecycle\configuration.js:1:5900) + at evaluateNodeVigorFile (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor\src\base\internal\lifecycle\configuration.js:1:8450) + at evalProject (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor\src\base\internal\lifecycle\configuration.js:1:3495) + at process.processTicksAndRejections (node:internal/process/task_queues:95:5) +[2025-05-15T10:43:56.989] [ERROR] debug-file - Error: Invalid project path. + Detail: Please move the project to a valid path + at OhosLogger.errorMessageExit (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor\src\base\log\hvigor-log.js:1:3224) + at OhosLogger._printAllExit (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\src\utils\log\ohos-logger.js:1:1274) + at ProjectInspection.exitOnError (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\src\tasks\inspection\project-inspection.js:1:672) + at AppPlugin.doProjectInspection (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\src\plugin\common\abstract-project-plugin.js:1:1585) + at PluginFactory.getAppPlugin (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\src\plugin\factory\plugin-factory.js:1:2159) + at appTasks (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\index.js:1:593) + at bindSystemPlugins (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor\src\base\internal\lifecycle\configuration.js:1:5900) + at evaluateNodeVigorFile (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor\src\base\internal\lifecycle\configuration.js:1:8450) + at evalProject (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor\src\base\internal\lifecycle\configuration.js:1:3495) + at process.processTicksAndRejections (node:internal/process/task_queues:95:5) +[2025-05-15T10:43:56.996] [WARN] debug-file - BUILD FAILED in 1 s 821 ms +[2025-05-15T10:43:57.007] [DEBUG] debug-file - Since there is no instance or instance is terminated, create a new worker pool. +[2025-05-15T10:43:57.007] [DEBUG] debug-file - Worker pool is initialized with config: { + minPoolNum: 2, + maxPoolNum: undefined, + maxCoreSize: undefined, + cacheCapacity: undefined, + cacheTtl: undefined +} +[2025-05-15T10:43:57.008] [DEBUG] debug-file - Create resident worker with id: 0. +[2025-05-15T10:43:57.010] [DEBUG] debug-file - session manager: send message to worker process. +[2025-05-15T10:43:57.010] [DEBUG] debug-file - session manager: send message to worker process. +[2025-05-15T10:43:57.011] [DEBUG] debug-file - Create resident worker with id: 1. +[2025-05-15T10:43:57.014] [DEBUG] debug-file - Cleanup worker 0. +[2025-05-15T10:43:57.014] [DEBUG] debug-file - Worker 0 has been cleaned up. +[2025-05-15T10:43:57.014] [DEBUG] debug-file - Current idle worker size: 1. +[2025-05-15T10:43:57.014] [DEBUG] debug-file - Current resident worker size: 2. +[2025-05-15T10:43:57.014] [DEBUG] debug-file - Cleanup worker 1. +[2025-05-15T10:43:57.014] [DEBUG] debug-file - Worker 1 has been cleaned up. +[2025-05-15T10:43:57.014] [DEBUG] debug-file - Current idle worker size: 0. +[2025-05-15T10:43:57.014] [DEBUG] debug-file - Current resident worker size: 2. +[2025-05-15T10:43:57.021] [DEBUG] debug-file - hvigor build process will be closed. +[2025-05-15T10:43:57.023] [DEBUG] debug-file - watch worker: worker id should be larger than 0. Nothing will be sent to any worker thread. +[2025-05-15T10:43:57.023] [DEBUG] debug-file - watch worker: worker id should be larger than 0. Nothing will be sent to any worker thread. +[2025-05-15T10:43:57.023] [DEBUG] debug-file - worker[0] exits with exit code 0. +[2025-05-15T10:43:57.024] [DEBUG] debug-file - worker[1] exits with exit code 0. diff --git a/NdkDrawing/.hvigor/outputs/logs/details/details.json b/NdkDrawing/.hvigor/outputs/logs/details/details.json new file mode 100644 index 0000000000000000000000000000000000000000..f0054bfd3b946170c21080cbe00552ce9fb9ff20 --- /dev/null +++ b/NdkDrawing/.hvigor/outputs/logs/details/details.json @@ -0,0 +1,24 @@ +{ + "HVIGOR_OHOS_PLUGIN": { + "MODULES": [ + { + "MODULE_NAME": "1043bfc77febe75fafec0c4309faccf1", + "API_TYPE": "stageMode" + } + ], + "BUILD_MODE": "debug" + }, + "HVIGOR": { + "IS_INCREMENTAL": true, + "IS_DAEMON": true, + "IS_PARALLEL": true, + "IS_HVIGORFILE_TYPE_CHECK": false, + "TASK_TIME": {}, + "BUILD_ID": "202505151043551730", + "ERROR_MESSAGE": { + "CODE": "00000", + "TIMESTAMP": "1747277036988" + }, + "TOTAL_TIME": 1820526000 + } +} \ No newline at end of file diff --git a/NdkDrawing/.hvigor/report/report-202505120909563440.json b/NdkDrawing/.hvigor/report/report-202505120909563440.json new file mode 100644 index 0000000000000000000000000000000000000000..1168e377dc06af460a446e5e9c97a5ea313448d8 --- /dev/null +++ b/NdkDrawing/.hvigor/report/report-202505120909563440.json @@ -0,0 +1,978 @@ +{ + "version": "2.0", + "ppid": 2224, + "events": [ + { + "head": { + "id": "1761e1a8-0dbe-4b99-aa78-a699113b6116", + "name": "env: nodejsVersion=v18.20.1", + "description": "", + "type": "log" + }, + "body": { + "pid": 6272, + "tid": "Main Thread", + "startTime": 250038335554900 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "5f7bcc1c-72e7-45de-9c1c-5115dced8eaa", + "name": "env: hvigor-config.json5 content = {\n modelVersion: '5.0.0',\n dependencies: {},\n execution: {},\n logging: {},\n debugging: {},\n nodeOptions: {}\n}", + "description": "", + "type": "log" + }, + "body": { + "pid": 6272, + "tid": "Main Thread", + "startTime": 250038338230700 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "9d8868d3-2673-40f5-adc3-e0ec1a7e1ae2", + "name": "env: daemon=false", + "description": "", + "type": "log" + }, + "body": { + "pid": 6272, + "tid": "Main Thread", + "startTime": 250038340630700 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "872b57c8-5f8c-4f5e-909d-3f7e62004440", + "name": "no-daemon, use the parent process.execArgv --max-old-space-size=8192,--expose-gc", + "description": "", + "type": "log" + }, + "body": { + "pid": 6272, + "tid": "Main Thread", + "startTime": 250038340712400 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "ee45ec13-052f-4c58-a015-414010f9cedb", + "name": "init", + "description": "Initialize and build task graph.", + "type": "duration" + }, + "body": { + "pid": 6272, + "tid": "Main Thread", + "startTime": 250038820121500 + }, + "additional": { + "children": [ + "3eb3d1ea-4fa5-49bc-8ede-47bd594e3758", + "cf59190f-11dc-4843-a523-770648fb16ff", + "762b1532-d223-46dd-899c-addd349ed7df", + "8c4a0234-fdfd-4e94-b974-86202bb2900f", + "d75a46ed-d8ff-4435-9b5d-61299ae2a899", + "6c9f2dc7-bab4-40a6-9f86-84f78e773892" + ], + "state": "running", + "targetName": "", + "moduleName": "", + "category": "Init", + "taskRunReasons": [] + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "3eb3d1ea-4fa5-49bc-8ede-47bd594e3758", + "name": "create hvigor project model", + "description": "Initialize hvigor project model.", + "type": "duration" + }, + "body": { + "pid": 6272, + "tid": "Main Thread", + "startTime": 250038820133600, + "endTime": 250038837385600 + }, + "additional": { + "children": [], + "state": "success", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "ee45ec13-052f-4c58-a015-414010f9cedb", + "logId": "d06a79f9-5105-4375-afe6-0dd56a6f745a" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "cf59190f-11dc-4843-a523-770648fb16ff", + "name": "configure hvigor plugin", + "description": "Configure hvigor plugin.", + "type": "duration" + }, + "body": { + "pid": 6272, + "tid": "Main Thread", + "startTime": 250038837416900 + }, + "additional": { + "children": [ + "b3beb9c7-137e-490f-a334-0c0fd658a369", + "524a528b-fc88-473a-bce2-91032c2ef58a", + "f8eeb494-1512-49e5-9fb6-d44add3f48e1", + "796405ab-69a6-405a-b36a-7b488a1f1482", + "63c4df69-0486-4883-b4c4-9e49ec94ed86", + "2da5d130-79a9-482b-a54e-4e68f37555b4", + "e6f56c71-08d4-4c6c-b9af-94a073883c07", + "bab0bce8-f46c-4bc9-a6b5-14941fda429c" + ], + "state": "running", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "ee45ec13-052f-4c58-a015-414010f9cedb" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "d75a46ed-d8ff-4435-9b5d-61299ae2a899", + "name": "\"configEvaluated\" hook function", + "description": "", + "type": "duration" + }, + "body": { + "pid": 6272, + "tid": "Main Thread", + "startTime": 250038825877400, + "endTime": 250038826164300 + }, + "additional": { + "children": [], + "state": "success", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "ee45ec13-052f-4c58-a015-414010f9cedb", + "logId": "81c9ba3c-15c1-408b-9399-e8f6b9c7e32c" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "81c9ba3c-15c1-408b-9399-e8f6b9c7e32c", + "name": "\"configEvaluated\" hook function", + "description": "", + "type": "log" + }, + "body": { + "pid": 6272, + "tid": "Main Thread", + "startTime": 250038825877400, + "endTime": 250038826164300 + }, + "additional": { + "logType": "info", + "children": [], + "durationId": "d75a46ed-d8ff-4435-9b5d-61299ae2a899" + } + }, + { + "head": { + "id": "6c9f2dc7-bab4-40a6-9f86-84f78e773892", + "name": "\"nodesInitialized\" hook function", + "description": "", + "type": "duration" + }, + "body": { + "pid": 6272, + "tid": "Main Thread", + "startTime": 250038834594700, + "endTime": 250038834665300 + }, + "additional": { + "children": [], + "state": "success", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "ee45ec13-052f-4c58-a015-414010f9cedb", + "logId": "8d3f9808-a389-42bf-9bdb-05848526b896" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "8d3f9808-a389-42bf-9bdb-05848526b896", + "name": "\"nodesInitialized\" hook function", + "description": "", + "type": "log" + }, + "body": { + "pid": 6272, + "tid": "Main Thread", + "startTime": 250038834594700, + "endTime": 250038834665300 + }, + "additional": { + "logType": "info", + "children": [], + "durationId": "6c9f2dc7-bab4-40a6-9f86-84f78e773892" + } + }, + { + "head": { + "id": "0ab5a5de-bca7-4dc9-b2d3-a382d333efa1", + "name": "Hvigor init with startParameters:{\n hvigorfileTypeCheck: false,\n parallelExecution: true,\n incrementalExecution: true,\n printStackTrace: false,\n daemon: false,\n analyze: 0,\n logLevel: Level { level: 20000, levelStr: 'INFO', colour: 'green' }\n}", + "description": "", + "type": "log" + }, + "body": { + "pid": 6272, + "tid": "Main Thread", + "startTime": 250038834903300 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "a18cf5fb-3d5b-4493-8c04-e97168c08d31", + "name": "Since current hvigor version 5.17.0 differs from last hvigor version \n undefined, delete file-cache.json and task-cache.json.", + "description": "", + "type": "log" + }, + "body": { + "pid": 6272, + "tid": "Main Thread", + "startTime": 250038836634300 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "c0c24c9d-417b-4671-868a-6207419165cd", + "name": "Cache service initialization finished in 2 ms ", + "description": "", + "type": "log" + }, + "body": { + "pid": 6272, + "tid": "Main Thread", + "startTime": 250038837209300 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "d06a79f9-5105-4375-afe6-0dd56a6f745a", + "name": "create hvigor project model", + "description": "", + "type": "log" + }, + "body": { + "pid": 6272, + "tid": "Main Thread", + "startTime": 250038820133600, + "endTime": 250038837385600 + }, + "additional": { + "logType": "info", + "children": [], + "durationId": "3eb3d1ea-4fa5-49bc-8ede-47bd594e3758" + } + }, + { + "head": { + "id": "b3beb9c7-137e-490f-a334-0c0fd658a369", + "name": "init configuration", + "description": "Initialize configuration.", + "type": "duration" + }, + "body": { + "pid": 6272, + "tid": "Main Thread", + "startTime": 250038846448800, + "endTime": 250038846495100 + }, + "additional": { + "children": [], + "state": "success", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "cf59190f-11dc-4843-a523-770648fb16ff", + "logId": "235107b1-203b-4aed-a6bf-5f3371f1efdd" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "524a528b-fc88-473a-bce2-91032c2ef58a", + "name": "configure project task", + "description": "Configure project task.", + "type": "duration" + }, + "body": { + "pid": 6272, + "tid": "Main Thread", + "startTime": 250038846538600, + "endTime": 250038854062900 + }, + "additional": { + "children": [], + "state": "success", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "cf59190f-11dc-4843-a523-770648fb16ff", + "logId": "bfed1a4e-ae6a-4bee-9933-2a35a39cc12d" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "f8eeb494-1512-49e5-9fb6-d44add3f48e1", + "name": "eval project", + "description": "Evaluate project.", + "type": "duration" + }, + "body": { + "pid": 6272, + "tid": "Main Thread", + "startTime": 250038854217200 + }, + "additional": { + "children": [ + "3bfb725a-a8a5-43e3-a7c0-7c4050a1d6c5", + "1513444d-6a4f-46bd-ac55-e59db72b275e" + ], + "state": "running", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "cf59190f-11dc-4843-a523-770648fb16ff" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "235107b1-203b-4aed-a6bf-5f3371f1efdd", + "name": "init configuration", + "description": "", + "type": "log" + }, + "body": { + "pid": 6272, + "tid": "Main Thread", + "startTime": 250038846448800, + "endTime": 250038846495100 + }, + "additional": { + "logType": "info", + "children": [], + "durationId": "b3beb9c7-137e-490f-a334-0c0fd658a369" + } + }, + { + "head": { + "id": "bfed1a4e-ae6a-4bee-9933-2a35a39cc12d", + "name": "configure project task", + "description": "", + "type": "log" + }, + "body": { + "pid": 6272, + "tid": "Main Thread", + "startTime": 250038846538600, + "endTime": 250038854062900 + }, + "additional": { + "logType": "info", + "children": [], + "durationId": "524a528b-fc88-473a-bce2-91032c2ef58a" + } + }, + { + "head": { + "id": "3bfb725a-a8a5-43e3-a7c0-7c4050a1d6c5", + "name": "\"beforeNodeEvaluate\" hook function", + "description": "", + "type": "duration" + }, + "body": { + "pid": 6272, + "tid": "Main Thread", + "startTime": 250038855531800, + "endTime": 250038855628700 + }, + "additional": { + "children": [], + "state": "success", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "f8eeb494-1512-49e5-9fb6-d44add3f48e1", + "logId": "f8fdcb05-1597-4789-af85-04c2669b316c" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "f8fdcb05-1597-4789-af85-04c2669b316c", + "name": "\"beforeNodeEvaluate\" hook function", + "description": "", + "type": "log" + }, + "body": { + "pid": 6272, + "tid": "Main Thread", + "startTime": 250038855531800, + "endTime": 250038855628700 + }, + "additional": { + "logType": "info", + "children": [], + "durationId": "3bfb725a-a8a5-43e3-a7c0-7c4050a1d6c5" + } + }, + { + "head": { + "id": "1513444d-6a4f-46bd-ac55-e59db72b275e", + "name": "eval hvigorfile", + "description": "Evaluate hvigorfile.", + "type": "duration" + }, + "body": { + "pid": 6272, + "tid": "Main Thread", + "startTime": 250038859145600 + }, + "additional": { + "children": [ + "39199485-e981-4da3-b033-dbd01ce04100", + "544d70e4-bf18-4c17-b297-a1024abe8475" + ], + "state": "running", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "f8eeb494-1512-49e5-9fb6-d44add3f48e1" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "39199485-e981-4da3-b033-dbd01ce04100", + "name": "require hvigorfile", + "description": "Require hvigorfile.", + "type": "duration" + }, + "body": { + "pid": 6272, + "tid": "Main Thread", + "startTime": 250038859147400, + "endTime": 250040479927100 + }, + "additional": { + "children": [], + "state": "success", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "1513444d-6a4f-46bd-ac55-e59db72b275e", + "logId": "e9746ad6-a45f-4814-accf-7d34083f9e37" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "544d70e4-bf18-4c17-b297-a1024abe8475", + "name": "bind plugins", + "description": "Bind plugins.", + "type": "duration" + }, + "body": { + "pid": 6272, + "tid": "Main Thread", + "startTime": 250040479953900 + }, + "additional": { + "children": [], + "state": "running", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "1513444d-6a4f-46bd-ac55-e59db72b275e" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "5c824b81-6859-425b-a1cf-1c30e557c674", + "name": "hvigorfile, resolving D:\\LiuDongHai\\FAQ最佳实践资料\\BestPractices\\BestPractices\\DevelopmentPractice\\NdkDrawing\\hvigorfile.ts", + "description": "", + "type": "log" + }, + "body": { + "pid": 6272, + "tid": "Main Thread", + "startTime": 250038859155900 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "8a084751-2db2-4922-b769-2d712e9d4279", + "name": "hvigorfile, require result: { default: { system: [Function: appTasks], plugins: [] } }", + "description": "", + "type": "log" + }, + "body": { + "pid": 6272, + "tid": "Main Thread", + "startTime": 250040479540100 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "e9746ad6-a45f-4814-accf-7d34083f9e37", + "name": "require hvigorfile", + "description": "", + "type": "log" + }, + "body": { + "pid": 6272, + "tid": "Main Thread", + "startTime": 250038859147400, + "endTime": 250040479927100 + }, + "additional": { + "logType": "info", + "children": [], + "durationId": "39199485-e981-4da3-b033-dbd01ce04100" + } + }, + { + "head": { + "id": "b117e031-7901-4a38-aa23-05f9b2e0bee6", + "name": "hvigorfile, binding system plugins [Function: appTasks]", + "description": "", + "type": "log" + }, + "body": { + "pid": 6272, + "tid": "Main Thread", + "startTime": 250040480069500 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "af324bcd-045b-4bc4-878f-2870011968a7", + "name": "hvigor build process will be closed with an error.", + "description": "", + "type": "log" + }, + "body": { + "pid": 6272, + "tid": "Main Thread", + "startTime": 250040675728900 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "933add4e-1fdc-4ea3-ae3a-7929be34efd3", + "name": "ERROR: stacktrace = Error: Invalid project path.\r\n\t Detail: Please move the project to a valid path\n at OhosLogger.errorMessageExit (D:\\LiuDongHai\\DevEco Studio\\tools\\hvigor\\hvigor\\src\\base\\log\\hvigor-log.js:1:3224)\n at OhosLogger._printAllExit (D:\\LiuDongHai\\DevEco Studio\\tools\\hvigor\\hvigor-ohos-plugin\\src\\utils\\log\\ohos-logger.js:1:1274)\n at ProjectInspection.exitOnError (D:\\LiuDongHai\\DevEco Studio\\tools\\hvigor\\hvigor-ohos-plugin\\src\\tasks\\inspection\\project-inspection.js:1:672)\n at AppPlugin.doProjectInspection (D:\\LiuDongHai\\DevEco Studio\\tools\\hvigor\\hvigor-ohos-plugin\\src\\plugin\\common\\abstract-project-plugin.js:1:1585)\n at PluginFactory.getAppPlugin (D:\\LiuDongHai\\DevEco Studio\\tools\\hvigor\\hvigor-ohos-plugin\\src\\plugin\\factory\\plugin-factory.js:1:2159)\n at appTasks (D:\\LiuDongHai\\DevEco Studio\\tools\\hvigor\\hvigor-ohos-plugin\\index.js:1:593)\n at bindSystemPlugins (D:\\LiuDongHai\\DevEco Studio\\tools\\hvigor\\hvigor\\src\\base\\internal\\lifecycle\\configuration.js:1:5900)\n at evaluateNodeVigorFile (D:\\LiuDongHai\\DevEco Studio\\tools\\hvigor\\hvigor\\src\\base\\internal\\lifecycle\\configuration.js:1:8450)\n at evalProject (D:\\LiuDongHai\\DevEco Studio\\tools\\hvigor\\hvigor\\src\\base\\internal\\lifecycle\\configuration.js:1:3495)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)", + "description": "", + "type": "log" + }, + "body": { + "pid": 6272, + "tid": "Main Thread", + "startTime": 250040677473500 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "d9dd1cb9-4888-48a9-bb15-2f22973c9397", + "name": "\"buildFinished\" hook function", + "description": "", + "type": "duration" + }, + "body": { + "pid": 6272, + "tid": "Main Thread", + "startTime": 250040683523500, + "endTime": 250040683711900 + }, + "additional": { + "children": [], + "state": "success", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "968272d6-8b89-450a-86bb-a6c7194e8776", + "logId": "e40ec2d6-bdc5-412a-a8ad-f1d7b10aa394" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "e40ec2d6-bdc5-412a-a8ad-f1d7b10aa394", + "name": "\"buildFinished\" hook function", + "description": "", + "type": "log" + }, + "body": { + "pid": 6272, + "tid": "Main Thread", + "startTime": 250040683523500, + "endTime": 250040683711900 + }, + "additional": { + "logType": "info", + "children": [], + "durationId": "d9dd1cb9-4888-48a9-bb15-2f22973c9397" + } + }, + { + "head": { + "id": "4f9fee12-bcba-4071-880a-093d734ae184", + "name": "", + "description": "", + "type": "mark" + }, + "body": { + "pid": 6272, + "tid": "Main Thread", + "startTime": 250038814464100, + "endTime": 250040684642500 + }, + "additional": { + "time": { + "year": 2025, + "month": 5, + "day": 12, + "hour": 9, + "minute": 9 + }, + "completeCommand": "{\"prop\":[\"product=default\"],\"sync\":true,\"parallel\":true,\"incremental\":true,\"daemon\":false,\"_\":[],\"analyze\":\"normal\"};--sync -p product=default --analyze=normal --parallel --incremental --no-daemon", + "hvigorVersion": "5.17.0", + "markType": "history", + "nodeVersion": "v18.20.1", + "category": "build", + "state": "failed" + } + }, + { + "head": { + "id": "2527f2cf-9843-4762-8d86-ed0dce2180db", + "name": "BUILD FAILED in 1 s 870 ms ", + "description": "", + "type": "log" + }, + "body": { + "pid": 6272, + "tid": "Main Thread", + "startTime": 250040684737100 + }, + "additional": { + "logType": "error", + "children": [] + } + } + ] +} \ No newline at end of file diff --git a/NdkDrawing/.hvigor/report/report-202505120928290690.json b/NdkDrawing/.hvigor/report/report-202505120928290690.json new file mode 100644 index 0000000000000000000000000000000000000000..16706b83f6e493ee2fbbc0408db0982e1213aa6a --- /dev/null +++ b/NdkDrawing/.hvigor/report/report-202505120928290690.json @@ -0,0 +1,927 @@ +{ + "version": "2.0", + "ppid": 4028, + "events": [ + { + "head": { + "id": "4e838806-c18a-4f92-a477-625dbd868ec3", + "name": "watch worker: worker id should be larger than 0. Nothing will be sent to any worker thread.", + "description": "", + "type": "log" + }, + "body": { + "pid": 12652, + "tid": "Main Thread", + "startTime": 251151534241800 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "cd15b9da-06c5-4eb5-9286-fff7fe7601f5", + "name": "init", + "description": "Initialize and build task graph.", + "type": "duration" + }, + "body": { + "pid": 12652, + "tid": "Main Thread", + "startTime": 251151544099900 + }, + "additional": { + "children": [ + "0578f77c-9246-473f-afba-4bc38c51ce52", + "6338d641-34c0-43e0-aa0f-87bc041ec951", + "8d1ee832-5655-4eed-a833-89f79438f3b7", + "ade36713-01e2-4d8f-a546-771f08ae5728", + "fa450838-c670-4fe2-a110-ac946506f5d1", + "92468440-ed7f-4f47-a203-471410b8d4cd" + ], + "state": "running", + "targetName": "", + "moduleName": "", + "category": "Init", + "taskRunReasons": [] + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "0578f77c-9246-473f-afba-4bc38c51ce52", + "name": "create hvigor project model", + "description": "Initialize hvigor project model.", + "type": "duration" + }, + "body": { + "pid": 12652, + "tid": "Main Thread", + "startTime": 251151544104100, + "endTime": 251151558690600 + }, + "additional": { + "children": [], + "state": "success", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "cd15b9da-06c5-4eb5-9286-fff7fe7601f5", + "logId": "988b8eba-4925-4f5b-b0b5-0de25975a27e" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "6338d641-34c0-43e0-aa0f-87bc041ec951", + "name": "configure hvigor plugin", + "description": "Configure hvigor plugin.", + "type": "duration" + }, + "body": { + "pid": 12652, + "tid": "Main Thread", + "startTime": 251151558714700 + }, + "additional": { + "children": [ + "19394625-d9da-4634-b148-2ce98680c47c", + "09671cc6-2825-471b-ad33-7da9267eef6a", + "c65b6242-ce6c-49ca-8beb-23e2bb202161", + "1a3e4ead-bfa1-4e01-aba0-bfaf32313f76", + "818a0ac2-fff4-48c2-a90c-a99a24711e4d", + "22c1bfcc-0024-44a2-8a22-d923e219689a", + "8c01bad9-7ed4-4123-a885-61f61d87b44c", + "0c40a3ce-aaf4-44d3-96e0-87f22ec30ebb" + ], + "state": "running", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "cd15b9da-06c5-4eb5-9286-fff7fe7601f5" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "fa450838-c670-4fe2-a110-ac946506f5d1", + "name": "\"configEvaluated\" hook function", + "description": "", + "type": "duration" + }, + "body": { + "pid": 12652, + "tid": "Main Thread", + "startTime": 251151548157400, + "endTime": 251151548598800 + }, + "additional": { + "children": [], + "state": "success", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "cd15b9da-06c5-4eb5-9286-fff7fe7601f5", + "logId": "73dcc622-c86e-45d3-8ee8-7dbafd460d3c" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "73dcc622-c86e-45d3-8ee8-7dbafd460d3c", + "name": "\"configEvaluated\" hook function", + "description": "", + "type": "log" + }, + "body": { + "pid": 12652, + "tid": "Main Thread", + "startTime": 251151548157400, + "endTime": 251151548598800 + }, + "additional": { + "logType": "info", + "children": [], + "durationId": "fa450838-c670-4fe2-a110-ac946506f5d1" + } + }, + { + "head": { + "id": "92468440-ed7f-4f47-a203-471410b8d4cd", + "name": "\"nodesInitialized\" hook function", + "description": "", + "type": "duration" + }, + "body": { + "pid": 12652, + "tid": "Main Thread", + "startTime": 251151553996000, + "endTime": 251151554096000 + }, + "additional": { + "children": [], + "state": "success", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "cd15b9da-06c5-4eb5-9286-fff7fe7601f5", + "logId": "0d320f3b-31ff-4c11-add5-6d89ea9731fc" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "0d320f3b-31ff-4c11-add5-6d89ea9731fc", + "name": "\"nodesInitialized\" hook function", + "description": "", + "type": "log" + }, + "body": { + "pid": 12652, + "tid": "Main Thread", + "startTime": 251151553996000, + "endTime": 251151554096000 + }, + "additional": { + "logType": "info", + "children": [], + "durationId": "92468440-ed7f-4f47-a203-471410b8d4cd" + } + }, + { + "head": { + "id": "fd72b6ce-cb70-46a0-89e0-567d301dfd73", + "name": "Hvigor init with startParameters:{\n hvigorfileTypeCheck: false,\n parallelExecution: true,\n incrementalExecution: true,\n printStackTrace: false,\n daemon: true,\n analyze: 0,\n logLevel: Level { level: 20000, levelStr: 'INFO', colour: 'green' }\n}", + "description": "", + "type": "log" + }, + "body": { + "pid": 12652, + "tid": "Main Thread", + "startTime": 251151554810300 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "e13c4103-b15a-4b5e-aa67-7f701d86090e", + "name": "Since current hvigor version 5.17.0 differs from last hvigor version \n undefined, delete file-cache.json and task-cache.json.", + "description": "", + "type": "log" + }, + "body": { + "pid": 12652, + "tid": "Main Thread", + "startTime": 251151556586500 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "043330ed-677c-4bfb-9f7e-58a04559932e", + "name": "Cache service initialization finished in 4 ms ", + "description": "", + "type": "log" + }, + "body": { + "pid": 12652, + "tid": "Main Thread", + "startTime": 251151558581200 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "988b8eba-4925-4f5b-b0b5-0de25975a27e", + "name": "create hvigor project model", + "description": "", + "type": "log" + }, + "body": { + "pid": 12652, + "tid": "Main Thread", + "startTime": 251151544104100, + "endTime": 251151558690600 + }, + "additional": { + "logType": "info", + "children": [], + "durationId": "0578f77c-9246-473f-afba-4bc38c51ce52" + } + }, + { + "head": { + "id": "19394625-d9da-4634-b148-2ce98680c47c", + "name": "init configuration", + "description": "Initialize configuration.", + "type": "duration" + }, + "body": { + "pid": 12652, + "tid": "Main Thread", + "startTime": 251151563687600, + "endTime": 251151563723500 + }, + "additional": { + "children": [], + "state": "success", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "6338d641-34c0-43e0-aa0f-87bc041ec951", + "logId": "6dcfbe81-c25e-4c10-beb6-286b8443e2c4" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "09671cc6-2825-471b-ad33-7da9267eef6a", + "name": "configure project task", + "description": "Configure project task.", + "type": "duration" + }, + "body": { + "pid": 12652, + "tid": "Main Thread", + "startTime": 251151563765800, + "endTime": 251151568015400 + }, + "additional": { + "children": [], + "state": "success", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "6338d641-34c0-43e0-aa0f-87bc041ec951", + "logId": "3b5daa29-b916-463f-8f4e-77fd0c57d76a" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "c65b6242-ce6c-49ca-8beb-23e2bb202161", + "name": "eval project", + "description": "Evaluate project.", + "type": "duration" + }, + "body": { + "pid": 12652, + "tid": "Main Thread", + "startTime": 251151568122800 + }, + "additional": { + "children": [ + "23d4dc5a-958d-45f0-ac99-50a9301247de", + "d6d701fb-659e-4a89-b6b4-0fc3823ac886" + ], + "state": "running", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "6338d641-34c0-43e0-aa0f-87bc041ec951" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "6dcfbe81-c25e-4c10-beb6-286b8443e2c4", + "name": "init configuration", + "description": "", + "type": "log" + }, + "body": { + "pid": 12652, + "tid": "Main Thread", + "startTime": 251151563687600, + "endTime": 251151563723500 + }, + "additional": { + "logType": "info", + "children": [], + "durationId": "19394625-d9da-4634-b148-2ce98680c47c" + } + }, + { + "head": { + "id": "3b5daa29-b916-463f-8f4e-77fd0c57d76a", + "name": "configure project task", + "description": "", + "type": "log" + }, + "body": { + "pid": 12652, + "tid": "Main Thread", + "startTime": 251151563765800, + "endTime": 251151568015400 + }, + "additional": { + "logType": "info", + "children": [], + "durationId": "09671cc6-2825-471b-ad33-7da9267eef6a" + } + }, + { + "head": { + "id": "23d4dc5a-958d-45f0-ac99-50a9301247de", + "name": "\"beforeNodeEvaluate\" hook function", + "description": "", + "type": "duration" + }, + "body": { + "pid": 12652, + "tid": "Main Thread", + "startTime": 251151568858800, + "endTime": 251151568993600 + }, + "additional": { + "children": [], + "state": "success", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "c65b6242-ce6c-49ca-8beb-23e2bb202161", + "logId": "fcdca185-e240-40d6-bc54-d071a0e0f5e4" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "fcdca185-e240-40d6-bc54-d071a0e0f5e4", + "name": "\"beforeNodeEvaluate\" hook function", + "description": "", + "type": "log" + }, + "body": { + "pid": 12652, + "tid": "Main Thread", + "startTime": 251151568858800, + "endTime": 251151568993600 + }, + "additional": { + "logType": "info", + "children": [], + "durationId": "23d4dc5a-958d-45f0-ac99-50a9301247de" + } + }, + { + "head": { + "id": "d6d701fb-659e-4a89-b6b4-0fc3823ac886", + "name": "eval hvigorfile", + "description": "Evaluate hvigorfile.", + "type": "duration" + }, + "body": { + "pid": 12652, + "tid": "Main Thread", + "startTime": 251151571012400 + }, + "additional": { + "children": [ + "115dc393-42df-4c0d-9119-a7434809d9a6", + "01f3aeef-74e8-4c72-a52d-6cd6067c7f17" + ], + "state": "running", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "c65b6242-ce6c-49ca-8beb-23e2bb202161" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "115dc393-42df-4c0d-9119-a7434809d9a6", + "name": "require hvigorfile", + "description": "Require hvigorfile.", + "type": "duration" + }, + "body": { + "pid": 12652, + "tid": "Main Thread", + "startTime": 251151571013400, + "endTime": 251153204650100 + }, + "additional": { + "children": [], + "state": "success", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "d6d701fb-659e-4a89-b6b4-0fc3823ac886", + "logId": "c4e48928-c11d-4710-9dff-2185cf2acd42" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "01f3aeef-74e8-4c72-a52d-6cd6067c7f17", + "name": "bind plugins", + "description": "Bind plugins.", + "type": "duration" + }, + "body": { + "pid": 12652, + "tid": "Main Thread", + "startTime": 251153204676400 + }, + "additional": { + "children": [], + "state": "running", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "d6d701fb-659e-4a89-b6b4-0fc3823ac886" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "216241b4-bcff-4c02-9b5a-0f3f2aa7e57a", + "name": "hvigorfile, resolving D:\\LiuDongHai\\FAQ最佳实践资料\\BestPractices\\BestPractices\\DevelopmentPractice\\NdkDrawing\\hvigorfile.ts", + "description": "", + "type": "log" + }, + "body": { + "pid": 12652, + "tid": "Main Thread", + "startTime": 251151571018700 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "958cd7a5-9507-49ae-84c4-efa7446e91fa", + "name": "hvigorfile, require result: { default: { system: [Function: appTasks], plugins: [] } }", + "description": "", + "type": "log" + }, + "body": { + "pid": 12652, + "tid": "Main Thread", + "startTime": 251153204516300 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "c4e48928-c11d-4710-9dff-2185cf2acd42", + "name": "require hvigorfile", + "description": "", + "type": "log" + }, + "body": { + "pid": 12652, + "tid": "Main Thread", + "startTime": 251151571013400, + "endTime": 251153204650100 + }, + "additional": { + "logType": "info", + "children": [], + "durationId": "115dc393-42df-4c0d-9119-a7434809d9a6" + } + }, + { + "head": { + "id": "60d710ec-48b2-46c2-b5a2-e701d9180d57", + "name": "hvigorfile, binding system plugins [Function: appTasks]", + "description": "", + "type": "log" + }, + "body": { + "pid": 12652, + "tid": "Main Thread", + "startTime": 251153204787000 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "77a236ff-31c4-48cf-859c-3066bc22a631", + "name": "hvigor build process will be closed with an error.", + "description": "", + "type": "log" + }, + "body": { + "pid": 12652, + "tid": "Main Thread", + "startTime": 251153403958500 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "d1cd5f7d-4bea-406b-8c14-beff8c66d670", + "name": "ERROR: stacktrace = Error: Invalid project path.\r\n\t Detail: Please move the project to a valid path\n at OhosLogger.errorMessageExit (D:\\LiuDongHai\\DevEco Studio\\tools\\hvigor\\hvigor\\src\\base\\log\\hvigor-log.js:1:3224)\n at OhosLogger._printAllExit (D:\\LiuDongHai\\DevEco Studio\\tools\\hvigor\\hvigor-ohos-plugin\\src\\utils\\log\\ohos-logger.js:1:1274)\n at ProjectInspection.exitOnError (D:\\LiuDongHai\\DevEco Studio\\tools\\hvigor\\hvigor-ohos-plugin\\src\\tasks\\inspection\\project-inspection.js:1:672)\n at AppPlugin.doProjectInspection (D:\\LiuDongHai\\DevEco Studio\\tools\\hvigor\\hvigor-ohos-plugin\\src\\plugin\\common\\abstract-project-plugin.js:1:1585)\n at PluginFactory.getAppPlugin (D:\\LiuDongHai\\DevEco Studio\\tools\\hvigor\\hvigor-ohos-plugin\\src\\plugin\\factory\\plugin-factory.js:1:2159)\n at appTasks (D:\\LiuDongHai\\DevEco Studio\\tools\\hvigor\\hvigor-ohos-plugin\\index.js:1:593)\n at bindSystemPlugins (D:\\LiuDongHai\\DevEco Studio\\tools\\hvigor\\hvigor\\src\\base\\internal\\lifecycle\\configuration.js:1:5900)\n at evaluateNodeVigorFile (D:\\LiuDongHai\\DevEco Studio\\tools\\hvigor\\hvigor\\src\\base\\internal\\lifecycle\\configuration.js:1:8450)\n at evalProject (D:\\LiuDongHai\\DevEco Studio\\tools\\hvigor\\hvigor\\src\\base\\internal\\lifecycle\\configuration.js:1:3495)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)", + "description": "", + "type": "log" + }, + "body": { + "pid": 12652, + "tid": "Main Thread", + "startTime": 251153405182800 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "47b45b33-a1bf-4b08-affd-89ad613c2ab0", + "name": "\"buildFinished\" hook function", + "description": "", + "type": "duration" + }, + "body": { + "pid": 12652, + "tid": "Main Thread", + "startTime": 251153410604400, + "endTime": 251153410738300 + }, + "additional": { + "children": [], + "state": "success", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "2b8ca496-095e-4e88-835d-6876bf517840", + "logId": "078e4a21-4756-45db-bb99-cae2cee25d48" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "078e4a21-4756-45db-bb99-cae2cee25d48", + "name": "\"buildFinished\" hook function", + "description": "", + "type": "log" + }, + "body": { + "pid": 12652, + "tid": "Main Thread", + "startTime": 251153410604400, + "endTime": 251153410738300 + }, + "additional": { + "logType": "info", + "children": [], + "durationId": "47b45b33-a1bf-4b08-affd-89ad613c2ab0" + } + }, + { + "head": { + "id": "525e6e5f-b354-4d56-8426-a8516a70d12c", + "name": "", + "description": "", + "type": "mark" + }, + "body": { + "pid": 12652, + "tid": "Main Thread", + "startTime": 251151540154700, + "endTime": 251153411477600 + }, + "additional": { + "time": { + "year": 2025, + "month": 5, + "day": 12, + "hour": 9, + "minute": 28 + }, + "completeCommand": "{\"prop\":[\"product=default\"],\"sync\":true,\"parallel\":true,\"incremental\":true,\"daemon\":true,\"_\":[],\"analyze\":\"normal\"};", + "hvigorVersion": "5.17.0", + "markType": "history", + "nodeVersion": "v18.20.1", + "category": "build", + "state": "failed" + } + }, + { + "head": { + "id": "d228d18e-eb44-4582-a396-95f7bc6fa123", + "name": "BUILD FAILED in 1 s 871 ms ", + "description": "", + "type": "log" + }, + "body": { + "pid": 12652, + "tid": "Main Thread", + "startTime": 251153411598000 + }, + "additional": { + "logType": "error", + "children": [] + } + } + ] +} \ No newline at end of file diff --git a/NdkDrawing/.hvigor/report/report-202505121520553500.json b/NdkDrawing/.hvigor/report/report-202505121520553500.json new file mode 100644 index 0000000000000000000000000000000000000000..477699ce9b6f45fd467b9a8b4c4b7d069e62da47 --- /dev/null +++ b/NdkDrawing/.hvigor/report/report-202505121520553500.json @@ -0,0 +1,927 @@ +{ + "version": "2.0", + "ppid": 14032, + "events": [ + { + "head": { + "id": "bfcebb94-23a7-4ff0-ac91-df40af618ac9", + "name": "watch worker: worker id should be larger than 0. Nothing will be sent to any worker thread.", + "description": "", + "type": "log" + }, + "body": { + "pid": 9368, + "tid": "Main Thread", + "startTime": 272297923174200 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "832c131a-e642-49f6-9373-8707cdf7e6ef", + "name": "init", + "description": "Initialize and build task graph.", + "type": "duration" + }, + "body": { + "pid": 9368, + "tid": "Main Thread", + "startTime": 272297934377300 + }, + "additional": { + "children": [ + "956a6fe2-b06d-4320-9d94-fb688fd3c526", + "c881c9a8-f980-464d-91de-b5501b581941", + "90a3c030-04c1-4ee6-994a-a35a920c0c09", + "65615aba-2ce9-4f31-9b16-eaa534401e42", + "1c76ead7-c580-4b1b-a703-acb8127cf08c", + "24804ea3-1a36-4c20-afaa-4e70d65761ef" + ], + "state": "running", + "targetName": "", + "moduleName": "", + "category": "Init", + "taskRunReasons": [] + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "956a6fe2-b06d-4320-9d94-fb688fd3c526", + "name": "create hvigor project model", + "description": "Initialize hvigor project model.", + "type": "duration" + }, + "body": { + "pid": 9368, + "tid": "Main Thread", + "startTime": 272297934381700, + "endTime": 272297948954800 + }, + "additional": { + "children": [], + "state": "success", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "832c131a-e642-49f6-9373-8707cdf7e6ef", + "logId": "9164b0db-3756-4707-b548-3a7547e0602c" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "c881c9a8-f980-464d-91de-b5501b581941", + "name": "configure hvigor plugin", + "description": "Configure hvigor plugin.", + "type": "duration" + }, + "body": { + "pid": 9368, + "tid": "Main Thread", + "startTime": 272297948976400 + }, + "additional": { + "children": [ + "7529e2d9-3fda-483f-b2f1-a3603928708d", + "59596e1e-d1c2-4ff8-b3dd-a43c18061a46", + "70b0e742-9d3d-49d8-a012-77ac12d2d8d4", + "fbdff17f-1048-4ba1-bca9-cbf8b1eae0f3", + "503ea05c-6637-438f-a03d-e4062325bec8", + "d5726918-3f5b-4f45-8128-9254e6f39aa5", + "22aefa5a-1790-4924-8d6b-2555d3a5ec7b", + "4a3c56c2-436b-4af9-b560-f25d768354e1" + ], + "state": "running", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "832c131a-e642-49f6-9373-8707cdf7e6ef" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "1c76ead7-c580-4b1b-a703-acb8127cf08c", + "name": "\"configEvaluated\" hook function", + "description": "", + "type": "duration" + }, + "body": { + "pid": 9368, + "tid": "Main Thread", + "startTime": 272297938266900, + "endTime": 272297938585900 + }, + "additional": { + "children": [], + "state": "success", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "832c131a-e642-49f6-9373-8707cdf7e6ef", + "logId": "3c77526b-77f8-472d-979a-ec0bdf36f041" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "3c77526b-77f8-472d-979a-ec0bdf36f041", + "name": "\"configEvaluated\" hook function", + "description": "", + "type": "log" + }, + "body": { + "pid": 9368, + "tid": "Main Thread", + "startTime": 272297938266900, + "endTime": 272297938585900 + }, + "additional": { + "logType": "info", + "children": [], + "durationId": "1c76ead7-c580-4b1b-a703-acb8127cf08c" + } + }, + { + "head": { + "id": "24804ea3-1a36-4c20-afaa-4e70d65761ef", + "name": "\"nodesInitialized\" hook function", + "description": "", + "type": "duration" + }, + "body": { + "pid": 9368, + "tid": "Main Thread", + "startTime": 272297943643700, + "endTime": 272297943688200 + }, + "additional": { + "children": [], + "state": "success", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "832c131a-e642-49f6-9373-8707cdf7e6ef", + "logId": "995e7ff3-298c-46af-8d8e-4995d1bd1a40" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "995e7ff3-298c-46af-8d8e-4995d1bd1a40", + "name": "\"nodesInitialized\" hook function", + "description": "", + "type": "log" + }, + "body": { + "pid": 9368, + "tid": "Main Thread", + "startTime": 272297943643700, + "endTime": 272297943688200 + }, + "additional": { + "logType": "info", + "children": [], + "durationId": "24804ea3-1a36-4c20-afaa-4e70d65761ef" + } + }, + { + "head": { + "id": "97a31f9d-5011-4c7e-8a6b-9c0f4ddb4b17", + "name": "Hvigor init with startParameters:{\n hvigorfileTypeCheck: false,\n parallelExecution: true,\n incrementalExecution: true,\n printStackTrace: false,\n daemon: true,\n analyze: 0,\n logLevel: Level { level: 20000, levelStr: 'INFO', colour: 'green' }\n}", + "description": "", + "type": "log" + }, + "body": { + "pid": 9368, + "tid": "Main Thread", + "startTime": 272297944451000 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "cf991e9e-16d7-4a8d-abfe-00668648d098", + "name": "Since current hvigor version 5.17.0 differs from last hvigor version \n undefined, delete file-cache.json and task-cache.json.", + "description": "", + "type": "log" + }, + "body": { + "pid": 9368, + "tid": "Main Thread", + "startTime": 272297946249600 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "df0338fc-7b7b-49f8-8880-08c1a5e14cd9", + "name": "Cache service initialization finished in 4 ms ", + "description": "", + "type": "log" + }, + "body": { + "pid": 9368, + "tid": "Main Thread", + "startTime": 272297948822100 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "9164b0db-3756-4707-b548-3a7547e0602c", + "name": "create hvigor project model", + "description": "", + "type": "log" + }, + "body": { + "pid": 9368, + "tid": "Main Thread", + "startTime": 272297934381700, + "endTime": 272297948954800 + }, + "additional": { + "logType": "info", + "children": [], + "durationId": "956a6fe2-b06d-4320-9d94-fb688fd3c526" + } + }, + { + "head": { + "id": "7529e2d9-3fda-483f-b2f1-a3603928708d", + "name": "init configuration", + "description": "Initialize configuration.", + "type": "duration" + }, + "body": { + "pid": 9368, + "tid": "Main Thread", + "startTime": 272297954267600, + "endTime": 272297954316200 + }, + "additional": { + "children": [], + "state": "success", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "c881c9a8-f980-464d-91de-b5501b581941", + "logId": "24e07efc-d385-4595-be4a-2ff37eda9b12" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "59596e1e-d1c2-4ff8-b3dd-a43c18061a46", + "name": "configure project task", + "description": "Configure project task.", + "type": "duration" + }, + "body": { + "pid": 9368, + "tid": "Main Thread", + "startTime": 272297954360800, + "endTime": 272297958688200 + }, + "additional": { + "children": [], + "state": "success", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "c881c9a8-f980-464d-91de-b5501b581941", + "logId": "fe3702cf-2e98-436b-8191-3dabe5fd5f0f" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "70b0e742-9d3d-49d8-a012-77ac12d2d8d4", + "name": "eval project", + "description": "Evaluate project.", + "type": "duration" + }, + "body": { + "pid": 9368, + "tid": "Main Thread", + "startTime": 272297958799100 + }, + "additional": { + "children": [ + "bcfc236b-0832-4b49-976e-33e5763ad033", + "ceb90405-2162-41c4-83f8-3e504fd6fc3c" + ], + "state": "running", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "c881c9a8-f980-464d-91de-b5501b581941" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "24e07efc-d385-4595-be4a-2ff37eda9b12", + "name": "init configuration", + "description": "", + "type": "log" + }, + "body": { + "pid": 9368, + "tid": "Main Thread", + "startTime": 272297954267600, + "endTime": 272297954316200 + }, + "additional": { + "logType": "info", + "children": [], + "durationId": "7529e2d9-3fda-483f-b2f1-a3603928708d" + } + }, + { + "head": { + "id": "fe3702cf-2e98-436b-8191-3dabe5fd5f0f", + "name": "configure project task", + "description": "", + "type": "log" + }, + "body": { + "pid": 9368, + "tid": "Main Thread", + "startTime": 272297954360800, + "endTime": 272297958688200 + }, + "additional": { + "logType": "info", + "children": [], + "durationId": "59596e1e-d1c2-4ff8-b3dd-a43c18061a46" + } + }, + { + "head": { + "id": "bcfc236b-0832-4b49-976e-33e5763ad033", + "name": "\"beforeNodeEvaluate\" hook function", + "description": "", + "type": "duration" + }, + "body": { + "pid": 9368, + "tid": "Main Thread", + "startTime": 272297959534200, + "endTime": 272297959668400 + }, + "additional": { + "children": [], + "state": "success", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "70b0e742-9d3d-49d8-a012-77ac12d2d8d4", + "logId": "6d299230-b488-4a66-80e0-8436cec0884b" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "6d299230-b488-4a66-80e0-8436cec0884b", + "name": "\"beforeNodeEvaluate\" hook function", + "description": "", + "type": "log" + }, + "body": { + "pid": 9368, + "tid": "Main Thread", + "startTime": 272297959534200, + "endTime": 272297959668400 + }, + "additional": { + "logType": "info", + "children": [], + "durationId": "bcfc236b-0832-4b49-976e-33e5763ad033" + } + }, + { + "head": { + "id": "ceb90405-2162-41c4-83f8-3e504fd6fc3c", + "name": "eval hvigorfile", + "description": "Evaluate hvigorfile.", + "type": "duration" + }, + "body": { + "pid": 9368, + "tid": "Main Thread", + "startTime": 272297961686200 + }, + "additional": { + "children": [ + "8a3af211-2492-4bc8-ace8-7e4a3efab3ae", + "723e834c-8ea1-47c2-933e-94a13b157982" + ], + "state": "running", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "70b0e742-9d3d-49d8-a012-77ac12d2d8d4" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "8a3af211-2492-4bc8-ace8-7e4a3efab3ae", + "name": "require hvigorfile", + "description": "Require hvigorfile.", + "type": "duration" + }, + "body": { + "pid": 9368, + "tid": "Main Thread", + "startTime": 272297961687200, + "endTime": 272299642937700 + }, + "additional": { + "children": [], + "state": "success", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "ceb90405-2162-41c4-83f8-3e504fd6fc3c", + "logId": "7058666e-922f-43ae-bcc6-723b8f526381" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "723e834c-8ea1-47c2-933e-94a13b157982", + "name": "bind plugins", + "description": "Bind plugins.", + "type": "duration" + }, + "body": { + "pid": 9368, + "tid": "Main Thread", + "startTime": 272299642961800 + }, + "additional": { + "children": [], + "state": "running", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "ceb90405-2162-41c4-83f8-3e504fd6fc3c" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "50fbc9e6-943f-4958-aaa3-63075900613f", + "name": "hvigorfile, resolving D:\\LiuDongHai\\FAQ最佳实践资料\\BestPractices\\BestPractices\\DevelopmentPractice\\NdkDrawing\\hvigorfile.ts", + "description": "", + "type": "log" + }, + "body": { + "pid": 9368, + "tid": "Main Thread", + "startTime": 272297961693200 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "1bd2c39f-98df-4805-9fb7-9bc630a97ff9", + "name": "hvigorfile, require result: { default: { system: [Function: appTasks], plugins: [] } }", + "description": "", + "type": "log" + }, + "body": { + "pid": 9368, + "tid": "Main Thread", + "startTime": 272299642810100 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "7058666e-922f-43ae-bcc6-723b8f526381", + "name": "require hvigorfile", + "description": "", + "type": "log" + }, + "body": { + "pid": 9368, + "tid": "Main Thread", + "startTime": 272297961687200, + "endTime": 272299642937700 + }, + "additional": { + "logType": "info", + "children": [], + "durationId": "8a3af211-2492-4bc8-ace8-7e4a3efab3ae" + } + }, + { + "head": { + "id": "cd9b3e60-ae27-4459-af3a-7c83cbf796b0", + "name": "hvigorfile, binding system plugins [Function: appTasks]", + "description": "", + "type": "log" + }, + "body": { + "pid": 9368, + "tid": "Main Thread", + "startTime": 272299643068700 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "518fdbeb-42f4-469e-82a8-981da23c4750", + "name": "hvigor build process will be closed with an error.", + "description": "", + "type": "log" + }, + "body": { + "pid": 9368, + "tid": "Main Thread", + "startTime": 272299836916000 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "70d7aa80-45c0-42d3-8e0a-49571e9c0066", + "name": "ERROR: stacktrace = Error: Invalid project path.\r\n\t Detail: Please move the project to a valid path\n at OhosLogger.errorMessageExit (D:\\LiuDongHai\\DevEco Studio\\tools\\hvigor\\hvigor\\src\\base\\log\\hvigor-log.js:1:3224)\n at OhosLogger._printAllExit (D:\\LiuDongHai\\DevEco Studio\\tools\\hvigor\\hvigor-ohos-plugin\\src\\utils\\log\\ohos-logger.js:1:1274)\n at ProjectInspection.exitOnError (D:\\LiuDongHai\\DevEco Studio\\tools\\hvigor\\hvigor-ohos-plugin\\src\\tasks\\inspection\\project-inspection.js:1:672)\n at AppPlugin.doProjectInspection (D:\\LiuDongHai\\DevEco Studio\\tools\\hvigor\\hvigor-ohos-plugin\\src\\plugin\\common\\abstract-project-plugin.js:1:1585)\n at PluginFactory.getAppPlugin (D:\\LiuDongHai\\DevEco Studio\\tools\\hvigor\\hvigor-ohos-plugin\\src\\plugin\\factory\\plugin-factory.js:1:2159)\n at appTasks (D:\\LiuDongHai\\DevEco Studio\\tools\\hvigor\\hvigor-ohos-plugin\\index.js:1:593)\n at bindSystemPlugins (D:\\LiuDongHai\\DevEco Studio\\tools\\hvigor\\hvigor\\src\\base\\internal\\lifecycle\\configuration.js:1:5900)\n at evaluateNodeVigorFile (D:\\LiuDongHai\\DevEco Studio\\tools\\hvigor\\hvigor\\src\\base\\internal\\lifecycle\\configuration.js:1:8450)\n at evalProject (D:\\LiuDongHai\\DevEco Studio\\tools\\hvigor\\hvigor\\src\\base\\internal\\lifecycle\\configuration.js:1:3495)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)", + "description": "", + "type": "log" + }, + "body": { + "pid": 9368, + "tid": "Main Thread", + "startTime": 272299838349800 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "4b4d02f2-e251-4c53-abc5-71284174a39e", + "name": "\"buildFinished\" hook function", + "description": "", + "type": "duration" + }, + "body": { + "pid": 9368, + "tid": "Main Thread", + "startTime": 272299843672700, + "endTime": 272299843807500 + }, + "additional": { + "children": [], + "state": "success", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "ccc12e0f-4a6f-44de-a5f3-ddf62d911ca3", + "logId": "2017f077-7c4e-4a10-94cf-b1af95eb1b90" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "2017f077-7c4e-4a10-94cf-b1af95eb1b90", + "name": "\"buildFinished\" hook function", + "description": "", + "type": "log" + }, + "body": { + "pid": 9368, + "tid": "Main Thread", + "startTime": 272299843672700, + "endTime": 272299843807500 + }, + "additional": { + "logType": "info", + "children": [], + "durationId": "4b4d02f2-e251-4c53-abc5-71284174a39e" + } + }, + { + "head": { + "id": "5f44c424-1072-41e9-988b-e81b32af86e6", + "name": "", + "description": "", + "type": "mark" + }, + "body": { + "pid": 9368, + "tid": "Main Thread", + "startTime": 272297929680700, + "endTime": 272299844408500 + }, + "additional": { + "time": { + "year": 2025, + "month": 5, + "day": 12, + "hour": 15, + "minute": 20 + }, + "completeCommand": "{\"prop\":[\"product=default\"],\"sync\":true,\"parallel\":true,\"incremental\":true,\"daemon\":true,\"_\":[],\"analyze\":\"normal\"};", + "hvigorVersion": "5.17.0", + "markType": "history", + "nodeVersion": "v18.20.1", + "category": "build", + "state": "failed" + } + }, + { + "head": { + "id": "d3d1438f-1261-43c6-a827-0c75ecf6bf8b", + "name": "BUILD FAILED in 1 s 915 ms ", + "description": "", + "type": "log" + }, + "body": { + "pid": 9368, + "tid": "Main Thread", + "startTime": 272299844528000 + }, + "additional": { + "logType": "error", + "children": [] + } + } + ] +} \ No newline at end of file diff --git a/NdkDrawing/.hvigor/report/report-202505121649408660.json b/NdkDrawing/.hvigor/report/report-202505121649408660.json new file mode 100644 index 0000000000000000000000000000000000000000..11f73da85e0b2a0cf953c6f2f2facbead74dda7d --- /dev/null +++ b/NdkDrawing/.hvigor/report/report-202505121649408660.json @@ -0,0 +1,927 @@ +{ + "version": "2.0", + "ppid": 15164, + "events": [ + { + "head": { + "id": "9d456f85-4b39-4a3f-bd8a-90720eb2c31e", + "name": "watch worker: worker id should be larger than 0. Nothing will be sent to any worker thread.", + "description": "", + "type": "log" + }, + "body": { + "pid": 10648, + "tid": "Main Thread", + "startTime": 277623457864500 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "8be7bf00-1970-44d2-b8ea-81a97e6614b8", + "name": "init", + "description": "Initialize and build task graph.", + "type": "duration" + }, + "body": { + "pid": 10648, + "tid": "Main Thread", + "startTime": 277623466716700 + }, + "additional": { + "children": [ + "0c00c7ec-ef06-41c0-9198-e3e55835c2e0", + "7506b8f7-b8dc-4c00-bcb0-aac7d6a3df33", + "484e2dff-34c3-46a2-afe1-f61d16e70159", + "71d4b88c-647d-4f03-b380-0bdbec5fb08e", + "bffdf173-a4af-4d8b-b44f-c7cf6568a13f", + "682874ad-b9fb-450b-9186-e76f491c817a" + ], + "state": "running", + "targetName": "", + "moduleName": "", + "category": "Init", + "taskRunReasons": [] + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "0c00c7ec-ef06-41c0-9198-e3e55835c2e0", + "name": "create hvigor project model", + "description": "Initialize hvigor project model.", + "type": "duration" + }, + "body": { + "pid": 10648, + "tid": "Main Thread", + "startTime": 277623466720500, + "endTime": 277623480190200 + }, + "additional": { + "children": [], + "state": "success", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "8be7bf00-1970-44d2-b8ea-81a97e6614b8", + "logId": "a43094cf-e0cf-4746-bf86-89c613d83cc7" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "7506b8f7-b8dc-4c00-bcb0-aac7d6a3df33", + "name": "configure hvigor plugin", + "description": "Configure hvigor plugin.", + "type": "duration" + }, + "body": { + "pid": 10648, + "tid": "Main Thread", + "startTime": 277623480213100 + }, + "additional": { + "children": [ + "d1007644-c7e9-4554-85cf-9b26844ae519", + "7ad6e742-b60e-4284-8020-720d52273fbd", + "40cd342c-459f-46d9-85ab-f1b92fb059ce", + "3340e2ec-5871-49f3-a3c6-8732277fb5ca", + "88639d08-c23e-4e25-9483-f7d997559aff", + "8041168f-8051-4a86-9eb5-c2c28af05abb", + "b195f960-459a-45de-9557-fe0e361c0d19", + "38698141-d1e9-4a06-bc50-259f543d24bd" + ], + "state": "running", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "8be7bf00-1970-44d2-b8ea-81a97e6614b8" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "bffdf173-a4af-4d8b-b44f-c7cf6568a13f", + "name": "\"configEvaluated\" hook function", + "description": "", + "type": "duration" + }, + "body": { + "pid": 10648, + "tid": "Main Thread", + "startTime": 277623470432300, + "endTime": 277623470733300 + }, + "additional": { + "children": [], + "state": "success", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "8be7bf00-1970-44d2-b8ea-81a97e6614b8", + "logId": "8606626c-6e90-49b8-9e68-788e335976ae" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "8606626c-6e90-49b8-9e68-788e335976ae", + "name": "\"configEvaluated\" hook function", + "description": "", + "type": "log" + }, + "body": { + "pid": 10648, + "tid": "Main Thread", + "startTime": 277623470432300, + "endTime": 277623470733300 + }, + "additional": { + "logType": "info", + "children": [], + "durationId": "bffdf173-a4af-4d8b-b44f-c7cf6568a13f" + } + }, + { + "head": { + "id": "682874ad-b9fb-450b-9186-e76f491c817a", + "name": "\"nodesInitialized\" hook function", + "description": "", + "type": "duration" + }, + "body": { + "pid": 10648, + "tid": "Main Thread", + "startTime": 277623475597900, + "endTime": 277623475634000 + }, + "additional": { + "children": [], + "state": "success", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "8be7bf00-1970-44d2-b8ea-81a97e6614b8", + "logId": "710f8c49-55b0-487b-bc2e-2fd5fbba8b33" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "710f8c49-55b0-487b-bc2e-2fd5fbba8b33", + "name": "\"nodesInitialized\" hook function", + "description": "", + "type": "log" + }, + "body": { + "pid": 10648, + "tid": "Main Thread", + "startTime": 277623475597900, + "endTime": 277623475634000 + }, + "additional": { + "logType": "info", + "children": [], + "durationId": "682874ad-b9fb-450b-9186-e76f491c817a" + } + }, + { + "head": { + "id": "60db3867-9bb9-4e21-b9f1-6e4d0ef7edde", + "name": "Hvigor init with startParameters:{\n hvigorfileTypeCheck: false,\n parallelExecution: true,\n incrementalExecution: true,\n printStackTrace: false,\n daemon: true,\n analyze: 0,\n logLevel: Level { level: 20000, levelStr: 'INFO', colour: 'green' }\n}", + "description": "", + "type": "log" + }, + "body": { + "pid": 10648, + "tid": "Main Thread", + "startTime": 277623476236600 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "c2b604a9-d395-41e0-8705-4a7aa9d1b7e6", + "name": "Since current hvigor version 5.17.0 differs from last hvigor version \n undefined, delete file-cache.json and task-cache.json.", + "description": "", + "type": "log" + }, + "body": { + "pid": 10648, + "tid": "Main Thread", + "startTime": 277623478051200 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "13918895-f60a-4c97-afaa-880bf942ce7e", + "name": "Cache service initialization finished in 4 ms ", + "description": "", + "type": "log" + }, + "body": { + "pid": 10648, + "tid": "Main Thread", + "startTime": 277623480075300 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "a43094cf-e0cf-4746-bf86-89c613d83cc7", + "name": "create hvigor project model", + "description": "", + "type": "log" + }, + "body": { + "pid": 10648, + "tid": "Main Thread", + "startTime": 277623466720500, + "endTime": 277623480190200 + }, + "additional": { + "logType": "info", + "children": [], + "durationId": "0c00c7ec-ef06-41c0-9198-e3e55835c2e0" + } + }, + { + "head": { + "id": "d1007644-c7e9-4554-85cf-9b26844ae519", + "name": "init configuration", + "description": "Initialize configuration.", + "type": "duration" + }, + "body": { + "pid": 10648, + "tid": "Main Thread", + "startTime": 277623485220600, + "endTime": 277623485262900 + }, + "additional": { + "children": [], + "state": "success", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "7506b8f7-b8dc-4c00-bcb0-aac7d6a3df33", + "logId": "0576fb2c-1d1d-4efc-ac08-cedb00024657" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "7ad6e742-b60e-4284-8020-720d52273fbd", + "name": "configure project task", + "description": "Configure project task.", + "type": "duration" + }, + "body": { + "pid": 10648, + "tid": "Main Thread", + "startTime": 277623485304900, + "endTime": 277623489399600 + }, + "additional": { + "children": [], + "state": "success", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "7506b8f7-b8dc-4c00-bcb0-aac7d6a3df33", + "logId": "35e2a82e-0f14-4f55-b7ce-9fe6b6ec143b" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "40cd342c-459f-46d9-85ab-f1b92fb059ce", + "name": "eval project", + "description": "Evaluate project.", + "type": "duration" + }, + "body": { + "pid": 10648, + "tid": "Main Thread", + "startTime": 277623489497100 + }, + "additional": { + "children": [ + "01201e65-414e-4ebf-8329-10fda906c8e5", + "a8ec8d2c-09ff-4d99-acd2-6b4f36fd6dfd" + ], + "state": "running", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "7506b8f7-b8dc-4c00-bcb0-aac7d6a3df33" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "0576fb2c-1d1d-4efc-ac08-cedb00024657", + "name": "init configuration", + "description": "", + "type": "log" + }, + "body": { + "pid": 10648, + "tid": "Main Thread", + "startTime": 277623485220600, + "endTime": 277623485262900 + }, + "additional": { + "logType": "info", + "children": [], + "durationId": "d1007644-c7e9-4554-85cf-9b26844ae519" + } + }, + { + "head": { + "id": "35e2a82e-0f14-4f55-b7ce-9fe6b6ec143b", + "name": "configure project task", + "description": "", + "type": "log" + }, + "body": { + "pid": 10648, + "tid": "Main Thread", + "startTime": 277623485304900, + "endTime": 277623489399600 + }, + "additional": { + "logType": "info", + "children": [], + "durationId": "7ad6e742-b60e-4284-8020-720d52273fbd" + } + }, + { + "head": { + "id": "01201e65-414e-4ebf-8329-10fda906c8e5", + "name": "\"beforeNodeEvaluate\" hook function", + "description": "", + "type": "duration" + }, + "body": { + "pid": 10648, + "tid": "Main Thread", + "startTime": 277623490253000, + "endTime": 277623490382300 + }, + "additional": { + "children": [], + "state": "success", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "40cd342c-459f-46d9-85ab-f1b92fb059ce", + "logId": "5438b10b-049c-4f20-b540-dba200fc6faf" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "5438b10b-049c-4f20-b540-dba200fc6faf", + "name": "\"beforeNodeEvaluate\" hook function", + "description": "", + "type": "log" + }, + "body": { + "pid": 10648, + "tid": "Main Thread", + "startTime": 277623490253000, + "endTime": 277623490382300 + }, + "additional": { + "logType": "info", + "children": [], + "durationId": "01201e65-414e-4ebf-8329-10fda906c8e5" + } + }, + { + "head": { + "id": "a8ec8d2c-09ff-4d99-acd2-6b4f36fd6dfd", + "name": "eval hvigorfile", + "description": "Evaluate hvigorfile.", + "type": "duration" + }, + "body": { + "pid": 10648, + "tid": "Main Thread", + "startTime": 277623492453100 + }, + "additional": { + "children": [ + "a238c4c2-bd88-4ab0-bab8-56cd821c527d", + "854b375f-984b-466e-a479-cd5384fadde5" + ], + "state": "running", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "40cd342c-459f-46d9-85ab-f1b92fb059ce" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "a238c4c2-bd88-4ab0-bab8-56cd821c527d", + "name": "require hvigorfile", + "description": "Require hvigorfile.", + "type": "duration" + }, + "body": { + "pid": 10648, + "tid": "Main Thread", + "startTime": 277623492454300, + "endTime": 277625079891100 + }, + "additional": { + "children": [], + "state": "success", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "a8ec8d2c-09ff-4d99-acd2-6b4f36fd6dfd", + "logId": "11d56ec7-279e-4c35-bcfc-26281e6ea1a7" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "854b375f-984b-466e-a479-cd5384fadde5", + "name": "bind plugins", + "description": "Bind plugins.", + "type": "duration" + }, + "body": { + "pid": 10648, + "tid": "Main Thread", + "startTime": 277625079916700 + }, + "additional": { + "children": [], + "state": "running", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "a8ec8d2c-09ff-4d99-acd2-6b4f36fd6dfd" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "372b7be2-858f-4941-9327-8e4023079bb2", + "name": "hvigorfile, resolving D:\\LiuDongHai\\FAQ最佳实践资料\\BestPractices\\BestPractices\\DevelopmentPractice\\NdkDrawing\\hvigorfile.ts", + "description": "", + "type": "log" + }, + "body": { + "pid": 10648, + "tid": "Main Thread", + "startTime": 277623492460400 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "05baeecd-333e-4e0d-97c6-b7fe2f68f8bc", + "name": "hvigorfile, require result: { default: { system: [Function: appTasks], plugins: [] } }", + "description": "", + "type": "log" + }, + "body": { + "pid": 10648, + "tid": "Main Thread", + "startTime": 277625079762300 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "11d56ec7-279e-4c35-bcfc-26281e6ea1a7", + "name": "require hvigorfile", + "description": "", + "type": "log" + }, + "body": { + "pid": 10648, + "tid": "Main Thread", + "startTime": 277623492454300, + "endTime": 277625079891100 + }, + "additional": { + "logType": "info", + "children": [], + "durationId": "a238c4c2-bd88-4ab0-bab8-56cd821c527d" + } + }, + { + "head": { + "id": "a335716a-38b1-49eb-8f38-dc665a89dd1f", + "name": "hvigorfile, binding system plugins [Function: appTasks]", + "description": "", + "type": "log" + }, + "body": { + "pid": 10648, + "tid": "Main Thread", + "startTime": 277625080029300 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "fc3c5daf-ddc0-49af-9856-f933c5b5668c", + "name": "hvigor build process will be closed with an error.", + "description": "", + "type": "log" + }, + "body": { + "pid": 10648, + "tid": "Main Thread", + "startTime": 277625263810700 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "875a8fed-ff1b-4726-8b1e-e7af98fd189d", + "name": "ERROR: stacktrace = Error: Invalid project path.\r\n\t Detail: Please move the project to a valid path\n at OhosLogger.errorMessageExit (D:\\LiuDongHai\\DevEco Studio\\tools\\hvigor\\hvigor\\src\\base\\log\\hvigor-log.js:1:3224)\n at OhosLogger._printAllExit (D:\\LiuDongHai\\DevEco Studio\\tools\\hvigor\\hvigor-ohos-plugin\\src\\utils\\log\\ohos-logger.js:1:1274)\n at ProjectInspection.exitOnError (D:\\LiuDongHai\\DevEco Studio\\tools\\hvigor\\hvigor-ohos-plugin\\src\\tasks\\inspection\\project-inspection.js:1:672)\n at AppPlugin.doProjectInspection (D:\\LiuDongHai\\DevEco Studio\\tools\\hvigor\\hvigor-ohos-plugin\\src\\plugin\\common\\abstract-project-plugin.js:1:1585)\n at PluginFactory.getAppPlugin (D:\\LiuDongHai\\DevEco Studio\\tools\\hvigor\\hvigor-ohos-plugin\\src\\plugin\\factory\\plugin-factory.js:1:2159)\n at appTasks (D:\\LiuDongHai\\DevEco Studio\\tools\\hvigor\\hvigor-ohos-plugin\\index.js:1:593)\n at bindSystemPlugins (D:\\LiuDongHai\\DevEco Studio\\tools\\hvigor\\hvigor\\src\\base\\internal\\lifecycle\\configuration.js:1:5900)\n at evaluateNodeVigorFile (D:\\LiuDongHai\\DevEco Studio\\tools\\hvigor\\hvigor\\src\\base\\internal\\lifecycle\\configuration.js:1:8450)\n at evalProject (D:\\LiuDongHai\\DevEco Studio\\tools\\hvigor\\hvigor\\src\\base\\internal\\lifecycle\\configuration.js:1:3495)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)", + "description": "", + "type": "log" + }, + "body": { + "pid": 10648, + "tid": "Main Thread", + "startTime": 277625265199500 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "d0d66263-920a-479c-933e-6bed3ff27861", + "name": "\"buildFinished\" hook function", + "description": "", + "type": "duration" + }, + "body": { + "pid": 10648, + "tid": "Main Thread", + "startTime": 277625270613600, + "endTime": 277625270752400 + }, + "additional": { + "children": [], + "state": "success", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "e3433902-5849-40fb-89fd-9480a93eee8f", + "logId": "9228b09b-7dfd-4617-b853-8be2050b1d63" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "9228b09b-7dfd-4617-b853-8be2050b1d63", + "name": "\"buildFinished\" hook function", + "description": "", + "type": "log" + }, + "body": { + "pid": 10648, + "tid": "Main Thread", + "startTime": 277625270613600, + "endTime": 277625270752400 + }, + "additional": { + "logType": "info", + "children": [], + "durationId": "d0d66263-920a-479c-933e-6bed3ff27861" + } + }, + { + "head": { + "id": "76a061a8-fde2-4db7-8e51-02868e52bed1", + "name": "", + "description": "", + "type": "mark" + }, + "body": { + "pid": 10648, + "tid": "Main Thread", + "startTime": 277623463266300, + "endTime": 277625271418800 + }, + "additional": { + "time": { + "year": 2025, + "month": 5, + "day": 12, + "hour": 16, + "minute": 49 + }, + "completeCommand": "{\"prop\":[\"product=default\"],\"sync\":true,\"parallel\":true,\"incremental\":true,\"daemon\":true,\"_\":[],\"analyze\":\"normal\"};", + "hvigorVersion": "5.17.0", + "markType": "history", + "nodeVersion": "v18.20.1", + "category": "build", + "state": "failed" + } + }, + { + "head": { + "id": "d3c0f61a-257a-4e04-9f65-beb6ce6bea39", + "name": "BUILD FAILED in 1 s 808 ms ", + "description": "", + "type": "log" + }, + "body": { + "pid": 10648, + "tid": "Main Thread", + "startTime": 277625271541800 + }, + "additional": { + "logType": "error", + "children": [] + } + } + ] +} \ No newline at end of file diff --git a/NdkDrawing/.hvigor/report/report-202505131101201980.json b/NdkDrawing/.hvigor/report/report-202505131101201980.json new file mode 100644 index 0000000000000000000000000000000000000000..039ff2cfc6ead41af441ee5353d5abd6bc187cc3 --- /dev/null +++ b/NdkDrawing/.hvigor/report/report-202505131101201980.json @@ -0,0 +1,927 @@ +{ + "version": "2.0", + "ppid": 18168, + "events": [ + { + "head": { + "id": "57747908-157b-4a2e-a1eb-bc4464f4a2e3", + "name": "watch worker: worker id should be larger than 0. Nothing will be sent to any worker thread.", + "description": "", + "type": "log" + }, + "body": { + "pid": 20152, + "tid": "Main Thread", + "startTime": 343122950693600 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "310dc289-6fc2-4356-a683-747a741b89f9", + "name": "init", + "description": "Initialize and build task graph.", + "type": "duration" + }, + "body": { + "pid": 20152, + "tid": "Main Thread", + "startTime": 343122959469100 + }, + "additional": { + "children": [ + "d8da60c6-b898-4209-98c5-5cec6b9c4117", + "070ab7fc-715b-4e7f-8f4e-0426909ec1ea", + "afbaf11c-e4e7-473b-bc95-c80c7e0ca552", + "ecfd0549-6312-425b-80d9-40ff420cdeaa", + "a310dad4-905a-4271-9792-319c972303e0", + "d4e785c4-e75c-42ef-b9cb-17fe65673865" + ], + "state": "running", + "targetName": "", + "moduleName": "", + "category": "Init", + "taskRunReasons": [] + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "d8da60c6-b898-4209-98c5-5cec6b9c4117", + "name": "create hvigor project model", + "description": "Initialize hvigor project model.", + "type": "duration" + }, + "body": { + "pid": 20152, + "tid": "Main Thread", + "startTime": 343122959473000, + "endTime": 343122972991900 + }, + "additional": { + "children": [], + "state": "success", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "310dc289-6fc2-4356-a683-747a741b89f9", + "logId": "d234650d-7d27-4500-b235-15a3a0a15c46" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "070ab7fc-715b-4e7f-8f4e-0426909ec1ea", + "name": "configure hvigor plugin", + "description": "Configure hvigor plugin.", + "type": "duration" + }, + "body": { + "pid": 20152, + "tid": "Main Thread", + "startTime": 343122973013100 + }, + "additional": { + "children": [ + "d4869e9d-5064-4670-a967-5273e067ec5e", + "9f875693-a0e3-4879-a383-92baebe55726", + "3388a5d9-4953-4ad3-9d92-36e9ca8e95b0", + "dedee611-51f7-4c99-8b13-0cdbbb16bf22", + "7bb0f613-1163-4469-849c-db73ae0e94c8", + "699bbb8a-dfe6-4e02-bc55-ab758b9ee863", + "5e359e41-e265-4df6-a5b9-0d7740337f7a", + "95a26d19-85dd-443c-8697-345c5c33630c" + ], + "state": "running", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "310dc289-6fc2-4356-a683-747a741b89f9" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "a310dad4-905a-4271-9792-319c972303e0", + "name": "\"configEvaluated\" hook function", + "description": "", + "type": "duration" + }, + "body": { + "pid": 20152, + "tid": "Main Thread", + "startTime": 343122963155600, + "endTime": 343122963461300 + }, + "additional": { + "children": [], + "state": "success", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "310dc289-6fc2-4356-a683-747a741b89f9", + "logId": "0ea20a88-408d-4fcb-9d04-feb55c7c8383" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "0ea20a88-408d-4fcb-9d04-feb55c7c8383", + "name": "\"configEvaluated\" hook function", + "description": "", + "type": "log" + }, + "body": { + "pid": 20152, + "tid": "Main Thread", + "startTime": 343122963155600, + "endTime": 343122963461300 + }, + "additional": { + "logType": "info", + "children": [], + "durationId": "a310dad4-905a-4271-9792-319c972303e0" + } + }, + { + "head": { + "id": "d4e785c4-e75c-42ef-b9cb-17fe65673865", + "name": "\"nodesInitialized\" hook function", + "description": "", + "type": "duration" + }, + "body": { + "pid": 20152, + "tid": "Main Thread", + "startTime": 343122968532100, + "endTime": 343122968574800 + }, + "additional": { + "children": [], + "state": "success", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "310dc289-6fc2-4356-a683-747a741b89f9", + "logId": "5bb0fd32-001e-4f3c-ace3-ff80f531edf8" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "5bb0fd32-001e-4f3c-ace3-ff80f531edf8", + "name": "\"nodesInitialized\" hook function", + "description": "", + "type": "log" + }, + "body": { + "pid": 20152, + "tid": "Main Thread", + "startTime": 343122968532100, + "endTime": 343122968574800 + }, + "additional": { + "logType": "info", + "children": [], + "durationId": "d4e785c4-e75c-42ef-b9cb-17fe65673865" + } + }, + { + "head": { + "id": "abfbaac3-7fe5-4b38-a5a6-cffb5fa4fdd6", + "name": "Hvigor init with startParameters:{\n hvigorfileTypeCheck: false,\n parallelExecution: true,\n incrementalExecution: true,\n printStackTrace: false,\n daemon: true,\n analyze: 0,\n logLevel: Level { level: 20000, levelStr: 'INFO', colour: 'green' }\n}", + "description": "", + "type": "log" + }, + "body": { + "pid": 20152, + "tid": "Main Thread", + "startTime": 343122969336600 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "1ea6b437-3285-4a94-9799-5e58c3d281c5", + "name": "Since current hvigor version 5.17.0 differs from last hvigor version \n undefined, delete file-cache.json and task-cache.json.", + "description": "", + "type": "log" + }, + "body": { + "pid": 20152, + "tid": "Main Thread", + "startTime": 343122970983800 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "2c51e6dd-4893-4e12-a772-4f24f163fe8b", + "name": "Cache service initialization finished in 4 ms ", + "description": "", + "type": "log" + }, + "body": { + "pid": 20152, + "tid": "Main Thread", + "startTime": 343122972894200 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "d234650d-7d27-4500-b235-15a3a0a15c46", + "name": "create hvigor project model", + "description": "", + "type": "log" + }, + "body": { + "pid": 20152, + "tid": "Main Thread", + "startTime": 343122959473000, + "endTime": 343122972991900 + }, + "additional": { + "logType": "info", + "children": [], + "durationId": "d8da60c6-b898-4209-98c5-5cec6b9c4117" + } + }, + { + "head": { + "id": "d4869e9d-5064-4670-a967-5273e067ec5e", + "name": "init configuration", + "description": "Initialize configuration.", + "type": "duration" + }, + "body": { + "pid": 20152, + "tid": "Main Thread", + "startTime": 343122977868300, + "endTime": 343122977897200 + }, + "additional": { + "children": [], + "state": "success", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "070ab7fc-715b-4e7f-8f4e-0426909ec1ea", + "logId": "f8ae11f1-e5df-4ac9-a724-7c0310800633" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "9f875693-a0e3-4879-a383-92baebe55726", + "name": "configure project task", + "description": "Configure project task.", + "type": "duration" + }, + "body": { + "pid": 20152, + "tid": "Main Thread", + "startTime": 343122977932900, + "endTime": 343122981876700 + }, + "additional": { + "children": [], + "state": "success", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "070ab7fc-715b-4e7f-8f4e-0426909ec1ea", + "logId": "712246a6-12a2-4a9e-908e-344b9f8ae876" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "3388a5d9-4953-4ad3-9d92-36e9ca8e95b0", + "name": "eval project", + "description": "Evaluate project.", + "type": "duration" + }, + "body": { + "pid": 20152, + "tid": "Main Thread", + "startTime": 343122981976600 + }, + "additional": { + "children": [ + "45a1d276-0e13-444a-97cc-6a21b8a84687", + "5478ca89-54f9-47f9-8269-374f065b2d10" + ], + "state": "running", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "070ab7fc-715b-4e7f-8f4e-0426909ec1ea" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "f8ae11f1-e5df-4ac9-a724-7c0310800633", + "name": "init configuration", + "description": "", + "type": "log" + }, + "body": { + "pid": 20152, + "tid": "Main Thread", + "startTime": 343122977868300, + "endTime": 343122977897200 + }, + "additional": { + "logType": "info", + "children": [], + "durationId": "d4869e9d-5064-4670-a967-5273e067ec5e" + } + }, + { + "head": { + "id": "712246a6-12a2-4a9e-908e-344b9f8ae876", + "name": "configure project task", + "description": "", + "type": "log" + }, + "body": { + "pid": 20152, + "tid": "Main Thread", + "startTime": 343122977932900, + "endTime": 343122981876700 + }, + "additional": { + "logType": "info", + "children": [], + "durationId": "9f875693-a0e3-4879-a383-92baebe55726" + } + }, + { + "head": { + "id": "45a1d276-0e13-444a-97cc-6a21b8a84687", + "name": "\"beforeNodeEvaluate\" hook function", + "description": "", + "type": "duration" + }, + "body": { + "pid": 20152, + "tid": "Main Thread", + "startTime": 343122982688500, + "endTime": 343122982806700 + }, + "additional": { + "children": [], + "state": "success", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "3388a5d9-4953-4ad3-9d92-36e9ca8e95b0", + "logId": "5cf8c144-69ff-4358-97b2-22f027e4915a" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "5cf8c144-69ff-4358-97b2-22f027e4915a", + "name": "\"beforeNodeEvaluate\" hook function", + "description": "", + "type": "log" + }, + "body": { + "pid": 20152, + "tid": "Main Thread", + "startTime": 343122982688500, + "endTime": 343122982806700 + }, + "additional": { + "logType": "info", + "children": [], + "durationId": "45a1d276-0e13-444a-97cc-6a21b8a84687" + } + }, + { + "head": { + "id": "5478ca89-54f9-47f9-8269-374f065b2d10", + "name": "eval hvigorfile", + "description": "Evaluate hvigorfile.", + "type": "duration" + }, + "body": { + "pid": 20152, + "tid": "Main Thread", + "startTime": 343122984838700 + }, + "additional": { + "children": [ + "408a40c7-480a-4b4a-a9ed-b8f53a10c1e1", + "628b1690-7fbc-427c-8c53-2778c97b93c1" + ], + "state": "running", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "3388a5d9-4953-4ad3-9d92-36e9ca8e95b0" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "408a40c7-480a-4b4a-a9ed-b8f53a10c1e1", + "name": "require hvigorfile", + "description": "Require hvigorfile.", + "type": "duration" + }, + "body": { + "pid": 20152, + "tid": "Main Thread", + "startTime": 343122984839800, + "endTime": 343124609875100 + }, + "additional": { + "children": [], + "state": "success", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "5478ca89-54f9-47f9-8269-374f065b2d10", + "logId": "b69f4b31-e02c-442c-b6ef-cbe15e94ae64" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "628b1690-7fbc-427c-8c53-2778c97b93c1", + "name": "bind plugins", + "description": "Bind plugins.", + "type": "duration" + }, + "body": { + "pid": 20152, + "tid": "Main Thread", + "startTime": 343124609900400 + }, + "additional": { + "children": [], + "state": "running", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "5478ca89-54f9-47f9-8269-374f065b2d10" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "ba0c28c6-7337-41fc-bd9a-b0ce3b5d091e", + "name": "hvigorfile, resolving D:\\LiuDongHai\\FAQ最佳实践资料\\BestPractices\\BestPractices\\DevelopmentPractice\\NdkDrawing\\hvigorfile.ts", + "description": "", + "type": "log" + }, + "body": { + "pid": 20152, + "tid": "Main Thread", + "startTime": 343122984844900 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "5333640f-d1b2-488e-9188-689bb39bec09", + "name": "hvigorfile, require result: { default: { system: [Function: appTasks], plugins: [] } }", + "description": "", + "type": "log" + }, + "body": { + "pid": 20152, + "tid": "Main Thread", + "startTime": 343124609747900 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "b69f4b31-e02c-442c-b6ef-cbe15e94ae64", + "name": "require hvigorfile", + "description": "", + "type": "log" + }, + "body": { + "pid": 20152, + "tid": "Main Thread", + "startTime": 343122984839800, + "endTime": 343124609875100 + }, + "additional": { + "logType": "info", + "children": [], + "durationId": "408a40c7-480a-4b4a-a9ed-b8f53a10c1e1" + } + }, + { + "head": { + "id": "aeb4e626-afa5-4739-aa60-6d2bf767accd", + "name": "hvigorfile, binding system plugins [Function: appTasks]", + "description": "", + "type": "log" + }, + "body": { + "pid": 20152, + "tid": "Main Thread", + "startTime": 343124610014600 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "f2fea224-c683-45ff-afd0-9d8835ad34dc", + "name": "hvigor build process will be closed with an error.", + "description": "", + "type": "log" + }, + "body": { + "pid": 20152, + "tid": "Main Thread", + "startTime": 343124804832500 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "b2154562-5e95-4b06-8c0e-1561e2168e0f", + "name": "ERROR: stacktrace = Error: Invalid project path.\r\n\t Detail: Please move the project to a valid path\n at OhosLogger.errorMessageExit (D:\\LiuDongHai\\DevEco Studio\\tools\\hvigor\\hvigor\\src\\base\\log\\hvigor-log.js:1:3224)\n at OhosLogger._printAllExit (D:\\LiuDongHai\\DevEco Studio\\tools\\hvigor\\hvigor-ohos-plugin\\src\\utils\\log\\ohos-logger.js:1:1274)\n at ProjectInspection.exitOnError (D:\\LiuDongHai\\DevEco Studio\\tools\\hvigor\\hvigor-ohos-plugin\\src\\tasks\\inspection\\project-inspection.js:1:672)\n at AppPlugin.doProjectInspection (D:\\LiuDongHai\\DevEco Studio\\tools\\hvigor\\hvigor-ohos-plugin\\src\\plugin\\common\\abstract-project-plugin.js:1:1585)\n at PluginFactory.getAppPlugin (D:\\LiuDongHai\\DevEco Studio\\tools\\hvigor\\hvigor-ohos-plugin\\src\\plugin\\factory\\plugin-factory.js:1:2159)\n at appTasks (D:\\LiuDongHai\\DevEco Studio\\tools\\hvigor\\hvigor-ohos-plugin\\index.js:1:593)\n at bindSystemPlugins (D:\\LiuDongHai\\DevEco Studio\\tools\\hvigor\\hvigor\\src\\base\\internal\\lifecycle\\configuration.js:1:5900)\n at evaluateNodeVigorFile (D:\\LiuDongHai\\DevEco Studio\\tools\\hvigor\\hvigor\\src\\base\\internal\\lifecycle\\configuration.js:1:8450)\n at evalProject (D:\\LiuDongHai\\DevEco Studio\\tools\\hvigor\\hvigor\\src\\base\\internal\\lifecycle\\configuration.js:1:3495)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)", + "description": "", + "type": "log" + }, + "body": { + "pid": 20152, + "tid": "Main Thread", + "startTime": 343124806000900 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "c0a677ec-5292-4d31-8674-34c6a6fa3260", + "name": "\"buildFinished\" hook function", + "description": "", + "type": "duration" + }, + "body": { + "pid": 20152, + "tid": "Main Thread", + "startTime": 343124811582500, + "endTime": 343124811731800 + }, + "additional": { + "children": [], + "state": "success", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "7f8c53a1-19ac-4f3d-9efb-86e2551d80f2", + "logId": "b0f57259-ba83-4fd9-bd81-a4d59165d7b0" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "b0f57259-ba83-4fd9-bd81-a4d59165d7b0", + "name": "\"buildFinished\" hook function", + "description": "", + "type": "log" + }, + "body": { + "pid": 20152, + "tid": "Main Thread", + "startTime": 343124811582500, + "endTime": 343124811731800 + }, + "additional": { + "logType": "info", + "children": [], + "durationId": "c0a677ec-5292-4d31-8674-34c6a6fa3260" + } + }, + { + "head": { + "id": "1bace607-a5f2-4e65-86ae-56adfe8674a3", + "name": "", + "description": "", + "type": "mark" + }, + "body": { + "pid": 20152, + "tid": "Main Thread", + "startTime": 343122956062300, + "endTime": 343124812347200 + }, + "additional": { + "time": { + "year": 2025, + "month": 5, + "day": 13, + "hour": 11, + "minute": 1 + }, + "completeCommand": "{\"prop\":[\"product=default\"],\"sync\":true,\"parallel\":true,\"incremental\":true,\"daemon\":true,\"_\":[],\"analyze\":\"normal\"};", + "hvigorVersion": "5.17.0", + "markType": "history", + "nodeVersion": "v18.20.1", + "category": "build", + "state": "failed" + } + }, + { + "head": { + "id": "ebaf4639-d85b-4741-bc59-3c793272b324", + "name": "BUILD FAILED in 1 s 856 ms ", + "description": "", + "type": "log" + }, + "body": { + "pid": 20152, + "tid": "Main Thread", + "startTime": 343124812467300 + }, + "additional": { + "logType": "error", + "children": [] + } + } + ] +} \ No newline at end of file diff --git a/NdkDrawing/.hvigor/report/report-202505151043551730.json b/NdkDrawing/.hvigor/report/report-202505151043551730.json new file mode 100644 index 0000000000000000000000000000000000000000..97dfd296c083d1dd4a393e00f329635b220b26ef --- /dev/null +++ b/NdkDrawing/.hvigor/report/report-202505151043551730.json @@ -0,0 +1,927 @@ +{ + "version": "2.0", + "ppid": 18448, + "events": [ + { + "head": { + "id": "6bdb8bd3-24d3-488a-9b8b-235f8ba3b3ec", + "name": "watch worker: worker id should be larger than 0. Nothing will be sent to any worker thread.", + "description": "", + "type": "log" + }, + "body": { + "pid": 1864, + "tid": "Main Thread", + "startTime": 514878480907400 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "c5cae0e7-0917-4395-9732-34a5cbe20302", + "name": "init", + "description": "Initialize and build task graph.", + "type": "duration" + }, + "body": { + "pid": 1864, + "tid": "Main Thread", + "startTime": 514878490026300 + }, + "additional": { + "children": [ + "5ebe0a33-8f7f-4635-9a08-cd8a387b0dbe", + "35cb6a9f-26e5-48cc-9d13-e75c1f3c5656", + "d997caad-2b40-4ae0-a337-b1affd78930e", + "4daf45d3-7840-4668-82e2-aa7e4db64f67", + "8f7ca73e-db61-4af9-a2f4-4a12a39be2af", + "fc52b09b-fd80-4e60-b2a0-28d37898623f" + ], + "state": "running", + "targetName": "", + "moduleName": "", + "category": "Init", + "taskRunReasons": [] + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "5ebe0a33-8f7f-4635-9a08-cd8a387b0dbe", + "name": "create hvigor project model", + "description": "Initialize hvigor project model.", + "type": "duration" + }, + "body": { + "pid": 1864, + "tid": "Main Thread", + "startTime": 514878490030200, + "endTime": 514878503981600 + }, + "additional": { + "children": [], + "state": "success", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "c5cae0e7-0917-4395-9732-34a5cbe20302", + "logId": "782445d1-3b2f-4f74-9c17-a229aa0189c8" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "35cb6a9f-26e5-48cc-9d13-e75c1f3c5656", + "name": "configure hvigor plugin", + "description": "Configure hvigor plugin.", + "type": "duration" + }, + "body": { + "pid": 1864, + "tid": "Main Thread", + "startTime": 514878504007100 + }, + "additional": { + "children": [ + "09f72edd-179a-4b59-88c7-fb294eb36e94", + "a4df2d6b-c60e-4248-bee8-56612399aa9c", + "118aa0bf-63e2-48a6-ab2a-94f5e57e1581", + "f9dd5b0f-61f3-475c-abaa-36d102b2d5e3", + "9d1732b9-43f1-4a60-8b1f-fbbe16b7488c", + "3210932b-6b85-4fd8-a37e-90ea9ba04e5d", + "6d51ad32-793b-44b7-8d70-ca998399b979", + "0b2b41b1-1463-43a7-a0b5-640eb9b1cb9e" + ], + "state": "running", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "c5cae0e7-0917-4395-9732-34a5cbe20302" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "8f7ca73e-db61-4af9-a2f4-4a12a39be2af", + "name": "\"configEvaluated\" hook function", + "description": "", + "type": "duration" + }, + "body": { + "pid": 1864, + "tid": "Main Thread", + "startTime": 514878493755000, + "endTime": 514878494078900 + }, + "additional": { + "children": [], + "state": "success", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "c5cae0e7-0917-4395-9732-34a5cbe20302", + "logId": "c829ac3f-0d70-4fce-8733-4b12c3eb1eb0" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "c829ac3f-0d70-4fce-8733-4b12c3eb1eb0", + "name": "\"configEvaluated\" hook function", + "description": "", + "type": "log" + }, + "body": { + "pid": 1864, + "tid": "Main Thread", + "startTime": 514878493755000, + "endTime": 514878494078900 + }, + "additional": { + "logType": "info", + "children": [], + "durationId": "8f7ca73e-db61-4af9-a2f4-4a12a39be2af" + } + }, + { + "head": { + "id": "fc52b09b-fd80-4e60-b2a0-28d37898623f", + "name": "\"nodesInitialized\" hook function", + "description": "", + "type": "duration" + }, + "body": { + "pid": 1864, + "tid": "Main Thread", + "startTime": 514878499122800, + "endTime": 514878499163400 + }, + "additional": { + "children": [], + "state": "success", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "c5cae0e7-0917-4395-9732-34a5cbe20302", + "logId": "eec5c178-873a-49cb-8ed3-ff36188990d8" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "eec5c178-873a-49cb-8ed3-ff36188990d8", + "name": "\"nodesInitialized\" hook function", + "description": "", + "type": "log" + }, + "body": { + "pid": 1864, + "tid": "Main Thread", + "startTime": 514878499122800, + "endTime": 514878499163400 + }, + "additional": { + "logType": "info", + "children": [], + "durationId": "fc52b09b-fd80-4e60-b2a0-28d37898623f" + } + }, + { + "head": { + "id": "7330945c-0996-49ff-b4e7-cf122e9fdee1", + "name": "Hvigor init with startParameters:{\n hvigorfileTypeCheck: false,\n parallelExecution: true,\n incrementalExecution: true,\n printStackTrace: false,\n daemon: true,\n analyze: 0,\n logLevel: Level { level: 20000, levelStr: 'INFO', colour: 'green' }\n}", + "description": "", + "type": "log" + }, + "body": { + "pid": 1864, + "tid": "Main Thread", + "startTime": 514878499794800 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "82e9d09f-8cd8-40b1-9274-23c2fd75d8ce", + "name": "Since current hvigor version 5.17.0 differs from last hvigor version \n undefined, delete file-cache.json and task-cache.json.", + "description": "", + "type": "log" + }, + "body": { + "pid": 1864, + "tid": "Main Thread", + "startTime": 514878501617700 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "5fca52f3-2c5d-4323-8c4b-c8ab6a7aac9b", + "name": "Cache service initialization finished in 4 ms ", + "description": "", + "type": "log" + }, + "body": { + "pid": 1864, + "tid": "Main Thread", + "startTime": 514878503848200 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "782445d1-3b2f-4f74-9c17-a229aa0189c8", + "name": "create hvigor project model", + "description": "", + "type": "log" + }, + "body": { + "pid": 1864, + "tid": "Main Thread", + "startTime": 514878490030200, + "endTime": 514878503981600 + }, + "additional": { + "logType": "info", + "children": [], + "durationId": "5ebe0a33-8f7f-4635-9a08-cd8a387b0dbe" + } + }, + { + "head": { + "id": "09f72edd-179a-4b59-88c7-fb294eb36e94", + "name": "init configuration", + "description": "Initialize configuration.", + "type": "duration" + }, + "body": { + "pid": 1864, + "tid": "Main Thread", + "startTime": 514878509425500, + "endTime": 514878509469200 + }, + "additional": { + "children": [], + "state": "success", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "35cb6a9f-26e5-48cc-9d13-e75c1f3c5656", + "logId": "495cfa50-8a2e-45ef-9168-8424030251e5" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "a4df2d6b-c60e-4248-bee8-56612399aa9c", + "name": "configure project task", + "description": "Configure project task.", + "type": "duration" + }, + "body": { + "pid": 1864, + "tid": "Main Thread", + "startTime": 514878509510000, + "endTime": 514878513922300 + }, + "additional": { + "children": [], + "state": "success", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "35cb6a9f-26e5-48cc-9d13-e75c1f3c5656", + "logId": "0cbc0c2b-76d2-4071-b4bb-ffb257f3ddf1" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "118aa0bf-63e2-48a6-ab2a-94f5e57e1581", + "name": "eval project", + "description": "Evaluate project.", + "type": "duration" + }, + "body": { + "pid": 1864, + "tid": "Main Thread", + "startTime": 514878514026800 + }, + "additional": { + "children": [ + "c2d79892-487d-4bb4-98bb-0f810a8e3508", + "4967cb27-0ba3-47ee-8cd2-c738e85e3ab2" + ], + "state": "running", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "35cb6a9f-26e5-48cc-9d13-e75c1f3c5656" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "495cfa50-8a2e-45ef-9168-8424030251e5", + "name": "init configuration", + "description": "", + "type": "log" + }, + "body": { + "pid": 1864, + "tid": "Main Thread", + "startTime": 514878509425500, + "endTime": 514878509469200 + }, + "additional": { + "logType": "info", + "children": [], + "durationId": "09f72edd-179a-4b59-88c7-fb294eb36e94" + } + }, + { + "head": { + "id": "0cbc0c2b-76d2-4071-b4bb-ffb257f3ddf1", + "name": "configure project task", + "description": "", + "type": "log" + }, + "body": { + "pid": 1864, + "tid": "Main Thread", + "startTime": 514878509510000, + "endTime": 514878513922300 + }, + "additional": { + "logType": "info", + "children": [], + "durationId": "a4df2d6b-c60e-4248-bee8-56612399aa9c" + } + }, + { + "head": { + "id": "c2d79892-487d-4bb4-98bb-0f810a8e3508", + "name": "\"beforeNodeEvaluate\" hook function", + "description": "", + "type": "duration" + }, + "body": { + "pid": 1864, + "tid": "Main Thread", + "startTime": 514878514778900, + "endTime": 514878514919200 + }, + "additional": { + "children": [], + "state": "success", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "118aa0bf-63e2-48a6-ab2a-94f5e57e1581", + "logId": "700c7ee0-f638-4b08-89a9-08976a26308c" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "700c7ee0-f638-4b08-89a9-08976a26308c", + "name": "\"beforeNodeEvaluate\" hook function", + "description": "", + "type": "log" + }, + "body": { + "pid": 1864, + "tid": "Main Thread", + "startTime": 514878514778900, + "endTime": 514878514919200 + }, + "additional": { + "logType": "info", + "children": [], + "durationId": "c2d79892-487d-4bb4-98bb-0f810a8e3508" + } + }, + { + "head": { + "id": "4967cb27-0ba3-47ee-8cd2-c738e85e3ab2", + "name": "eval hvigorfile", + "description": "Evaluate hvigorfile.", + "type": "duration" + }, + "body": { + "pid": 1864, + "tid": "Main Thread", + "startTime": 514878517032400 + }, + "additional": { + "children": [ + "6aafc09b-e6b6-4435-a3ad-5ecb24ac0b73", + "ee4684c6-95c1-4968-91c7-9dafbd71fadf" + ], + "state": "running", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "118aa0bf-63e2-48a6-ab2a-94f5e57e1581" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "6aafc09b-e6b6-4435-a3ad-5ecb24ac0b73", + "name": "require hvigorfile", + "description": "Require hvigorfile.", + "type": "duration" + }, + "body": { + "pid": 1864, + "tid": "Main Thread", + "startTime": 514878517033700, + "endTime": 514880115213600 + }, + "additional": { + "children": [], + "state": "success", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "4967cb27-0ba3-47ee-8cd2-c738e85e3ab2", + "logId": "2d8ee699-1850-48ca-8285-5fb63cd25642" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "ee4684c6-95c1-4968-91c7-9dafbd71fadf", + "name": "bind plugins", + "description": "Bind plugins.", + "type": "duration" + }, + "body": { + "pid": 1864, + "tid": "Main Thread", + "startTime": 514880115236600 + }, + "additional": { + "children": [], + "state": "running", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "4967cb27-0ba3-47ee-8cd2-c738e85e3ab2" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "8fab9360-e91a-407e-88fc-75889f7576f3", + "name": "hvigorfile, resolving D:\\LiuDongHai\\FAQ最佳实践资料\\BestPractices\\BestPractices\\DevelopmentPractice\\NdkDrawing\\hvigorfile.ts", + "description": "", + "type": "log" + }, + "body": { + "pid": 1864, + "tid": "Main Thread", + "startTime": 514878517041100 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "174330ce-6f2d-4d66-b5e0-f5eb6da3c276", + "name": "hvigorfile, require result: { default: { system: [Function: appTasks], plugins: [] } }", + "description": "", + "type": "log" + }, + "body": { + "pid": 1864, + "tid": "Main Thread", + "startTime": 514880115091700 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "2d8ee699-1850-48ca-8285-5fb63cd25642", + "name": "require hvigorfile", + "description": "", + "type": "log" + }, + "body": { + "pid": 1864, + "tid": "Main Thread", + "startTime": 514878517033700, + "endTime": 514880115213600 + }, + "additional": { + "logType": "info", + "children": [], + "durationId": "6aafc09b-e6b6-4435-a3ad-5ecb24ac0b73" + } + }, + { + "head": { + "id": "187b34df-c011-4f6d-9221-54469e6e71e7", + "name": "hvigorfile, binding system plugins [Function: appTasks]", + "description": "", + "type": "log" + }, + "body": { + "pid": 1864, + "tid": "Main Thread", + "startTime": 514880115344800 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "46f8aba2-91fd-4e71-8c0f-9f97c74948e9", + "name": "hvigor build process will be closed with an error.", + "description": "", + "type": "log" + }, + "body": { + "pid": 1864, + "tid": "Main Thread", + "startTime": 514880299189000 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "91d085dc-8a02-4591-ace7-ea773f4ea5fd", + "name": "ERROR: stacktrace = Error: Invalid project path.\r\n\t Detail: Please move the project to a valid path\n at OhosLogger.errorMessageExit (D:\\LiuDongHai\\DevEco Studio\\tools\\hvigor\\hvigor\\src\\base\\log\\hvigor-log.js:1:3224)\n at OhosLogger._printAllExit (D:\\LiuDongHai\\DevEco Studio\\tools\\hvigor\\hvigor-ohos-plugin\\src\\utils\\log\\ohos-logger.js:1:1274)\n at ProjectInspection.exitOnError (D:\\LiuDongHai\\DevEco Studio\\tools\\hvigor\\hvigor-ohos-plugin\\src\\tasks\\inspection\\project-inspection.js:1:672)\n at AppPlugin.doProjectInspection (D:\\LiuDongHai\\DevEco Studio\\tools\\hvigor\\hvigor-ohos-plugin\\src\\plugin\\common\\abstract-project-plugin.js:1:1585)\n at PluginFactory.getAppPlugin (D:\\LiuDongHai\\DevEco Studio\\tools\\hvigor\\hvigor-ohos-plugin\\src\\plugin\\factory\\plugin-factory.js:1:2159)\n at appTasks (D:\\LiuDongHai\\DevEco Studio\\tools\\hvigor\\hvigor-ohos-plugin\\index.js:1:593)\n at bindSystemPlugins (D:\\LiuDongHai\\DevEco Studio\\tools\\hvigor\\hvigor\\src\\base\\internal\\lifecycle\\configuration.js:1:5900)\n at evaluateNodeVigorFile (D:\\LiuDongHai\\DevEco Studio\\tools\\hvigor\\hvigor\\src\\base\\internal\\lifecycle\\configuration.js:1:8450)\n at evalProject (D:\\LiuDongHai\\DevEco Studio\\tools\\hvigor\\hvigor\\src\\base\\internal\\lifecycle\\configuration.js:1:3495)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)", + "description": "", + "type": "log" + }, + "body": { + "pid": 1864, + "tid": "Main Thread", + "startTime": 514880300351000 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "5e715dfd-a155-460d-b1d6-2701e214da82", + "name": "\"buildFinished\" hook function", + "description": "", + "type": "duration" + }, + "body": { + "pid": 1864, + "tid": "Main Thread", + "startTime": 514880306752800, + "endTime": 514880306888900 + }, + "additional": { + "children": [], + "state": "success", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "a6a637c6-84e1-43a5-b5fb-453901f6e7da", + "logId": "0e0936ad-db2c-46d5-a068-7c675dcd4afc" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "0e0936ad-db2c-46d5-a068-7c675dcd4afc", + "name": "\"buildFinished\" hook function", + "description": "", + "type": "log" + }, + "body": { + "pid": 1864, + "tid": "Main Thread", + "startTime": 514880306752800, + "endTime": 514880306888900 + }, + "additional": { + "logType": "info", + "children": [], + "durationId": "5e715dfd-a155-460d-b1d6-2701e214da82" + } + }, + { + "head": { + "id": "9edb36b7-e21c-452f-9041-9acbd8137d33", + "name": "", + "description": "", + "type": "mark" + }, + "body": { + "pid": 1864, + "tid": "Main Thread", + "startTime": 514878486379100, + "endTime": 514880307523600 + }, + "additional": { + "time": { + "year": 2025, + "month": 5, + "day": 15, + "hour": 10, + "minute": 43 + }, + "completeCommand": "{\"prop\":[\"product=default\"],\"sync\":true,\"parallel\":true,\"incremental\":true,\"daemon\":true,\"_\":[],\"analyze\":\"normal\"};", + "hvigorVersion": "5.17.0", + "markType": "history", + "nodeVersion": "v18.20.1", + "category": "build", + "state": "failed" + } + }, + { + "head": { + "id": "6dadec55-d233-4d20-a0c2-8e045c9322a0", + "name": "BUILD FAILED in 1 s 821 ms ", + "description": "", + "type": "log" + }, + "body": { + "pid": 1864, + "tid": "Main Thread", + "startTime": 514880307658500 + }, + "additional": { + "logType": "error", + "children": [] + } + } + ] +} \ No newline at end of file diff --git a/NdkDrawing/.idea/.deveco/project.cache.json b/NdkDrawing/.idea/.deveco/project.cache.json new file mode 100644 index 0000000000000000000000000000000000000000..9cf2d4a556c51ac7219505d6604c9c1c13c4f070 --- /dev/null +++ b/NdkDrawing/.idea/.deveco/project.cache.json @@ -0,0 +1,10 @@ +{ + "CommonInfo":{ + "project.ide.version":"5.0.13.100", + "current.select.product":"", + "current.select.buildMode":"" + }, + "BuildOptions":{ + + } +} \ No newline at end of file diff --git a/NdkDrawing/.idea/.gitignore b/NdkDrawing/.idea/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..359bb5307e8535ab7d59faf27a7377033291821e --- /dev/null +++ b/NdkDrawing/.idea/.gitignore @@ -0,0 +1,3 @@ +# 默认忽略的文件 +/shelf/ +/workspace.xml diff --git a/NdkDrawing/.idea/git_toolbox_blame.xml b/NdkDrawing/.idea/git_toolbox_blame.xml new file mode 100644 index 0000000000000000000000000000000000000000..7dc124965d28403ec2545a24d7d1cd1fec1f57d8 --- /dev/null +++ b/NdkDrawing/.idea/git_toolbox_blame.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/NdkDrawing/.idea/modules.xml b/NdkDrawing/.idea/modules.xml new file mode 100644 index 0000000000000000000000000000000000000000..9e4186588dcb516dd1caa8511ad87c3bc18029fb --- /dev/null +++ b/NdkDrawing/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/NdkDrawing/.idea/modules/NdkDrawing.iml b/NdkDrawing/.idea/modules/NdkDrawing.iml new file mode 100644 index 0000000000000000000000000000000000000000..c18b750345e8b2634d9c96c6aeb46c05139195ca --- /dev/null +++ b/NdkDrawing/.idea/modules/NdkDrawing.iml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/NdkDrawing/AppScope/app.json5 b/NdkDrawing/AppScope/app.json5 new file mode 100644 index 0000000000000000000000000000000000000000..35664b2dcfd75de02951db516bd3051b640fbd80 --- /dev/null +++ b/NdkDrawing/AppScope/app.json5 @@ -0,0 +1,10 @@ +{ + "app": { + "bundleName": "com.example.ndkdrawing", + "vendor": "example", + "versionCode": 1000000, + "versionName": "1.0.0", + "icon": "$media:app_icon", + "label": "$string:app_name" + } +} diff --git a/NdkDrawing/AppScope/resources/base/element/string.json b/NdkDrawing/AppScope/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..1fa2ec9d28f735445da400a28de8bdb772db1192 --- /dev/null +++ b/NdkDrawing/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "NdkDrawing" + } + ] +} diff --git a/NdkDrawing/AppScope/resources/base/media/app_icon.png b/NdkDrawing/AppScope/resources/base/media/app_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..a39445dc87828b76fed6d2ec470dd455c45319e3 Binary files /dev/null and b/NdkDrawing/AppScope/resources/base/media/app_icon.png differ diff --git a/NdkDrawing/LICENSE b/NdkDrawing/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..338e5b0bc22082e0ffcc7121c2ed3897a3ddccb0 --- /dev/null +++ b/NdkDrawing/LICENSE @@ -0,0 +1,78 @@ + Copyright (c) 2024 Huawei Device Co., Ltd. All rights reserved. + + 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. + +Apache License, Version 2.0 +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + +2. Grant of Copyright License. + +Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. + +Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. + +You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: +1.You must give any other recipients of the Work or Derivative Works a copy of this License; and +2.You must cause any modified files to carry prominent notices stating that You changed the files; and +3.You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and +4.If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + +You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + +5. Submission of Contributions. + +Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + +6. Trademarks. + +This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. + +Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. + +In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. + +While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS \ No newline at end of file diff --git a/NdkDrawing/build-profile.json5 b/NdkDrawing/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..19b2d1d0b868064df8c461ecdbbdbb5f6755b07f --- /dev/null +++ b/NdkDrawing/build-profile.json5 @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2024 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. + */ + +{ + "app": { + "signingConfigs": [], + "products": [ + { + "name": "default", + "signingConfig": "default", + "compatibleSdkVersion": "5.0.0(12)", + "runtimeOS": "HarmonyOS", + } + ], + "buildModeSet": [ + { + "name": "debug", + }, + { + "name": "release" + } + ] + }, + "modules": [ + { + "name": "entry", + "srcPath": "./entry", + "targets": [ + { + "name": "default", + "applyToProducts": [ + "default" + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/NdkDrawing/entry/build-profile.json5 b/NdkDrawing/entry/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..640f4efe5cc97a212f4c9258e817ae601ab3a79c --- /dev/null +++ b/NdkDrawing/entry/build-profile.json5 @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2024 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. + */ + +{ + "apiType": "stageMode", + "buildOption": { + "externalNativeOptions": { + "path": "./src/main/cpp/CMakeLists.txt", + "arguments": "", + "cppFlags": "", + "abiFilters": [ + "arm64-v8a","x86_64" + ], + } + }, + "buildOptionSet": [ + { + "name": "release", + "arkOptions": { + "obfuscation": { + "ruleOptions": { + "enable": true, + "files": [ + "./obfuscation-rules.txt" + ] + } + } + }, + "nativeLib": { + "debugSymbol": { + "strip": true, + "exclude": [] + } + } + }, + ], + "targets": [ + { + "name": "default" + }, + { + "name": "ohosTest", + } + ] +} \ No newline at end of file diff --git a/NdkDrawing/entry/hvigorfile.ts b/NdkDrawing/entry/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..c6edcd90486dd5a853cf7d34c8647f08414ca7a3 --- /dev/null +++ b/NdkDrawing/entry/hvigorfile.ts @@ -0,0 +1,6 @@ +import { hapTasks } from '@ohos/hvigor-ohos-plugin'; + +export default { + system: hapTasks, /* Built-in plugin of Hvigor. It cannot be modified. */ + plugins:[] /* Custom plugin to extend the functionality of Hvigor. */ +} diff --git a/NdkDrawing/entry/obfuscation-rules.txt b/NdkDrawing/entry/obfuscation-rules.txt new file mode 100644 index 0000000000000000000000000000000000000000..69c4d6a8a5531548e4886fa766090c5c157a87d9 --- /dev/null +++ b/NdkDrawing/entry/obfuscation-rules.txt @@ -0,0 +1,18 @@ +# Define project specific obfuscation rules here. +# You can include the obfuscation configuration files in the current module's build-profile.json5. +# +# For more details, see +# https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/source-obfuscation-V5 + +# Obfuscation options: +# -disable-obfuscation: disable all obfuscations +# -enable-property-obfuscation: obfuscate the property names +# -enable-toplevel-obfuscation: obfuscate the names in the global scope +# -compact: remove unnecessary blank spaces and all line feeds +# -remove-log: remove all console.* statements +# -print-namecache: print the name cache that contains the mapping from the old names to new names +# -apply-namecache: reuse the given cache file + +# Keep options: +# -keep-property-name: specifies property names that you want to keep +# -keep-global-name: specifies names that you want to keep in the global scope \ No newline at end of file diff --git a/NdkDrawing/entry/oh-package-lock.json5 b/NdkDrawing/entry/oh-package-lock.json5 new file mode 100644 index 0000000000000000000000000000000000000000..d99383e8276cd8f22825fa1a44540c885e0a2289 --- /dev/null +++ b/NdkDrawing/entry/oh-package-lock.json5 @@ -0,0 +1,18 @@ +{ + "meta": { + "stableOrder": true + }, + "lockfileVersion": 3, + "ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.", + "specifiers": { + "libndkDrawing.so@src/main/cpp/types/libndkDrawing": "libndkDrawing.so@src/main/cpp/types/libndkDrawing" + }, + "packages": { + "libndkDrawing.so@src/main/cpp/types/libndkDrawing": { + "name": "libndkDrawing.so", + "version": "1.0.0", + "resolved": "src/main/cpp/types/libndkDrawing", + "registryType": "local" + } + } +} \ No newline at end of file diff --git a/NdkDrawing/entry/oh-package.json5 b/NdkDrawing/entry/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..65e0530b9a3e488bb6095a03e340fbf2040fd8a0 --- /dev/null +++ b/NdkDrawing/entry/oh-package.json5 @@ -0,0 +1,11 @@ +{ + "name": "entry", + "version": "1.0.0", + "description": "Please describe the basic information.", + "main": "", + "author": "", + "license": "", + "dependencies": { + "libndkDrawing.so": "file:./src/main/cpp/types/libndkDrawing" + } +} \ No newline at end of file diff --git a/NdkDrawing/entry/src/main/cpp/CMakeLists.txt b/NdkDrawing/entry/src/main/cpp/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..8244e96e3d20d685d30748f75d68064337ec404a --- /dev/null +++ b/NdkDrawing/entry/src/main/cpp/CMakeLists.txt @@ -0,0 +1,23 @@ +# the minimum version of CMake. +cmake_minimum_required(VERSION 3.4.1) +project(NdkDrawing) + +set(NATIVERENDER_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR}) + +if(DEFINED PACKAGE_FIND_FILE) + include(${PACKAGE_FIND_FILE}) +endif() + +include_directories(${NATIVERENDER_ROOT_PATH} ${NATIVERENDER_ROOT_PATH}/include) + +add_library(ndkDrawing SHARED native_bridge.cpp) + +find_library(hilog-lib hilog_ndk.z) + +target_link_libraries(ndkDrawing PUBLIC libace_napi.z.so) +target_link_libraries(ndkDrawing PUBLIC ${hilog-lib}) +target_link_libraries(ndkDrawing PUBLIC libnative_window.so) +target_link_libraries(ndkDrawing PUBLIC libnative_drawing.so) +target_link_libraries(ndkDrawing PUBLIC libpixelmap_ndk.z.so) +target_link_libraries(ndkDrawing PUBLIC libimage_source_ndk.z.so) +target_link_libraries(ndkDrawing PUBLIC librawfile.z.so) \ No newline at end of file diff --git a/NdkDrawing/entry/src/main/cpp/common/log_common.h b/NdkDrawing/entry/src/main/cpp/common/log_common.h new file mode 100644 index 0000000000000000000000000000000000000000..83b4a5ea03db2c7086b4a935b5a156a6227d2b44 --- /dev/null +++ b/NdkDrawing/entry/src/main/cpp/common/log_common.h @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2024 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. + */ +#ifndef LOG_COMMON_H +#define LOG_COMMON_H +#include +#define LOG_PRINT_DOMAIN 0xFF00 +#define APP_LOG_DOMAIN 0x0001 +constexpr const char *APP_LOG_TAG = "ndkDrawing"; +#define DRAWING_LOGI(...) ((void)OH_LOG_Print(LOG_APP, LOG_INFO, LOG_DOMAIN, APP_LOG_TAG, __VA_ARGS__)) +#define DRAWING_LOGD(...) ((void)OH_LOG_Print(LOG_APP, LOG_DEBUG, LOG_DOMAIN, APP_LOG_TAG, __VA_ARGS__)) +#define DRAWING_LOGW(...) ((void)OH_LOG_Print(LOG_APP, LOG_WARN, LOG_DOMAIN, APP_LOG_TAG, __VA_ARGS__)) +#define DRAWING_LOGE(...) ((void)OH_LOG_Print(LOG_APP, LOG_ERROR, LOG_DOMAIN, APP_LOG_TAG, __VA_ARGS__)) + +#endif // LOG_COMMON_H diff --git a/NdkDrawing/entry/src/main/cpp/native_bridge.cpp b/NdkDrawing/entry/src/main/cpp/native_bridge.cpp new file mode 100644 index 0000000000000000000000000000000000000000..df896104cafba5a3f06c9fbbcf1f99fc72884ea0 --- /dev/null +++ b/NdkDrawing/entry/src/main/cpp/native_bridge.cpp @@ -0,0 +1,194 @@ +/* + * Copyright (c) 2024 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. + */ + +/** + * 最佳实践: 使用drawing自绘制能力提升性能 + */ + +#include "cmath" +#include "string" +#include "bits/alltypes.h" +#include "native_drawing/drawing_point.h" +#include "native_drawing/drawing_bitmap.h" +#include "native_drawing/drawing_color.h" +#include "native_drawing/drawing_color_filter.h" +#include "native_drawing/drawing_canvas.h" +#include "native_drawing/drawing_pen.h" +#include "native_drawing/drawing_pixel_map.h" +#include "native_drawing/drawing_brush.h" +#include "native_drawing/drawing_rect.h" +#include "native_drawing/drawing_font.h" +#include "native_drawing/drawing_path.h" +#include "native_drawing/drawing_register_font.h" +#include "native_drawing/drawing_filter.h" +#include "native_drawing/drawing_font_collection.h" +#include "native_drawing/drawing_text_blob.h" +#include "native_drawing/drawing_sampling_options.h" +#include "native_drawing/drawing_text_declaration.h" +#include "native_drawing/drawing_text_typography.h" +#include "native_drawing/drawing_types.h" +#include "native_drawing/drawing_typeface.h" +#include "multimedia/image_framework/image_mdk_common.h" +#include "multimedia/image_framework/image_mdk.h" +#include "multimedia/image_framework/image_pixel_map_mdk.h" +#include "napi/native_api.h" +#include "native_window/external_window.h" +#include "native_window/external_window.h" +#include "common/log_common.h" + +// [Start native_onDraw_pixelMap] +// entry\src\main\cpp\native_bridge.cpp +enum DrawType { NONE, PATH, TEXT, IMAGE }; +#define DRAW_MAX_NUM 1000 // Maximum number of drawn circles + +// Generate random coordinates +static int RangedRand(int range_min, int range_max) { + int r = ((double)rand() / RAND_MAX) * (range_max - range_min) + range_min; + return r; +} + +void DrawCircle(OH_Drawing_Path *path, int x, int y, int width) { + OH_Drawing_PathMoveTo(path, x + width, y); + OH_Drawing_Rect *rect = OH_Drawing_RectCreate(x - width, y - width, x + width, y + width); + OH_Drawing_PathAddArc(path, rect, 0, 360); +} + +// Scene draw by fusion of hollow circle and background image +static void NativeOnDrawPixelMap(OH_Drawing_Canvas *canvas, NativePixelMap *nativeMap) { + // Draw a background picture + OH_Drawing_CanvasSave(canvas); + OH_Drawing_PixelMap *pixelMap = OH_Drawing_PixelMapGetFromNativePixelMap(nativeMap); + // Create a sampling option object + OH_Drawing_SamplingOptions *sampling = OH_Drawing_SamplingOptionsCreate(FILTER_MODE_NEAREST, MIPMAP_MODE_NONE); + // Acquiring a background image drawing area + OH_Drawing_Rect *src = OH_Drawing_RectCreate(0, 0, 360, 693); + // Create a render area + OH_Drawing_Rect *dst = OH_Drawing_RectCreate(0, 0, 1300, 2800); + // Create a brush + OH_Drawing_Brush *brush = OH_Drawing_BrushCreate(); + OH_Drawing_CanvasAttachBrush(canvas, brush); + // Render the background image to the designated area of the canvas. + OH_Drawing_CanvasDrawPixelMapRect(canvas, pixelMap, src, dst, sampling); + OH_Drawing_CanvasDetachBrush(canvas); + + // Call hierarchical interface + OH_Drawing_CanvasSaveLayer(canvas, dst, brush); + + // Painting mask layer + OH_Drawing_Rect *rect2 = OH_Drawing_RectCreate(0, 0, 1300, 2800); + OH_Drawing_Brush *brush2 = OH_Drawing_BrushCreate(); + // Set the brush color + OH_Drawing_BrushSetColor(brush2, OH_Drawing_ColorSetArgb(0x77, 0xCC, 0xCC, 0xCC)); + OH_Drawing_CanvasAttachBrush(canvas, brush2); + OH_Drawing_CanvasDrawRect(canvas, rect2); + OH_Drawing_CanvasDetachBrush(canvas); + + OH_Drawing_Point *pointArray[DRAW_MAX_NUM]; + int x = 0; + int y = 0; + for (int i = 0; i < DRAW_MAX_NUM; i++) { + // Generate random coordinates + x = RangedRand(0, 1300); + y = RangedRand(0, 2800); + pointArray[i] = OH_Drawing_PointCreate(x, y); + } + + OH_Drawing_Point *point = OH_Drawing_PointCreate(800, 1750); + OH_Drawing_Brush *brush3 = OH_Drawing_BrushCreate(); + // Set the brush and blending mode of the circle. + OH_Drawing_BrushSetBlendMode(brush3, BLEND_MODE_DST_OUT); + OH_Drawing_CanvasAttachBrush(canvas, brush3); + // Circle + OH_Drawing_Path *path = OH_Drawing_PathCreate(); + for (int i = 0; i < DRAW_MAX_NUM; i++) { + x = RangedRand(0, 1300); + y = RangedRand(0, 2800); + DrawCircle(path, x, y, 15); + } + OH_Drawing_CanvasDrawPath(canvas, path); + + // Destroy the object + OH_Drawing_CanvasDetachBrush(canvas); + OH_Drawing_RectDestroy(rect2); + OH_Drawing_BrushDestroy(brush2); + OH_Drawing_BrushDestroy(brush3); + OH_Drawing_PointDestroy(point); + OH_Drawing_BrushDestroy(brush); + OH_Drawing_CanvasRestore(canvas); + OH_Drawing_SamplingOptionsDestroy(sampling); + OH_Drawing_RectDestroy(src); + OH_Drawing_RectDestroy(dst); +} +// [End native_onDraw_pixelMap] + +// [Start napi_value_onDraw] +// entry\src\main\cpp\native_bridge.cpp +static napi_value OnDraw(napi_env env, napi_callback_info info) { + size_t argc = 6; + napi_value args[6] = {nullptr}; + + napi_get_cb_info(env, info, &argc, args, nullptr, nullptr); + + int32_t id; + napi_get_value_int32(env, args[0], &id); + + // Graphic drawing context parameters + void *temp = nullptr; + napi_unwrap(env, args[1], &temp); + OH_Drawing_Canvas *canvas = reinterpret_cast(temp); + + int32_t width; + napi_get_value_int32(env, args[2], &width); + + int32_t height; + napi_get_value_int32(env, args[3], &height); + + DRAWING_LOGI("OnDraw, width:%{public}d, helght:%{public}d", width, height); + int32_t drawOption; + napi_get_value_int32(env, args[4], &drawOption); + // Background image parameters + NativePixelMap *nativePixelMap = OH_PixelMap_InitNativePixelMap(env, args[5]); + if (drawOption == IMAGE) { + // Call the fusion drawing interface to draw + NativeOnDrawPixelMap(canvas, nativePixelMap); + } + return nullptr; +} +// [End napi_value_onDraw] + +// [Start napi_value_init] +// entry\src\main\cpp\native_bridge.cpp +EXTERN_C_START +static napi_value Init(napi_env env, napi_value exports) { + napi_property_descriptor desc[] = { + // Expose the NativeOnDraw interface for the front-end to call and bind the native OnDraw function + {"nativeOnDraw", nullptr, OnDraw, nullptr, nullptr, nullptr, napi_default, nullptr}}; + napi_define_properties(env, exports, sizeof(desc) / sizeof(desc[0]), desc); + return exports; +} +EXTERN_C_END +// [End napi_value_init] + +static napi_module demoModule = { + .nm_version = 1, + .nm_flags = 0, + .nm_filename = nullptr, + .nm_register_func = Init, + .nm_modname = "ndkDrawing", + .nm_priv = ((void *)0), + .reserved = {0}, +}; + +extern "C" __attribute__((constructor)) void RegisterEntryModule(void) { napi_module_register(&demoModule); } diff --git a/NdkDrawing/entry/src/main/cpp/types/libndkDrawing/Index.d.ts b/NdkDrawing/entry/src/main/cpp/types/libndkDrawing/Index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..25f15c498de567f29f1bbeec7384257b8b901c2a --- /dev/null +++ b/NdkDrawing/entry/src/main/cpp/types/libndkDrawing/Index.d.ts @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2024 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 { DrawContext } from '@ohos.arkui.node'; +import image from '@ohos.multimedia.image'; + +export const nativeOnDraw: (id: number, context: DrawContext, width: number, height: number, type: number, + imagePixel: image.PixelMap) => number; \ No newline at end of file diff --git a/NdkDrawing/entry/src/main/cpp/types/libndkDrawing/oh-package.json5 b/NdkDrawing/entry/src/main/cpp/types/libndkDrawing/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..112a3e08d2d5200cc34db14bb3f092c63408fab3 --- /dev/null +++ b/NdkDrawing/entry/src/main/cpp/types/libndkDrawing/oh-package.json5 @@ -0,0 +1,6 @@ +{ + "name": "libndkDrawing.so", + "types": "./Index.d.ts", + "version": "1.0.0", + "description": "Please describe the basic information." +} \ No newline at end of file diff --git a/NdkDrawing/entry/src/main/ets/entryability/EntryAbility.ets b/NdkDrawing/entry/src/main/ets/entryability/EntryAbility.ets new file mode 100644 index 0000000000000000000000000000000000000000..d608e6c452f2c69c1b8d558700b25884b4af49a4 --- /dev/null +++ b/NdkDrawing/entry/src/main/ets/entryability/EntryAbility.ets @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2024 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 { AbilityConstant, UIAbility, Want } from '@kit.AbilityKit'; +import { hilog } from '@kit.PerformanceAnalysisKit'; +import { window } from '@kit.ArkUI'; +import { BusinessError } from '@kit.BasicServicesKit'; + +export default class EntryAbility extends UIAbility { + windowClass: window.Window | undefined = undefined; + isLayoutFullScreen = true; + + onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); + } + + onDestroy(): void { + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onDestroy'); + } + + onWindowStageCreate(windowStage: window.WindowStage): void { + // Main window is created, set main page for this ability + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); + + windowStage.getMainWindow((err: BusinessError, data) => { + const errCode: number = err.code; + if (errCode) { + console.error(`Failed to obtain the main window. Cause code: ${err.code}, message: ${err.message}`); + return; + } + this.windowClass = data; + let isLayoutFullScreen = true; + try { + let promise = this.windowClass.setWindowLayoutFullScreen(isLayoutFullScreen); + promise.then(() => { + console.info('Succeeded in setting the window layout to full-screen mode.'); + }).catch((err: BusinessError) => { + console.error(`Failed to set the window layout to full-screen mode. Cause code: ${err.code}, + message: ${err.message}`); + }); + } catch (exception) { + console.error(`Failed to set the window layout to full-screen mode. Cause code: ${exception.code}, + message: ${exception.message}`); + } + this.windowClass.setSpecificSystemBarEnabled('navigationIndicator', false); + this.windowClass.setSpecificSystemBarEnabled('status', false); + }); + windowStage.loadContent('pages/Index', (err) => { + AppStorage.setOrCreate('uiContext', windowStage.getMainWindowSync().getUIContext()); + 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.'); + }); + } + + onWindowStageDestroy(): void { + // Main window is destroyed, release UI related resources + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); + } + + onForeground(): void { + // Ability has brought to foreground + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onForeground'); + } + + onBackground(): void { + // Ability has back to background + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onBackground'); + } +} diff --git a/NdkDrawing/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/NdkDrawing/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets new file mode 100644 index 0000000000000000000000000000000000000000..be794f48ccffc46278e76ce3493088a647b0d470 --- /dev/null +++ b/NdkDrawing/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2024 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 { hilog } from '@kit.PerformanceAnalysisKit'; +import { BackupExtensionAbility, BundleVersion } from '@kit.CoreFileKit'; + +export default class EntryBackupAbility extends BackupExtensionAbility { + async onBackup() { + hilog.info(0x0000, 'testTag', 'onBackup ok'); + } + + async onRestore(bundleVersion: BundleVersion) { + hilog.info(0x0000, 'testTag', 'onRestore ok %{public}s', JSON.stringify(bundleVersion)); + } +} \ No newline at end of file diff --git a/NdkDrawing/entry/src/main/ets/pages/Index.ets b/NdkDrawing/entry/src/main/ets/pages/Index.ets new file mode 100644 index 0000000000000000000000000000000000000000..f85358b4a74b2a92b179fae3b19fabf145c8adb2 --- /dev/null +++ b/NdkDrawing/entry/src/main/ets/pages/Index.ets @@ -0,0 +1,135 @@ +/* + * Copyright (c) 2024 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. + */ + +/** + * 最佳实践: 使用drawing自绘制能力提升性能 + */ + +import { FrameNode, NodeController, RenderNode } from '@kit.ArkUI'; +import { resourceManager } from '@kit.LocalizationKit'; +import { BusinessError } from '@kit.BasicServicesKit'; +import { Context } from '@kit.AbilityKit'; +import { image } from '@kit.ImageKit'; +import testNapi from 'libndkDrawing.so'; + +enum DrawType { NONE, PATH, TEXT, IMAGE }; + +const uiContext: UIContext | undefined = AppStorage.get('uiContext'); + +// [Start my_render_node] +// entry\src\main\ets\pages\Index.ets +// Define a RenderNode self-drawing RenderNode MyRenderNode, so as to draw with the interface of Native +class MyRenderNode extends RenderNode { + private drawType: DrawType = DrawType.NONE; + private pMap: image.PixelMap | undefined = undefined; // 背景图 + + draw(context: DrawContext): void { + // Call the Native ondraw interface on the native side to draw, and pass in the background image this.pMap and the graphic drawing context as parameters + testNapi.nativeOnDraw(666, context, uiContext?.vp2px(this.size.width), uiContext?.vp2px(this.size.height), this.drawType, this.pMap); + } + + // Set the drawing type + resetType(type: DrawType): void { + this.drawType = type; + } + + // Set the background picture + setPixelMap(p: PixelMap): void { + this.pMap = p; + } +} +// [End my_render_node] + +// [Start my_node_controller] +// entry\src\main\ets\pages\Index.ets +// Create a MyRenderNode object +const newNode = new MyRenderNode(); +// Defines the size and location of the newNode +newNode.frame = { + x: 0, + y: 0, + width: 980, + height: 1280 +}; + +// Mount the MyRenderNode object node on the NodeContainer +class MyNodeController extends NodeController { + private rootNode: FrameNode | null = null; + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new FrameNode(uiContext); + if (this.rootNode === null) { + return null; + } + const renderNode = this.rootNode.getRenderNode(); + if (renderNode !== null) { + renderNode.appendChild(newNode); + } + return this.rootNode; + } +} +// [End my_node_controller] + +// [Start page_component] +// entry\src\main\ets\pages\Index.ets +@Entry +@Component +struct Index { + private myNodeController: MyNodeController = new MyNodeController(); + + aboutToAppear(): void { + const context: Context = this.getUIContext().getHostContext(); + const resourceMgr: resourceManager.ResourceManager = context.resourceManager; + resourceMgr.getRawFileContent('drawImage.jpg').then((fileData: Uint8Array) => { + console.info('success in getRawFileContent'); + const buffer = fileData.buffer.slice(0); + const imageSource: image.ImageSource = image.createImageSource(buffer); + imageSource.createPixelMap().then((pMap: image.PixelMap) => { + // Self-drawing rendering node background map + newNode.setPixelMap(pMap); + }).catch((err: BusinessError) => { + console.error(`fail to create PixelMap, err: ${err}`); + }).catch((err: BusinessError) => { + console.error(`fail to getRawFileContent, err: ${err}`); + }) + }) + } + + build() { + Stack() { + // Mount the self-drawn rendering node to NodeContainer + NodeContainer(this.myNodeController) + .height('100%') + Row() { + Button('Begin Draw') + .width('100%') + .height(40) + .onClick(() => { + newNode.resetType(DrawType.IMAGE); + newNode.invalidate(); + }) + } + .padding({ + right: 16, + bottom: 16, + left: 16 + }) + } + .alignContent(Alignment.Bottom) + .width('100%') + .height('100%') + } +} +// [End page_component] diff --git a/NdkDrawing/entry/src/main/ets/view/GlassCoverView.ets b/NdkDrawing/entry/src/main/ets/view/GlassCoverView.ets new file mode 100644 index 0000000000000000000000000000000000000000..498abe412c94b2c8a39e28f5d042e809989bf5f8 --- /dev/null +++ b/NdkDrawing/entry/src/main/ets/view/GlassCoverView.ets @@ -0,0 +1,73 @@ +// [Start glass_cover_view] +import { hiTraceMeter } from '@kit.PerformanceAnalysisKit'; + +/** + * Glass cladding effect + */ +@Preview +@Component +export default struct GlassCoverView { + @Prop @Watch('onDraw') pointsToDraw: number[][] = []; + private settings = new RenderingContextSettings(true); + private renderContext = new CanvasRenderingContext2D(this.settings); + private viewWidth: number = 0; + private viewHeight: number = 0; + + build() { + Stack() { + Canvas(this.renderContext) + .width('100%') + .height('100%') + .onAreaChange((_: Area, newValue: Area) => { + this.handleAreaChange(newValue); + }) + } + .height('100%') + .width('100%') + } + + private handleAreaChange(area: Area): void { + this.viewWidth = parseInt(area.width.toString()); + this.viewHeight = parseInt(area.height.toString()); + this.onDraw(); + } + + private onDraw(): void { + const canvas = this.renderContext; + canvas.reset(); + if (canvas === undefined) { + return; + } + // Hollow transparent circle + hiTraceMeter.startTrace('slow', 1); + console.info('debug: slow start'); + // Save drawing context + canvas.save(); + // Clears the specified pixel within the given rectangle + canvas.clearRect(0, 0, this.viewWidth, this.viewHeight); + // Specifies the fill color of the drawing + canvas.fillStyle = '#77CCCCCC'; + // Fill a rectangle + canvas.fillRect(0, 0, this.viewWidth, this.viewHeight); + // Draw a hollow circle + canvas.globalCompositeOperation = 'destination-out'; + canvas.fillStyle = '#CCCCCC'; + this.pointsToDraw.forEach((xy: number[]) => { + this.drawOneCell(canvas, xy[0] * this.viewWidth, xy[1] * this.viewHeight, px2vp(15)); + }) + canvas.fill(); + // Restore the saved drawing context + canvas.restore(); + console.info('debug: slow end'); + hiTraceMeter.finishTrace('slow', 1); + } + + /** + * Draw a circle according to the specified position and width + */ + private drawOneCell(canvas: CanvasRenderer, x: number, y: number, width: number): void { + canvas.moveTo(x + width, y); + canvas.arc(x, y, width, 0, Math.PI * 2); + } +} +// [End glass_cover_view] \ No newline at end of file diff --git a/NdkDrawing/entry/src/main/ets/view/Index.ets b/NdkDrawing/entry/src/main/ets/view/Index.ets new file mode 100644 index 0000000000000000000000000000000000000000..82b53297691bfc264d357a061eb97deb42b83367 --- /dev/null +++ b/NdkDrawing/entry/src/main/ets/view/Index.ets @@ -0,0 +1,47 @@ +// [Start index_view] +import GlassCoverView from './GlassCoverView'; + +@Entry +@Component +struct Index { + @State pointsToDraw: number[][] = []; + + /** + * Make a list of 1000 0-1 positions and draw circles at the corresponding positions + */ + startDraw(): void { + this.pointsToDraw = []; + for (let index = 0; index < 1000; index++) { + this.pointsToDraw.push([Math.random(), Math.random()]); + } + } + + build() { + Stack() { + Image($r('app.media.drawImage')) + .width('100%') + .height('100%') + // Transparent circle custom component, in which 1000 transparent circles are drawn + GlassCoverView({ pointsToDraw: this.pointsToDraw }) + .width('100%') + .height('100%') + Row() { + Button('Begin Draw') + .width('100%') + .height(40) + } + .padding({ + right: 16, + bottom: 16, + left: 16 + }) + .onClick(() => { + this.startDraw(); + }) + } + .alignContent(Alignment.Bottom) + .width('100%') + .height('100%') + } +} +// [End index_view] \ No newline at end of file diff --git a/NdkDrawing/entry/src/main/module.json5 b/NdkDrawing/entry/src/main/module.json5 new file mode 100644 index 0000000000000000000000000000000000000000..a1cea8b6a4560cee7bda7a2db52f310c035ab6c8 --- /dev/null +++ b/NdkDrawing/entry/src/main/module.json5 @@ -0,0 +1,52 @@ +{ + "module": { + "name": "entry", + "type": "entry", + "description": "$string:module_desc", + "mainElement": "EntryAbility", + "deviceTypes": [ + "phone", + "tablet", + "2in1" + ], + "deliveryWithInstall": true, + "installationFree": false, + "pages": "$profile:main_pages", + "abilities": [ + { + "name": "EntryAbility", + "srcEntry": "./ets/entryability/EntryAbility.ets", + "description": "$string:EntryAbility_desc", + "icon": "$media:layered_image", + "label": "$string:EntryAbility_label", + "startWindowIcon": "$media:startIcon", + "startWindowBackground": "$color:start_window_background", + "exported": true, + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ] + } + ], + "extensionAbilities": [ + { + "name": "EntryBackupAbility", + "srcEntry": "./ets/entrybackupability/EntryBackupAbility.ets", + "type": "backup", + "exported": false, + "metadata": [ + { + "name": "ohos.extension.backup", + "resource": "$profile:backup_config" + } + ], + } + ] + } +} \ No newline at end of file diff --git a/NdkDrawing/entry/src/main/resources/base/element/color.json b/NdkDrawing/entry/src/main/resources/base/element/color.json new file mode 100644 index 0000000000000000000000000000000000000000..3c712962da3c2751c2b9ddb53559afcbd2b54a02 --- /dev/null +++ b/NdkDrawing/entry/src/main/resources/base/element/color.json @@ -0,0 +1,8 @@ +{ + "color": [ + { + "name": "start_window_background", + "value": "#FFFFFF" + } + ] +} \ No newline at end of file diff --git a/NdkDrawing/entry/src/main/resources/base/element/string.json b/NdkDrawing/entry/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..d384d31508c6d29ba04d9d5a2ddf054eaa7bf885 --- /dev/null +++ b/NdkDrawing/entry/src/main/resources/base/element/string.json @@ -0,0 +1,16 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "module description" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "NdkDrawing" + } + ] +} \ No newline at end of file diff --git a/NdkDrawing/entry/src/main/resources/base/media/background.png b/NdkDrawing/entry/src/main/resources/base/media/background.png new file mode 100644 index 0000000000000000000000000000000000000000..f939c9fa8cc8914832e602198745f592a0dfa34d Binary files /dev/null and b/NdkDrawing/entry/src/main/resources/base/media/background.png differ diff --git a/NdkDrawing/entry/src/main/resources/base/media/foreground.png b/NdkDrawing/entry/src/main/resources/base/media/foreground.png new file mode 100644 index 0000000000000000000000000000000000000000..4483ddad1f079e1089d685bd204ee1cfe1d01902 Binary files /dev/null and b/NdkDrawing/entry/src/main/resources/base/media/foreground.png differ diff --git a/NdkDrawing/entry/src/main/resources/base/media/layered_image.json b/NdkDrawing/entry/src/main/resources/base/media/layered_image.json new file mode 100644 index 0000000000000000000000000000000000000000..fb49920440fb4d246c82f9ada275e26123a2136a --- /dev/null +++ b/NdkDrawing/entry/src/main/resources/base/media/layered_image.json @@ -0,0 +1,7 @@ +{ + "layered-image": + { + "background" : "$media:background", + "foreground" : "$media:foreground" + } +} \ No newline at end of file diff --git a/NdkDrawing/entry/src/main/resources/base/media/startIcon.png b/NdkDrawing/entry/src/main/resources/base/media/startIcon.png new file mode 100644 index 0000000000000000000000000000000000000000..205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b Binary files /dev/null and b/NdkDrawing/entry/src/main/resources/base/media/startIcon.png differ diff --git a/NdkDrawing/entry/src/main/resources/base/profile/backup_config.json b/NdkDrawing/entry/src/main/resources/base/profile/backup_config.json new file mode 100644 index 0000000000000000000000000000000000000000..78f40ae7c494d71e2482278f359ec790ca73471a --- /dev/null +++ b/NdkDrawing/entry/src/main/resources/base/profile/backup_config.json @@ -0,0 +1,3 @@ +{ + "allowToBackupRestore": true +} \ No newline at end of file diff --git a/NdkDrawing/entry/src/main/resources/base/profile/main_pages.json b/NdkDrawing/entry/src/main/resources/base/profile/main_pages.json new file mode 100644 index 0000000000000000000000000000000000000000..1898d94f58d6128ab712be2c68acc7c98e9ab9ce --- /dev/null +++ b/NdkDrawing/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,5 @@ +{ + "src": [ + "pages/Index" + ] +} diff --git a/NdkDrawing/entry/src/main/resources/en_US/element/string.json b/NdkDrawing/entry/src/main/resources/en_US/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..d384d31508c6d29ba04d9d5a2ddf054eaa7bf885 --- /dev/null +++ b/NdkDrawing/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": "NdkDrawing" + } + ] +} \ No newline at end of file diff --git a/NdkDrawing/entry/src/main/resources/rawfile/drawImage.jpg b/NdkDrawing/entry/src/main/resources/rawfile/drawImage.jpg new file mode 100644 index 0000000000000000000000000000000000000000..77e9ce2be855a0325da8a06bfe5098a664f74e98 Binary files /dev/null and b/NdkDrawing/entry/src/main/resources/rawfile/drawImage.jpg differ diff --git a/NdkDrawing/entry/src/main/resources/zh_CN/element/string.json b/NdkDrawing/entry/src/main/resources/zh_CN/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..548be098c83df0b47d0f695ae1ce599e35972785 --- /dev/null +++ b/NdkDrawing/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": "NdkDrawing" + } + ] +} \ No newline at end of file diff --git a/NdkDrawing/hvigor/hvigor-config.json5 b/NdkDrawing/hvigor/hvigor-config.json5 new file mode 100644 index 0000000000000000000000000000000000000000..06b2783670a348f95533b352c1ceda909a842bbc --- /dev/null +++ b/NdkDrawing/hvigor/hvigor-config.json5 @@ -0,0 +1,22 @@ +{ + "modelVersion": "5.0.0", + "dependencies": { + }, + "execution": { + // "analyze": "normal", /* Define the build analyze mode. Value: [ "normal" | "advanced" | false ]. Default: "normal" */ + // "daemon": true, /* Enable daemon compilation. Value: [ true | false ]. Default: true */ + // "incremental": true, /* Enable incremental compilation. Value: [ true | false ]. Default: true */ + // "parallel": true, /* Enable parallel compilation. Value: [ true | false ]. Default: true */ + // "typeCheck": false, /* Enable typeCheck. Value: [ true | false ]. Default: false */ + }, + "logging": { + // "level": "info" /* Define the log level. Value: [ "debug" | "info" | "warn" | "error" ]. Default: "info" */ + }, + "debugging": { + // "stacktrace": false /* Disable stacktrace compilation. Value: [ true | false ]. Default: false */ + }, + "nodeOptions": { + // "maxOldSpaceSize": 8192 /* Enable nodeOptions maxOldSpaceSize compilation. Unit M. Used for the daemon process. Default: 8192*/ + // "exposeGC": true /* Enable to trigger garbage collection explicitly. Default: true*/ + } +} diff --git a/NdkDrawing/hvigorfile.ts b/NdkDrawing/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..f3cb9f1a87a81687554a76283af8df27d8bda775 --- /dev/null +++ b/NdkDrawing/hvigorfile.ts @@ -0,0 +1,6 @@ +import { appTasks } from '@ohos/hvigor-ohos-plugin'; + +export default { + system: appTasks, /* Built-in plugin of Hvigor. It cannot be modified. */ + plugins:[] /* Custom plugin to extend the functionality of Hvigor. */ +} diff --git a/NdkDrawing/oh-package.json5 b/NdkDrawing/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..8bf916d4a165e0466c65bc49f58ab2e3c27e8931 --- /dev/null +++ b/NdkDrawing/oh-package.json5 @@ -0,0 +1,8 @@ +{ + "modelVersion": "5.0.0", + "description": "Please describe the basic information.", + "dependencies": { + }, + "devDependencies": { + } +} diff --git a/NdkDrawing/oh_modules/.ohpm/lock.json5 b/NdkDrawing/oh_modules/.ohpm/lock.json5 new file mode 100644 index 0000000000000000000000000000000000000000..9e8ecdebc15f81d41533cc0ea10fa5b5e1bc55a2 --- /dev/null +++ b/NdkDrawing/oh_modules/.ohpm/lock.json5 @@ -0,0 +1,41 @@ +{ + "lockVersion": "1.0", + "settings": { + "resolveConflict": true, + "resolveConflictStrict": false, + "installAll": true + }, + "overrides": {}, + "overrideDependencyMap": {}, + "modules": { + ".": { + "name": "", + "dependencies": {}, + "devDependencies": {}, + "dynamicDependencies": {}, + "maskedByOverrideDependencyMap": false + }, + "entry": { + "name": "entry", + "dependencies": { + "libndkDrawing.so": { + "specifier": "file:entry/src/main/cpp/types/libndkDrawing", + "version": "file:entry/src/main/cpp/types/libndkDrawing" + } + }, + "devDependencies": {}, + "dynamicDependencies": {}, + "maskedByOverrideDependencyMap": false + } + }, + "packages": { + "libndkDrawing.so@file:entry/src/main/cpp/types/libndkDrawing": { + "storePath": "entry/src/main/cpp/types/libndkDrawing", + "dependencies": {}, + "dynamicDependencies": {}, + "dev": false, + "dynamic": false, + "maskedByOverrideDependencyMap": false + } + } +} \ No newline at end of file diff --git a/NdkQoS/entry/src/main/cpp/main.cpp b/NdkQoS/entry/src/main/cpp/main.cpp index 8132541db0caeabfd2d0a8e2e3a24a70e70769d0..c8e78899645db41587a20b5e970c3049370febe8 100644 --- a/NdkQoS/entry/src/main/cpp/main.cpp +++ b/NdkQoS/entry/src/main/cpp/main.cpp @@ -33,7 +33,7 @@ static double g_durationTime = 0; // Calculate task time consumption static int g_mask = 2; // bind cpu static int *g_affinity = &g_mask; -// DocsCode2 +// [Start do_fid] // Perform Fibonacci sequence calculations long long DoFib(double n) { if (n == ONE) { @@ -99,10 +99,9 @@ void SetQoS(QoS_Level level) { return; } } +// [End do_fid] -// DocsCode2 - -// DocsCode1 +// [Start add_loads] // the Load task void AddLoads(int n) { if (!n) { @@ -134,9 +133,9 @@ void AddLoads(int n) { // reset load flag g_addLoad = false; } -// DocsCode1 +// [End add_loads] -// DocsCode4 +// [Start high_qos_calculate] static napi_value highQoSCalculate(napi_env env, napi_callback_info info) { g_durationTime = 0; // Simulate system load @@ -159,9 +158,9 @@ static napi_value highQoSCalculate(napi_env env, napi_callback_info info) { napi_create_double(env, g_durationTime, &res); return res; } -// DocsCode4 +// [End high_qos_calculate] -// DocsCode3 +// [Start low_qos_calculate] static napi_value lowQoSCalculate(napi_env env, napi_callback_info info) { g_durationTime = 0; // Simulate system load @@ -185,7 +184,7 @@ static napi_value lowQoSCalculate(napi_env env, napi_callback_info info) { napi_create_double(env, g_durationTime, &res); return res; } -// DocsCode3 +// [End low_qos_calculate] EXTERN_C_START static napi_value Init(napi_env env, napi_value exports) { diff --git a/NetworkManagement/entry/src/main/ets/pages/CellularNetworkQuery.ets b/NetworkManagement/entry/src/main/ets/pages/CellularNetworkQuery.ets index f06946d71710fa94953b5731c470c03d6e00899f..05e2bcb5cd62285ea694a7537a381cf0bc2b95c2 100644 --- a/NetworkManagement/entry/src/main/ets/pages/CellularNetworkQuery.ets +++ b/NetworkManagement/entry/src/main/ets/pages/CellularNetworkQuery.ets @@ -13,8 +13,10 @@ * limitations under the License. */ -import { BusinessError } from '@kit.BasicServicesKit'; +// [Start import_radio] import { radio } from '@kit.TelephonyKit'; +import { BusinessError } from '@kit.BasicServicesKit'; +// [End import_radio] import { hilog } from '@kit.PerformanceAnalysisKit'; @Builder @@ -27,7 +29,7 @@ export struct CellularNetworkQuery { @State text: ResourceStr = ''; @State textArea: string = ''; - // DocsCode 1 + // [Start get_network_status] getNetworkStatus() { radio.getNetworkState((err: BusinessError, data: radio.NetworkState) => { if (err) { @@ -35,15 +37,14 @@ export struct CellularNetworkQuery { return; } hilog.info(0x0000, 'Sample', 'getNetworkState success, callback: data->: %{public}s', JSON.stringify(data)); - // DocsDot + // [StartExclude get_network_status] this.textArea = `getNetworkState success, callback: data->${JSON.stringify(data)}`; - // DocsDot + // [EndExclude get_network_status] }); } + // [End get_network_status] - // DocsCode 1 - - // DocsCode 2 + // [Start get_signal_type] getSignalType() { let slotId: number = 0; radio.getSignalInformation(slotId, (err: BusinessError, data: Array) => { @@ -53,32 +54,30 @@ export struct CellularNetworkQuery { } hilog.info(0x0000, 'Sample', 'getSignalInformation success, callback: data->: %{public}s', JSON.stringify(data)); let signalType = data[0]?.signalType; - // DocsDot + // [StartExclude get_signal_type] this.textArea = `signalType is: ${signalType}`; - // DocsDot + // [EndExclude get_signal_type] }); } + // [End get_signal_type] - // DocsCode 2 - - // DocsCode 3 + // [Start get_radio_status] getRadioStatus() { radio.isRadioOn((err: BusinessError, data: boolean) => { if (err) { hilog.error(0x0000, 'Sample', 'isRadioOn failed, callback: err->: %{public}s', JSON.stringify(err)); - // DocsDot + // [StartExclude get_radio_status] this.textArea = `isRadioOn failed, callback: err->${JSON.stringify(err)}`; - // DocsDot + // [EndExclude get_radio_status] return; } hilog.info(0x0000, 'Sample', 'isRadioOn success, callback: data->: %{public}s', JSON.stringify(data)); - // DocsDot + // [StartExclude get_radio_status] this.textArea = `isRadioOn success, callback: data->${JSON.stringify(data)}`; - // DocsDot + // [EndExclude get_radio_status] }); } - - // DocsCode 3 + // [End get_radio_status] @Builder NavDestinationTitle() { diff --git a/NetworkManagement/entry/src/main/ets/pages/GetNetworkConnectionInfo.ets b/NetworkManagement/entry/src/main/ets/pages/GetNetworkConnectionInfo.ets index a7e133981e29d6f246edb88877d5d99dab27a481..b06b37631117cb57ce7dcdb9190f499adc5fc9e4 100644 --- a/NetworkManagement/entry/src/main/ets/pages/GetNetworkConnectionInfo.ets +++ b/NetworkManagement/entry/src/main/ets/pages/GetNetworkConnectionInfo.ets @@ -13,8 +13,10 @@ * limitations under the License. */ +// [Start import_connection] import { connection } from '@kit.NetworkKit'; import { BusinessError } from '@kit.BasicServicesKit'; +// [End import_connection] import { hilog } from '@kit.PerformanceAnalysisKit'; @Builder @@ -27,7 +29,7 @@ export struct GetNetworkConnectionInfo { @State text: ResourceStr = ''; @State textArea: string = ''; - // DocsCode 1 + // [Start get_network_connection_type] getNetworkConnectionType() { try { let netHandle = connection.getDefaultNetSync(); @@ -36,19 +38,18 @@ export struct GetNetworkConnectionInfo { } let netCapability = connection.getNetCapabilitiesSync(netHandle); hilog.info(0x0000, 'Sample', 'bearerTypes: %{public}s', JSON.stringify(netCapability.bearerTypes)); - // DocsDot + // [StartExclude get_network_connection_type] this.textArea = 'bearerTypes:' + JSON.stringify(netCapability.bearerTypes); - // DocsDot + // [EndExclude get_network_connection_type] } catch (e) { let err = e as BusinessError; hilog.error(0x0000, 'Sample', 'errCode: %{public}s, errMessage: %{public}s', (err as BusinessError).code, (err as BusinessError).message); } } + // [End get_network_connection_type] - // DocsCode 1 - - // DocsCode 2 + // [Start fuction_judge_has_net] judgeHasNet(): boolean { try { let netHandle = connection.getDefaultNetSync(); @@ -60,15 +61,15 @@ export struct GetNetworkConnectionInfo { if (cap.includes(connection.NetCap.NET_CAPABILITY_VALIDATED)) { // connection.NetCap.NET_CAPABILITY_VALIDATED,The value indicates that the network is normal and HTTP and HTTPS requests can be initiated。 // The network information changes and the network is available - // DocsDot + // [StartExclude fuction_judge_has_net] this.textArea = 'true'; - // DocsDot + // [EndExclude fuction_judge_has_net] return true; } else { // The network information changes and the network is unavailable. - // DocsDot + // [StartExclude fuction_judge_has_net] this.textArea = 'false'; - // DocsDot + // [EndExclude fuction_judge_has_net] return false; } } catch (e) { @@ -77,10 +78,9 @@ export struct GetNetworkConnectionInfo { } return false; } + // [End fuction_judge_has_net] - // DocsCode 2 - - // DocsCode 3 + // [Start get_route_info_and_link_address] getRouteInfoAndLinkAddress() { connection.getDefaultNet().then((netHandle: connection.NetHandle) => { if (!netHandle || netHandle.netId === 0) { @@ -95,15 +95,14 @@ export struct GetNetworkConnectionInfo { hilog.info(0x0000, 'Sample', 'Succeeded to get data: %{public}s', JSON.stringify(data)); let routeInfo = data.routes; let linkAddress = data.linkAddresses; - // DocsDot + // [StartExclude get_route_info_and_link_address] this.textArea = 'routeInfo is: ' + JSON.stringify(routeInfo) + '\n' + 'linkAddress is: ' + JSON.stringify(linkAddress); - // DocsDot + // [EndExclude get_route_info_and_link_address] }) }); } - - // DocsCode 3 + // [End get_route_info_and_link_address] @Builder NavDestinationTitle() { diff --git a/NetworkManagement/entry/src/main/ets/pages/ListeningNetworkStatus.ets b/NetworkManagement/entry/src/main/ets/pages/ListeningNetworkStatus.ets index bedee70f8ad8f8bf8a8db545022f2f9985cc7f39..51bba8543e824ced39ed7d73db973b7e4b6f3ec6 100644 --- a/NetworkManagement/entry/src/main/ets/pages/ListeningNetworkStatus.ets +++ b/NetworkManagement/entry/src/main/ets/pages/ListeningNetworkStatus.ets @@ -15,9 +15,13 @@ import { connection } from '@kit.NetworkKit'; import { promptAction } from '@kit.ArkUI'; +// [Start import_netQuality] import { BusinessError } from '@kit.BasicServicesKit'; import { netHandover, netQuality } from '@kit.NetworkBoostKit'; +// [End import_netQuality] +// [Start import_wifi_manager] import { wifiManager } from '@kit.ConnectivityKit'; +// [End import_wifi_manager] import { hilog } from '@kit.PerformanceAnalysisKit'; @Builder @@ -25,10 +29,12 @@ export function ListeningNetworkStatusBuilder() { ListeningNetworkStatus() } +// [Start video_player] @Component export struct ListeningNetworkStatus { controller: VideoController = new VideoController(); @State videoSrc: Resource = $rawfile('video.mp4'); // Replace it with the actual video loading URL. + // [End video_player] private netCon: connection.NetConnection | null = null; private networkPause: boolean = false; // Listen to the loading status private isLowQuality: boolean = false; @@ -41,7 +47,7 @@ export struct ListeningNetworkStatus { this.handoverChangeListen(); } - // DocsCode 1 + // [Start net_con_unregister] aboutToDisappear(): void { this.netCon?.unregister((error: BusinessError) => { if (error) { @@ -49,10 +55,9 @@ export struct ListeningNetworkStatus { } }); } + // [End net_con_unregister] - // DocsCode 1 - - // DocsCode 2 + // [Start function_network_listen] networkListen() { this.netCon = connection.createNetConnection(); this.netCon.register((error: BusinessError) => { @@ -66,7 +71,9 @@ export struct ListeningNetworkStatus { hilog.info(0x0000, 'Sample', 'Succeeded to get netAvailable: %{public}s', JSON.stringify(data)); if (connection.hasDefaultNetSync()) { if (this.networkPause) { + // [Start video_start] this.controller?.start(); + // [End video_start] this.networkPause = false; } } @@ -75,7 +82,9 @@ export struct ListeningNetworkStatus { // Subscribe to network loss events this.netCon.on('netLost', (data: connection.NetHandle) => { if (connection.getAllNetsSync().length == 0) { + // [Start video_pause] this.controller?.pause(); + // [End video_pause] this.networkPause = true; } hilog.info(0x0000, 'Sample', 'Succeeded to get netLost: %{public}s', JSON.stringify(data)); @@ -89,10 +98,8 @@ export struct ListeningNetworkStatus { hilog.info(0x0000, 'Sample', 'Succeeded to get unavailable net event'); }); } + // [End function_network_listen] - // DocsCode 2 - - // DocsCode 3 judgeHasNet(): boolean { try { let netHandle = connection.getDefaultNetSync(); @@ -117,16 +124,13 @@ export struct ListeningNetworkStatus { return false; } - // DocsCode 3 - - // DocsCode 4 + // [Start toggle_low_definition] toggleLowDefinition() { this.videoSrc = $rawfile('lowQuality.mp4'); } + // [End toggle_low_definition] - // DocsCode 4 - - // DocsCode 5 + // [Start net_quality_listen] netQualityListen() { try { netQuality.on('netQosChange', (list: Array) => { @@ -148,10 +152,9 @@ export struct ListeningNetworkStatus { (err as BusinessError).message); } } + // [End net_quality_listen] - // DocsCode 5 - - // DocsCode 6 + // [Start wifi_change_listen] wifiChangeListen() { this.netCon = connection.createNetConnection({ netCapabilities: { @@ -187,10 +190,9 @@ export struct ListeningNetworkStatus { wifiManager.on('wifiStateChange', recvPowerNotifyFunc); wifiManager.on('wifiConnectionChange', recvWifiConnectionChangeFunc); } + // [End wifi_change_listen] - // DocsCode 6 - - // DocsCode 7 + // [Start scene_change_listen] sceneChangeListen() { try { netQuality.on('netSceneChange', (list: Array) => { @@ -198,11 +200,20 @@ export struct ListeningNetworkStatus { list.forEach((networkScene) => { // Callback information processing hilog.info(0x0000, 'Sample', 'Succeeded receive netSceneChange info'); + // [Start weak_signal_congestion] if (networkScene.scene === 'weakSignal' || networkScene.scene === 'congestion') { // Indicates the weak network scenario. + // [End weak_signal_congestion] hilog.info(0x0000, 'Sample', 'The current network is weak'); this.networkWeak(); + // [Start weak_signal_congestion] } + // [End weak_signal_congestion] + // [Start weak_signal_prediction] + if (networkScene.weakSignalPrediction) { + // Weak signal prediction processing + } + // [End weak_signal_prediction] }); } }); @@ -211,20 +222,18 @@ export struct ListeningNetworkStatus { (err as BusinessError).message); } } + // [End scene_change_listen] - // DocsCode 7 - - // DocsCode 8 + // [Start network_weak] networkWeak() { - promptAction.showToast({ + this.getUIContext().getPromptAction().showToast({ message: $r('app.string.weak_network_environment_message'), duration: 2000 }); } + // [End network_weak] - // DocsCode 8 - - // DocsCode 9 + // [Start handover_change_listen] handoverChangeListen() { try { netHandover.on('handoverChange', (info: netHandover.HandoverInfo) => { @@ -241,8 +250,7 @@ export struct ListeningNetworkStatus { (err as BusinessError).message); } } - - // DocsCode 9 + // [End handover_change_listen] @Builder NavDestinationTitle() { @@ -256,19 +264,20 @@ export struct ListeningNetworkStatus { } .width('100%') } - + // [Start video_player] build() { NavDestination() { Video({ src: this.videoSrc, controller: this.controller }) + // [End video_player] .objectFit(ImageFit.Cover) .onStart(() => { let judgeHasNet = this.judgeHasNet(); if (!judgeHasNet) { this.controller?.reset(); - promptAction.showToast({ + this.getUIContext().getPromptAction().showToast({ message: $r('app.string.network_unavailable_message'), duration: 2000 }); @@ -279,7 +288,7 @@ export struct ListeningNetworkStatus { Column() { Button($r('app.string.simulate_network_unavailable')).onClick(() => { this.controller.pause(); - promptAction.showToast({ + this.getUIContext().getPromptAction().showToast({ message: $r('app.string.network_unavailable_message'), duration: 2000 }); @@ -289,7 +298,7 @@ export struct ListeningNetworkStatus { .backgroundColor('#0A59F7') Button($r('app.string.simulate_network_lost')).onClick(() => { this.controller.pause(); - promptAction.showToast({ + this.getUIContext().getPromptAction().showToast({ message: $r('app.string.simulate_network_disconnected_message'), duration: 2000 }); @@ -299,7 +308,7 @@ export struct ListeningNetworkStatus { .backgroundColor('#0A59F7') Button($r('app.string.simulate_weak_network_environment')).onClick(() => { this.controller.pause(); - promptAction.showToast({ + this.getUIContext().getPromptAction().showToast({ message: $r('app.string.weak_network_toggle_video'), duration: 2000 }); @@ -309,7 +318,7 @@ export struct ListeningNetworkStatus { .backgroundColor('#0A59F7') Button($r('app.string.Simulate_low_quality_network_environment')).onClick(() => { this.controller.pause(); - promptAction.showToast({ + this.getUIContext().getPromptAction().showToast({ message: $r('app.string.low_quality_network_environment_message'), duration: 2000 }); @@ -321,13 +330,13 @@ export struct ListeningNetworkStatus { if (!this.isLowQuality) { this.toggleLowDefinition(); this.isLowQuality = true; - promptAction.showToast({ + this.getUIContext().getPromptAction().showToast({ message: $r('app.string.toggle_low_definition_message'), duration: 2000 }); this.controller?.reset(); } else { - promptAction.showToast({ + this.getUIContext().getPromptAction().showToast({ message: $r('app.string.toggle_definition_message_fail'), duration: 2000 }); @@ -340,7 +349,7 @@ export struct ListeningNetworkStatus { this.videoSrc = $rawfile('video.mp4'); this.isLowQuality = false; this.controller?.reset(); - promptAction.showToast({ + this.getUIContext().getPromptAction().showToast({ message: $r('app.string.toggle_high_definition_message'), duration: 2000 }); @@ -352,7 +361,11 @@ export struct ListeningNetworkStatus { .height(346) .padding({ left: 16, right: 16, bottom: 24 }) .margin({ bottom: 16 }) + // [Start video_player] } + // [End video_player] .title(this.NavDestinationTitle()) + // [Start video_player] } -} \ No newline at end of file +} +// [End video_player] \ No newline at end of file diff --git a/NetworkManagement/entry/src/main/ets/pages/WiFiQuery.ets b/NetworkManagement/entry/src/main/ets/pages/WiFiQuery.ets index af4faec467dd5ac9c9166e793f7954bcff83b0ff..37f990f31aff06314956b02250eda2a9f6c0cb47 100644 --- a/NetworkManagement/entry/src/main/ets/pages/WiFiQuery.ets +++ b/NetworkManagement/entry/src/main/ets/pages/WiFiQuery.ets @@ -26,69 +26,65 @@ export struct WiFiQuery { @State text: ResourceStr = ''; @State textArea: string = ''; - // DocsCode 1 + // [Start get_wifi_status] getWifiStatus() { try { let isWifiActive = wifiManager.isWifiActive(); hilog.info(0x0000, 'Sample', 'isWifiActive: %{public}s', isWifiActive); - // DocsDot + // [StartExclude get_wifi_status] this.textArea = 'isWifiActive:' + isWifiActive; - // DocsDot + // [EndExclude get_wifi_status] } catch (error) { hilog.error(0x0000, 'Sample', 'failed: err->: %{public}s', JSON.stringify(error)); } } + // [End get_wifi_status] - // DocsCode 1 - - // DocsCode 2 + // [Start get_wifi_is_connected] getWifiIsConnected() { try { let ret = wifiManager.isConnected(); hilog.info(0x0000, 'Sample', 'isConnected: %{public}s', ret); - // DocsDot + // [StartExclude get_wifi_is_connected] this.textArea = 'isConnected:' + ret; - // DocsDot + // [EndExclude get_wifi_is_connected] } catch (error) { hilog.error(0x0000, 'Sample', 'failed: err->: %{public}s', JSON.stringify(error)); } } + // [End get_wifi_is_connected] - // DocsCode 2 - - // DocsCode 3 + // [Start get_scan_info_list] getScanInfoList() { try { let scanInfoList = wifiManager.getScanInfoList(); hilog.info(0x0000, 'Sample', 'scanInfoList: %{public}s', JSON.stringify(scanInfoList)); - // DocsDot + // [StartExclude get_scan_info_list] this.textArea = 'scanInfoList:' + JSON.stringify(scanInfoList); - // DocsDot + // [EndExclude get_scan_info_list] } catch (error) { hilog.error(0x0000, 'Sample', 'failed: err->: %{public}s', JSON.stringify(error)); } } + // [End get_scan_info_list] - // DocsCode 3 - - // DocsCode 4 + // [Start get_signal_level] getSignalLevel() { try { let rssi = 0; let band = 0; let level = wifiManager.getSignalLevel(rssi, band); hilog.info(0x0000, 'Sample', 'level: %{public}s', JSON.stringify(level)); - // DocsDot + // [StartExclude get_signal_level] this.textArea = 'level:' + JSON.stringify(level); - // DocsDot + // [EndExclude get_signal_level] } catch (error) { hilog.error(0x0000, 'Sample', 'failed: err->: %{public}s', JSON.stringify(error)); } } + // [End get_signal_level] - // DocsCode 4 - - // DocsCode 5 + // [Start add_candidate_config] addCandidateConfig() { try { let config: wifiManager.WifiDeviceConfig = { @@ -101,15 +97,14 @@ export struct WiFiQuery { }).catch((err: number) => { hilog.error(0x0000, 'Sample', 'failed: err->: %{public}s', JSON.stringify(err)); }); - // DocsDot + // [StartExclude add_candidate_config] this.textArea = JSON.stringify(config); - // DocsDot + // [EndExclude add_candidate_config] } catch (error) { hilog.error(0x0000, 'Sample', 'failed: err->: %{public}s', JSON.stringify(error)); } } - - // DocsCode 5 + // [End add_candidate_config] @Builder NavDestinationTitle() { diff --git a/NonSameLayerRendering/.clang-format b/NonSameLayerRendering/.clang-format new file mode 100644 index 0000000000000000000000000000000000000000..48439ed68073b99be118d374d1ebd43d04d4c4eb --- /dev/null +++ b/NonSameLayerRendering/.clang-format @@ -0,0 +1,64 @@ +Language: Cpp +# BasedOnStyle: LLVM +ColumnLimit: 120 +SortIncludes: CaseSensitive +TabWidth: 4 +IndentWidth: 4 +UseTab: Never +AccessModifierOffset: -4 +ContinuationIndentWidth: 4 +IndentCaseBlocks: false +IndentCaseLabels: false +IndentGotoLabels: true +IndentWrappedFunctionNames: false +SortUsingDeclarations: false +NamespaceIndentation: None +SpaceAfterCStyleCast: false +SpaceAfterLogicalNot: false +SpaceAfterTemplateKeyword: true +SpaceBeforeAssignmentOperators: true +SpaceBeforeCaseColon: false +SpaceBeforeCpp11BracedList: false +SpaceBeforeCtorInitializerColon: true +SpaceBeforeInheritanceColon: true +SpaceBeforeRangeBasedForLoopColon: true +SpaceBeforeSquareBrackets: false +SpaceInEmptyBlock: false +SpaceInEmptyParentheses: false +SpacesInAngles: false +SpacesInCStyleCastParentheses: false +SpacesInConditionalStatement: false +SpacesInParentheses: false +SpacesInSquareBrackets: false +AlignTrailingComments: true +AlignAfterOpenBracket: true +AllowShortCaseLabelsOnASingleLine: false +AllowShortEnumsOnASingleLine: true +AllowShortFunctionsOnASingleLine: All +AllowShortIfStatementsOnASingleLine: Never +AllowShortLambdasOnASingleLine: All +AllowShortLoopsOnASingleLine: false +AlwaysBreakTemplateDeclarations: MultiLine +BinPackArguments: true +BinPackParameters: true +BreakBeforeTernaryOperators: true +BreakConstructorInitializers: BeforeColon +BreakInheritanceList: BeforeColon +BreakStringLiterals: true +InsertBraces: false +IndentExternBlock: NoIndent +BreakBeforeBraces: Custom +BraceWrapping: + AfterCaseLabel: false + AfterClass: false + AfterControlStatement: Never + AfterEnum: false + AfterFunction: false + AfterNamespace: false + AfterStruct: false + AfterUnion: false + AfterExternBlock: false + BeforeCatch: false + BeforeElse: false +ReflowComments: true +MaxEmptyLinesToKeep: 2 \ No newline at end of file diff --git a/NonSameLayerRendering/.hvigor/cache/file-cache.json b/NonSameLayerRendering/.hvigor/cache/file-cache.json new file mode 100644 index 0000000000000000000000000000000000000000..9e26dfeeb6e641a33dae4961196235bdb965b21b --- /dev/null +++ b/NonSameLayerRendering/.hvigor/cache/file-cache.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/NonSameLayerRendering/.hvigor/cache/task-cache.json b/NonSameLayerRendering/.hvigor/cache/task-cache.json new file mode 100644 index 0000000000000000000000000000000000000000..9e26dfeeb6e641a33dae4961196235bdb965b21b --- /dev/null +++ b/NonSameLayerRendering/.hvigor/cache/task-cache.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/NonSameLayerRendering/.hvigor/outputs/build-logs/build.log b/NonSameLayerRendering/.hvigor/outputs/build-logs/build.log new file mode 100644 index 0000000000000000000000000000000000000000..ca7960362de1bd9359f52fe625c6922d299e4f03 --- /dev/null +++ b/NonSameLayerRendering/.hvigor/outputs/build-logs/build.log @@ -0,0 +1,315 @@ +[2025-05-12T09:32:46.619] [DEBUG] debug-file - env: nodejsVersion=v18.20.1 +[2025-05-12T09:32:47.103] [DEBUG] debug-file - Hvigor init with startParameters:{ + hvigorfileTypeCheck: false, + parallelExecution: true, + incrementalExecution: true, + printStackTrace: false, + daemon: false, + analyze: 0, + logLevel: Level { level: 20000, levelStr: 'INFO', colour: 'green' } +} +[2025-05-12T09:32:47.125] [DEBUG] debug-file - hvigorfile, resolving D:\LiuDongHai\FAQ最佳实践资料\BestPractices\BestPractices\DevelopmentPractice\NonSameLayerRendering\hvigorfile.ts +[2025-05-12T09:32:48.789] [DEBUG] debug-file - hvigorfile, require result: { default: { system: [Function: appTasks], plugins: [] } } +[2025-05-12T09:32:48.986] [DEBUG] debug-file - hvigor build process will be closed with an error. +[2025-05-12T09:32:48.996] [WARN] debug-file - BUILD FAILED in 1 s 912 ms +[2025-05-12T09:32:46.621] [DEBUG] debug-file - env: hvigor-config.json5 content = { + modelVersion: '5.0.0', + dependencies: {}, + execution: {}, + logging: {}, + debugging: {}, + nodeOptions: {} +} +[2025-05-12T09:32:49.011] [DEBUG] debug-file - Create resident worker with id: 0. +[2025-05-12T09:32:47.105] [DEBUG] debug-file - Since current hvigor version 5.17.0 differs from last hvigor version + undefined, delete file-cache.json and task-cache.json. +[2025-05-12T09:32:48.790] [DEBUG] debug-file - hvigorfile, binding system plugins [Function: appTasks] +[2025-05-12T09:32:48.988] [DEBUG] debug-file - ERROR: stacktrace = Error: Invalid project path. + Detail: Please move the project to a valid path + at OhosLogger.errorMessageExit (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor\src\base\log\hvigor-log.js:1:3224) + at OhosLogger._printAllExit (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\src\utils\log\ohos-logger.js:1:1274) + at ProjectInspection.exitOnError (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\src\tasks\inspection\project-inspection.js:1:672) + at AppPlugin.doProjectInspection (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\src\plugin\common\abstract-project-plugin.js:1:1585) + at PluginFactory.getAppPlugin (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\src\plugin\factory\plugin-factory.js:1:2159) + at appTasks (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\index.js:1:593) + at bindSystemPlugins (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor\src\base\internal\lifecycle\configuration.js:1:5900) + at evaluateNodeVigorFile (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor\src\base\internal\lifecycle\configuration.js:1:8450) + at evalProject (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor\src\base\internal\lifecycle\configuration.js:1:3495) + at process.processTicksAndRejections (node:internal/process/task_queues:95:5) +[2025-05-12T09:32:49.008] [DEBUG] debug-file - Since there is no instance or instance is terminated, create a new worker pool. +[2025-05-12T09:32:46.623] [DEBUG] debug-file - env: daemon=false +[2025-05-12T09:32:49.014] [DEBUG] debug-file - Create resident worker with id: 1. +[2025-05-12T09:32:47.105] [DEBUG] debug-file - Cache service initialization finished in 2 ms +[2025-05-12T09:32:48.988] [ERROR] debug-file - Error: Invalid project path. + Detail: Please move the project to a valid path + at OhosLogger.errorMessageExit (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor\src\base\log\hvigor-log.js:1:3224) + at OhosLogger._printAllExit (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\src\utils\log\ohos-logger.js:1:1274) + at ProjectInspection.exitOnError (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\src\tasks\inspection\project-inspection.js:1:672) + at AppPlugin.doProjectInspection (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\src\plugin\common\abstract-project-plugin.js:1:1585) + at PluginFactory.getAppPlugin (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\src\plugin\factory\plugin-factory.js:1:2159) + at appTasks (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\index.js:1:593) + at bindSystemPlugins (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor\src\base\internal\lifecycle\configuration.js:1:5900) + at evaluateNodeVigorFile (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor\src\base\internal\lifecycle\configuration.js:1:8450) + at evalProject (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor\src\base\internal\lifecycle\configuration.js:1:3495) + at process.processTicksAndRejections (node:internal/process/task_queues:95:5) +[2025-05-12T09:32:49.009] [DEBUG] debug-file - Worker pool is initialized with config: { + minPoolNum: 2, + maxPoolNum: undefined, + maxCoreSize: undefined, + cacheCapacity: undefined, + cacheTtl: undefined +} +[2025-05-12T09:32:46.623] [DEBUG] debug-file - no-daemon, use the parent process.execArgv --max-old-space-size=8192,--expose-gc +[2025-05-12T09:32:49.016] [DEBUG] debug-file - Current worker pool is stopped or closed. +[2025-05-12T09:32:49.016] [DEBUG] debug-file - Clear worker 0. +[2025-05-12T09:32:49.016] [DEBUG] debug-file - Worker 0 has been cleared. +[2025-05-12T09:32:49.016] [DEBUG] debug-file - Current idle worker size: 1. +[2025-05-12T09:32:49.016] [DEBUG] debug-file - Current busy worker size: 0. +[2025-05-12T09:32:49.016] [DEBUG] debug-file - Clear worker 1. +[2025-05-12T09:32:49.016] [DEBUG] debug-file - Worker 1 has been cleared. +[2025-05-12T09:32:49.016] [DEBUG] debug-file - Current idle worker size: 0. +[2025-05-12T09:32:49.016] [DEBUG] debug-file - Current busy worker size: 0. +[2025-05-12T09:32:49.025] [DEBUG] debug-file - hvigor build process will be closed. +[2025-05-12T09:32:49.029] [DEBUG] debug-file - worker[0] exits with exit code 0. +[2025-05-12T09:32:49.030] [DEBUG] debug-file - worker[1] exits with exit code 0. +[2025-05-12T09:32:49.030] [DEBUG] debug-file - Current worker pool is terminated. +[2025-05-12T15:51:04.914] [DEBUG] debug-file - env: nodejsVersion=v18.20.1 +[2025-05-12T15:51:05.233] [DEBUG] debug-file - env: daemon=true +[2025-05-12T15:51:04.916] [DEBUG] debug-file - env: hvigor-config.json5 content = { + modelVersion: '5.0.0', + dependencies: {}, + execution: {}, + logging: {}, + debugging: {}, + nodeOptions: {} +} +[2025-05-12T15:51:06.089] [DEBUG] debug-file - java daemon tryConnect failed Error: connect ECONNREFUSED 127.0.0.1:45050 +[2025-05-12T15:51:06.095] [DEBUG] debug-file - java daemon started at port 45050 pid 17184 +[2025-05-12T15:51:06.122] [DEBUG] debug-file - session manager: set active socket. socketId=anqZBjvNsk9q37FuAAAB +[2025-05-12T15:51:06.815] [DEBUG] debug-file - watch worker: worker id should be larger than 0. Nothing will be sent to any worker thread. +[2025-05-12T15:51:06.835] [DEBUG] debug-file - Hvigor init with startParameters:{ + hvigorfileTypeCheck: false, + parallelExecution: true, + incrementalExecution: true, + printStackTrace: false, + daemon: true, + analyze: 0, + logLevel: Level { level: 20000, levelStr: 'INFO', colour: 'green' } +} +[2025-05-12T15:51:06.836] [DEBUG] debug-file - Since current hvigor version 5.17.0 differs from last hvigor version + undefined, delete file-cache.json and task-cache.json. +[2025-05-12T15:51:06.839] [DEBUG] debug-file - Cache service initialization finished in 4 ms +[2025-05-12T15:51:06.853] [DEBUG] debug-file - hvigorfile, resolving D:\LiuDongHai\FAQ最佳实践资料\BestPractices\BestPractices\DevelopmentPractice\NonSameLayerRendering\hvigorfile.ts +[2025-05-12T15:51:08.439] [DEBUG] debug-file - hvigorfile, require result: { default: { plugins: [] } } +[2025-05-12T15:51:08.439] [DEBUG] debug-file - hvigorfile, binding system plugins null +[2025-05-12T15:51:08.636] [DEBUG] debug-file - hvigor build process will be closed with an error. +[2025-05-12T15:51:08.637] [DEBUG] debug-file - ERROR: stacktrace = Error: Invalid project path. + Detail: Please move the project to a valid path + at OhosLogger.errorMessageExit (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor\src\base\log\hvigor-log.js:1:3224) + at OhosLogger._printAllExit (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\src\utils\log\ohos-logger.js:1:1274) + at ProjectInspection.exitOnError (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\src\tasks\inspection\project-inspection.js:1:672) + at AppPlugin.doProjectInspection (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\src\plugin\common\abstract-project-plugin.js:1:1585) + at PluginFactory.getAppPlugin (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\src\plugin\factory\plugin-factory.js:1:2159) + at appTasks (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\index.js:1:593) + at bindSystemPlugins (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor\src\base\internal\lifecycle\configuration.js:1:5900) + at evaluateNodeVigorFile (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor\src\base\internal\lifecycle\configuration.js:1:8450) + at evalProject (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor\src\base\internal\lifecycle\configuration.js:1:3495) + at process.processTicksAndRejections (node:internal/process/task_queues:95:5) +[2025-05-12T15:51:08.638] [ERROR] debug-file - Error: Invalid project path. + Detail: Please move the project to a valid path + at OhosLogger.errorMessageExit (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor\src\base\log\hvigor-log.js:1:3224) + at OhosLogger._printAllExit (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\src\utils\log\ohos-logger.js:1:1274) + at ProjectInspection.exitOnError (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\src\tasks\inspection\project-inspection.js:1:672) + at AppPlugin.doProjectInspection (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\src\plugin\common\abstract-project-plugin.js:1:1585) + at PluginFactory.getAppPlugin (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\src\plugin\factory\plugin-factory.js:1:2159) + at appTasks (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\index.js:1:593) + at bindSystemPlugins (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor\src\base\internal\lifecycle\configuration.js:1:5900) + at evaluateNodeVigorFile (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor\src\base\internal\lifecycle\configuration.js:1:8450) + at evalProject (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor\src\base\internal\lifecycle\configuration.js:1:3495) + at process.processTicksAndRejections (node:internal/process/task_queues:95:5) +[2025-05-12T15:51:08.645] [WARN] debug-file - BUILD FAILED in 1 s 824 ms +[2025-05-12T15:51:08.655] [DEBUG] debug-file - Since there is no instance or instance is terminated, create a new worker pool. +[2025-05-12T15:51:08.655] [DEBUG] debug-file - Worker pool is initialized with config: { + minPoolNum: 2, + maxPoolNum: undefined, + maxCoreSize: undefined, + cacheCapacity: undefined, + cacheTtl: undefined +} +[2025-05-12T15:51:08.657] [DEBUG] debug-file - Create resident worker with id: 0. +[2025-05-12T15:51:08.659] [DEBUG] debug-file - session manager: send message to worker process. +[2025-05-12T15:51:08.659] [DEBUG] debug-file - session manager: send message to worker process. +[2025-05-12T15:51:08.660] [DEBUG] debug-file - Create resident worker with id: 1. +[2025-05-12T15:51:08.663] [DEBUG] debug-file - Cleanup worker 0. +[2025-05-12T15:51:08.663] [DEBUG] debug-file - Worker 0 has been cleaned up. +[2025-05-12T15:51:08.663] [DEBUG] debug-file - Current idle worker size: 1. +[2025-05-12T15:51:08.663] [DEBUG] debug-file - Current resident worker size: 2. +[2025-05-12T15:51:08.663] [DEBUG] debug-file - Cleanup worker 1. +[2025-05-12T15:51:08.663] [DEBUG] debug-file - Worker 1 has been cleaned up. +[2025-05-12T15:51:08.664] [DEBUG] debug-file - Current idle worker size: 0. +[2025-05-12T15:51:08.664] [DEBUG] debug-file - Current resident worker size: 2. +[2025-05-12T15:51:08.670] [DEBUG] debug-file - hvigor build process will be closed. +[2025-05-12T15:51:08.677] [DEBUG] debug-file - watch worker: worker id should be larger than 0. Nothing will be sent to any worker thread. +[2025-05-12T15:51:08.677] [DEBUG] debug-file - watch worker: worker id should be larger than 0. Nothing will be sent to any worker thread. +[2025-05-12T15:51:08.678] [DEBUG] debug-file - worker[0] exits with exit code 0. +[2025-05-12T15:51:08.678] [DEBUG] debug-file - worker[1] exits with exit code 0. +[2025-05-13T15:27:33.512] [DEBUG] debug-file - env: nodejsVersion=v18.20.1 +[2025-05-13T15:27:33.835] [DEBUG] debug-file - env: daemon=true +[2025-05-13T15:27:33.515] [DEBUG] debug-file - env: hvigor-config.json5 content = { + modelVersion: '5.0.0', + dependencies: {}, + execution: {}, + logging: {}, + debugging: {}, + nodeOptions: {} +} +[2025-05-13T15:27:34.726] [DEBUG] debug-file - java daemon tryConnect failed Error: connect ECONNREFUSED 127.0.0.1:45050 +[2025-05-13T15:27:34.732] [DEBUG] debug-file - java daemon started at port 45050 pid 19412 +[2025-05-13T15:27:34.756] [DEBUG] debug-file - session manager: set active socket. socketId=Rp0KAOiA6eNweB92AAAB +[2025-05-13T15:27:35.459] [DEBUG] debug-file - watch worker: worker id should be larger than 0. Nothing will be sent to any worker thread. +[2025-05-13T15:27:35.477] [DEBUG] debug-file - Hvigor init with startParameters:{ + hvigorfileTypeCheck: false, + parallelExecution: true, + incrementalExecution: true, + printStackTrace: false, + daemon: true, + analyze: 0, + logLevel: Level { level: 20000, levelStr: 'INFO', colour: 'green' } +} +[2025-05-13T15:27:35.479] [DEBUG] debug-file - Since current hvigor version 5.17.0 differs from last hvigor version + undefined, delete file-cache.json and task-cache.json. +[2025-05-13T15:27:35.481] [DEBUG] debug-file - Cache service initialization finished in 4 ms +[2025-05-13T15:27:35.493] [DEBUG] debug-file - hvigorfile, resolving D:\LiuDongHai\FAQ最佳实践资料\BestPractices\BestPractices\DevelopmentPractice\NonSameLayerRendering\hvigorfile.ts +[2025-05-13T15:27:37.114] [DEBUG] debug-file - hvigorfile, require result: { default: { plugins: [] } } +[2025-05-13T15:27:37.114] [DEBUG] debug-file - hvigorfile, binding system plugins null +[2025-05-13T15:27:37.308] [DEBUG] debug-file - hvigor build process will be closed with an error. +[2025-05-13T15:27:37.309] [DEBUG] debug-file - ERROR: stacktrace = Error: Invalid project path. + Detail: Please move the project to a valid path + at OhosLogger.errorMessageExit (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor\src\base\log\hvigor-log.js:1:3224) + at OhosLogger._printAllExit (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\src\utils\log\ohos-logger.js:1:1274) + at ProjectInspection.exitOnError (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\src\tasks\inspection\project-inspection.js:1:672) + at AppPlugin.doProjectInspection (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\src\plugin\common\abstract-project-plugin.js:1:1585) + at PluginFactory.getAppPlugin (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\src\plugin\factory\plugin-factory.js:1:2159) + at appTasks (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\index.js:1:593) + at bindSystemPlugins (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor\src\base\internal\lifecycle\configuration.js:1:5900) + at evaluateNodeVigorFile (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor\src\base\internal\lifecycle\configuration.js:1:8450) + at evalProject (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor\src\base\internal\lifecycle\configuration.js:1:3495) + at process.processTicksAndRejections (node:internal/process/task_queues:95:5) +[2025-05-13T15:27:37.309] [ERROR] debug-file - Error: Invalid project path. + Detail: Please move the project to a valid path + at OhosLogger.errorMessageExit (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor\src\base\log\hvigor-log.js:1:3224) + at OhosLogger._printAllExit (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\src\utils\log\ohos-logger.js:1:1274) + at ProjectInspection.exitOnError (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\src\tasks\inspection\project-inspection.js:1:672) + at AppPlugin.doProjectInspection (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\src\plugin\common\abstract-project-plugin.js:1:1585) + at PluginFactory.getAppPlugin (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\src\plugin\factory\plugin-factory.js:1:2159) + at appTasks (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\index.js:1:593) + at bindSystemPlugins (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor\src\base\internal\lifecycle\configuration.js:1:5900) + at evaluateNodeVigorFile (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor\src\base\internal\lifecycle\configuration.js:1:8450) + at evalProject (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor\src\base\internal\lifecycle\configuration.js:1:3495) + at process.processTicksAndRejections (node:internal/process/task_queues:95:5) +[2025-05-13T15:27:37.316] [WARN] debug-file - BUILD FAILED in 1 s 852 ms +[2025-05-13T15:27:37.327] [DEBUG] debug-file - Since there is no instance or instance is terminated, create a new worker pool. +[2025-05-13T15:27:37.327] [DEBUG] debug-file - Worker pool is initialized with config: { + minPoolNum: 2, + maxPoolNum: undefined, + maxCoreSize: undefined, + cacheCapacity: undefined, + cacheTtl: undefined +} +[2025-05-13T15:27:37.328] [DEBUG] debug-file - Create resident worker with id: 0. +[2025-05-13T15:27:37.330] [DEBUG] debug-file - session manager: send message to worker process. +[2025-05-13T15:27:37.330] [DEBUG] debug-file - session manager: send message to worker process. +[2025-05-13T15:27:37.331] [DEBUG] debug-file - Create resident worker with id: 1. +[2025-05-13T15:27:37.333] [DEBUG] debug-file - Cleanup worker 0. +[2025-05-13T15:27:37.334] [DEBUG] debug-file - Worker 0 has been cleaned up. +[2025-05-13T15:27:37.334] [DEBUG] debug-file - Current idle worker size: 1. +[2025-05-13T15:27:37.334] [DEBUG] debug-file - Current resident worker size: 2. +[2025-05-13T15:27:37.334] [DEBUG] debug-file - Cleanup worker 1. +[2025-05-13T15:27:37.334] [DEBUG] debug-file - Worker 1 has been cleaned up. +[2025-05-13T15:27:37.334] [DEBUG] debug-file - Current idle worker size: 0. +[2025-05-13T15:27:37.334] [DEBUG] debug-file - Current resident worker size: 2. +[2025-05-13T15:27:37.341] [DEBUG] debug-file - hvigor build process will be closed. +[2025-05-13T15:27:37.342] [DEBUG] debug-file - watch worker: worker id should be larger than 0. Nothing will be sent to any worker thread. +[2025-05-13T15:27:37.343] [DEBUG] debug-file - watch worker: worker id should be larger than 0. Nothing will be sent to any worker thread. +[2025-05-13T15:27:37.343] [DEBUG] debug-file - worker[0] exits with exit code 0. +[2025-05-13T15:27:37.344] [DEBUG] debug-file - worker[1] exits with exit code 0. +[2025-05-15T10:37:33.616] [DEBUG] debug-file - env: nodejsVersion=v18.20.1 +[2025-05-15T10:37:33.933] [DEBUG] debug-file - env: daemon=true +[2025-05-15T10:37:33.618] [DEBUG] debug-file - env: hvigor-config.json5 content = { + modelVersion: '5.0.0', + dependencies: {}, + execution: {}, + logging: {}, + debugging: {}, + nodeOptions: {} +} +[2025-05-15T10:37:34.736] [DEBUG] debug-file - java daemon tryConnect failed Error: connect ECONNREFUSED 127.0.0.1:45050 +[2025-05-15T10:37:34.743] [DEBUG] debug-file - java daemon started at port 45050 pid 21960 +[2025-05-15T10:37:34.779] [DEBUG] debug-file - session manager: set active socket. socketId=pexVYVJnokvAG0BIAAAB +[2025-05-15T10:37:35.460] [DEBUG] debug-file - watch worker: worker id should be larger than 0. Nothing will be sent to any worker thread. +[2025-05-15T10:37:35.478] [DEBUG] debug-file - Hvigor init with startParameters:{ + hvigorfileTypeCheck: false, + parallelExecution: true, + incrementalExecution: true, + printStackTrace: false, + daemon: true, + analyze: 0, + logLevel: Level { level: 20000, levelStr: 'INFO', colour: 'green' } +} +[2025-05-15T10:37:35.480] [DEBUG] debug-file - Since current hvigor version 5.17.0 differs from last hvigor version + undefined, delete file-cache.json and task-cache.json. +[2025-05-15T10:37:35.482] [DEBUG] debug-file - Cache service initialization finished in 4 ms +[2025-05-15T10:37:35.495] [DEBUG] debug-file - hvigorfile, resolving D:\LiuDongHai\FAQ最佳实践资料\BestPractices\BestPractices\DevelopmentPractice\NonSameLayerRendering\hvigorfile.ts +[2025-05-15T10:37:37.140] [DEBUG] debug-file - hvigorfile, require result: { default: { plugins: [] } } +[2025-05-15T10:37:37.140] [DEBUG] debug-file - hvigorfile, binding system plugins null +[2025-05-15T10:37:37.327] [DEBUG] debug-file - hvigor build process will be closed with an error. +[2025-05-15T10:37:37.328] [DEBUG] debug-file - ERROR: stacktrace = Error: Invalid project path. + Detail: Please move the project to a valid path + at OhosLogger.errorMessageExit (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor\src\base\log\hvigor-log.js:1:3224) + at OhosLogger._printAllExit (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\src\utils\log\ohos-logger.js:1:1274) + at ProjectInspection.exitOnError (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\src\tasks\inspection\project-inspection.js:1:672) + at AppPlugin.doProjectInspection (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\src\plugin\common\abstract-project-plugin.js:1:1585) + at PluginFactory.getAppPlugin (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\src\plugin\factory\plugin-factory.js:1:2159) + at appTasks (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\index.js:1:593) + at bindSystemPlugins (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor\src\base\internal\lifecycle\configuration.js:1:5900) + at evaluateNodeVigorFile (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor\src\base\internal\lifecycle\configuration.js:1:8450) + at evalProject (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor\src\base\internal\lifecycle\configuration.js:1:3495) + at process.processTicksAndRejections (node:internal/process/task_queues:95:5) +[2025-05-15T10:37:37.328] [ERROR] debug-file - Error: Invalid project path. + Detail: Please move the project to a valid path + at OhosLogger.errorMessageExit (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor\src\base\log\hvigor-log.js:1:3224) + at OhosLogger._printAllExit (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\src\utils\log\ohos-logger.js:1:1274) + at ProjectInspection.exitOnError (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\src\tasks\inspection\project-inspection.js:1:672) + at AppPlugin.doProjectInspection (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\src\plugin\common\abstract-project-plugin.js:1:1585) + at PluginFactory.getAppPlugin (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\src\plugin\factory\plugin-factory.js:1:2159) + at appTasks (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor-ohos-plugin\index.js:1:593) + at bindSystemPlugins (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor\src\base\internal\lifecycle\configuration.js:1:5900) + at evaluateNodeVigorFile (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor\src\base\internal\lifecycle\configuration.js:1:8450) + at evalProject (D:\LiuDongHai\DevEco Studio\tools\hvigor\hvigor\src\base\internal\lifecycle\configuration.js:1:3495) + at process.processTicksAndRejections (node:internal/process/task_queues:95:5) +[2025-05-15T10:37:37.335] [WARN] debug-file - BUILD FAILED in 1 s 870 ms +[2025-05-15T10:37:37.346] [DEBUG] debug-file - Since there is no instance or instance is terminated, create a new worker pool. +[2025-05-15T10:37:37.346] [DEBUG] debug-file - Worker pool is initialized with config: { + minPoolNum: 2, + maxPoolNum: undefined, + maxCoreSize: undefined, + cacheCapacity: undefined, + cacheTtl: undefined +} +[2025-05-15T10:37:37.348] [DEBUG] debug-file - Create resident worker with id: 0. +[2025-05-15T10:37:37.349] [DEBUG] debug-file - session manager: send message to worker process. +[2025-05-15T10:37:37.349] [DEBUG] debug-file - session manager: send message to worker process. +[2025-05-15T10:37:37.350] [DEBUG] debug-file - Create resident worker with id: 1. +[2025-05-15T10:37:37.352] [DEBUG] debug-file - Cleanup worker 0. +[2025-05-15T10:37:37.353] [DEBUG] debug-file - Worker 0 has been cleaned up. +[2025-05-15T10:37:37.353] [DEBUG] debug-file - Current idle worker size: 1. +[2025-05-15T10:37:37.353] [DEBUG] debug-file - Current resident worker size: 2. +[2025-05-15T10:37:37.353] [DEBUG] debug-file - Cleanup worker 1. +[2025-05-15T10:37:37.353] [DEBUG] debug-file - Worker 1 has been cleaned up. +[2025-05-15T10:37:37.353] [DEBUG] debug-file - Current idle worker size: 0. +[2025-05-15T10:37:37.353] [DEBUG] debug-file - Current resident worker size: 2. +[2025-05-15T10:37:37.360] [DEBUG] debug-file - hvigor build process will be closed. +[2025-05-15T10:37:37.362] [DEBUG] debug-file - watch worker: worker id should be larger than 0. Nothing will be sent to any worker thread. +[2025-05-15T10:37:37.363] [DEBUG] debug-file - watch worker: worker id should be larger than 0. Nothing will be sent to any worker thread. +[2025-05-15T10:37:37.363] [DEBUG] debug-file - worker[0] exits with exit code 0. +[2025-05-15T10:37:37.364] [DEBUG] debug-file - worker[1] exits with exit code 0. diff --git a/NonSameLayerRendering/.hvigor/outputs/logs/details/details.json b/NonSameLayerRendering/.hvigor/outputs/logs/details/details.json new file mode 100644 index 0000000000000000000000000000000000000000..f8d1a24d311e9de68125aa20b7efb17d48762a10 --- /dev/null +++ b/NonSameLayerRendering/.hvigor/outputs/logs/details/details.json @@ -0,0 +1,24 @@ +{ + "HVIGOR_OHOS_PLUGIN": { + "MODULES": [ + { + "MODULE_NAME": "1043bfc77febe75fafec0c4309faccf1", + "API_TYPE": "stageMode" + } + ], + "BUILD_MODE": "debug" + }, + "HVIGOR": { + "IS_INCREMENTAL": true, + "IS_DAEMON": true, + "IS_PARALLEL": true, + "IS_HVIGORFILE_TYPE_CHECK": false, + "TASK_TIME": {}, + "BUILD_ID": "202505151037354630", + "ERROR_MESSAGE": { + "CODE": "00000", + "TIMESTAMP": "1747276657327" + }, + "TOTAL_TIME": 1869802400 + } +} \ No newline at end of file diff --git a/NonSameLayerRendering/.hvigor/report/report-202505120932470820.json b/NonSameLayerRendering/.hvigor/report/report-202505120932470820.json new file mode 100644 index 0000000000000000000000000000000000000000..08a6dd15ce167fc0ccab3bec4bc4234f5c7022c2 --- /dev/null +++ b/NonSameLayerRendering/.hvigor/report/report-202505120932470820.json @@ -0,0 +1,978 @@ +{ + "version": "2.0", + "ppid": 10288, + "events": [ + { + "head": { + "id": "6b5aba4d-39f9-4486-adb4-eaeffa54a13f", + "name": "env: nodejsVersion=v18.20.1", + "description": "", + "type": "log" + }, + "body": { + "pid": 5160, + "tid": "Main Thread", + "startTime": 251409088501400 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "da701818-2889-4b55-bb1c-b975bb041382", + "name": "env: hvigor-config.json5 content = {\n modelVersion: '5.0.0',\n dependencies: {},\n execution: {},\n logging: {},\n debugging: {},\n nodeOptions: {}\n}", + "description": "", + "type": "log" + }, + "body": { + "pid": 5160, + "tid": "Main Thread", + "startTime": 251409091117300 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "beae51da-c27f-45cd-a2b0-e148e27e9dbc", + "name": "env: daemon=false", + "description": "", + "type": "log" + }, + "body": { + "pid": 5160, + "tid": "Main Thread", + "startTime": 251409093375300 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "a83c1a91-9911-49a1-8b8a-4e6059c5d7a1", + "name": "no-daemon, use the parent process.execArgv --max-old-space-size=8192,--expose-gc", + "description": "", + "type": "log" + }, + "body": { + "pid": 5160, + "tid": "Main Thread", + "startTime": 251409093462900 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "5e8f5879-9c06-46c3-bf57-f3f2795620e9", + "name": "init", + "description": "Initialize and build task graph.", + "type": "duration" + }, + "body": { + "pid": 5160, + "tid": "Main Thread", + "startTime": 251409559186600 + }, + "additional": { + "children": [ + "ed709911-3948-4dce-9c98-908b7e700553", + "796bddfb-a1fb-4e02-a9d5-9f125c18bd90", + "4c0306f6-f3f9-44d5-92bf-446367a84302", + "f0b911de-2dea-44ca-8daf-8157c2dcc601", + "daf3ce4b-e34a-4987-8828-52ccb04b810a", + "bb2bbfd8-293d-48e4-a144-7397eb92306a" + ], + "state": "running", + "targetName": "", + "moduleName": "", + "category": "Init", + "taskRunReasons": [] + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "ed709911-3948-4dce-9c98-908b7e700553", + "name": "create hvigor project model", + "description": "Initialize hvigor project model.", + "type": "duration" + }, + "body": { + "pid": 5160, + "tid": "Main Thread", + "startTime": 251409559199300, + "endTime": 251409575591000 + }, + "additional": { + "children": [], + "state": "success", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "5e8f5879-9c06-46c3-bf57-f3f2795620e9", + "logId": "4994f2cc-5c18-44f5-b023-882b5c659310" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "796bddfb-a1fb-4e02-a9d5-9f125c18bd90", + "name": "configure hvigor plugin", + "description": "Configure hvigor plugin.", + "type": "duration" + }, + "body": { + "pid": 5160, + "tid": "Main Thread", + "startTime": 251409575620700 + }, + "additional": { + "children": [ + "91572363-3cc4-4325-aeb0-615abee2f3bc", + "532c3abc-2552-46d5-8a04-e5aa5820c090", + "78711501-3e64-4eaa-becc-2c08ed1a1687", + "2e4173d7-7fc5-4de2-ae16-2b584ce028bf", + "0615c338-5636-4de0-a269-def52b77eec2", + "be47d4c0-475b-4fab-b267-8fd052999193", + "6c7a4bfe-dc7d-4f72-94dd-a1aa38c5d8cf", + "ea4adaac-16aa-4a7d-8477-dd2590470a23" + ], + "state": "running", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "5e8f5879-9c06-46c3-bf57-f3f2795620e9" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "daf3ce4b-e34a-4987-8828-52ccb04b810a", + "name": "\"configEvaluated\" hook function", + "description": "", + "type": "duration" + }, + "body": { + "pid": 5160, + "tid": "Main Thread", + "startTime": 251409564194700, + "endTime": 251409564458200 + }, + "additional": { + "children": [], + "state": "success", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "5e8f5879-9c06-46c3-bf57-f3f2795620e9", + "logId": "55af076c-c9c2-4982-af7c-576e25e1c4c1" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "55af076c-c9c2-4982-af7c-576e25e1c4c1", + "name": "\"configEvaluated\" hook function", + "description": "", + "type": "log" + }, + "body": { + "pid": 5160, + "tid": "Main Thread", + "startTime": 251409564194700, + "endTime": 251409564458200 + }, + "additional": { + "logType": "info", + "children": [], + "durationId": "daf3ce4b-e34a-4987-8828-52ccb04b810a" + } + }, + { + "head": { + "id": "bb2bbfd8-293d-48e4-a144-7397eb92306a", + "name": "\"nodesInitialized\" hook function", + "description": "", + "type": "duration" + }, + "body": { + "pid": 5160, + "tid": "Main Thread", + "startTime": 251409572947400, + "endTime": 251409573019200 + }, + "additional": { + "children": [], + "state": "success", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "5e8f5879-9c06-46c3-bf57-f3f2795620e9", + "logId": "575625b5-505c-4960-b2ea-d6b355dccfe7" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "575625b5-505c-4960-b2ea-d6b355dccfe7", + "name": "\"nodesInitialized\" hook function", + "description": "", + "type": "log" + }, + "body": { + "pid": 5160, + "tid": "Main Thread", + "startTime": 251409572947400, + "endTime": 251409573019200 + }, + "additional": { + "logType": "info", + "children": [], + "durationId": "bb2bbfd8-293d-48e4-a144-7397eb92306a" + } + }, + { + "head": { + "id": "c83df2d2-03af-466f-87fe-5ff308f9c237", + "name": "Hvigor init with startParameters:{\n hvigorfileTypeCheck: false,\n parallelExecution: true,\n incrementalExecution: true,\n printStackTrace: false,\n daemon: false,\n analyze: 0,\n logLevel: Level { level: 20000, levelStr: 'INFO', colour: 'green' }\n}", + "description": "", + "type": "log" + }, + "body": { + "pid": 5160, + "tid": "Main Thread", + "startTime": 251409573236400 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "aaf653f9-1f27-42cd-99ac-0503bff4cdee", + "name": "Since current hvigor version 5.17.0 differs from last hvigor version \n undefined, delete file-cache.json and task-cache.json.", + "description": "", + "type": "log" + }, + "body": { + "pid": 5160, + "tid": "Main Thread", + "startTime": 251409574907000 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "2489e7d4-0997-424f-8ab8-dadaf7464bb9", + "name": "Cache service initialization finished in 2 ms ", + "description": "", + "type": "log" + }, + "body": { + "pid": 5160, + "tid": "Main Thread", + "startTime": 251409575430800 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "4994f2cc-5c18-44f5-b023-882b5c659310", + "name": "create hvigor project model", + "description": "", + "type": "log" + }, + "body": { + "pid": 5160, + "tid": "Main Thread", + "startTime": 251409559199300, + "endTime": 251409575591000 + }, + "additional": { + "logType": "info", + "children": [], + "durationId": "ed709911-3948-4dce-9c98-908b7e700553" + } + }, + { + "head": { + "id": "91572363-3cc4-4325-aeb0-615abee2f3bc", + "name": "init configuration", + "description": "Initialize configuration.", + "type": "duration" + }, + "body": { + "pid": 5160, + "tid": "Main Thread", + "startTime": 251409584194000, + "endTime": 251409584245300 + }, + "additional": { + "children": [], + "state": "success", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "796bddfb-a1fb-4e02-a9d5-9f125c18bd90", + "logId": "6d886cda-c6cd-4ca3-aa83-623a40a12c86" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "532c3abc-2552-46d5-8a04-e5aa5820c090", + "name": "configure project task", + "description": "Configure project task.", + "type": "duration" + }, + "body": { + "pid": 5160, + "tid": "Main Thread", + "startTime": 251409584288300, + "endTime": 251409591140100 + }, + "additional": { + "children": [], + "state": "success", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "796bddfb-a1fb-4e02-a9d5-9f125c18bd90", + "logId": "80e64c69-e1e7-472d-9b6e-b1b4ff5a088c" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "78711501-3e64-4eaa-becc-2c08ed1a1687", + "name": "eval project", + "description": "Evaluate project.", + "type": "duration" + }, + "body": { + "pid": 5160, + "tid": "Main Thread", + "startTime": 251409591259800 + }, + "additional": { + "children": [ + "25141eb4-798f-4128-80ac-6fea9098c1a0", + "151a99ec-34f4-41fc-bbc7-e1f10ad092fe" + ], + "state": "running", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "796bddfb-a1fb-4e02-a9d5-9f125c18bd90" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "6d886cda-c6cd-4ca3-aa83-623a40a12c86", + "name": "init configuration", + "description": "", + "type": "log" + }, + "body": { + "pid": 5160, + "tid": "Main Thread", + "startTime": 251409584194000, + "endTime": 251409584245300 + }, + "additional": { + "logType": "info", + "children": [], + "durationId": "91572363-3cc4-4325-aeb0-615abee2f3bc" + } + }, + { + "head": { + "id": "80e64c69-e1e7-472d-9b6e-b1b4ff5a088c", + "name": "configure project task", + "description": "", + "type": "log" + }, + "body": { + "pid": 5160, + "tid": "Main Thread", + "startTime": 251409584288300, + "endTime": 251409591140100 + }, + "additional": { + "logType": "info", + "children": [], + "durationId": "532c3abc-2552-46d5-8a04-e5aa5820c090" + } + }, + { + "head": { + "id": "25141eb4-798f-4128-80ac-6fea9098c1a0", + "name": "\"beforeNodeEvaluate\" hook function", + "description": "", + "type": "duration" + }, + "body": { + "pid": 5160, + "tid": "Main Thread", + "startTime": 251409592374100, + "endTime": 251409592449300 + }, + "additional": { + "children": [], + "state": "success", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "78711501-3e64-4eaa-becc-2c08ed1a1687", + "logId": "3d1b4225-075c-4ab8-9019-bbf03817c99b" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "3d1b4225-075c-4ab8-9019-bbf03817c99b", + "name": "\"beforeNodeEvaluate\" hook function", + "description": "", + "type": "log" + }, + "body": { + "pid": 5160, + "tid": "Main Thread", + "startTime": 251409592374100, + "endTime": 251409592449300 + }, + "additional": { + "logType": "info", + "children": [], + "durationId": "25141eb4-798f-4128-80ac-6fea9098c1a0" + } + }, + { + "head": { + "id": "151a99ec-34f4-41fc-bbc7-e1f10ad092fe", + "name": "eval hvigorfile", + "description": "Evaluate hvigorfile.", + "type": "duration" + }, + "body": { + "pid": 5160, + "tid": "Main Thread", + "startTime": 251409595621100 + }, + "additional": { + "children": [ + "38711803-a385-4579-817e-6f32f754214c", + "fb754b7c-501f-4d03-94fc-b5e3ca7323fe" + ], + "state": "running", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "78711501-3e64-4eaa-becc-2c08ed1a1687" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "38711803-a385-4579-817e-6f32f754214c", + "name": "require hvigorfile", + "description": "Require hvigorfile.", + "type": "duration" + }, + "body": { + "pid": 5160, + "tid": "Main Thread", + "startTime": 251409595622200, + "endTime": 251411259787400 + }, + "additional": { + "children": [], + "state": "success", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "151a99ec-34f4-41fc-bbc7-e1f10ad092fe", + "logId": "59781781-3460-4179-a5c0-21756ae8dd10" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "fb754b7c-501f-4d03-94fc-b5e3ca7323fe", + "name": "bind plugins", + "description": "Bind plugins.", + "type": "duration" + }, + "body": { + "pid": 5160, + "tid": "Main Thread", + "startTime": 251411259811700 + }, + "additional": { + "children": [], + "state": "running", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "151a99ec-34f4-41fc-bbc7-e1f10ad092fe" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "d95e045b-acaf-4346-93b9-8bb7b738ccac", + "name": "hvigorfile, resolving D:\\LiuDongHai\\FAQ最佳实践资料\\BestPractices\\BestPractices\\DevelopmentPractice\\NonSameLayerRendering\\hvigorfile.ts", + "description": "", + "type": "log" + }, + "body": { + "pid": 5160, + "tid": "Main Thread", + "startTime": 251409595628600 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "233adfd3-ad69-4153-94bb-dcdbe2804b42", + "name": "hvigorfile, require result: { default: { system: [Function: appTasks], plugins: [] } }", + "description": "", + "type": "log" + }, + "body": { + "pid": 5160, + "tid": "Main Thread", + "startTime": 251411259442600 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "59781781-3460-4179-a5c0-21756ae8dd10", + "name": "require hvigorfile", + "description": "", + "type": "log" + }, + "body": { + "pid": 5160, + "tid": "Main Thread", + "startTime": 251409595622200, + "endTime": 251411259787400 + }, + "additional": { + "logType": "info", + "children": [], + "durationId": "38711803-a385-4579-817e-6f32f754214c" + } + }, + { + "head": { + "id": "b7ab7fea-8ddc-4abf-8161-5198bac18064", + "name": "hvigorfile, binding system plugins [Function: appTasks]", + "description": "", + "type": "log" + }, + "body": { + "pid": 5160, + "tid": "Main Thread", + "startTime": 251411259929400 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "e7993e5d-776e-4bb9-97f6-cf367298c4eb", + "name": "hvigor build process will be closed with an error.", + "description": "", + "type": "log" + }, + "body": { + "pid": 5160, + "tid": "Main Thread", + "startTime": 251411456017000 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "91ca6d20-fca0-49b0-995d-ddfbe34642b7", + "name": "ERROR: stacktrace = Error: Invalid project path.\r\n\t Detail: Please move the project to a valid path\n at OhosLogger.errorMessageExit (D:\\LiuDongHai\\DevEco Studio\\tools\\hvigor\\hvigor\\src\\base\\log\\hvigor-log.js:1:3224)\n at OhosLogger._printAllExit (D:\\LiuDongHai\\DevEco Studio\\tools\\hvigor\\hvigor-ohos-plugin\\src\\utils\\log\\ohos-logger.js:1:1274)\n at ProjectInspection.exitOnError (D:\\LiuDongHai\\DevEco Studio\\tools\\hvigor\\hvigor-ohos-plugin\\src\\tasks\\inspection\\project-inspection.js:1:672)\n at AppPlugin.doProjectInspection (D:\\LiuDongHai\\DevEco Studio\\tools\\hvigor\\hvigor-ohos-plugin\\src\\plugin\\common\\abstract-project-plugin.js:1:1585)\n at PluginFactory.getAppPlugin (D:\\LiuDongHai\\DevEco Studio\\tools\\hvigor\\hvigor-ohos-plugin\\src\\plugin\\factory\\plugin-factory.js:1:2159)\n at appTasks (D:\\LiuDongHai\\DevEco Studio\\tools\\hvigor\\hvigor-ohos-plugin\\index.js:1:593)\n at bindSystemPlugins (D:\\LiuDongHai\\DevEco Studio\\tools\\hvigor\\hvigor\\src\\base\\internal\\lifecycle\\configuration.js:1:5900)\n at evaluateNodeVigorFile (D:\\LiuDongHai\\DevEco Studio\\tools\\hvigor\\hvigor\\src\\base\\internal\\lifecycle\\configuration.js:1:8450)\n at evalProject (D:\\LiuDongHai\\DevEco Studio\\tools\\hvigor\\hvigor\\src\\base\\internal\\lifecycle\\configuration.js:1:3495)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)", + "description": "", + "type": "log" + }, + "body": { + "pid": 5160, + "tid": "Main Thread", + "startTime": 251411458033300 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "d87123a3-9388-4bec-b033-671044316ab4", + "name": "\"buildFinished\" hook function", + "description": "", + "type": "duration" + }, + "body": { + "pid": 5160, + "tid": "Main Thread", + "startTime": 251411464598300, + "endTime": 251411464777800 + }, + "additional": { + "children": [], + "state": "success", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "02412f4e-ca75-418b-a8e0-975a3574ba61", + "logId": "fed5b9d5-c3fc-46f0-9e07-cd76927ce663" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "fed5b9d5-c3fc-46f0-9e07-cd76927ce663", + "name": "\"buildFinished\" hook function", + "description": "", + "type": "log" + }, + "body": { + "pid": 5160, + "tid": "Main Thread", + "startTime": 251411464598300, + "endTime": 251411464777800 + }, + "additional": { + "logType": "info", + "children": [], + "durationId": "d87123a3-9388-4bec-b033-671044316ab4" + } + }, + { + "head": { + "id": "dd9636a7-5125-48a1-b28c-0427d09c6040", + "name": "", + "description": "", + "type": "mark" + }, + "body": { + "pid": 5160, + "tid": "Main Thread", + "startTime": 251409553158700, + "endTime": 251411465701100 + }, + "additional": { + "time": { + "year": 2025, + "month": 5, + "day": 12, + "hour": 9, + "minute": 32 + }, + "completeCommand": "{\"prop\":[\"product=default\"],\"sync\":true,\"parallel\":true,\"incremental\":true,\"daemon\":false,\"_\":[],\"analyze\":\"normal\"};--sync -p product=default --analyze=normal --parallel --incremental --no-daemon", + "hvigorVersion": "5.17.0", + "markType": "history", + "nodeVersion": "v18.20.1", + "category": "build", + "state": "failed" + } + }, + { + "head": { + "id": "392b1534-836d-4562-8540-a88c7e7d762f", + "name": "BUILD FAILED in 1 s 912 ms ", + "description": "", + "type": "log" + }, + "body": { + "pid": 5160, + "tid": "Main Thread", + "startTime": 251411465795000 + }, + "additional": { + "logType": "error", + "children": [] + } + } + ] +} \ No newline at end of file diff --git a/NonSameLayerRendering/.hvigor/report/report-202505121551068180.json b/NonSameLayerRendering/.hvigor/report/report-202505121551068180.json new file mode 100644 index 0000000000000000000000000000000000000000..2293edfc2a370fd65156751713e90727833fbba4 --- /dev/null +++ b/NonSameLayerRendering/.hvigor/report/report-202505121551068180.json @@ -0,0 +1,927 @@ +{ + "version": "2.0", + "ppid": 11588, + "events": [ + { + "head": { + "id": "084c7656-7159-4974-9703-1b08d5055c3c", + "name": "watch worker: worker id should be larger than 0. Nothing will be sent to any worker thread.", + "description": "", + "type": "log" + }, + "body": { + "pid": 18368, + "tid": "Main Thread", + "startTime": 274109391826100 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "caf3542f-89cf-417d-8a4e-144954038196", + "name": "init", + "description": "Initialize and build task graph.", + "type": "duration" + }, + "body": { + "pid": 18368, + "tid": "Main Thread", + "startTime": 274109402007700 + }, + "additional": { + "children": [ + "588d0866-d8f6-4d72-a530-77c131deba5f", + "b2dcd45c-ee27-481c-8175-a07f846beae2", + "037b3b1e-acf7-4fc3-a054-58239a108139", + "b129f2d8-384f-488c-8eb2-b33f287bdfff", + "8ad561ad-e08a-4abf-8058-7738b6f2fdb9", + "47e6f61c-6140-400f-8f8b-5dca94c984a5" + ], + "state": "running", + "targetName": "", + "moduleName": "", + "category": "Init", + "taskRunReasons": [] + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "588d0866-d8f6-4d72-a530-77c131deba5f", + "name": "create hvigor project model", + "description": "Initialize hvigor project model.", + "type": "duration" + }, + "body": { + "pid": 18368, + "tid": "Main Thread", + "startTime": 274109402012400, + "endTime": 274109416924000 + }, + "additional": { + "children": [], + "state": "success", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "caf3542f-89cf-417d-8a4e-144954038196", + "logId": "9753f9bb-4c33-4ee2-9369-0e660c91500d" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "b2dcd45c-ee27-481c-8175-a07f846beae2", + "name": "configure hvigor plugin", + "description": "Configure hvigor plugin.", + "type": "duration" + }, + "body": { + "pid": 18368, + "tid": "Main Thread", + "startTime": 274109416955100 + }, + "additional": { + "children": [ + "7379bc81-0456-4743-a1ec-4065b0966a32", + "77063dac-d90e-46c8-8f3d-8690df122d06", + "1a638ee2-cf54-4b66-8a22-4c7ee2339f76", + "8414bd63-5554-4e79-8ab4-f0ddb06b7499", + "1e556a78-358d-4e6e-9375-1dd76966ec61", + "a2cdecc5-0481-4aec-8b02-66ed393a601c", + "ac69f601-f3da-419b-87d3-7f96245a40c3", + "a3181c5f-fcd9-46b6-b0da-34b82cc8877d" + ], + "state": "running", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "caf3542f-89cf-417d-8a4e-144954038196" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "8ad561ad-e08a-4abf-8058-7738b6f2fdb9", + "name": "\"configEvaluated\" hook function", + "description": "", + "type": "duration" + }, + "body": { + "pid": 18368, + "tid": "Main Thread", + "startTime": 274109405953100, + "endTime": 274109406308900 + }, + "additional": { + "children": [], + "state": "success", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "caf3542f-89cf-417d-8a4e-144954038196", + "logId": "cf811e28-cf13-4b40-81ea-3555e2fd07c7" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "cf811e28-cf13-4b40-81ea-3555e2fd07c7", + "name": "\"configEvaluated\" hook function", + "description": "", + "type": "log" + }, + "body": { + "pid": 18368, + "tid": "Main Thread", + "startTime": 274109405953100, + "endTime": 274109406308900 + }, + "additional": { + "logType": "info", + "children": [], + "durationId": "8ad561ad-e08a-4abf-8058-7738b6f2fdb9" + } + }, + { + "head": { + "id": "47e6f61c-6140-400f-8f8b-5dca94c984a5", + "name": "\"nodesInitialized\" hook function", + "description": "", + "type": "duration" + }, + "body": { + "pid": 18368, + "tid": "Main Thread", + "startTime": 274109411720100, + "endTime": 274109411780700 + }, + "additional": { + "children": [], + "state": "success", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "caf3542f-89cf-417d-8a4e-144954038196", + "logId": "1bcb2be7-2815-45d4-8ade-646bb949796b" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "1bcb2be7-2815-45d4-8ade-646bb949796b", + "name": "\"nodesInitialized\" hook function", + "description": "", + "type": "log" + }, + "body": { + "pid": 18368, + "tid": "Main Thread", + "startTime": 274109411720100, + "endTime": 274109411780700 + }, + "additional": { + "logType": "info", + "children": [], + "durationId": "47e6f61c-6140-400f-8f8b-5dca94c984a5" + } + }, + { + "head": { + "id": "ca50390e-402b-4fd0-b9d7-5774ac4f5db8", + "name": "Hvigor init with startParameters:{\n hvigorfileTypeCheck: false,\n parallelExecution: true,\n incrementalExecution: true,\n printStackTrace: false,\n daemon: true,\n analyze: 0,\n logLevel: Level { level: 20000, levelStr: 'INFO', colour: 'green' }\n}", + "description": "", + "type": "log" + }, + "body": { + "pid": 18368, + "tid": "Main Thread", + "startTime": 274109412591300 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "4307acc3-1f79-44a0-893d-5b4ff1d4a37b", + "name": "Since current hvigor version 5.17.0 differs from last hvigor version \n undefined, delete file-cache.json and task-cache.json.", + "description": "", + "type": "log" + }, + "body": { + "pid": 18368, + "tid": "Main Thread", + "startTime": 274109414435300 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "e975e6e5-1ad7-4ace-a937-a07da21c1328", + "name": "Cache service initialization finished in 4 ms ", + "description": "", + "type": "log" + }, + "body": { + "pid": 18368, + "tid": "Main Thread", + "startTime": 274109416709200 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "9753f9bb-4c33-4ee2-9369-0e660c91500d", + "name": "create hvigor project model", + "description": "", + "type": "log" + }, + "body": { + "pid": 18368, + "tid": "Main Thread", + "startTime": 274109402012400, + "endTime": 274109416924000 + }, + "additional": { + "logType": "info", + "children": [], + "durationId": "588d0866-d8f6-4d72-a530-77c131deba5f" + } + }, + { + "head": { + "id": "7379bc81-0456-4743-a1ec-4065b0966a32", + "name": "init configuration", + "description": "Initialize configuration.", + "type": "duration" + }, + "body": { + "pid": 18368, + "tid": "Main Thread", + "startTime": 274109422722700, + "endTime": 274109422771600 + }, + "additional": { + "children": [], + "state": "success", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "b2dcd45c-ee27-481c-8175-a07f846beae2", + "logId": "13e67fe3-21c6-4f95-989e-8b44b2ccce40" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "77063dac-d90e-46c8-8f3d-8690df122d06", + "name": "configure project task", + "description": "Configure project task.", + "type": "duration" + }, + "body": { + "pid": 18368, + "tid": "Main Thread", + "startTime": 274109422820600, + "endTime": 274109427460800 + }, + "additional": { + "children": [], + "state": "success", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "b2dcd45c-ee27-481c-8175-a07f846beae2", + "logId": "49df2f9c-6bc5-4514-87e7-79066df9a470" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "1a638ee2-cf54-4b66-8a22-4c7ee2339f76", + "name": "eval project", + "description": "Evaluate project.", + "type": "duration" + }, + "body": { + "pid": 18368, + "tid": "Main Thread", + "startTime": 274109427598200 + }, + "additional": { + "children": [ + "a06b9fac-2c0c-4155-9b0b-4864dfccee97", + "ebec96ff-a502-423a-890a-62b13b635b4d" + ], + "state": "running", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "b2dcd45c-ee27-481c-8175-a07f846beae2" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "13e67fe3-21c6-4f95-989e-8b44b2ccce40", + "name": "init configuration", + "description": "", + "type": "log" + }, + "body": { + "pid": 18368, + "tid": "Main Thread", + "startTime": 274109422722700, + "endTime": 274109422771600 + }, + "additional": { + "logType": "info", + "children": [], + "durationId": "7379bc81-0456-4743-a1ec-4065b0966a32" + } + }, + { + "head": { + "id": "49df2f9c-6bc5-4514-87e7-79066df9a470", + "name": "configure project task", + "description": "", + "type": "log" + }, + "body": { + "pid": 18368, + "tid": "Main Thread", + "startTime": 274109422820600, + "endTime": 274109427460800 + }, + "additional": { + "logType": "info", + "children": [], + "durationId": "77063dac-d90e-46c8-8f3d-8690df122d06" + } + }, + { + "head": { + "id": "a06b9fac-2c0c-4155-9b0b-4864dfccee97", + "name": "\"beforeNodeEvaluate\" hook function", + "description": "", + "type": "duration" + }, + "body": { + "pid": 18368, + "tid": "Main Thread", + "startTime": 274109428456200, + "endTime": 274109428617500 + }, + "additional": { + "children": [], + "state": "success", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "1a638ee2-cf54-4b66-8a22-4c7ee2339f76", + "logId": "306c2707-ca5e-4652-bcb8-d66e39b4fe2f" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "306c2707-ca5e-4652-bcb8-d66e39b4fe2f", + "name": "\"beforeNodeEvaluate\" hook function", + "description": "", + "type": "log" + }, + "body": { + "pid": 18368, + "tid": "Main Thread", + "startTime": 274109428456200, + "endTime": 274109428617500 + }, + "additional": { + "logType": "info", + "children": [], + "durationId": "a06b9fac-2c0c-4155-9b0b-4864dfccee97" + } + }, + { + "head": { + "id": "ebec96ff-a502-423a-890a-62b13b635b4d", + "name": "eval hvigorfile", + "description": "Evaluate hvigorfile.", + "type": "duration" + }, + "body": { + "pid": 18368, + "tid": "Main Thread", + "startTime": 274109430866300 + }, + "additional": { + "children": [ + "6994ff81-3696-4ce0-add0-fe3470970770", + "5e590868-a687-48af-b527-102ad612bf67" + ], + "state": "running", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "1a638ee2-cf54-4b66-8a22-4c7ee2339f76" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "6994ff81-3696-4ce0-add0-fe3470970770", + "name": "require hvigorfile", + "description": "Require hvigorfile.", + "type": "duration" + }, + "body": { + "pid": 18368, + "tid": "Main Thread", + "startTime": 274109430867700, + "endTime": 274111016759000 + }, + "additional": { + "children": [], + "state": "success", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "ebec96ff-a502-423a-890a-62b13b635b4d", + "logId": "29b214f5-37e8-4c5f-b7fc-991d2ea88bb4" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "5e590868-a687-48af-b527-102ad612bf67", + "name": "bind plugins", + "description": "Bind plugins.", + "type": "duration" + }, + "body": { + "pid": 18368, + "tid": "Main Thread", + "startTime": 274111016783300 + }, + "additional": { + "children": [], + "state": "running", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "ebec96ff-a502-423a-890a-62b13b635b4d" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "dc293539-da52-433d-88e2-e636e94c31ae", + "name": "hvigorfile, resolving D:\\LiuDongHai\\FAQ最佳实践资料\\BestPractices\\BestPractices\\DevelopmentPractice\\NonSameLayerRendering\\hvigorfile.ts", + "description": "", + "type": "log" + }, + "body": { + "pid": 18368, + "tid": "Main Thread", + "startTime": 274109430876700 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "d031b0ea-9342-40a5-96b3-e2c4d910c6b5", + "name": "hvigorfile, require result: { default: { system: [Function: appTasks], plugins: [] } }", + "description": "", + "type": "log" + }, + "body": { + "pid": 18368, + "tid": "Main Thread", + "startTime": 274111016632500 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "29b214f5-37e8-4c5f-b7fc-991d2ea88bb4", + "name": "require hvigorfile", + "description": "", + "type": "log" + }, + "body": { + "pid": 18368, + "tid": "Main Thread", + "startTime": 274109430867700, + "endTime": 274111016759000 + }, + "additional": { + "logType": "info", + "children": [], + "durationId": "6994ff81-3696-4ce0-add0-fe3470970770" + } + }, + { + "head": { + "id": "bde9f1fb-804c-4e29-9da8-b5a1ba3dab65", + "name": "hvigorfile, binding system plugins [Function: appTasks]", + "description": "", + "type": "log" + }, + "body": { + "pid": 18368, + "tid": "Main Thread", + "startTime": 274111016903000 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "564931af-6263-4198-a38f-304f10dcebc7", + "name": "hvigor build process will be closed with an error.", + "description": "", + "type": "log" + }, + "body": { + "pid": 18368, + "tid": "Main Thread", + "startTime": 274111213991700 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "c7345f78-e6a4-4901-8f58-5b34088828ea", + "name": "ERROR: stacktrace = Error: Invalid project path.\r\n\t Detail: Please move the project to a valid path\n at OhosLogger.errorMessageExit (D:\\LiuDongHai\\DevEco Studio\\tools\\hvigor\\hvigor\\src\\base\\log\\hvigor-log.js:1:3224)\n at OhosLogger._printAllExit (D:\\LiuDongHai\\DevEco Studio\\tools\\hvigor\\hvigor-ohos-plugin\\src\\utils\\log\\ohos-logger.js:1:1274)\n at ProjectInspection.exitOnError (D:\\LiuDongHai\\DevEco Studio\\tools\\hvigor\\hvigor-ohos-plugin\\src\\tasks\\inspection\\project-inspection.js:1:672)\n at AppPlugin.doProjectInspection (D:\\LiuDongHai\\DevEco Studio\\tools\\hvigor\\hvigor-ohos-plugin\\src\\plugin\\common\\abstract-project-plugin.js:1:1585)\n at PluginFactory.getAppPlugin (D:\\LiuDongHai\\DevEco Studio\\tools\\hvigor\\hvigor-ohos-plugin\\src\\plugin\\factory\\plugin-factory.js:1:2159)\n at appTasks (D:\\LiuDongHai\\DevEco Studio\\tools\\hvigor\\hvigor-ohos-plugin\\index.js:1:593)\n at bindSystemPlugins (D:\\LiuDongHai\\DevEco Studio\\tools\\hvigor\\hvigor\\src\\base\\internal\\lifecycle\\configuration.js:1:5900)\n at evaluateNodeVigorFile (D:\\LiuDongHai\\DevEco Studio\\tools\\hvigor\\hvigor\\src\\base\\internal\\lifecycle\\configuration.js:1:8450)\n at evalProject (D:\\LiuDongHai\\DevEco Studio\\tools\\hvigor\\hvigor\\src\\base\\internal\\lifecycle\\configuration.js:1:3495)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)", + "description": "", + "type": "log" + }, + "body": { + "pid": 18368, + "tid": "Main Thread", + "startTime": 274111215375200 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "dcd46f73-2306-4058-b77c-5f21d39ff669", + "name": "\"buildFinished\" hook function", + "description": "", + "type": "duration" + }, + "body": { + "pid": 18368, + "tid": "Main Thread", + "startTime": 274111221429600, + "endTime": 274111221629300 + }, + "additional": { + "children": [], + "state": "success", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "d02173f7-d90f-4b59-b822-e5b012117030", + "logId": "cb95abdb-c270-45a0-b643-e517be8bf48a" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "cb95abdb-c270-45a0-b643-e517be8bf48a", + "name": "\"buildFinished\" hook function", + "description": "", + "type": "log" + }, + "body": { + "pid": 18368, + "tid": "Main Thread", + "startTime": 274111221429600, + "endTime": 274111221629300 + }, + "additional": { + "logType": "info", + "children": [], + "durationId": "dcd46f73-2306-4058-b77c-5f21d39ff669" + } + }, + { + "head": { + "id": "0e44b522-cee3-43a0-83b9-027d58309cd4", + "name": "", + "description": "", + "type": "mark" + }, + "body": { + "pid": 18368, + "tid": "Main Thread", + "startTime": 274109397942500, + "endTime": 274111222403800 + }, + "additional": { + "time": { + "year": 2025, + "month": 5, + "day": 12, + "hour": 15, + "minute": 51 + }, + "completeCommand": "{\"prop\":[\"product=default\"],\"sync\":true,\"parallel\":true,\"incremental\":true,\"daemon\":true,\"_\":[],\"analyze\":\"normal\"};", + "hvigorVersion": "5.17.0", + "markType": "history", + "nodeVersion": "v18.20.1", + "category": "build", + "state": "failed" + } + }, + { + "head": { + "id": "92c58c8a-9996-4bfc-90cc-07013997b4a5", + "name": "BUILD FAILED in 1 s 824 ms ", + "description": "", + "type": "log" + }, + "body": { + "pid": 18368, + "tid": "Main Thread", + "startTime": 274111222537800 + }, + "additional": { + "logType": "error", + "children": [] + } + } + ] +} \ No newline at end of file diff --git a/NonSameLayerRendering/.hvigor/report/report-202505131527354620.json b/NonSameLayerRendering/.hvigor/report/report-202505131527354620.json new file mode 100644 index 0000000000000000000000000000000000000000..5241521b29ebec0778d5df0c1f493a863ad47b71 --- /dev/null +++ b/NonSameLayerRendering/.hvigor/report/report-202505131527354620.json @@ -0,0 +1,927 @@ +{ + "version": "2.0", + "ppid": 20456, + "events": [ + { + "head": { + "id": "e0f9e872-cc2b-4e92-afc2-a82329cbcc32", + "name": "watch worker: worker id should be larger than 0. Nothing will be sent to any worker thread.", + "description": "", + "type": "log" + }, + "body": { + "pid": 15008, + "tid": "Main Thread", + "startTime": 359098286550600 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "6371bbd3-3d38-4ff5-bc95-229104d7ebb2", + "name": "init", + "description": "Initialize and build task graph.", + "type": "duration" + }, + "body": { + "pid": 15008, + "tid": "Main Thread", + "startTime": 359098295505800 + }, + "additional": { + "children": [ + "bb34c902-6608-4d7c-ae28-7aed53294585", + "e0cb9a69-4ace-4a36-a442-8f51bd401381", + "2bc11959-788e-4b5d-a5aa-2c19e716169f", + "be73d238-e4b9-4fd6-b1b6-bf573fbc44c8", + "e4823d09-9fe6-4040-9924-3c1f76d2d943", + "efa13dda-e886-478d-bf23-0ae21a320071" + ], + "state": "running", + "targetName": "", + "moduleName": "", + "category": "Init", + "taskRunReasons": [] + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "bb34c902-6608-4d7c-ae28-7aed53294585", + "name": "create hvigor project model", + "description": "Initialize hvigor project model.", + "type": "duration" + }, + "body": { + "pid": 15008, + "tid": "Main Thread", + "startTime": 359098295509800, + "endTime": 359098308864500 + }, + "additional": { + "children": [], + "state": "success", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "6371bbd3-3d38-4ff5-bc95-229104d7ebb2", + "logId": "ff86b209-399d-4807-a694-81db0ad0b341" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "e0cb9a69-4ace-4a36-a442-8f51bd401381", + "name": "configure hvigor plugin", + "description": "Configure hvigor plugin.", + "type": "duration" + }, + "body": { + "pid": 15008, + "tid": "Main Thread", + "startTime": 359098308888300 + }, + "additional": { + "children": [ + "96cb7b6c-2404-4d49-a9c6-c5843768e751", + "e1681d38-f3e8-43f6-87bb-ded8d065d0b3", + "af339585-3f24-4761-bbd4-bee1c8f11853", + "83ee9c0c-0457-4df7-b07e-97eb6b9883b4", + "c9f5c20e-d42e-443f-b2e3-c9d8ac364a69", + "fb464c48-2514-4bd3-a29d-d8384e1cc18f", + "357701f9-2bf6-4706-a1fd-6469fe4f6472", + "4657ba9f-ddf3-4dd6-a552-e3b236a2eefc" + ], + "state": "running", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "6371bbd3-3d38-4ff5-bc95-229104d7ebb2" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "e4823d09-9fe6-4040-9924-3c1f76d2d943", + "name": "\"configEvaluated\" hook function", + "description": "", + "type": "duration" + }, + "body": { + "pid": 15008, + "tid": "Main Thread", + "startTime": 359098299116600, + "endTime": 359098299412400 + }, + "additional": { + "children": [], + "state": "success", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "6371bbd3-3d38-4ff5-bc95-229104d7ebb2", + "logId": "e6fbde7c-e358-4da9-ad67-0b0a5650d0a0" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "e6fbde7c-e358-4da9-ad67-0b0a5650d0a0", + "name": "\"configEvaluated\" hook function", + "description": "", + "type": "log" + }, + "body": { + "pid": 15008, + "tid": "Main Thread", + "startTime": 359098299116600, + "endTime": 359098299412400 + }, + "additional": { + "logType": "info", + "children": [], + "durationId": "e4823d09-9fe6-4040-9924-3c1f76d2d943" + } + }, + { + "head": { + "id": "efa13dda-e886-478d-bf23-0ae21a320071", + "name": "\"nodesInitialized\" hook function", + "description": "", + "type": "duration" + }, + "body": { + "pid": 15008, + "tid": "Main Thread", + "startTime": 359098304429600, + "endTime": 359098304469900 + }, + "additional": { + "children": [], + "state": "success", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "6371bbd3-3d38-4ff5-bc95-229104d7ebb2", + "logId": "880c8482-19f8-463f-a7d6-a4944c3f8c45" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "880c8482-19f8-463f-a7d6-a4944c3f8c45", + "name": "\"nodesInitialized\" hook function", + "description": "", + "type": "log" + }, + "body": { + "pid": 15008, + "tid": "Main Thread", + "startTime": 359098304429600, + "endTime": 359098304469900 + }, + "additional": { + "logType": "info", + "children": [], + "durationId": "efa13dda-e886-478d-bf23-0ae21a320071" + } + }, + { + "head": { + "id": "301d9972-cba9-46de-a558-4abe5c87d9af", + "name": "Hvigor init with startParameters:{\n hvigorfileTypeCheck: false,\n parallelExecution: true,\n incrementalExecution: true,\n printStackTrace: false,\n daemon: true,\n analyze: 0,\n logLevel: Level { level: 20000, levelStr: 'INFO', colour: 'green' }\n}", + "description": "", + "type": "log" + }, + "body": { + "pid": 15008, + "tid": "Main Thread", + "startTime": 359098305085900 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "97a60733-ed0c-4cc1-b6a3-60404de13db3", + "name": "Since current hvigor version 5.17.0 differs from last hvigor version \n undefined, delete file-cache.json and task-cache.json.", + "description": "", + "type": "log" + }, + "body": { + "pid": 15008, + "tid": "Main Thread", + "startTime": 359098306816800 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "3c4335e6-ab9e-4822-80e7-4151ca260773", + "name": "Cache service initialization finished in 4 ms ", + "description": "", + "type": "log" + }, + "body": { + "pid": 15008, + "tid": "Main Thread", + "startTime": 359098308763200 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "ff86b209-399d-4807-a694-81db0ad0b341", + "name": "create hvigor project model", + "description": "", + "type": "log" + }, + "body": { + "pid": 15008, + "tid": "Main Thread", + "startTime": 359098295509800, + "endTime": 359098308864500 + }, + "additional": { + "logType": "info", + "children": [], + "durationId": "bb34c902-6608-4d7c-ae28-7aed53294585" + } + }, + { + "head": { + "id": "96cb7b6c-2404-4d49-a9c6-c5843768e751", + "name": "init configuration", + "description": "Initialize configuration.", + "type": "duration" + }, + "body": { + "pid": 15008, + "tid": "Main Thread", + "startTime": 359098314019600, + "endTime": 359098314066900 + }, + "additional": { + "children": [], + "state": "success", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "e0cb9a69-4ace-4a36-a442-8f51bd401381", + "logId": "6d87bfa9-a1cb-4e18-89eb-2357ccfda300" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "e1681d38-f3e8-43f6-87bb-ded8d065d0b3", + "name": "configure project task", + "description": "Configure project task.", + "type": "duration" + }, + "body": { + "pid": 15008, + "tid": "Main Thread", + "startTime": 359098314108500, + "endTime": 359098318206100 + }, + "additional": { + "children": [], + "state": "success", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "e0cb9a69-4ace-4a36-a442-8f51bd401381", + "logId": "fc327401-bcb9-40ba-806c-05cd7908b211" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "af339585-3f24-4761-bbd4-bee1c8f11853", + "name": "eval project", + "description": "Evaluate project.", + "type": "duration" + }, + "body": { + "pid": 15008, + "tid": "Main Thread", + "startTime": 359098318307900 + }, + "additional": { + "children": [ + "a326bb1f-14fe-41fd-b163-cae383fa147c", + "b5eaf97d-2268-4c14-a2a2-6bb01ddfdc01" + ], + "state": "running", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "e0cb9a69-4ace-4a36-a442-8f51bd401381" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "6d87bfa9-a1cb-4e18-89eb-2357ccfda300", + "name": "init configuration", + "description": "", + "type": "log" + }, + "body": { + "pid": 15008, + "tid": "Main Thread", + "startTime": 359098314019600, + "endTime": 359098314066900 + }, + "additional": { + "logType": "info", + "children": [], + "durationId": "96cb7b6c-2404-4d49-a9c6-c5843768e751" + } + }, + { + "head": { + "id": "fc327401-bcb9-40ba-806c-05cd7908b211", + "name": "configure project task", + "description": "", + "type": "log" + }, + "body": { + "pid": 15008, + "tid": "Main Thread", + "startTime": 359098314108500, + "endTime": 359098318206100 + }, + "additional": { + "logType": "info", + "children": [], + "durationId": "e1681d38-f3e8-43f6-87bb-ded8d065d0b3" + } + }, + { + "head": { + "id": "a326bb1f-14fe-41fd-b163-cae383fa147c", + "name": "\"beforeNodeEvaluate\" hook function", + "description": "", + "type": "duration" + }, + "body": { + "pid": 15008, + "tid": "Main Thread", + "startTime": 359098319070200, + "endTime": 359098319200300 + }, + "additional": { + "children": [], + "state": "success", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "af339585-3f24-4761-bbd4-bee1c8f11853", + "logId": "e9a0116f-3ca2-42f9-bb13-5c60d376ce71" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "e9a0116f-3ca2-42f9-bb13-5c60d376ce71", + "name": "\"beforeNodeEvaluate\" hook function", + "description": "", + "type": "log" + }, + "body": { + "pid": 15008, + "tid": "Main Thread", + "startTime": 359098319070200, + "endTime": 359098319200300 + }, + "additional": { + "logType": "info", + "children": [], + "durationId": "a326bb1f-14fe-41fd-b163-cae383fa147c" + } + }, + { + "head": { + "id": "b5eaf97d-2268-4c14-a2a2-6bb01ddfdc01", + "name": "eval hvigorfile", + "description": "Evaluate hvigorfile.", + "type": "duration" + }, + "body": { + "pid": 15008, + "tid": "Main Thread", + "startTime": 359098321241800 + }, + "additional": { + "children": [ + "8b5c6afa-df1f-4260-a43d-fcd7f65ac2ab", + "5327a665-c44b-428e-bdf7-54639c939908" + ], + "state": "running", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "af339585-3f24-4761-bbd4-bee1c8f11853" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "8b5c6afa-df1f-4260-a43d-fcd7f65ac2ab", + "name": "require hvigorfile", + "description": "Require hvigorfile.", + "type": "duration" + }, + "body": { + "pid": 15008, + "tid": "Main Thread", + "startTime": 359098321242900, + "endTime": 359099941902700 + }, + "additional": { + "children": [], + "state": "success", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "b5eaf97d-2268-4c14-a2a2-6bb01ddfdc01", + "logId": "f6887840-c73e-441e-881f-61f528adeb41" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "5327a665-c44b-428e-bdf7-54639c939908", + "name": "bind plugins", + "description": "Bind plugins.", + "type": "duration" + }, + "body": { + "pid": 15008, + "tid": "Main Thread", + "startTime": 359099941927400 + }, + "additional": { + "children": [], + "state": "running", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "b5eaf97d-2268-4c14-a2a2-6bb01ddfdc01" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "1d6dbea1-86b6-417b-b635-8fb5cfa66434", + "name": "hvigorfile, resolving D:\\LiuDongHai\\FAQ最佳实践资料\\BestPractices\\BestPractices\\DevelopmentPractice\\NonSameLayerRendering\\hvigorfile.ts", + "description": "", + "type": "log" + }, + "body": { + "pid": 15008, + "tid": "Main Thread", + "startTime": 359098321248300 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "f8e0bb1c-352d-4306-a9a4-05bd82cbfc6e", + "name": "hvigorfile, require result: { default: { system: [Function: appTasks], plugins: [] } }", + "description": "", + "type": "log" + }, + "body": { + "pid": 15008, + "tid": "Main Thread", + "startTime": 359099941770700 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "f6887840-c73e-441e-881f-61f528adeb41", + "name": "require hvigorfile", + "description": "", + "type": "log" + }, + "body": { + "pid": 15008, + "tid": "Main Thread", + "startTime": 359098321242900, + "endTime": 359099941902700 + }, + "additional": { + "logType": "info", + "children": [], + "durationId": "8b5c6afa-df1f-4260-a43d-fcd7f65ac2ab" + } + }, + { + "head": { + "id": "03e0877b-66a5-47d4-acb8-0250b0feb1da", + "name": "hvigorfile, binding system plugins [Function: appTasks]", + "description": "", + "type": "log" + }, + "body": { + "pid": 15008, + "tid": "Main Thread", + "startTime": 359099942036600 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "f6b19e67-8eb0-4041-95a5-6982ff4cd9c4", + "name": "hvigor build process will be closed with an error.", + "description": "", + "type": "log" + }, + "body": { + "pid": 15008, + "tid": "Main Thread", + "startTime": 359100135750700 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "3181bb5e-82f0-4af4-a5d3-cc7e86617f39", + "name": "ERROR: stacktrace = Error: Invalid project path.\r\n\t Detail: Please move the project to a valid path\n at OhosLogger.errorMessageExit (D:\\LiuDongHai\\DevEco Studio\\tools\\hvigor\\hvigor\\src\\base\\log\\hvigor-log.js:1:3224)\n at OhosLogger._printAllExit (D:\\LiuDongHai\\DevEco Studio\\tools\\hvigor\\hvigor-ohos-plugin\\src\\utils\\log\\ohos-logger.js:1:1274)\n at ProjectInspection.exitOnError (D:\\LiuDongHai\\DevEco Studio\\tools\\hvigor\\hvigor-ohos-plugin\\src\\tasks\\inspection\\project-inspection.js:1:672)\n at AppPlugin.doProjectInspection (D:\\LiuDongHai\\DevEco Studio\\tools\\hvigor\\hvigor-ohos-plugin\\src\\plugin\\common\\abstract-project-plugin.js:1:1585)\n at PluginFactory.getAppPlugin (D:\\LiuDongHai\\DevEco Studio\\tools\\hvigor\\hvigor-ohos-plugin\\src\\plugin\\factory\\plugin-factory.js:1:2159)\n at appTasks (D:\\LiuDongHai\\DevEco Studio\\tools\\hvigor\\hvigor-ohos-plugin\\index.js:1:593)\n at bindSystemPlugins (D:\\LiuDongHai\\DevEco Studio\\tools\\hvigor\\hvigor\\src\\base\\internal\\lifecycle\\configuration.js:1:5900)\n at evaluateNodeVigorFile (D:\\LiuDongHai\\DevEco Studio\\tools\\hvigor\\hvigor\\src\\base\\internal\\lifecycle\\configuration.js:1:8450)\n at evalProject (D:\\LiuDongHai\\DevEco Studio\\tools\\hvigor\\hvigor\\src\\base\\internal\\lifecycle\\configuration.js:1:3495)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)", + "description": "", + "type": "log" + }, + "body": { + "pid": 15008, + "tid": "Main Thread", + "startTime": 359100137008800 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "20484f3e-a34e-4b57-b807-06dbf03c1b11", + "name": "\"buildFinished\" hook function", + "description": "", + "type": "duration" + }, + "body": { + "pid": 15008, + "tid": "Main Thread", + "startTime": 359100143340400, + "endTime": 359100143482900 + }, + "additional": { + "children": [], + "state": "success", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "45c9f73c-7d87-4bdc-b75d-4a647d995adf", + "logId": "fb32815b-f774-4e6c-aa1d-9b882f2fc3e7" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "fb32815b-f774-4e6c-aa1d-9b882f2fc3e7", + "name": "\"buildFinished\" hook function", + "description": "", + "type": "log" + }, + "body": { + "pid": 15008, + "tid": "Main Thread", + "startTime": 359100143340400, + "endTime": 359100143482900 + }, + "additional": { + "logType": "info", + "children": [], + "durationId": "20484f3e-a34e-4b57-b807-06dbf03c1b11" + } + }, + { + "head": { + "id": "6d5ee152-2e7d-49b3-b186-96ce15bec5df", + "name": "", + "description": "", + "type": "mark" + }, + "body": { + "pid": 15008, + "tid": "Main Thread", + "startTime": 359098291972400, + "endTime": 359100144094000 + }, + "additional": { + "time": { + "year": 2025, + "month": 5, + "day": 13, + "hour": 15, + "minute": 27 + }, + "completeCommand": "{\"prop\":[\"product=default\"],\"sync\":true,\"parallel\":true,\"incremental\":true,\"daemon\":true,\"_\":[],\"analyze\":\"normal\"};", + "hvigorVersion": "5.17.0", + "markType": "history", + "nodeVersion": "v18.20.1", + "category": "build", + "state": "failed" + } + }, + { + "head": { + "id": "5f6c0d9f-b742-48cb-b391-9fb3972a70c6", + "name": "BUILD FAILED in 1 s 852 ms ", + "description": "", + "type": "log" + }, + "body": { + "pid": 15008, + "tid": "Main Thread", + "startTime": 359100144223800 + }, + "additional": { + "logType": "error", + "children": [] + } + } + ] +} \ No newline at end of file diff --git a/NonSameLayerRendering/.hvigor/report/report-202505151037354630.json b/NonSameLayerRendering/.hvigor/report/report-202505151037354630.json new file mode 100644 index 0000000000000000000000000000000000000000..66e325ec08f880c45b132347e4ba0f9ce8c15328 --- /dev/null +++ b/NonSameLayerRendering/.hvigor/report/report-202505151037354630.json @@ -0,0 +1,927 @@ +{ + "version": "2.0", + "ppid": 9968, + "events": [ + { + "head": { + "id": "330cb248-eb82-46c9-a9f1-949be7c844c1", + "name": "watch worker: worker id should be larger than 0. Nothing will be sent to any worker thread.", + "description": "", + "type": "log" + }, + "body": { + "pid": 3780, + "tid": "Main Thread", + "startTime": 514498771925700 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "248a320f-1bdb-49a8-bc55-c7688f4cd4d1", + "name": "init", + "description": "Initialize and build task graph.", + "type": "duration" + }, + "body": { + "pid": 3780, + "tid": "Main Thread", + "startTime": 514498780812100 + }, + "additional": { + "children": [ + "15f0c991-8e40-4ee8-84ee-1479ba1f758d", + "43f18eb4-3e05-4f9b-93dd-d69c5d21d746", + "cfd469b0-67aa-4f74-937d-0f55b0acdd02", + "9402351f-fe59-47e7-b4fb-8619b7c7c0d6", + "22f705d2-b196-4899-a741-0079303c419c", + "68e512c6-6c6b-4f8c-bddd-6e4d65e9ff29" + ], + "state": "running", + "targetName": "", + "moduleName": "", + "category": "Init", + "taskRunReasons": [] + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "15f0c991-8e40-4ee8-84ee-1479ba1f758d", + "name": "create hvigor project model", + "description": "Initialize hvigor project model.", + "type": "duration" + }, + "body": { + "pid": 3780, + "tid": "Main Thread", + "startTime": 514498780816300, + "endTime": 514498795014300 + }, + "additional": { + "children": [], + "state": "success", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "248a320f-1bdb-49a8-bc55-c7688f4cd4d1", + "logId": "0dfa4925-6473-4dc6-9eba-d55efa7a7cd1" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "43f18eb4-3e05-4f9b-93dd-d69c5d21d746", + "name": "configure hvigor plugin", + "description": "Configure hvigor plugin.", + "type": "duration" + }, + "body": { + "pid": 3780, + "tid": "Main Thread", + "startTime": 514498795037200 + }, + "additional": { + "children": [ + "7e38d38b-5bad-4174-874d-4e2c90bd6048", + "ebcc9361-717d-4791-a863-493a6515743c", + "5c050a0f-7bba-4f96-888b-463934da44cb", + "903e93f9-b1e5-4a27-914b-a6597733635a", + "17381608-949b-4ab3-a910-5100244db4e3", + "0419879a-3184-4f16-9678-2233b318a113", + "df72c9c4-ec75-417a-bfad-8751e9363306", + "c1a057f0-c0a5-46d5-8acb-ae073cb5c395" + ], + "state": "running", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "248a320f-1bdb-49a8-bc55-c7688f4cd4d1" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "22f705d2-b196-4899-a741-0079303c419c", + "name": "\"configEvaluated\" hook function", + "description": "", + "type": "duration" + }, + "body": { + "pid": 3780, + "tid": "Main Thread", + "startTime": 514498784536000, + "endTime": 514498784864300 + }, + "additional": { + "children": [], + "state": "success", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "248a320f-1bdb-49a8-bc55-c7688f4cd4d1", + "logId": "d176be38-5821-445d-9de1-bd115d9ec7d8" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "d176be38-5821-445d-9de1-bd115d9ec7d8", + "name": "\"configEvaluated\" hook function", + "description": "", + "type": "log" + }, + "body": { + "pid": 3780, + "tid": "Main Thread", + "startTime": 514498784536000, + "endTime": 514498784864300 + }, + "additional": { + "logType": "info", + "children": [], + "durationId": "22f705d2-b196-4899-a741-0079303c419c" + } + }, + { + "head": { + "id": "68e512c6-6c6b-4f8c-bddd-6e4d65e9ff29", + "name": "\"nodesInitialized\" hook function", + "description": "", + "type": "duration" + }, + "body": { + "pid": 3780, + "tid": "Main Thread", + "startTime": 514498790113100, + "endTime": 514498790157300 + }, + "additional": { + "children": [], + "state": "success", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "248a320f-1bdb-49a8-bc55-c7688f4cd4d1", + "logId": "bad6b920-9b56-4ba2-bc38-af2e8b443900" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "bad6b920-9b56-4ba2-bc38-af2e8b443900", + "name": "\"nodesInitialized\" hook function", + "description": "", + "type": "log" + }, + "body": { + "pid": 3780, + "tid": "Main Thread", + "startTime": 514498790113100, + "endTime": 514498790157300 + }, + "additional": { + "logType": "info", + "children": [], + "durationId": "68e512c6-6c6b-4f8c-bddd-6e4d65e9ff29" + } + }, + { + "head": { + "id": "838e82c0-b5b7-4cbe-bd4b-f9d594f60d6e", + "name": "Hvigor init with startParameters:{\n hvigorfileTypeCheck: false,\n parallelExecution: true,\n incrementalExecution: true,\n printStackTrace: false,\n daemon: true,\n analyze: 0,\n logLevel: Level { level: 20000, levelStr: 'INFO', colour: 'green' }\n}", + "description": "", + "type": "log" + }, + "body": { + "pid": 3780, + "tid": "Main Thread", + "startTime": 514498790940500 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "0932efa4-253b-4240-b1cc-54cfb3b9b0b9", + "name": "Since current hvigor version 5.17.0 differs from last hvigor version \n undefined, delete file-cache.json and task-cache.json.", + "description": "", + "type": "log" + }, + "body": { + "pid": 3780, + "tid": "Main Thread", + "startTime": 514498792758500 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "e6d17872-a651-415e-8b22-633eb444b5ba", + "name": "Cache service initialization finished in 4 ms ", + "description": "", + "type": "log" + }, + "body": { + "pid": 3780, + "tid": "Main Thread", + "startTime": 514498794890200 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "0dfa4925-6473-4dc6-9eba-d55efa7a7cd1", + "name": "create hvigor project model", + "description": "", + "type": "log" + }, + "body": { + "pid": 3780, + "tid": "Main Thread", + "startTime": 514498780816300, + "endTime": 514498795014300 + }, + "additional": { + "logType": "info", + "children": [], + "durationId": "15f0c991-8e40-4ee8-84ee-1479ba1f758d" + } + }, + { + "head": { + "id": "7e38d38b-5bad-4174-874d-4e2c90bd6048", + "name": "init configuration", + "description": "Initialize configuration.", + "type": "duration" + }, + "body": { + "pid": 3780, + "tid": "Main Thread", + "startTime": 514498800143400, + "endTime": 514498800188200 + }, + "additional": { + "children": [], + "state": "success", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "43f18eb4-3e05-4f9b-93dd-d69c5d21d746", + "logId": "2b8284a7-6c59-456f-8ecc-3c30a3e68972" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "ebcc9361-717d-4791-a863-493a6515743c", + "name": "configure project task", + "description": "Configure project task.", + "type": "duration" + }, + "body": { + "pid": 3780, + "tid": "Main Thread", + "startTime": 514498800230000, + "endTime": 514498804459700 + }, + "additional": { + "children": [], + "state": "success", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "43f18eb4-3e05-4f9b-93dd-d69c5d21d746", + "logId": "c2f08c38-aa09-4efc-83a5-074f734c376f" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "5c050a0f-7bba-4f96-888b-463934da44cb", + "name": "eval project", + "description": "Evaluate project.", + "type": "duration" + }, + "body": { + "pid": 3780, + "tid": "Main Thread", + "startTime": 514498804563600 + }, + "additional": { + "children": [ + "585815da-def1-4d8b-b674-0db8846a82cb", + "63a632e4-ebf2-4988-a729-8279d672e7c6" + ], + "state": "running", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "43f18eb4-3e05-4f9b-93dd-d69c5d21d746" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "2b8284a7-6c59-456f-8ecc-3c30a3e68972", + "name": "init configuration", + "description": "", + "type": "log" + }, + "body": { + "pid": 3780, + "tid": "Main Thread", + "startTime": 514498800143400, + "endTime": 514498800188200 + }, + "additional": { + "logType": "info", + "children": [], + "durationId": "7e38d38b-5bad-4174-874d-4e2c90bd6048" + } + }, + { + "head": { + "id": "c2f08c38-aa09-4efc-83a5-074f734c376f", + "name": "configure project task", + "description": "", + "type": "log" + }, + "body": { + "pid": 3780, + "tid": "Main Thread", + "startTime": 514498800230000, + "endTime": 514498804459700 + }, + "additional": { + "logType": "info", + "children": [], + "durationId": "ebcc9361-717d-4791-a863-493a6515743c" + } + }, + { + "head": { + "id": "585815da-def1-4d8b-b674-0db8846a82cb", + "name": "\"beforeNodeEvaluate\" hook function", + "description": "", + "type": "duration" + }, + "body": { + "pid": 3780, + "tid": "Main Thread", + "startTime": 514498805334400, + "endTime": 514498805497100 + }, + "additional": { + "children": [], + "state": "success", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "5c050a0f-7bba-4f96-888b-463934da44cb", + "logId": "4ce80690-81b3-440e-ad0e-89a2a046c326" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "4ce80690-81b3-440e-ad0e-89a2a046c326", + "name": "\"beforeNodeEvaluate\" hook function", + "description": "", + "type": "log" + }, + "body": { + "pid": 3780, + "tid": "Main Thread", + "startTime": 514498805334400, + "endTime": 514498805497100 + }, + "additional": { + "logType": "info", + "children": [], + "durationId": "585815da-def1-4d8b-b674-0db8846a82cb" + } + }, + { + "head": { + "id": "63a632e4-ebf2-4988-a729-8279d672e7c6", + "name": "eval hvigorfile", + "description": "Evaluate hvigorfile.", + "type": "duration" + }, + "body": { + "pid": 3780, + "tid": "Main Thread", + "startTime": 514498807721800 + }, + "additional": { + "children": [ + "c8383036-656a-4b47-8a61-c935a8f7ebbb", + "c1e52f2d-48ba-48b5-bdcb-861b361a9ef7" + ], + "state": "running", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "5c050a0f-7bba-4f96-888b-463934da44cb" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "c8383036-656a-4b47-8a61-c935a8f7ebbb", + "name": "require hvigorfile", + "description": "Require hvigorfile.", + "type": "duration" + }, + "body": { + "pid": 3780, + "tid": "Main Thread", + "startTime": 514498807723300, + "endTime": 514500452385200 + }, + "additional": { + "children": [], + "state": "success", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "63a632e4-ebf2-4988-a729-8279d672e7c6", + "logId": "d513c6f9-abc5-45f3-9bb2-7e489727c61e" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "c1e52f2d-48ba-48b5-bdcb-861b361a9ef7", + "name": "bind plugins", + "description": "Bind plugins.", + "type": "duration" + }, + "body": { + "pid": 3780, + "tid": "Main Thread", + "startTime": 514500452408500 + }, + "additional": { + "children": [], + "state": "running", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "63a632e4-ebf2-4988-a729-8279d672e7c6" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "6e2f450d-5802-421c-9ba0-270ccd1fb49c", + "name": "hvigorfile, resolving D:\\LiuDongHai\\FAQ最佳实践资料\\BestPractices\\BestPractices\\DevelopmentPractice\\NonSameLayerRendering\\hvigorfile.ts", + "description": "", + "type": "log" + }, + "body": { + "pid": 3780, + "tid": "Main Thread", + "startTime": 514498807729700 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "f8bdabc2-4ea1-412c-9b9e-7509b879e2db", + "name": "hvigorfile, require result: { default: { system: [Function: appTasks], plugins: [] } }", + "description": "", + "type": "log" + }, + "body": { + "pid": 3780, + "tid": "Main Thread", + "startTime": 514500452254200 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "d513c6f9-abc5-45f3-9bb2-7e489727c61e", + "name": "require hvigorfile", + "description": "", + "type": "log" + }, + "body": { + "pid": 3780, + "tid": "Main Thread", + "startTime": 514498807723300, + "endTime": 514500452385200 + }, + "additional": { + "logType": "info", + "children": [], + "durationId": "c8383036-656a-4b47-8a61-c935a8f7ebbb" + } + }, + { + "head": { + "id": "ff745940-fe03-420e-b045-5fa2f787d067", + "name": "hvigorfile, binding system plugins [Function: appTasks]", + "description": "", + "type": "log" + }, + "body": { + "pid": 3780, + "tid": "Main Thread", + "startTime": 514500452516400 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "8ea11c4b-6191-4288-a2ea-0c6d8c195bff", + "name": "hvigor build process will be closed with an error.", + "description": "", + "type": "log" + }, + "body": { + "pid": 3780, + "tid": "Main Thread", + "startTime": 514500639652600 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "b3681313-9806-47f9-b8a8-827e52c08eff", + "name": "ERROR: stacktrace = Error: Invalid project path.\r\n\t Detail: Please move the project to a valid path\n at OhosLogger.errorMessageExit (D:\\LiuDongHai\\DevEco Studio\\tools\\hvigor\\hvigor\\src\\base\\log\\hvigor-log.js:1:3224)\n at OhosLogger._printAllExit (D:\\LiuDongHai\\DevEco Studio\\tools\\hvigor\\hvigor-ohos-plugin\\src\\utils\\log\\ohos-logger.js:1:1274)\n at ProjectInspection.exitOnError (D:\\LiuDongHai\\DevEco Studio\\tools\\hvigor\\hvigor-ohos-plugin\\src\\tasks\\inspection\\project-inspection.js:1:672)\n at AppPlugin.doProjectInspection (D:\\LiuDongHai\\DevEco Studio\\tools\\hvigor\\hvigor-ohos-plugin\\src\\plugin\\common\\abstract-project-plugin.js:1:1585)\n at PluginFactory.getAppPlugin (D:\\LiuDongHai\\DevEco Studio\\tools\\hvigor\\hvigor-ohos-plugin\\src\\plugin\\factory\\plugin-factory.js:1:2159)\n at appTasks (D:\\LiuDongHai\\DevEco Studio\\tools\\hvigor\\hvigor-ohos-plugin\\index.js:1:593)\n at bindSystemPlugins (D:\\LiuDongHai\\DevEco Studio\\tools\\hvigor\\hvigor\\src\\base\\internal\\lifecycle\\configuration.js:1:5900)\n at evaluateNodeVigorFile (D:\\LiuDongHai\\DevEco Studio\\tools\\hvigor\\hvigor\\src\\base\\internal\\lifecycle\\configuration.js:1:8450)\n at evalProject (D:\\LiuDongHai\\DevEco Studio\\tools\\hvigor\\hvigor\\src\\base\\internal\\lifecycle\\configuration.js:1:3495)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)", + "description": "", + "type": "log" + }, + "body": { + "pid": 3780, + "tid": "Main Thread", + "startTime": 514500640818000 + }, + "additional": { + "logType": "debug", + "children": [] + } + }, + { + "head": { + "id": "63dd06b9-46e6-40e0-8113-169232df7ed7", + "name": "\"buildFinished\" hook function", + "description": "", + "type": "duration" + }, + "body": { + "pid": 3780, + "tid": "Main Thread", + "startTime": 514500646829600, + "endTime": 514500646949600 + }, + "additional": { + "children": [], + "state": "success", + "targetName": "", + "moduleName": "", + "category": "", + "taskRunReasons": [], + "parent": "a6d7fa96-7d99-4b90-8c4c-59bb7793cdbb", + "logId": "357c3c42-5101-4070-8010-befef1c78b8d" + }, + "log": { + "_logger": { + "category": "DurationEvent", + "context": {}, + "callStackSkipIndex": 0 + }, + "_filelogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + }, + "anonymizeFileLogger": { + "fileLogger": { + "category": "debug-file", + "context": {}, + "callStackSkipIndex": 0 + } + } + } + }, + { + "head": { + "id": "357c3c42-5101-4070-8010-befef1c78b8d", + "name": "\"buildFinished\" hook function", + "description": "", + "type": "log" + }, + "body": { + "pid": 3780, + "tid": "Main Thread", + "startTime": 514500646829600, + "endTime": 514500646949600 + }, + "additional": { + "logType": "info", + "children": [], + "durationId": "63dd06b9-46e6-40e0-8113-169232df7ed7" + } + }, + { + "head": { + "id": "5aede3fa-2d9d-4692-8c19-63986dc51530", + "name": "", + "description": "", + "type": "mark" + }, + "body": { + "pid": 3780, + "tid": "Main Thread", + "startTime": 514498777162500, + "endTime": 514500647603400 + }, + "additional": { + "time": { + "year": 2025, + "month": 5, + "day": 15, + "hour": 10, + "minute": 37 + }, + "completeCommand": "{\"prop\":[\"product=default\"],\"sync\":true,\"parallel\":true,\"incremental\":true,\"daemon\":true,\"_\":[],\"analyze\":\"normal\"};", + "hvigorVersion": "5.17.0", + "markType": "history", + "nodeVersion": "v18.20.1", + "category": "build", + "state": "failed" + } + }, + { + "head": { + "id": "2d2637d3-cd39-45d2-aaf8-abc6aee83882", + "name": "BUILD FAILED in 1 s 870 ms ", + "description": "", + "type": "log" + }, + "body": { + "pid": 3780, + "tid": "Main Thread", + "startTime": 514500647735100 + }, + "additional": { + "logType": "error", + "children": [] + } + } + ] +} \ No newline at end of file diff --git a/NonSameLayerRendering/.idea/.deveco/project.cache.json b/NonSameLayerRendering/.idea/.deveco/project.cache.json new file mode 100644 index 0000000000000000000000000000000000000000..9cf2d4a556c51ac7219505d6604c9c1c13c4f070 --- /dev/null +++ b/NonSameLayerRendering/.idea/.deveco/project.cache.json @@ -0,0 +1,10 @@ +{ + "CommonInfo":{ + "project.ide.version":"5.0.13.100", + "current.select.product":"", + "current.select.buildMode":"" + }, + "BuildOptions":{ + + } +} \ No newline at end of file diff --git a/NonSameLayerRendering/.idea/.gitignore b/NonSameLayerRendering/.idea/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..359bb5307e8535ab7d59faf27a7377033291821e --- /dev/null +++ b/NonSameLayerRendering/.idea/.gitignore @@ -0,0 +1,3 @@ +# 默认忽略的文件 +/shelf/ +/workspace.xml diff --git a/NonSameLayerRendering/.idea/git_toolbox_blame.xml b/NonSameLayerRendering/.idea/git_toolbox_blame.xml new file mode 100644 index 0000000000000000000000000000000000000000..7dc124965d28403ec2545a24d7d1cd1fec1f57d8 --- /dev/null +++ b/NonSameLayerRendering/.idea/git_toolbox_blame.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/NonSameLayerRendering/.idea/modules.xml b/NonSameLayerRendering/.idea/modules.xml new file mode 100644 index 0000000000000000000000000000000000000000..b0d017944038b9e9803ec1a8d5413d75f1d885c5 --- /dev/null +++ b/NonSameLayerRendering/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/NonSameLayerRendering/.idea/modules/NonSameLayerRendering.iml b/NonSameLayerRendering/.idea/modules/NonSameLayerRendering.iml new file mode 100644 index 0000000000000000000000000000000000000000..c18b750345e8b2634d9c96c6aeb46c05139195ca --- /dev/null +++ b/NonSameLayerRendering/.idea/modules/NonSameLayerRendering.iml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/NonSameLayerRendering/AppScope/app.json5 b/NonSameLayerRendering/AppScope/app.json5 new file mode 100644 index 0000000000000000000000000000000000000000..9bf79775b9457c6deb4d467b6e41b2b16c52eed6 --- /dev/null +++ b/NonSameLayerRendering/AppScope/app.json5 @@ -0,0 +1,10 @@ +{ + "app": { + "bundleName": "com.example.nonsamelayerrendering", + "vendor": "example", + "versionCode": 1000000, + "versionName": "1.0.0", + "icon": "$media:app_icon", + "label": "$string:app_name" + } +} \ No newline at end of file diff --git a/NonSameLayerRendering/AppScope/resources/base/element/string.json b/NonSameLayerRendering/AppScope/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..f17dc2df17fd926201e4890d2ab954f881077fb8 --- /dev/null +++ b/NonSameLayerRendering/AppScope/resources/base/element/string.json @@ -0,0 +1,8 @@ +{ + "string": [ + { + "name": "app_name", + "value": "NonSameLayerRendering" + } + ] +} \ No newline at end of file diff --git a/NonSameLayerRendering/AppScope/resources/base/media/app_icon.png b/NonSameLayerRendering/AppScope/resources/base/media/app_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..a39445dc87828b76fed6d2ec470dd455c45319e3 Binary files /dev/null and b/NonSameLayerRendering/AppScope/resources/base/media/app_icon.png differ diff --git a/NonSameLayerRendering/build-profile.json5 b/NonSameLayerRendering/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..c033ce4278fb0641d84107c3c134047ac487368e --- /dev/null +++ b/NonSameLayerRendering/build-profile.json5 @@ -0,0 +1,35 @@ +{ + "app": { + "signingConfigs": [], + "products": [ + { + "name": "default", + "signingConfig": "default", + "compatibleSdkVersion": "5.0.0(12)", + "runtimeOS": "HarmonyOS", + } + ], + "buildModeSet": [ + { + "name": "debug", + }, + { + "name": "release" + } + ] + }, + "modules": [ + { + "name": "entry", + "srcPath": "./entry", + "targets": [ + { + "name": "default", + "applyToProducts": [ + "default" + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/NonSameLayerRendering/code-linter.json5 b/NonSameLayerRendering/code-linter.json5 new file mode 100644 index 0000000000000000000000000000000000000000..77b31b517a3e5c2f34c3ae1bf44083c0c06cbd6d --- /dev/null +++ b/NonSameLayerRendering/code-linter.json5 @@ -0,0 +1,20 @@ +{ + "files": [ + "**/*.ets" + ], + "ignore": [ + "**/src/ohosTest/**/*", + "**/src/test/**/*", + "**/src/mock/**/*", + "**/node_modules/**/*", + "**/oh_modules/**/*", + "**/build/**/*", + "**/.preview/**/*" + ], + "ruleSet": [ + "plugin:@performance/recommended", + "plugin:@typescript-eslint/recommended" + ], + "rules": { + } +} \ No newline at end of file diff --git a/NonSameLayerRendering/entry/build-profile.json5 b/NonSameLayerRendering/entry/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..4d611879c7913fb0610c686e2399258ab3a6dad1 --- /dev/null +++ b/NonSameLayerRendering/entry/build-profile.json5 @@ -0,0 +1,28 @@ +{ + "apiType": "stageMode", + "buildOption": { + }, + "buildOptionSet": [ + { + "name": "release", + "arkOptions": { + "obfuscation": { + "ruleOptions": { + "enable": false, + "files": [ + "./obfuscation-rules.txt" + ] + } + } + } + }, + ], + "targets": [ + { + "name": "default" + }, + { + "name": "ohosTest", + } + ] +} \ No newline at end of file diff --git a/NonSameLayerRendering/entry/hvigorfile.ts b/NonSameLayerRendering/entry/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..c6edcd90486dd5a853cf7d34c8647f08414ca7a3 --- /dev/null +++ b/NonSameLayerRendering/entry/hvigorfile.ts @@ -0,0 +1,6 @@ +import { hapTasks } from '@ohos/hvigor-ohos-plugin'; + +export default { + system: hapTasks, /* Built-in plugin of Hvigor. It cannot be modified. */ + plugins:[] /* Custom plugin to extend the functionality of Hvigor. */ +} diff --git a/NonSameLayerRendering/entry/obfuscation-rules.txt b/NonSameLayerRendering/entry/obfuscation-rules.txt new file mode 100644 index 0000000000000000000000000000000000000000..272efb6ca3f240859091bbbfc7c5802d52793b0b --- /dev/null +++ b/NonSameLayerRendering/entry/obfuscation-rules.txt @@ -0,0 +1,23 @@ +# Define project specific obfuscation rules here. +# You can include the obfuscation configuration files in the current module's build-profile.json5. +# +# For more details, see +# https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/source-obfuscation-V5 + +# Obfuscation options: +# -disable-obfuscation: disable all obfuscations +# -enable-property-obfuscation: obfuscate the property names +# -enable-toplevel-obfuscation: obfuscate the names in the global scope +# -compact: remove unnecessary blank spaces and all line feeds +# -remove-log: remove all console.* statements +# -print-namecache: print the name cache that contains the mapping from the old names to new names +# -apply-namecache: reuse the given cache file + +# Keep options: +# -keep-property-name: specifies property names that you want to keep +# -keep-global-name: specifies names that you want to keep in the global scope + +-enable-property-obfuscation +-enable-toplevel-obfuscation +-enable-filename-obfuscation +-enable-export-obfuscation \ No newline at end of file diff --git a/NonSameLayerRendering/entry/oh-package.json5 b/NonSameLayerRendering/entry/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..803b25293388deda7b9a05a21b5aeadeb716b4d5 --- /dev/null +++ b/NonSameLayerRendering/entry/oh-package.json5 @@ -0,0 +1,9 @@ +{ + "name": "entry", + "version": "1.0.0", + "description": "Please describe the basic information.", + "main": "", + "author": "", + "license": "", + "dependencies": {} +} \ No newline at end of file diff --git a/NonSameLayerRendering/entry/src/main/ets/entryability/EntryAbility.ets b/NonSameLayerRendering/entry/src/main/ets/entryability/EntryAbility.ets new file mode 100644 index 0000000000000000000000000000000000000000..4acdf913caf0268743174e616eb7e51bfe813d78 --- /dev/null +++ b/NonSameLayerRendering/entry/src/main/ets/entryability/EntryAbility.ets @@ -0,0 +1,41 @@ +import { AbilityConstant, UIAbility, Want } from '@kit.AbilityKit'; +import { hilog } from '@kit.PerformanceAnalysisKit'; +import { window } from '@kit.ArkUI'; + +export default class EntryAbility extends UIAbility { + onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void { + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate'); + } + + onDestroy(): void { + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onDestroy'); + } + + onWindowStageCreate(windowStage: window.WindowStage): void { + // Main window is created, set main page for this ability + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate'); + + windowStage.loadContent('pages/Index', (err) => { + 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.'); + }); + } + + onWindowStageDestroy(): void { + // Main window is destroyed, release UI related resources + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageDestroy'); + } + + onForeground(): void { + // Ability has brought to foreground + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onForeground'); + } + + onBackground(): void { + // Ability has back to background + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onBackground'); + } +} \ No newline at end of file diff --git a/NonSameLayerRendering/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets b/NonSameLayerRendering/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets new file mode 100644 index 0000000000000000000000000000000000000000..dc55c03d3eea7ce53d5346c732a39ce9bf5267e1 --- /dev/null +++ b/NonSameLayerRendering/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets @@ -0,0 +1,12 @@ +import { hilog } from '@kit.PerformanceAnalysisKit'; +import { BackupExtensionAbility, BundleVersion } from '@kit.CoreFileKit'; + +export default class EntryBackupAbility extends BackupExtensionAbility { + async onBackup() { + hilog.info(0x0000, 'testTag', 'onBackup ok'); + } + + async onRestore(bundleVersion: BundleVersion) { + hilog.info(0x0000, 'testTag', 'onRestore ok %{public}s', JSON.stringify(bundleVersion)); + } +} \ No newline at end of file diff --git a/NonSameLayerRendering/entry/src/main/ets/mock/GoodsMock.ets b/NonSameLayerRendering/entry/src/main/ets/mock/GoodsMock.ets new file mode 100644 index 0000000000000000000000000000000000000000..f650b5f4222449e01dad009916b39c8d39a7b940 --- /dev/null +++ b/NonSameLayerRendering/entry/src/main/ets/mock/GoodsMock.ets @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2024 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 { ProductDataModel } from '../model/GoodsModel'; + +// Commodity list data source +// [Start data_product_data] +export const PRODUCT_DATA: Array = [ + new ProductDataModel(0, $r('app.media.nativeembed_product000'), $r('app.string.nativeembed_product_title000'), + $r("app.string.nativeembed_product_price000")), + new ProductDataModel(1, $r('app.media.nativeembed_product001'), $r('app.string.nativeembed_product_title001'), + $r('app.string.nativeembed_product_price001')), + new ProductDataModel(2, $r('app.media.nativeembed_product002'), $r('app.string.nativeembed_product_title002'), + $r('app.string.nativeembed_product_price002')), + new ProductDataModel(4, $r('app.media.nativeembed_product003'), $r('app.string.nativeembed_product_title004'), + $r('app.string.nativeembed_product_price004')), + new ProductDataModel(0, $r('app.media.nativeembed_product000'), $r('app.string.nativeembed_product_title000'), + $r("app.string.nativeembed_product_price000")), + new ProductDataModel(1, $r('app.media.nativeembed_product001'), $r('app.string.nativeembed_product_title001'), + $r('app.string.nativeembed_product_price001')), + new ProductDataModel(2, $r('app.media.nativeembed_product002'), $r('app.string.nativeembed_product_title002'), + $r('app.string.nativeembed_product_price002')), + new ProductDataModel(4, $r('app.media.nativeembed_product003'), $r('app.string.nativeembed_product_title004'), + $r('app.string.nativeembed_product_price004')), + new ProductDataModel(0, $r('app.media.nativeembed_product000'), $r('app.string.nativeembed_product_title000'), + $r("app.string.nativeembed_product_price000")), + new ProductDataModel(1, $r('app.media.nativeembed_product001'), $r('app.string.nativeembed_product_title001'), + $r('app.string.nativeembed_product_price001')), + new ProductDataModel(2, $r('app.media.nativeembed_product002'), $r('app.string.nativeembed_product_title002'), + $r('app.string.nativeembed_product_price002')), + new ProductDataModel(4, $r('app.media.nativeembed_product003'), $r('app.string.nativeembed_product_title004'), + $r('app.string.nativeembed_product_price004')), + new ProductDataModel(0, $r('app.media.nativeembed_product000'), $r('app.string.nativeembed_product_title000'), + $r("app.string.nativeembed_product_price000")), + new ProductDataModel(1, $r('app.media.nativeembed_product001'), $r('app.string.nativeembed_product_title001'), + $r('app.string.nativeembed_product_price001')), + new ProductDataModel(2, $r('app.media.nativeembed_product002'), $r('app.string.nativeembed_product_title002'), + $r('app.string.nativeembed_product_price002')), + new ProductDataModel(4, $r('app.media.nativeembed_product003'), $r('app.string.nativeembed_product_title004'), + $r('app.string.nativeembed_product_price004')), +]; +// [End data_product_data] \ No newline at end of file diff --git a/NonSameLayerRendering/entry/src/main/ets/model/GoodsModel.ets b/NonSameLayerRendering/entry/src/main/ets/model/GoodsModel.ets new file mode 100644 index 0000000000000000000000000000000000000000..ebea371071af19000c3d1311023c16882efc770b --- /dev/null +++ b/NonSameLayerRendering/entry/src/main/ets/model/GoodsModel.ets @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2024 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. + */ + +// 设置项的数据类 +export class ProductDataModel { + id: number; + uri: ResourceStr; + title: ResourceStr; + price: ResourceStr; + + constructor(id: number, uri: ResourceStr, title: ResourceStr, price: ResourceStr) { + this.id = id; + this.uri = uri; + this.title = title; + this.price = price; + } +} \ No newline at end of file diff --git a/NonSameLayerRendering/entry/src/main/ets/pages/Index.ets b/NonSameLayerRendering/entry/src/main/ets/pages/Index.ets new file mode 100644 index 0000000000000000000000000000000000000000..413284b19ee614a9006bf06cf3d73a8c5d43a84c --- /dev/null +++ b/NonSameLayerRendering/entry/src/main/ets/pages/Index.ets @@ -0,0 +1,128 @@ +// [Start non_same_layer_rendering] +import { promptAction } from '@kit.ArkUI'; +import { PRODUCT_DATA } from '../mock/GoodsMock'; +import { webview } from '@kit.ArkWeb'; + +@Entry +@Component +struct NonSameLayerRendering { + @State searchWidth: number = 0; + @State searchHeight: number = 0; + @State isWebInit: boolean = false; + browserTabController: WebviewController = new webview.WebviewController(); // WebviewController controller + + build() { + Stack() { + Web({ src: $rawfile('nativeembed_view.html'), controller: this.browserTabController }) + .backgroundColor('#F1F3F5') + .onPageEnd(() => { + this.browserTabController.runJavaScript( + 'getEmbedSize()', + (error, result) => { + if (result) { + interface EmbedSize { + width: number, + height: number + } + let embedSize = JSON.parse(result) as EmbedSize; + this.searchWidth = embedSize.width; + this.searchHeight = embedSize.height; + this.isWebInit = true; + } + }); + }) + if (this.isWebInit){ + Column() { + // Because it needs to be displayed according to the actual size of the Web, it needs to wait for the width and height to be obtained after the Web is initialized, and then it needs to be layered on the Web + SearchComponent({ searchWidth: this.searchWidth, searchHeight: this.searchHeight }) + } + .zIndex(10) + } + } + } +} + +/** + * Set the data class of the item + */ +class ProductDataModel { + id: number; + uri: ResourceStr; + title: ResourceStr; + price: ResourceStr; + + constructor(id: number, uri: ResourceStr, title: ResourceStr, price: ResourceStr) { + this.id = id; + this.uri = uri; + this.title = title; + this.price = price; + } +} + +// [Start search_component] +@Component +struct SearchComponent { + @Prop searchWidth: number; + @Prop searchHeight: number; + + build() { + Column({ space: 8 }) { + Text('商城') + .fontSize(16) + Row() { + Image($r('app.media.nativeembed_search_icon')) + .width(14) + .margin({ left: 14 }) + Text('搜索相关宝贝') + .fontSize(14) + .opacity(0.6) + .fontColor('#000000') + .margin({ left: 14}) + } + .width('100%') + .margin(4) + .height(36) + .backgroundColor(Color.White) + .borderRadius(18) + .onClick(() => { + this.getUIContext().getPromptAction().showToast({ + message: '仅演示,可自行实现业务功能' + }); + }) + Grid() { + ForEach(PRODUCT_DATA, (item: ProductDataModel, index: number) => { + GridItem() { + Column({ space: 8 }) { + Image(item.uri) + .width(100) + .height(100) + Row({ space: 8 }) { + Text(item.title) + .fontSize(12) + Text(item.price) + .fontSize(12) + } + } + .backgroundColor(Color.White) + .alignItems(HorizontalAlign.Center) + .justifyContent(FlexAlign.Center) + .width('100%') + .borderRadius(12) + .padding({ bottom: 12 }) + } + }, (item: ProductDataModel) => `${item.id}`) + } + .columnsTemplate('1fr 1fr') + .rowsGap(8) + .columnsGap(8) + .width('100%') + .height('90%') + .backgroundColor('#F1F3F5') + } + .padding(10) + .width(this.searchWidth) + .height(this.searchHeight) + } +} +// [End search_component] +// [End non_same_layer_rendering] \ No newline at end of file diff --git a/NonSameLayerRendering/entry/src/main/ets/view/Index.ets b/NonSameLayerRendering/entry/src/main/ets/view/Index.ets new file mode 100644 index 0000000000000000000000000000000000000000..a06756277347d610e0438a3b80567a0c9d825365 --- /dev/null +++ b/NonSameLayerRendering/entry/src/main/ets/view/Index.ets @@ -0,0 +1,192 @@ +// [Start view_index] +import { BuilderNode, FrameNode, NodeController, NodeRenderType } from '@kit.ArkUI'; +import { webview } from '@kit.ArkWeb'; +import { PRODUCT_DATA } from '../viewmodel/GoodsViewModel'; +import { ProductDataModel } from '../model/GoodsModel'; + +const MARGIN_VERTICAL: number = 8; +const FONT_WEIGHT: number = 500; +const PLACEHOLDER: ResourceStr = $r('app.string.embed_search'); + +declare class Params { + width: number; + height: number; +} + +declare class NodeControllerParams { + surfaceId: string; + type: string; + renderType: NodeRenderType; + embedId: string; + width: number; + height: number; +} + +class SearchNodeController extends NodeController { + private rootNode: BuilderNode<[Params]> | undefined | null = null; + private embedId: string = ''; + private surfaceId: string = ''; + private renderType: NodeRenderType = NodeRenderType.RENDER_TYPE_DISPLAY; + private componentWidth: number = 0; + private componentHeight: number = 0; + private componentType: string = ''; + + setRenderOption(params: NodeControllerParams): void { + this.surfaceId = params.surfaceId; + this.renderType = params.renderType; + this.embedId = params.embedId; + this.componentWidth = params.width; + this.componentHeight = params.height; + this.componentType = params.type; + } + + makeNode(uiContext: UIContext): FrameNode | null { + this.rootNode = new BuilderNode(uiContext, { surfaceId: this.surfaceId, type: this.renderType }); + if (this.componentType === 'native/component') { + this.rootNode.build(wrapBuilder(searchBuilder), { width: this.componentWidth, height: this.componentHeight }); + } + return this.rootNode.getFrameNode(); + } + + setBuilderNode(rootNode: BuilderNode | null): void { + this.rootNode = rootNode; + } + + getBuilderNode(): BuilderNode<[Params]> | undefined | null { + return this.rootNode; + } + + updateNode(arg: Object): void { + this.rootNode?.update(arg); + } + + getEmbedId(): string { + return this.embedId; + } + + postEvent(event: TouchEvent | undefined): boolean { + return this.rootNode?.postTouchEvent(event) as boolean; + } +} + +@Component +struct SearchComponent { + @Prop params: Params; + controller: SearchController = new SearchController(); + + build() { + Column({ space: MARGIN_VERTICAL }) { + Text($r("app.string.embed_mall")) + .fontSize($r('app.string.ohos_id_text_size_body4')) + .fontWeight(FONT_WEIGHT) + .fontFamily('HarmonyHeiTi-Medium') + Row() { + Search({ placeholder: PLACEHOLDER, controller: this.controller }) + .backgroundColor(Color.White) + } + .width($r("app.string.embed_full_percent")) + .margin($r("app.integer.embed_row_margin")) + + Grid() { + ForEach(PRODUCT_DATA, (item: ProductDataModel, index: number) => { + GridItem() { + Column({ space: MARGIN_VERTICAL }) { + Image(item.uri).width($r("app.integer.embed_image_size")) + Row({ space: MARGIN_VERTICAL }) { + Text(item.title) + .fontSize($r('app.string.ohos_id_text_size_body1')) + .width(100) + .maxLines(1) + .textOverflow({ overflow: TextOverflow.Ellipsis }) + Text(item.price) + .fontSize($r('app.string.ohos_id_text_size_body1')) + .width(50) + .maxLines(1) + } + } + .backgroundColor($r('app.color.ohos_id_color_background')) + .alignItems(HorizontalAlign.Center) + .justifyContent(FlexAlign.Center) + .width($r("app.string.embed_full_percent")) + .height($r("app.string.embed_full_percent")) + .borderRadius($r('app.string.ohos_id_corner_radius_default_m')) + } + }, (item: ProductDataModel, index: number) => index.toString()) + } + .columnsTemplate('1fr 1fr') + .rowsTemplate('1fr 1fr 1fr') + .rowsGap($r('app.string.ohos_id_elements_margin_vertical_m')) + .columnsGap($r('app.string.ohos_id_elements_margin_vertical_m')) + .width($r("app.string.embed_full_percent")) + .height($r("app.string.embed_sixty_percent")) + .backgroundColor($r('app.color.ohos_id_color_sub_background')) + } + .padding($r('app.string.ohos_id_card_margin_start')) + .width(this.params.width) + .height(this.params.height) + } +} + +@Builder +function searchBuilder(params: Params) { + SearchComponent({ params: params }) + .backgroundColor($r('app.color.ohos_id_color_sub_background')) +} + +@Entry +@Component +struct Index { + browserTabController: WebviewController = new webview.WebviewController(); + @State componentIdArr: Array = []; + private nodeControllerMap: Map = new Map(); + + build() { + Stack() { + ForEach(this.componentIdArr, (componentId: string) => { + NodeContainer(this.nodeControllerMap.get(componentId)); + }, (embedId: string) => embedId) + Web({ src: $rawfile('embed_view.html'), controller: this.browserTabController }) + .backgroundColor($r('app.color.ohos_id_color_sub_background')) + .zoomAccess(false) + .enableNativeEmbedMode(true) + .onNativeEmbedLifecycleChange((embed) => { + const componentId = embed.info?.id?.toString() as string + if (embed.status === NativeEmbedStatus.CREATE) { + let nodeController = new SearchNodeController(); + nodeController.setRenderOption({ + surfaceId: embed.surfaceId as string, + type: embed.info?.type as string, + renderType: NodeRenderType.RENDER_TYPE_TEXTURE, + embedId: embed.embedId as string, + width: px2vp(embed.info?.width), + height: px2vp(embed.info?.height) + }); + nodeController.rebuild(); + this.nodeControllerMap.set(componentId, nodeController); + this.componentIdArr.push(componentId); + } else if (embed.status === NativeEmbedStatus.UPDATE) { + let nodeController = this.nodeControllerMap.get(componentId); + nodeController?.updateNode({ + text: 'update', + width: px2vp(embed.info?.width), + height: px2vp(embed.info?.height) + } as ESObject); + nodeController?.rebuild(); + } else { + let nodeController = this.nodeControllerMap.get(componentId); + nodeController?.setBuilderNode(null); + nodeController?.rebuild(); + } + }) + .onNativeEmbedGestureEvent((touch) => { + this.componentIdArr.forEach((componentId: string) => { + let nodeController = this.nodeControllerMap.get(componentId); + if (nodeController?.getEmbedId() === touch.embedId) { + nodeController?.postEvent(touch.touchEvent); + } + }) + }) + } + } +} +// [End view_index] \ No newline at end of file diff --git a/NonSameLayerRendering/entry/src/main/module.json5 b/NonSameLayerRendering/entry/src/main/module.json5 new file mode 100644 index 0000000000000000000000000000000000000000..a1cea8b6a4560cee7bda7a2db52f310c035ab6c8 --- /dev/null +++ b/NonSameLayerRendering/entry/src/main/module.json5 @@ -0,0 +1,52 @@ +{ + "module": { + "name": "entry", + "type": "entry", + "description": "$string:module_desc", + "mainElement": "EntryAbility", + "deviceTypes": [ + "phone", + "tablet", + "2in1" + ], + "deliveryWithInstall": true, + "installationFree": false, + "pages": "$profile:main_pages", + "abilities": [ + { + "name": "EntryAbility", + "srcEntry": "./ets/entryability/EntryAbility.ets", + "description": "$string:EntryAbility_desc", + "icon": "$media:layered_image", + "label": "$string:EntryAbility_label", + "startWindowIcon": "$media:startIcon", + "startWindowBackground": "$color:start_window_background", + "exported": true, + "skills": [ + { + "entities": [ + "entity.system.home" + ], + "actions": [ + "action.system.home" + ] + } + ] + } + ], + "extensionAbilities": [ + { + "name": "EntryBackupAbility", + "srcEntry": "./ets/entrybackupability/EntryBackupAbility.ets", + "type": "backup", + "exported": false, + "metadata": [ + { + "name": "ohos.extension.backup", + "resource": "$profile:backup_config" + } + ], + } + ] + } +} \ No newline at end of file diff --git a/NonSameLayerRendering/entry/src/main/resources/base/element/color.json b/NonSameLayerRendering/entry/src/main/resources/base/element/color.json new file mode 100644 index 0000000000000000000000000000000000000000..3c712962da3c2751c2b9ddb53559afcbd2b54a02 --- /dev/null +++ b/NonSameLayerRendering/entry/src/main/resources/base/element/color.json @@ -0,0 +1,8 @@ +{ + "color": [ + { + "name": "start_window_background", + "value": "#FFFFFF" + } + ] +} \ No newline at end of file diff --git a/NonSameLayerRendering/entry/src/main/resources/base/element/string.json b/NonSameLayerRendering/entry/src/main/resources/base/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..1c6c45cb5ea92421aca58aafe065a17425fc5cbf --- /dev/null +++ b/NonSameLayerRendering/entry/src/main/resources/base/element/string.json @@ -0,0 +1,92 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "module description" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "label" + }, + { + "name": "nativeembed_product_title000", + "value": "充电宝" + }, + { + "name": "nativeembed_product_title001", + "value": "笔记本电脑" + }, + { + "name": "nativeembed_product_title002", + "value": "移动手机" + }, + { + "name": "nativeembed_product_title003", + "value": "手机充电器" + }, + { + "name": "nativeembed_product_title004", + "value": "头戴式耳机" + }, + { + "name": "nativeembed_product_title005", + "value": "背包" + }, + { + "name": "nativeembed_product_price000", + "value": "¥79.9" + }, + { + "name": "nativeembed_product_price001", + "value": "¥6999" + }, + { + "name": "nativeembed_product_price002", + "value": "¥5999" + }, + { + "name": "nativeembed_product_price003", + "value": "¥72.5" + }, + { + "name": "nativeembed_product_price004", + "value": "¥899" + }, + { + "name": "nativeembed_product_price005", + "value": "¥328" + }, + { + "name": "nativeembed_reason", + "value": "get internet permisssion" + }, + { + "name": "nativeembed_full_percent", + "value": "100%" + }, + { + "name": "nativeembed_sixty_percent", + "value": "60%" + }, + { + "name": "nativeembed_mall", + "value": "商城" + }, + { + "name": "nativeembed_search", + "value": "搜索" + }, + { + "name": "nativeembed_prompt_text", + "value": "仅演示,可自行实现业务功能" + }, + { + "name": "nativeembed_search_text_placeholder", + "value": "搜索相关宝贝" + } + ] +} \ No newline at end of file diff --git a/NonSameLayerRendering/entry/src/main/resources/base/media/background.png b/NonSameLayerRendering/entry/src/main/resources/base/media/background.png new file mode 100644 index 0000000000000000000000000000000000000000..f939c9fa8cc8914832e602198745f592a0dfa34d Binary files /dev/null and b/NonSameLayerRendering/entry/src/main/resources/base/media/background.png differ diff --git a/NonSameLayerRendering/entry/src/main/resources/base/media/foreground.png b/NonSameLayerRendering/entry/src/main/resources/base/media/foreground.png new file mode 100644 index 0000000000000000000000000000000000000000..4483ddad1f079e1089d685bd204ee1cfe1d01902 Binary files /dev/null and b/NonSameLayerRendering/entry/src/main/resources/base/media/foreground.png differ diff --git a/NonSameLayerRendering/entry/src/main/resources/base/media/layered_image.json b/NonSameLayerRendering/entry/src/main/resources/base/media/layered_image.json new file mode 100644 index 0000000000000000000000000000000000000000..fb49920440fb4d246c82f9ada275e26123a2136a --- /dev/null +++ b/NonSameLayerRendering/entry/src/main/resources/base/media/layered_image.json @@ -0,0 +1,7 @@ +{ + "layered-image": + { + "background" : "$media:background", + "foreground" : "$media:foreground" + } +} \ No newline at end of file diff --git a/NonSameLayerRendering/entry/src/main/resources/base/media/nativeembed_product000.jpg b/NonSameLayerRendering/entry/src/main/resources/base/media/nativeembed_product000.jpg new file mode 100644 index 0000000000000000000000000000000000000000..55525056cc3edd2d2fe0c7b82f62fcf740fb1e61 Binary files /dev/null and b/NonSameLayerRendering/entry/src/main/resources/base/media/nativeembed_product000.jpg differ diff --git a/NonSameLayerRendering/entry/src/main/resources/base/media/nativeembed_product001.jpg b/NonSameLayerRendering/entry/src/main/resources/base/media/nativeembed_product001.jpg new file mode 100644 index 0000000000000000000000000000000000000000..e53a68b9a1301d8bcfafb779a99c1544feec210e Binary files /dev/null and b/NonSameLayerRendering/entry/src/main/resources/base/media/nativeembed_product001.jpg differ diff --git a/NonSameLayerRendering/entry/src/main/resources/base/media/nativeembed_product002.jpg b/NonSameLayerRendering/entry/src/main/resources/base/media/nativeembed_product002.jpg new file mode 100644 index 0000000000000000000000000000000000000000..408e567df0d0143f2dbcdd6127df7b41e83d3fc2 Binary files /dev/null and b/NonSameLayerRendering/entry/src/main/resources/base/media/nativeembed_product002.jpg differ diff --git a/NonSameLayerRendering/entry/src/main/resources/base/media/nativeembed_product003.jpg b/NonSameLayerRendering/entry/src/main/resources/base/media/nativeembed_product003.jpg new file mode 100644 index 0000000000000000000000000000000000000000..b15f2742f8ed79ccea723b2f317c8908b9dfe912 Binary files /dev/null and b/NonSameLayerRendering/entry/src/main/resources/base/media/nativeembed_product003.jpg differ diff --git a/NonSameLayerRendering/entry/src/main/resources/base/media/nativeembed_search_icon.png b/NonSameLayerRendering/entry/src/main/resources/base/media/nativeembed_search_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ec62bde8acb8d505343032a456c74c7cdd17cf82 Binary files /dev/null and b/NonSameLayerRendering/entry/src/main/resources/base/media/nativeembed_search_icon.png differ diff --git a/NonSameLayerRendering/entry/src/main/resources/base/media/startIcon.png b/NonSameLayerRendering/entry/src/main/resources/base/media/startIcon.png new file mode 100644 index 0000000000000000000000000000000000000000..205ad8b5a8a42e8762fbe4899b8e5e31ce822b8b Binary files /dev/null and b/NonSameLayerRendering/entry/src/main/resources/base/media/startIcon.png differ diff --git a/NonSameLayerRendering/entry/src/main/resources/base/profile/backup_config.json b/NonSameLayerRendering/entry/src/main/resources/base/profile/backup_config.json new file mode 100644 index 0000000000000000000000000000000000000000..78f40ae7c494d71e2482278f359ec790ca73471a --- /dev/null +++ b/NonSameLayerRendering/entry/src/main/resources/base/profile/backup_config.json @@ -0,0 +1,3 @@ +{ + "allowToBackupRestore": true +} \ No newline at end of file diff --git a/NonSameLayerRendering/entry/src/main/resources/base/profile/main_pages.json b/NonSameLayerRendering/entry/src/main/resources/base/profile/main_pages.json new file mode 100644 index 0000000000000000000000000000000000000000..1898d94f58d6128ab712be2c68acc7c98e9ab9ce --- /dev/null +++ b/NonSameLayerRendering/entry/src/main/resources/base/profile/main_pages.json @@ -0,0 +1,5 @@ +{ + "src": [ + "pages/Index" + ] +} diff --git a/NonSameLayerRendering/entry/src/main/resources/en_US/element/string.json b/NonSameLayerRendering/entry/src/main/resources/en_US/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..34efc1b083023e049e0be952eadfebac1951da58 --- /dev/null +++ b/NonSameLayerRendering/entry/src/main/resources/en_US/element/string.json @@ -0,0 +1,92 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "module description" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "label" + }, + { + "name": "nativeembed_product_title000", + "value": "Mobile power pack" + }, + { + "name": "nativeembed_product_title001", + "value": "Laptops" + }, + { + "name": "nativeembed_product_title002", + "value": "Mobile phone" + }, + { + "name": "nativeembed_product_title003", + "value": "Mobile phone charger" + }, + { + "name": "nativeembed_product_title004", + "value": "Over-ear headphone" + }, + { + "name": "nativeembed_product_title005", + "value": "Backpacks" + }, + { + "name": "nativeembed_product_price000", + "value": "¥79.9" + }, + { + "name": "nativeembed_product_price001", + "value": "¥6999" + }, + { + "name": "nativeembed_product_price002", + "value": "¥5999" + }, + { + "name": "nativeembed_product_price003", + "value": "¥72.5" + }, + { + "name": "nativeembed_product_price004", + "value": "¥899" + }, + { + "name": "nativeembed_product_price005", + "value": "¥328" + }, + { + "name": "nativeembed_reason", + "value": "get internet permisssion" + }, + { + "name": "nativeembed_full_percent", + "value": "100%" + }, + { + "name": "nativeembed_sixty_percent", + "value": "60%" + }, + { + "name": "nativeembed_mall", + "value": "Mall" + }, + { + "name": "nativeembed_search", + "value": "搜索" + }, + { + "name": "nativeembed_prompt_text", + "value": "仅演示,可自行实现业务功能" + }, + { + "name": "nativeembed_search_text_placeholder", + "value": "Search for related babies" + } + ] +} \ No newline at end of file diff --git a/NonSameLayerRendering/entry/src/main/resources/rawfile/nativeembed_view.html b/NonSameLayerRendering/entry/src/main/resources/rawfile/nativeembed_view.html new file mode 100644 index 0000000000000000000000000000000000000000..d39450167c90818d539ee3210ec271d56e0c65e3 --- /dev/null +++ b/NonSameLayerRendering/entry/src/main/resources/rawfile/nativeembed_view.html @@ -0,0 +1,30 @@ + + + + viewhtml + + + + + +
+
+ + +
+
+ + + + + \ No newline at end of file diff --git a/NonSameLayerRendering/entry/src/main/resources/zh_CN/element/string.json b/NonSameLayerRendering/entry/src/main/resources/zh_CN/element/string.json new file mode 100644 index 0000000000000000000000000000000000000000..d49dcea4c76303ff86497de2183d73c9f94f5a32 --- /dev/null +++ b/NonSameLayerRendering/entry/src/main/resources/zh_CN/element/string.json @@ -0,0 +1,92 @@ +{ + "string": [ + { + "name": "module_desc", + "value": "模块描述" + }, + { + "name": "EntryAbility_desc", + "value": "description" + }, + { + "name": "EntryAbility_label", + "value": "label" + }, + { + "name": "nativeembed_product_title000", + "value": "充电宝" + }, + { + "name": "nativeembed_product_title001", + "value": "笔记本电脑" + }, + { + "name": "nativeembed_product_title002", + "value": "移动手机" + }, + { + "name": "nativeembed_product_title003", + "value": "手机充电器" + }, + { + "name": "nativeembed_product_title004", + "value": "头戴式耳机" + }, + { + "name": "nativeembed_product_title005", + "value": "背包" + }, + { + "name": "nativeembed_product_price000", + "value": "¥79.9" + }, + { + "name": "nativeembed_product_price001", + "value": "¥6999" + }, + { + "name": "nativeembed_product_price002", + "value": "¥5999" + }, + { + "name": "nativeembed_product_price003", + "value": "¥72.5" + }, + { + "name": "nativeembed_product_price004", + "value": "¥899" + }, + { + "name": "nativeembed_product_price005", + "value": "¥328" + }, + { + "name": "nativeembed_reason", + "value": "get internet permisssion" + }, + { + "name": "nativeembed_full_percent", + "value": "100%" + }, + { + "name": "nativeembed_sixty_percent", + "value": "60%" + }, + { + "name": "nativeembed_mall", + "value": "商城" + }, + { + "name": "nativeembed_search", + "value": "搜索" + }, + { + "name": "nativeembed_prompt_text", + "value": "仅演示,可自行实现业务功能" + }, + { + "name": "nativeembed_search_text_placeholder", + "value": "搜索相关宝贝" + } + ] +} \ No newline at end of file diff --git a/NonSameLayerRendering/hvigor/hvigor-config.json5 b/NonSameLayerRendering/hvigor/hvigor-config.json5 new file mode 100644 index 0000000000000000000000000000000000000000..2662c04148f9901f7fdcbc0436754f5e2a1766fd --- /dev/null +++ b/NonSameLayerRendering/hvigor/hvigor-config.json5 @@ -0,0 +1,22 @@ +{ + "modelVersion": "5.0.0", + "dependencies": { + }, + "execution": { + // "analyze": "normal", /* Define the build analyze mode. Value: [ "normal" | "advanced" | false ]. Default: "normal" */ + // "daemon": true, /* Enable daemon compilation. Value: [ true | false ]. Default: true */ + // "incremental": true, /* Enable incremental compilation. Value: [ true | false ]. Default: true */ + // "parallel": true, /* Enable parallel compilation. Value: [ true | false ]. Default: true */ + // "typeCheck": false, /* Enable typeCheck. Value: [ true | false ]. Default: false */ + }, + "logging": { + // "level": "info" /* Define the log level. Value: [ "debug" | "info" | "warn" | "error" ]. Default: "info" */ + }, + "debugging": { + // "stacktrace": false /* Disable stacktrace compilation. Value: [ true | false ]. Default: false */ + }, + "nodeOptions": { + // "maxOldSpaceSize": 8192 /* Enable nodeOptions maxOldSpaceSize compilation. Unit M. Used for the daemon process. Default: 8192*/ + // "exposeGC": true /* Enable to trigger garbage collection explicitly. Default: true*/ + } +} \ No newline at end of file diff --git a/NonSameLayerRendering/hvigorfile.ts b/NonSameLayerRendering/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..f3cb9f1a87a81687554a76283af8df27d8bda775 --- /dev/null +++ b/NonSameLayerRendering/hvigorfile.ts @@ -0,0 +1,6 @@ +import { appTasks } from '@ohos/hvigor-ohos-plugin'; + +export default { + system: appTasks, /* Built-in plugin of Hvigor. It cannot be modified. */ + plugins:[] /* Custom plugin to extend the functionality of Hvigor. */ +} diff --git a/NonSameLayerRendering/oh-package-lock.json5 b/NonSameLayerRendering/oh-package-lock.json5 new file mode 100644 index 0000000000000000000000000000000000000000..205c6cfd4d8cc03127a8a61d9c533f230e8ad80b --- /dev/null +++ b/NonSameLayerRendering/oh-package-lock.json5 @@ -0,0 +1,27 @@ +{ + "meta": { + "stableOrder": true + }, + "lockfileVersion": 3, + "ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.", + "specifiers": { + "@ohos/hamock@1.0.0": "@ohos/hamock@1.0.0", + "@ohos/hypium@1.0.19": "@ohos/hypium@1.0.19" + }, + "packages": { + "@ohos/hamock@1.0.0": { + "name": "@ohos/hamock", + "version": "1.0.0", + "integrity": "sha512-K6lDPYc6VkKe6ZBNQa9aoG+ZZMiwqfcR/7yAVFSUGIuOAhPvCJAo9+t1fZnpe0dBRBPxj2bxPPbKh69VuyAtDg==", + "resolved": "https://ohpm.openharmony.cn/ohpm/@ohos/hamock/-/hamock-1.0.0.har", + "registryType": "ohpm" + }, + "@ohos/hypium@1.0.19": { + "name": "@ohos/hypium", + "version": "1.0.19", + "integrity": "sha512-cEjDgLFCm3cWZDeRXk7agBUkPqjWxUo6AQeiu0gEkb3J8ESqlduQLSIXeo3cCsm8U/asL7iKjF85ZyOuufAGSQ==", + "resolved": "https://ohpm.openharmony.cn/ohpm/@ohos/hypium/-/hypium-1.0.19.har", + "registryType": "ohpm" + } + } +} \ No newline at end of file diff --git a/NonSameLayerRendering/oh-package.json5 b/NonSameLayerRendering/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..f3884ebeba43b0beec2ec781d334eb3347549d05 --- /dev/null +++ b/NonSameLayerRendering/oh-package.json5 @@ -0,0 +1,10 @@ +{ + "modelVersion": "5.0.0", + "description": "Please describe the basic information.", + "dependencies": { + }, + "devDependencies": { + "@ohos/hypium": "1.0.19", + "@ohos/hamock": "1.0.0" + } +} \ No newline at end of file diff --git a/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/CHANGELOG.md b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/CHANGELOG.md new file mode 100644 index 0000000000000000000000000000000000000000..22a35bda8a1fab36dd81c1c7ae86addcc1f111cc --- /dev/null +++ b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/CHANGELOG.md @@ -0,0 +1,4 @@ +## 1.0.0 +- 修复once断言问题 +## 1.0.0-rc +- 提供DevEco Studio预览器场景使能的MockSetup装饰器 \ No newline at end of file diff --git a/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/LICENSE b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..4947287f7b5ccb5d1e8b7b2d3aa5d89f322c160d --- /dev/null +++ b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/LICENSE @@ -0,0 +1,177 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS \ No newline at end of file diff --git a/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/README.md b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/README.md new file mode 100644 index 0000000000000000000000000000000000000000..c46981eb6b9163cb82723dd4c410b69b5e6a66cd --- /dev/null +++ b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/README.md @@ -0,0 +1,82 @@ +# Hamock + +## 简介 + +Hamock 是 OpenHarmony 上的模拟框架,提供预览场景的模拟功能。 + +## 下载安装 + +```bash +ohpm install @ohos/hamock +``` + +OpenHarmony ohpm 环境配置等更多内容,请参考[如何安装 OpenHarmony ohpm 包](https://gitee.com/openharmony-tpc/docs/blob/master/OpenHarmony_har_usage.md) + +## 使用示例 + +Hamock 提供了 @MockSetup 用于修饰 Mock 方法,仅支持声明式范式的组件。当开发者预览该组件时,预览运行时将在组件初始化时执行被 @MockSetup 修饰的方法。因此,开发者可以在这个被修饰的方法内重定义组件的方法或重赋值组件的属性,其将在预览时生效。 + +> 说明: +> @MockSetup 修饰的方法仅在预览场景会自动触发,并先于组件的 aboutToAppear 执行。 + +### UI组件的方法 + +在 ArkTS 页面代码中引入 Hamock。在目标组件中定义一个方法,并用 @MockSetup 修饰该方法。在这个方法中,使用 MockKit 模拟目标方法。 + +```typescript +import { MockKit, when, MockSetup } from '@ohos/hamock'; + +@Entry +@Component +struct Index { + ... + @MockSetup + randomName() { + let mocker: MockKit = new MockKit(); + let mockfunc: Object = mocker.mockFunc(this, this.method1); + // mock 指定的方法在指定入参的返回值 + when(mockfunc)('test').afterReturn(1); + } + ... + // 业务场景调用方法 + const result: number = this.method1('test'); // in previewer, result = 1 +} +``` + +### UI组件的属性 + +在 ArkTS 页面代码中引入 Hamock。在目标组件中定义一个方法,并用 @MockSetup 修饰该方法。在这个方法中,对于需要 Mock 的属性,可以重新赋值。 + +```typescript +import { MockSetup } from '@ohos/hamock'; + +@Component +struct Person { + @Prop species: string; + ... + // 在 @MockSetup 片段中,定义对象属性 + @MockSetup + randomName() { + this.species = 'primates'; + } + ... + // 业务场景调用属性(如果从初始化到调用期间,该属性无变化) + const result: string = this.species; // in previewer, result = primates +} +``` + +## 约束与限制 + +在下述版本验证通过: + +DevEco Studio: 4.1 (4.1.3.400), SDK: API11 (4.1.0.36) + +MockSetup 仅在 API11 支持。 + +## 贡献代码 + +使用过程中发现任何问题都可以提[Issue](https://gitee.com/openharmony/testfwk_arkxtest/issues) 给我们,当然,我们也非常欢迎你给我们提[PR](https://gitee.com/openharmony/testfwk_arkxtest/pulls) 。 + +## 开源协议 + +本项目基于 [Apache License 2.0](https://gitee.com/openharmony/testfwk_arkxtest/blob/master/hamock/LICENSE) ,请自由地享受和参与开源。 \ No newline at end of file diff --git a/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/build-profile.json5 b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..12fe2d844bdb69584fd05ebaa3e1cb197a25c3f1 --- /dev/null +++ b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/build-profile.json5 @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2023 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. + */ + +{ + "apiType": "stageMode", + "buildOption": { + }, + "targets": [ + { + "name": "default" + } + ] +} diff --git a/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/hvigorfile.js b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/hvigorfile.js new file mode 100644 index 0000000000000000000000000000000000000000..d7bda561c9bf09b92a7fac485141cc8648907388 --- /dev/null +++ b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/hvigorfile.js @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2023 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. + */ + +// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently. +export { harTasks } from '@ohos/hvigor-ohos-plugin'; diff --git a/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/hvigorfile.ts b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..960be7d7df0790853d6bdab1f52a3ec8c8e4a1ca --- /dev/null +++ b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/hvigorfile.ts @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2023 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. + */ + +// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently. +export { harTasks } from '@ohos/hvigor-ohos-plugin'; \ No newline at end of file diff --git a/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/index.d.ts b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..6bc7929ba5718da0e459721be04e903ec59289c0 --- /dev/null +++ b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/index.d.ts @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2023 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. + */ + +export class ArgumentMatchers { + static any; + static anyString; + static anyBoolean; + static anyNumber; + static anyObj; + static anyFunction; + static matchRegexs(Regex: RegExp): void +} + +declare interface when { + afterReturn(value: any): any + afterReturnNothing(): undefined + afterAction(action: any): any + afterThrow(e_msg: string): string + (argMatchers?: any): when; +} + +export const when: when; + +export interface VerificationMode { + times(count: Number): void + never(): void + once(): void + atLeast(count: Number): void + atMost(count: Number): void +} + +export class MockKit { + constructor() + mockFunc(obj: Object, func: Function): Function + mockObject(obj: Object): Object + verify(methodName: String, argsArray: Array): VerificationMode + ignoreMock(obj: Object, func: Function): void + clear(obj: Object): void + clearAll(): void +} + +export declare function MockSetup( + target: Object, + propertyName: string | Symbol, + descriptor: TypedPropertyDescriptor<() => void> +): void; \ No newline at end of file diff --git a/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/index.ets b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/index.ets new file mode 100644 index 0000000000000000000000000000000000000000..c3a47320c2b674216cccde0fe217dbb8423625cc --- /dev/null +++ b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/index.ets @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2023 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. + */ + +export { MockSetup, MockKit, when } from './src/main/mock/MockKit'; +export { ArgumentMatchers } from './src/main/mock/ArgumentMatchers'; \ No newline at end of file diff --git a/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/index.js b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/index.js new file mode 100644 index 0000000000000000000000000000000000000000..1cb2b5e0256e00aa9276867f0753a89a7ac5e16f --- /dev/null +++ b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/index.js @@ -0,0 +1,16 @@ +/* + * Copyright (c) 2021-2023 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. + */ +export { MockSetup, MockKit, when } from './src/main/mock/MockKit.js'; +export { ArgumentMatchers } from './src/main/mock/ArgumentMatchers.js'; diff --git a/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/index.ts b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/index.ts new file mode 100644 index 0000000000000000000000000000000000000000..608eb4fe72aaf0f6cca0ccb3baad94e9b6101de0 --- /dev/null +++ b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/index.ts @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2021-2023 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. + */ + +export { MockSetup, MockKit, when } from './src/main/mock/MockKit.js'; +export { ArgumentMatchers } from './src/main/mock/ArgumentMatchers.js'; \ No newline at end of file diff --git a/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/oh-package.json5 b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..0ef4eeed251a93463c2abf85b262c3e1fb6733bc --- /dev/null +++ b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/oh-package.json5 @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2023 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. + */ + +{ + name: '@ohos/hamock', + version: '1.0.0', + description: 'A mock framework for OpenHarmony application.', + main: 'index.ets', + author: 'huawei', + license: 'Apache-2.0', + dependencies: {}, + ohos: { + org: 'ohos', + }, + types: 'index.d.ts' +} diff --git a/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/src/main/mock/ArgumentMatchers.js b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/src/main/mock/ArgumentMatchers.js new file mode 100644 index 0000000000000000000000000000000000000000..f06bbca0b287aac612f42f9263c064c0157ae03a --- /dev/null +++ b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/src/main/mock/ArgumentMatchers.js @@ -0,0 +1,97 @@ +/* + * 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. + */ +export class ArgumentMatchers { + constructor() { + this.ANY = ""; + this.ANY_STRING = ""; + this.ANY_BOOLEAN = ""; + this.ANY_NUMBER = ""; + this.ANY_OBJECT = ""; + this.ANY_FUNCTION = ""; + this.MATCH_REGEXS = ""; + } + static any() { + } + static anyString() { + } + static anyBoolean() { + } + static anyNumber() { + } + static anyObj() { + } + static anyFunction() { + } + static matchRegexs(regex) { + if (ArgumentMatchers.isRegExp(regex)) { + return regex; + } + throw Error("not a regex"); + } + static isRegExp(value) { + return Object.prototype.toString.call(value) === "[object RegExp]"; + } + matcheReturnKey(...args) { + let arg = args[0]; + let regex = args[1]; + let stubSetKey = args[2]; + if (stubSetKey && stubSetKey == this.ANY) { + return this.ANY; + } + if (typeof arg === "string" && !regex) { + return this.ANY_STRING; + } + if (typeof arg === "boolean" && !regex) { + return this.ANY_BOOLEAN; + } + if (typeof arg === "number" && !regex) { + return this.ANY_NUMBER; + } + if (typeof arg === "object" && !regex) { + return this.ANY_OBJECT; + } + if (typeof arg === "function" && !regex) { + return this.ANY_FUNCTION; + } + if (typeof arg === "string" && regex) { + return regex.test(arg); + } + return null; + } + matcheStubKey(key) { + if (key === ArgumentMatchers.any) { + return this.ANY; + } + if (key === ArgumentMatchers.anyString) { + return this.ANY_STRING; + } + if (key === ArgumentMatchers.anyBoolean) { + return this.ANY_BOOLEAN; + } + if (key === ArgumentMatchers.anyNumber) { + return this.ANY_NUMBER; + } + if (key === ArgumentMatchers.anyObj) { + return this.ANY_OBJECT; + } + if (key === ArgumentMatchers.anyFunction) { + return this.ANY_FUNCTION; + } + if (ArgumentMatchers.isRegExp(key)) { + return key; + } + return null; + } +} diff --git a/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/src/main/mock/ArgumentMatchers.ts b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/src/main/mock/ArgumentMatchers.ts new file mode 100644 index 0000000000000000000000000000000000000000..262bea1afbeb611029db0cfaeb65767b92f97b91 --- /dev/null +++ b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/src/main/mock/ArgumentMatchers.ts @@ -0,0 +1,118 @@ +/* + * 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. + */ + +export class ArgumentMatchers { + ANY = ""; + ANY_STRING = ""; + ANY_BOOLEAN = ""; + ANY_NUMBER = ""; + ANY_OBJECT = ""; + ANY_FUNCTION = ""; + MATCH_REGEXS = ""; + + static any() { + } + + static anyString() { + } + + static anyBoolean() { + } + + static anyNumber() { + } + + static anyObj() { + } + + static anyFunction() { + } + + static matchRegexs(regex: any) { + if (ArgumentMatchers.isRegExp(regex)) { + return regex; + } + throw Error("not a regex"); + } + + static isRegExp(value: string) { + return Object.prototype.toString.call(value) === "[object RegExp]"; + } + + matcheReturnKey(...args: Array) { + let arg = args[0]; + let regex = args[1]; + let stubSetKey = args[2]; + + if (stubSetKey && stubSetKey == this.ANY) { + return this.ANY; + } + + if (typeof arg === "string" && !regex) { + return this.ANY_STRING; + } + + if (typeof arg === "boolean" && !regex) { + return this.ANY_BOOLEAN; + } + + if (typeof arg === "number" && !regex) { + return this.ANY_NUMBER; + } + + if (typeof arg === "object" && !regex) { + return this.ANY_OBJECT; + } + + if (typeof arg === "function" && !regex) { + return this.ANY_FUNCTION; + } + + if (typeof arg === "string" && regex) { + return regex.test(arg); + } + + return null; + } + + matcheStubKey(key: any) { + + if (key === ArgumentMatchers.any) { + return this.ANY; + } + + if (key === ArgumentMatchers.anyString) { + return this.ANY_STRING; + } + if (key === ArgumentMatchers.anyBoolean) { + return this.ANY_BOOLEAN; + } + if (key === ArgumentMatchers.anyNumber) { + return this.ANY_NUMBER; + } + if (key === ArgumentMatchers.anyObj) { + return this.ANY_OBJECT; + } + if (key === ArgumentMatchers.anyFunction) { + return this.ANY_FUNCTION; + } + + if (ArgumentMatchers.isRegExp(key)) { + return key; + } + + return null; + } +} \ No newline at end of file diff --git a/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/src/main/mock/ExtendInterface.js b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/src/main/mock/ExtendInterface.js new file mode 100644 index 0000000000000000000000000000000000000000..52f9dff07f7b719900ca47d56c3020586db31d5b --- /dev/null +++ b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/src/main/mock/ExtendInterface.js @@ -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. + */ +class ExtendInterface { + constructor(mocker) { + this.mocker = mocker; + } + stub() { + this.params = arguments; + return this; + } + stubMockedCall(returnInfo) { + this.mocker.stubApply(this, this.params, returnInfo); + } + afterReturn(value) { + this.stubMockedCall(function () { + return value; + }); + } + afterReturnNothing() { + this.stubMockedCall(function () { + return undefined; + }); + } + afterAction(action) { + this.stubMockedCall(action); + } + afterThrow(msg) { + this.stubMockedCall(function () { + throw msg; + }); + } + clear(obj) { + this.mocker.clear(obj); + } +} +export default ExtendInterface; diff --git a/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/src/main/mock/ExtendInterface.ts b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/src/main/mock/ExtendInterface.ts new file mode 100644 index 0000000000000000000000000000000000000000..55f7a0b36bc2895e17a2e6b32a6c1980853cbce9 --- /dev/null +++ b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/src/main/mock/ExtendInterface.ts @@ -0,0 +1,63 @@ +/* + * 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 { MockKit } from "./MockKit.js"; + +class ExtendInterface { + + private mocker: MockKit + private params: any + + constructor(mocker: MockKit) { + this.mocker = mocker; + } + + stub() { + this.params = arguments; + return this; + } + + stubMockedCall(returnInfo: any) { + this.mocker.stubApply(this, this.params, returnInfo); + } + + afterReturn(value: any) { + this.stubMockedCall(function () { + return value; + }); + } + + afterReturnNothing() { + this.stubMockedCall(function () { + return undefined; + }); + } + + afterAction(action: Function) { + this.stubMockedCall(action); + } + + afterThrow(msg: string) { + this.stubMockedCall(function () { + throw msg; + }); + } + + clear(obj?: any) { + this.mocker.clear(obj); + } +} + +export default ExtendInterface; \ No newline at end of file diff --git a/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/src/main/mock/MockKit.js b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/src/main/mock/MockKit.js new file mode 100644 index 0000000000000000000000000000000000000000..c1ca51614abe9f9c149094f5186eeb750b00a074 --- /dev/null +++ b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/src/main/mock/MockKit.js @@ -0,0 +1,253 @@ +/* + * Copyright (c) 2022-2023 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 ExtendInterface from "./ExtendInterface.js"; +import VerificationMode from "./VerificationMode.js"; +import { ArgumentMatchers } from "./ArgumentMatchers.js"; +class MockKit { + constructor() { + this.mFunctions = []; + this.stubs = new Map(); + this.recordCalls = new Map(); + this.currentSetKey = new Map(); + this.mockObj = null; + this.recordMockedMethod = new Map(); + this.mFunctions = []; + this.stubs = new Map(); + this.recordCalls = new Map(); + this.currentSetKey = new Map(); + this.mockObj = null; + this.recordMockedMethod = new Map(); + } + init() { + this.reset(); + } + reset() { + this.mFunctions = []; + this.stubs = new Map(); + this.recordCalls = new Map(); + this.currentSetKey = new Map(); + this.mockObj = null; + this.recordMockedMethod = new Map(); + } + clearAll() { + this.reset(); + } + clear(obj) { + if (!obj) throw Error("Please enter an object to be cleaned"); + if (typeof (obj) !== 'object' && typeof (obj) !== 'function') throw new Error('Not a object or static class'); + this.recordMockedMethod.forEach(function (value, key, map) { + if (key) { + obj[key] = value; + } + }); + } + ignoreMock(obj, method) { + if (typeof (obj) !== 'object' && typeof (obj) !== 'function') throw new Error('Not a object or static class'); + if (typeof (method) !== 'function') throw new Error('Not a function'); + let og = this.recordMockedMethod.get(method.propName); + if (og) { + obj[method.propName] = og; + this.recordMockedMethod.set(method.propName, undefined); + } + } + extend(dest, source) { + dest["stub"] = source["stub"]; + dest["afterReturn"] = source["afterReturn"]; + dest["afterReturnNothing"] = source["afterReturnNothing"]; + dest["afterAction"] = source["afterAction"]; + dest["afterThrow"] = source["afterThrow"]; + dest["stubMockedCall"] = source["stubMockedCall"]; + dest["clear"] = source["clear"]; + return dest; + } + stubApply(f, params, returnInfo) { + let values = this.stubs.get(f); + if (!values) { + values = new Map(); + } + let key = params[0]; + if (typeof key === "undefined") { + key = "anonymous-mock-" + f.propName; + } + let matcher = new ArgumentMatchers(); + if (matcher.matcheStubKey(key)) { + key = matcher.matcheStubKey(key); + if (key) { + this.currentSetKey.set(f, key); + } + } + values.set(key, returnInfo); + this.stubs.set(f, values); + } + getReturnInfo(f, params) { + let values = this.stubs.get(f); + if (!values) { + return undefined; + } + let retrunKet = params[0]; + if (typeof retrunKet === "undefined") { + retrunKet = "anonymous-mock-" + f.propName; + } + let stubSetKey = this.currentSetKey.get(f); + + if (stubSetKey && (typeof (retrunKet) !== "undefined")) { + retrunKet = stubSetKey; + } + let matcher = new ArgumentMatchers(); + if (matcher.matcheReturnKey(params[0], undefined, stubSetKey) && matcher.matcheReturnKey(params[0], undefined, stubSetKey) !== stubSetKey) { + retrunKet = params[0]; + } + values.forEach(function (value, key, map) { + if (ArgumentMatchers.isRegExp(key) && matcher.matcheReturnKey(params[0], key)) { + retrunKet = key; + } + }); + return values.get(retrunKet); + } + findName(obj, value) { + let properties = this.findProperties(obj); + let name = ''; + properties.filter((item) => (item !== 'caller' && item !== 'arguments')).forEach(function (va1, idx, array) { + if (obj[va1] === value) { + name = va1; + } + }); + return name; + } + isFunctionFromPrototype(f, container, propName) { + if (container.constructor !== Object && container.constructor.prototype !== container) { + return container.constructor.prototype[propName] === f; + } + return false; + } + findProperties(obj, ...arg) { + function getProperty(new_obj) { + if (new_obj.__proto__ === null) { + return []; + } + let properties = Object.getOwnPropertyNames(new_obj); + return [...properties, ...getProperty(new_obj.__proto__)]; + } + return getProperty(obj); + } + recordMethodCall(originalMethod, args) { + originalMethod['getName'] = function () { + return this.name || this.toString().match(/function\s*([^(]*)\(/)[1]; + }; + let name = originalMethod.getName(); + let arglistString = name + '(' + Array.from(args).toString() + ')'; + let records = this.recordCalls.get(arglistString); + if (!records) { + records = 0; + } + records++; + this.recordCalls.set(arglistString, records); + } + mockFunc(originalObject, originalMethod) { + let tmp = this; + this.originalMethod = originalMethod; + const _this = this; + let f = function () { + let args = arguments; + let action = tmp.getReturnInfo(f, args); + if (originalMethod) { + tmp.recordMethodCall(originalMethod, args); + } + if (action) { + return action.apply(_this, args); + } + }; + f.container = null || originalObject; + f.original = originalMethod || null; + if (originalObject && originalMethod) { + if (typeof (originalMethod) != 'function') + throw new Error('Not a function'); + var name = this.findName(originalObject, originalMethod); + originalObject[name] = f; + this.recordMockedMethod.set(name, originalMethod); + f.propName = name; + f.originalFromPrototype = this.isFunctionFromPrototype(f.original, originalObject, f.propName); + } + f.mocker = this; + this.mFunctions.push(f); + this.extend(f, new ExtendInterface(this)); + return f; + } + verify(methodName, argsArray) { + if (!methodName) { + throw Error("not a function name"); + } + let a = this.recordCalls.get(methodName + '(' + argsArray.toString() + ')'); + return new VerificationMode(a ? a : 0); + } + mockObject(object) { + if (!object || typeof object === "string") { + throw Error(`this ${object} cannot be mocked`); + } + const _this = this; + let mockedObject = {}; + let keys = Reflect.ownKeys(object); + keys.filter(key => (typeof Reflect.get(object, key)) === 'function') + .forEach((key) => { + mockedObject[key] = object[key]; + mockedObject[key] = _this.mockFunc(mockedObject, mockedObject[key]); + }); + return mockedObject; + } +} +function ifMockedFunction(f) { + if (Object.prototype.toString.call(f) != "[object Function]" && + Object.prototype.toString.call(f) != "[object AsyncFunction]") { + throw Error("not a function"); + } + if (!f.stub) { + throw Error("not a mock function"); + } + return true; +} +function when(f) { + if (ifMockedFunction(f)) { + return f.stub.bind(f); + } +} +function MockSetup(target, propertyName, descriptor) { + const aboutToAppearOrigin = target.aboutToAppear; + const setup = descriptor.value; + target.aboutToAppear = function (...args) { + if (target.__Param) { // copy attributes and params of the original context + try { + const map = target.__Param; + for (const [key, val] of map) { + this[key] = val; // 'this' refers to context of current function + } + } + catch (e) { + throw new Error(`Mock setup param error: ${e}`); + } + } + if (setup) { // apply the mock content + try { + setup.apply(this); + } + catch (e) { + throw new Error(`Mock setup apply error: ${e}`); + } + } + if (aboutToAppearOrigin) { // append to aboutToAppear function of the original context + aboutToAppearOrigin.apply(this, args); + } + }; +} +export { MockSetup, MockKit, when }; diff --git a/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/src/main/mock/MockKit.ts b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/src/main/mock/MockKit.ts new file mode 100644 index 0000000000000000000000000000000000000000..2807643e29d6da16ee7061ce5674b696a4fc3ca6 --- /dev/null +++ b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/src/main/mock/MockKit.ts @@ -0,0 +1,294 @@ +/* + * Copyright (c) 2023 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 ExtendInterface from "./ExtendInterface.js"; +import VerificationMode from "./VerificationMode.js"; +import { ArgumentMatchers } from "./ArgumentMatchers.js"; + +interface IFunction extends Function { + container: any; + original: any; + propName: string; + originalFromPrototype: boolean + mocker: MockKit +} + +class MockKit { + + private mFunctions:Array = []; + private stubs = new Map(); + private recordCalls = new Map(); + private currentSetKey = new Map(); + private mockObj = null; + private recordMockedMethod = new Map(); + private originalMethod: any; + + constructor() { + this.mFunctions = []; + this.stubs = new Map(); + this.recordCalls = new Map(); + this.currentSetKey = new Map(); + this.mockObj = null; + this.recordMockedMethod = new Map(); + } + + init() { + this.reset(); + } + + reset() { + this.mFunctions = []; + this.stubs = new Map() + this.recordCalls = new Map(); + this.currentSetKey = new Map(); + this.mockObj = null; + this.recordMockedMethod = new Map(); + } + + clearAll() { + this.reset(); + } + + clear(obj: any) { + if (!obj) throw Error("Please enter an object to be cleaned"); + if (typeof (obj) != 'object') throw new Error('Not a object'); + this.recordMockedMethod.forEach(function (value, key, map) { + if (key) { + obj[key] = value; + } + }); + } + + ignoreMock(obj:any, method: any) { + if (typeof (obj) != 'object') throw new Error('Not a object'); + if (typeof (method) != 'function') throw new Error('Not a function'); + let og = this.recordMockedMethod.get(method.propName); + if (og) { + obj[method.propName] = og; + this.recordMockedMethod.set(method.propName, undefined); + } + } + + extend(dest: any, source:any) { + dest["stub"] = source["stub"]; + dest["afterReturn"] = source["afterReturn"]; + dest["afterReturnNothing"] = source["afterReturnNothing"]; + dest["afterAction"] = source["afterAction"]; + dest["afterThrow"] = source["afterThrow"]; + dest["stubMockedCall"] = source["stubMockedCall"]; + dest["clear"] = source["clear"]; + return dest; + } + + stubApply(f: any, params:any, returnInfo:any) { + let values = this.stubs.get(f); + if (!values) { + values = new Map(); + } + let key = params[0]; + if (typeof key == "undefined") { + key = "anonymous-mock-" + f.propName; + } + let matcher = new ArgumentMatchers(); + if (matcher.matcheStubKey(key)) { + key = matcher.matcheStubKey(key); + if (key) { + this.currentSetKey.set(f, key); + } + } + values.set(key, returnInfo); + this.stubs.set(f, values); + } + + getReturnInfo(f: any, params:any) { + let values = this.stubs.get(f); + if (!values) { + return undefined; + } + let retrunKet = params[0]; + if (typeof retrunKet == "undefined") { + retrunKet = "anonymous-mock-" + f.propName; + } + let stubSetKey = this.currentSetKey.get(f); + + if (stubSetKey && (typeof (retrunKet) != "undefined")) { + retrunKet = stubSetKey; + } + let matcher = new ArgumentMatchers(); + if (matcher.matcheReturnKey(params[0], undefined, stubSetKey) && matcher.matcheReturnKey(params[0], undefined, stubSetKey) != stubSetKey) { + retrunKet = params[0]; + } + + values.forEach(function (value: any, key: any, map: any) { + if (ArgumentMatchers.isRegExp(key) && matcher.matcheReturnKey(params[0], key)) { + retrunKet = key; + } + }); + + return values.get(retrunKet); + } + + findName(obj: any, value: any) { + let properties = this.findProperties(obj); + let name = ''; + properties.filter((item:any) => (item !== 'caller' && item !== 'arguments')).forEach( + function (va1:any, idx:any, array:any) { + if (obj[va1] === value) { + name = va1; + } + } + ); + return name; + } + + isFunctionFromPrototype(f: Function, container:Function, propName: string) { + if (container.constructor != Object && container.constructor.prototype !== container) { + return container.constructor.prototype[propName] === f; + } + return false; + } + + findProperties(obj: any, ...arg: Array) { + function getProperty(new_obj:any): Array { + if (new_obj.__proto__ === null) { + return []; + } + let properties = Object.getOwnPropertyNames(new_obj); + return [...properties, ...getProperty(new_obj.__proto__)]; + } + return getProperty(obj); + } + + recordMethodCall(originalMethod: any, args: any) { + originalMethod['getName'] = function () { + return this.name || this.toString().match(/function\s*([^(]*)\(/)[1]; + } + let name = originalMethod.getName(); + let arglistString = name + '(' + Array.from(args).toString() + ')'; + let records = this.recordCalls.get(arglistString); + if (!records) { + records = 0; + } + records++; + this.recordCalls.set(arglistString, records); + } + + mockFunc(originalObject:any, originalMethod:any) { + let tmp = this; + this.originalMethod = originalMethod; + const _this = this; + let f:any = function () { + let args = arguments; + let action = tmp.getReturnInfo(f, args); + if (originalMethod) { + tmp.recordMethodCall(originalMethod, args); + } + if (action) { + return action.apply(_this, args); + } + }; + + f.container = null || originalObject; + f.original = originalMethod || null; + + if (originalObject && originalMethod) { + if (typeof (originalMethod) != 'function') throw new Error('Not a function'); + var name = this.findName(originalObject, originalMethod); + originalObject[name] = f; + this.recordMockedMethod.set(name, originalMethod); + f.propName = name; + f.originalFromPrototype = this.isFunctionFromPrototype(f.original, originalObject, f.propName); + } + f.mocker = this; + this.mFunctions.push(f); + this.extend(f, new ExtendInterface(this)); + return f; + } + + verify(methodName:any, argsArray:any) { + if (!methodName) { + throw Error("not a function name"); + } + let a = this.recordCalls.get(methodName + '(' + argsArray.toString() + ')'); + return new VerificationMode(a ? a : 0); + } + + mockObject(object: any) { + if (!object || typeof object === "string") { + throw Error(`this ${object} cannot be mocked`); + } + const _this = this; + let mockedObject:any = {}; + let keys = Reflect.ownKeys(object); + keys.filter(key => (typeof Reflect.get(object, key)) === 'function') + .forEach((key:any) => { + mockedObject[key] = object[key]; + mockedObject[key] = _this.mockFunc(mockedObject, mockedObject[key]); + }); + return mockedObject; + } +} + +function ifMockedFunction(f: any) { + if (Object.prototype.toString.call(f) != "[object Function]" && + Object.prototype.toString.call(f) != "[object AsyncFunction]") { + throw Error("not a function"); + } + if (!f.stub) { + throw Error("not a mock function"); + } + return true; +} + +function when(f: any) { + if (ifMockedFunction(f)) { + return f.stub.bind(f); + } +} + +function MockSetup(target: Object, propertyName: string | Symbol, descriptor: TypedPropertyDescriptor<() => void>): void { + const aboutToAppearOrigin = target.aboutToAppear; + const setup = descriptor.value; + target.aboutToAppear = function (...args: any[]) { + if (target.__Param) { // copy attributes and params of the original context + try { + const map = target.__Param as Map; + for (const [key, val] of map) { + this[key] = val; // 'this' refers to context of current function + } + } catch (e) { + throw new Error(`Mock setup param error: ${e}`); + } + } + + if (setup) { // apply the mock content + try { + setup.apply(this); + } catch (e) { + throw new Error(`Mock setup apply error: ${e}`); + } + } + + if (aboutToAppearOrigin) { // append to aboutToAppear function of the original context + aboutToAppearOrigin.apply(this, args); + } + } +} + +export { + MockSetup, + MockKit, + when +}; \ No newline at end of file diff --git a/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/src/main/mock/VerificationMode.js b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/src/main/mock/VerificationMode.js new file mode 100644 index 0000000000000000000000000000000000000000..21e10fb8037f59475510b2821fcf7432c9459a4a --- /dev/null +++ b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/src/main/mock/VerificationMode.js @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2022-2023 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. + */ +class VerificationMode { + constructor(times) { + this.doTimes = times; + } + times(count) { + if (count !== this.doTimes) { + throw Error(`expect ${count} actual ${this.doTimes}`); + } + } + never() { + if (this.doTimes !== 0) { + throw Error(`expect 0 actual ${this.doTimes}`); + } + } + once() { + if (this.doTimes !== 1) { + throw Error(`expect 1 actual ${this.doTimes}`); + } + } + atLeast(count) { + if (count > this.doTimes) { + throw Error('failed ' + count + ' greater than the actual execution times of method'); + } + } + atMost(count) { + if (count < this.doTimes) { + throw Error('failed ' + count + ' less than the actual execution times of method'); + } + } +} +export default VerificationMode; diff --git a/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/src/main/mock/VerificationMode.ts b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/src/main/mock/VerificationMode.ts new file mode 100644 index 0000000000000000000000000000000000000000..93d976ce73b2fbde199d31b3efd30eb3544179d8 --- /dev/null +++ b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/src/main/mock/VerificationMode.ts @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2022-2023 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. + */ + + +class VerificationMode { + + private doTimes: number + + constructor(times: number) { + this.doTimes = times; + } + + times(count: number) { + if(count !== this.doTimes) { + throw Error(`expect ${count} actual ${this.doTimes}`); + } + } + + never() { + if (this.doTimes !== 0) { + throw Error(`expect 0 actual ${this.doTimes}`); + } + } + + once() { + if (this.doTimes !== 1) { + throw Error(`expect 1 actual ${this.doTimes}`); + } + } + + atLeast(count: number) { + if (count > this.doTimes) { + throw Error('failed ' + count + ' greater than the actual execution times of method'); + } + } + + atMost(count: number) { + if (count < this.doTimes) { + throw Error('failed ' + count + ' less than the actual execution times of method'); + } + } +} + +export default VerificationMode; \ No newline at end of file diff --git a/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/src/main/module.json b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/src/main/module.json new file mode 100644 index 0000000000000000000000000000000000000000..384ae72f9bd2353fea8a5c9c5d6696ab5e67cb21 --- /dev/null +++ b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/src/main/module.json @@ -0,0 +1,22 @@ +{ + "app": { + "bundleName": "com.example.hamock", + "debug": true, + "versionCode": 1000000, + "versionName": "1.0.0", + "minAPIVersion": 9, + "targetAPIVersion": 9, + "apiReleaseType": "Release" + }, + "module": { + "name": "hamock", + "type": "har", + "deviceTypes": [ + "default", + "tablet", + "tv", + "wearable", + "car" + ] + } +} diff --git a/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/src/res/schemas/mock-config-json5-schema.json b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/src/res/schemas/mock-config-json5-schema.json new file mode 100644 index 0000000000000000000000000000000000000000..96036325a316d827cb9fcb6908b3de23c53b4b79 --- /dev/null +++ b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hamock@1.0.0/oh_modules/@ohos/hamock/src/res/schemas/mock-config-json5-schema.json @@ -0,0 +1,25 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "title": "JSON schema for mock-config.json5 file", + "definitions": { + "sourceRedirection": { + "description": "A source redirection for mocked module.", + "type": "object", + "required": [ + "source" + ], + "properties": { + "source": { + "type": "string", + "maxLength": 128, + "minLength": 1 + } + } + } + }, + "patternProperties": { + ".+": { + "$ref": "#/definitions/sourceRedirection" + } + } +} \ No newline at end of file diff --git a/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/BuildProfile.ets b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/BuildProfile.ets new file mode 100644 index 0000000000000000000000000000000000000000..b054e98af7ad6092740cef28d7dcf6207e514dcb --- /dev/null +++ b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/BuildProfile.ets @@ -0,0 +1,5 @@ +export default class BuildProfile { + static readonly HAR_VERSION = '1.0.19'; + static readonly BUILD_MODE_NAME = 'debug'; + static readonly DEBUG = true; +} \ No newline at end of file diff --git a/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/CHANGELOG.md b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/CHANGELOG.md new file mode 100644 index 0000000000000000000000000000000000000000..309d707c3d19f506f5582509edf1d0db9011a5b1 --- /dev/null +++ b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/CHANGELOG.md @@ -0,0 +1,24 @@ +## 1.0.14 +- 堆栈信息打印到cmd +## 1.0.15 +- 支持获取测试代码的失败堆栈信息 +- mock代码迁移至harmock包 +- 适配arkts语法 +- 修复覆盖率数据容易截断的bug +## 1.0.16 +- 修改覆盖率文件生成功能 +- 修改静态方法无法ignoreMock函数 +- ## 1.0.17 +- 修改not断言失败提示日志 +- 自定义错误message信息 +- 添加xdescribe, xit API功能 +- ## 1.0.18 +- 添加全局变量存储API get set +- 自定义断言功能 +## 1.0.18-rc.0 +添加框架worker执行能力 +## 1.0.18-rc.1 +规范日志格式 +## 1.0.19 +- 规范日志格式 +- 代码规范整改 \ No newline at end of file diff --git a/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/LICENSE b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..4947287f7b5ccb5d1e8b7b2d3aa5d89f322c160d --- /dev/null +++ b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/LICENSE @@ -0,0 +1,177 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS \ No newline at end of file diff --git a/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/README.md b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/README.md new file mode 100644 index 0000000000000000000000000000000000000000..6d795105533a9b3b9949e91d2c3dd14e8f867433 --- /dev/null +++ b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/README.md @@ -0,0 +1,219 @@ +
Hypium
+
A unit test framework for OpenHarmonyOS application
+ +## Hypium是什么? +*** +- Hypium是OpenHarmony上的测试框架,提供测试用例编写、执行、结果显示能力,用于OpenHarmony系统应用接口以及应用界面测试。 +- Hypium结构化模型:hypium工程主要由List.test.js与TestCase.test.js组成。 +``` +rootProject // Hypium工程根目录 +├── moduleA +│   ├── src +│      ├── main // 被测试应用目录 +│      ├── ohosTest // 测试用例目录 +│         ├── js/ets +│            └── test +│               └── List.test.js // 测试用例加载脚本,ets目录下为.ets后缀 +│               └── TestCase.test.js // 测试用例脚本,ets目录下为.ets后缀 +└── moduleB + ... +│               └── List.test.js // 测试用例加载脚本,ets目录下为.ets后缀 +│               └── TestCase.test.js // 测试用例脚本,ets目录下为.ets后缀 +``` + +## 安装使用 +*** +- 在DevEco Studio内使用Hypium +- 工程级package.json内配置: +```json +"dependencies": { + "@ohos/hypium": "1.0.19" +} +``` +注: +hypium服务于OpenHarmonyOS应用对外接口测试、系统对外接口测试(SDK中接口),完成HAP自动化测试。详细指导: +[Deveco Studio](https://developer.harmonyos.com/cn/develop/deveco-studio) + +#### 通用语法 + +- 测试用例采用业内通用语法,describe代表一个测试套, it代表一条用例。 + +| No. | API | 功能说明 | +| --- | ---------- | ---------------------------------------------------------------------------------------------------------------------- | +| 1 | describe | 定义一个测试套,支持两个参数:测试套名称和测试套函数 | +| 2 | beforeAll | 在测试套内定义一个预置条件,在所有测试用例开始前执行且仅执行一次,支持一个参数:预置动作函数 | +| 3 | beforeEach | 在测试套内定义一个单元预置条件,在每条测试用例开始前执行,执行次数与it定义的测试用例数一致,支持一个参数:预置动作函数 | +| 4 | afterEach | 在测试套内定义一个单元清理条件,在每条测试用例结束后执行,执行次数与it定义的测试用例数一致,支持一个参数:清理动作函数 | +| 5 | afterAll | 在测试套内定义一个清理条件,在所有测试用例结束后执行且仅执行一次,支持一个参数:清理动作函数 | +| 6 | it | 定义一条测试用例,支持三个参数:用例名称,过滤参数和用例函数 | +| 7 | expect | 支持bool类型判断等多种断言方法 | + +#### 断言库 + +- 示例代码: + +```javascript + expect(${actualvalue}).assertX(${expectvalue}) +``` + +- 断言功能列表: + +| No. | API | 功能说明 | +| :--- | :------------------------------- | ---------------------------------------------------------------------------------------------- | +| 1 | assertClose | 检验actualvalue和expectvalue(0)的接近程度是否是expectValue(1) | +| 2 | assertContain | 检验actualvalue中是否包含expectvalue | +| 3 | assertDeepEquals | @since1.0.4 检验actualvalue和expectvalue(0)是否是同一个对象 | +| 4 | assertEqual | 检验actualvalue是否等于expectvalue[0] | +| 5 | assertFail | 抛出一个错误 | +| 6 | assertFalse | 检验actualvalue是否是false | +| 7 | assertTrue | 检验actualvalue是否是true | +| 8 | assertInstanceOf | 检验actualvalue是否是expectvalue类型 | +| 9 | assertLarger | 检验actualvalue是否大于expectvalue | +| 10 | assertLess | 检验actualvalue是否小于expectvalue | +| 11 | assertNaN | @since1.0.4 检验actualvalue是否是NaN | +| 12 | assertNegUnlimited | @since1.0.4 检验actualvalue是否等于Number.NEGATIVE_INFINITY | +| 13 | assertNull | 检验actualvalue是否是null | +| 14 | assertPosUnlimited | @since1.0.4 检验actualvalue是否等于Number.POSITIVE_INFINITY | +| 15 | assertPromiseIsPending | @since1.0.4 检验actualvalue是否处于Pending状态【actualvalue为promse对象】 | +| 16 | assertPromiseIsRejected | @since1.0.4 检验actualvalue是否处于Rejected状态【同15】 | +| 17 | assertPromiseIsRejectedWith | @since1.0.4 检验actualvalue是否处于Rejected状态,并且比较执行的结果值【同15】 | +| 18 | assertPromiseIsRejectedWithError | @since1.0.4 检验actualvalue是否处于Rejected状态并有异常,同时比较异常的类型和message值【同15】 | +| 19 | assertPromiseIsResolved | @since1.0.4 检验actualvalue是否处于Resolved状态【同15】 | +| 20 | assertPromiseIsResolvedWith | @since1.0.4 检验actualvalue是否处于Resolved状态,并且比较执行的结果值【同15】 | +| 21 | assertThrowError | 检验actualvalue抛出Error内容是否是expectValue | +| 22 | assertUndefined | 检验actualvalue是否是undefined | +| 23 | not | @since1.0.4 断言结果取反 | + + +示例代码: + +```javascript + import { describe, it, expect } from '@ohos/hypium'; + + export default async function assertCloseTest() { + describe('assertClose', function () { + it('assertClose_success', 0, function () { + let a = 100; + let b = 0.1; + expect(a).assertClose(99, b); + }) + }) + } +``` + +#### 公共系统能力 + +| No. | API | 功能描述 | +| ---- | ------------------------------------------------------- | ------------------------------------------------------------ | +| 1 | existKeyword(keyword: string, timeout: number): boolean | @since1.0.3 hilog日志中查找指定字段是否存在,keyword是待查找关键字,timeout为设置的查找时间 | +| 2 | actionStart(tag: string): void | @since1.0.3 cmd窗口输出开始tag | +| 3 | actionEnd(tag: string): void | @since1.0.3 cmd窗口输出结束tag | + +示例代码: + +```javascript +import { describe, it, expect, SysTestKit} from '@ohos/hypium'; + +export default function existKeywordTest() { + describe('existKeywordTest', function () { + it('existKeyword',DEFAULT, async function () { + console.info("HelloTest"); + let isExist = await SysTestKit.existKeyword('HelloTest'); + console.info('isExist ------>' + isExist); + }) + }) +} +``` +```javascript +import { describe, it, expect, SysTestKit} from '@ohos/hypium'; + +export default function actionTest() { + describe('actionTest', function () { + it('existKeyword',DEFAULT, async function () { + let tag = '[MyTest]'; + SysTestKit.actionStart(tag); + //do something + SysTestKit.actionEnd(tag); + }) + }) +} +``` + +#### 专项能力 + +- 测试用例属性筛选能力:hypium支持根据用例属性筛选执行指定测试用例,使用方式是先在测试用例上标记用例属性后,再在测试应用的启动shell命令后新增" -s ${Key} ${Value}"。 + +| Key | 含义说明 | Value取值范围 | +| -------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------ | +| level | 用例级别 | "0","1","2","3","4", 例如:-s level 1 | +| size | 用例粒度 | "small","medium","large", 例如:-s size small | +| testType | 用例测试类型 | "function","performance","power","reliability","security","global","compatibility","user","standard","safety","resilience", 例如:-s testType function | + +示例代码 + +```javascript +import { describe, it, expect, TestType, Size, Level } from '@ohos/hypium'; + +export default function attributeTest() { + describe('attributeTest', function () { + it("testAttributeIt", TestType.FUNCTION | Size.SMALLTEST | Level.LEVEL0, function () { + console.info('Hello Test'); + }) + }) +} +``` + +示例命令 +```shell +XX -s level 1 -s size small -s testType function +``` +该命令的作用是:筛选测试应用中同时满足a)用例级别是1 b)用例粒度是small c)用例测试类型是function 三个条件的用例执行。 + +- 测试套/测试用例名称筛选能力(测试套与用例名称用“#”号连接,多个用“,”英文逗号分隔) + +| Key | 含义说明 | Value取值范围 | +| -------- | ----------------------- | -------------------------------------------------------------------------------------------- | +| class | 指定要执行的测试套&用例 | ${describeName}#${itName},${describeName} , 例如:-s class attributeTest#testAttributeIt | +| notClass | 指定不执行的测试套&用例 | ${describeName}#${itName},${describeName} , 例如:-s notClass attributeTest#testAttributeIt | + +示例命令 +```shell +XX -s class attributeTest#testAttributeIt,abilityTest#testAbilityIt +``` +该命令的作用是:筛选测试应用中attributeTest测试套下的testAttributeIt测试用例,abilityTest测试套下的testAbilityIt测试用例,只执行这两条用例。 + +- 其他能力 + +| 能力项 | Key | 含义说明 | Value取值范围 | +| ------------ | ------- | ---------------------------- | ---------------------------------------------- | +| 随机执行能力 | random | 测试套&测试用例随机执行 | true, 不传参默认为false, 例如:-s random true | +| 空跑能力 | dryRun | 显示要执行的测试用例信息全集 | true , 不传参默认为false,例如:-s dryRun true | +| 异步超时能力 | timeout | 异步用例执行的超时时间 | 正整数 , 单位ms,例如:-s timeout 5000 | + +##### 约束限制 +随机执行能力和空跑能力从npm包1.0.3版本开始支持 + +#### Mock能力 + +##### 约束限制 + +单元测试框架Mock能力从npm包[1.0.1版本](https://repo.harmonyos.com/#/cn/application/atomService/@ohos%2Fhypium/v/1.0.1)开始支持 + +## 约束 + +*** + 本模块首批接口从OpenHarmony SDK API version 8开始支持。 + +## Hypium开放能力隐私声明 + +- 我们如何收集和使用您的个人信息 + 您在使用集成了Hypium开放能力的测试应用时,Hypium不会处理您的个人信息。 +- SDK处理的个人信息 + 不涉及。 +- SDK集成第三方服务声明 + 不涉及。 +- SDK数据安全保护 + 不涉及。 +- SDK版本更新声明 + 为了向您提供最新的服务,我们会不时更新Hypium版本。我们强烈建议开发者集成使用最新版本的Hypium。 + diff --git a/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/build-profile.json5 b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/build-profile.json5 new file mode 100644 index 0000000000000000000000000000000000000000..312d38eb08629793b3484c7373213f22840c8d82 --- /dev/null +++ b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/build-profile.json5 @@ -0,0 +1,28 @@ +{ + "apiType": "stageMode", + "buildOption": { + }, + "buildOptionSet": [ + { + "name": "release", + "arkOptions": { + "obfuscation": { + "ruleOptions": { + "enable": true, + "files": [ + "./obfuscation-rules.txt" + ] + }, + "consumerFiles": [ + "./consumer-rules.txt" + ] + } + }, + }, + ], + "targets": [ + { + "name": "default" + } + ] +} diff --git a/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/hvigorfile.ts b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/hvigorfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..42187071482d292588ad40babeda74f7b8d97a23 --- /dev/null +++ b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/hvigorfile.ts @@ -0,0 +1,6 @@ +import { harTasks } from '@ohos/hvigor-ohos-plugin'; + +export default { + system: harTasks, /* Built-in plugin of Hvigor. It cannot be modified. */ + plugins:[] /* Custom plugin to extend the functionality of Hvigor. */ +} diff --git a/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/index.d.ts b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..7272b5fa839a2cd510d0c70d517bb6800133dba2 --- /dev/null +++ b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/index.d.ts @@ -0,0 +1,150 @@ +/* + * Copyright (c) 2021-2024 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. + */ + +export const DEFAULT = 0B0000 + +export const when: when; + +export enum TestType { + FUNCTION = 0B1, + PERFORMANCE = 0B1 << 1, + POWER = 0B1 << 2, + RELIABILITY = 0B1 << 3, + SECURITY = 0B1 << 4, + GLOBAL = 0B1 << 5, + COMPATIBILITY = 0B1 << 6, + USER = 0B1 << 7, + STANDARD = 0B1 << 8, + SAFETY = 0B1 << 9, + RESILIENCE = 0B1 << 10 +} + +export enum Size { + SMALLTEST = 0B1 << 16, + MEDIUMTEST = 0B1 << 17, + LARGETEST = 0B1 << 18 +} + +export enum Level { + LEVEL0 = 0B1 << 24, + LEVEL1 = 0B1 << 25, + LEVEL2 = 0B1 << 26, + LEVEL3 = 0B1 << 27, + LEVEL4 = 0B1 << 28 +} +export { xdescribe, xit, describe, it } from './index'; + + + +export function beforeItSpecified(testCaseNames: Array | string, callback: Function): void + +export function afterItSpecified(testCaseNames: Array | string, callback: Function): void + +export function beforeEach(callback: Function): void + +export function afterEach(callback: Function): void + +export function beforeAll(callback: Function): void + +export function afterAll(callback: Function): void + + +export interface Assert { + assertClose(expectValue: number, precision: number): void + assertContain(expectValue: any): void + assertEqual(expectValue: any): void + assertFail(): void + assertFalse(): void + assertTrue(): void + assertInstanceOf(expectValue: string): void + assertLarger(expectValue: number): void + assertLess(expectValue: number): void + assertNull(): void + assertThrowError(expectValue: string | Function): void + assertUndefined(): void + assertLargerOrEqual(expectValue: number): void + assertLessOrEqual(expectValue: number): void + assertNaN(): void + assertNegUnlimited(): void + assertPosUnlimited(): void + not(): Assert; + assertDeepEquals(expectValue: any): void + assertPromiseIsPending(): Promise + assertPromiseIsRejected(): Promise + assertPromiseIsRejectedWith(expectValue?: any): Promise + assertPromiseIsRejectedWithError(...expectValue): Promise + assertPromiseIsResolved(): Promise + assertPromiseIsResolvedWith(expectValue?: any): Promise + message(msg: string): Assert +} + +export function expect(actualValue?: any): Assert + +export class ArgumentMatchers { + static any; + static anyString; + static anyBoolean; + static anyNumber; + static anyObj; + static anyFunction; + static matchRegexs(Regex: RegExp): void +} + +declare interface when { + afterReturn(value: any): any + afterReturnNothing(): undefined + afterAction(action: any): any + afterThrow(e_msg: string): string + (argMatchers?: any): when; +} + +export interface VerificationMode { + times(count: Number): void + never(): void + once(): void + atLeast(count: Number): void + atMost(count: Number): void +} + +export class MockKit { + constructor() + mockFunc(obj: Object, func: Function): Function + mockObject(obj: Object): Object + verify(methodName: String, argsArray: Array): VerificationMode + ignoreMock(obj: Object, func: Function): void + clear(obj: Object): void + clearAll(): void +} + +export class SysTestKit { + static getDescribeName(): string; + static getItName(): string; + static getItAttribute(): TestType | Size | Level + static actionStart(tag: string): void + static actionEnd(tag: string): void + static existKeyword(keyword: string, timeout?: number): boolean +} + +export class Hypium { + static setData(data: { [key: string]: any }): void + static setTimeConfig(systemTime: any) + static hypiumTest(abilityDelegator: any, abilityDelegatorArguments: any, testsuite: Function): void + static set(key: string, value: any): void + static get(key: string): any + static registerAssert(customAssertion: Function): void + static unregisterAssert(customAssertion: string | Function): void + static hypiumWorkerTest(abilityDelegator: Object, abilityDelegatorArguments: Object, testsuite: Function, workerPort: Object): void; + static hypiumInitWorkers(abilityDelegator: Object, scriptURL: string, workerNum: number, params: Object): void; +} \ No newline at end of file diff --git a/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/index.ets b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/index.ets new file mode 100644 index 0000000000000000000000000000000000000000..02a237f1c999d1f48b3974b6076d5dae9213245a --- /dev/null +++ b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/index.ets @@ -0,0 +1,137 @@ +/* + * Copyright (c) 2021-2024 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 Core from './src/main/core'; +import {TestType, Size, Level, DEFAULT} from './src/main/Constant'; +import DataDriver from './src/main/module/config/DataDriver'; +import ExpectExtend from './src/main/module/assert/ExpectExtend'; +import OhReport from './src/main/module/report/OhReport'; +export { xdescribe, xit, describe, it } from './index.ts'; + +export declare class Hypium { + static setData(data: Object): void + static setTimeConfig(systemTime: Object): void + static hypiumTest(abilityDelegator: Object, abilityDelegatorArguments: Object, testsuite: Function): void + static set(key: string, value: Object): void + static get(key: string): Object + static registerAssert(customAssertion: Function): void + static unregisterAssert(customAssertion: string | Function): void + static hypiumWorkerTest(abilityDelegator: Object, abilityDelegatorArguments: Object, + testsuite: Function, workerPort: Object): void; + static hypiumInitWorkers(abilityDelegator: Object, scriptURL: string, workerNum: number, params: Object): void; +} + +export { + Core, + DataDriver, + ExpectExtend, + OhReport, + TestType, + Size, + Level, + DEFAULT +}; + +type allExpectType = Object | undefined | null + +export declare function beforeItSpecified(testCaseNames: Array | string, callback: Function): void + +export declare function afterItSpecified(testCaseNames: Array | string, callback: Function): void + +export declare function beforeEach(callback: Function): void + +export declare function afterEach(callback: Function): void + +export declare function beforeAll(callback: Function): void + +export declare function afterAll(callback: Function): void + +export declare interface Assert { + assertClose(expectValue: number, precision: number): void + assertContain(expectValue: allExpectType): void + assertEqual(expectValue: allExpectType): void + assertFail(): void + assertFalse(): void + assertTrue(): void + assertInstanceOf(expectValue: string): void + assertLarger(expectValue: number): void + assertLess(expectValue: number): void + assertNull(): void + assertThrowError(expectValue: string | Function): void + assertUndefined(): void + assertLargerOrEqual(expectValue: number):void + assertLessOrEqual(expectValue: number):void + assertNaN():void + assertNegUnlimited(): void + assertPosUnlimited(): void + not(): Assert; + assertDeepEquals(expectValue: allExpectType):void + assertPromiseIsPending(): Promise + assertPromiseIsRejected(): Promise + assertPromiseIsRejectedWith(expectValue?: allExpectType): Promise + assertPromiseIsRejectedWithError(...expectValue: allExpectType[]): Promise + assertPromiseIsResolved(): Promise + assertPromiseIsResolvedWith(expectValue?: allExpectType): Promise + message(msg: string): Assert +} + +export declare function expect(actualValue?: allExpectType): Assert + +export declare class ArgumentMatchers { + public static any: allExpectType; + public static anyString: string; + public static anyBoolean: Boolean; + public static anyNumber: Number; + public static anyObj: Object; + public static anyFunction: Function; + public static matchRegexs(regex: RegExp): void +} + +declare interface whenResult { + afterReturn: (value: allExpectType) => allExpectType + afterReturnNothing: () => undefined + afterAction: (action: allExpectType) => allExpectType + afterThrow: (e_msg: string) => string +} + +export declare function when(f:Function): (f?: allExpectType | void) => whenResult + +export declare interface VerificationMode { + times(count: Number): void + never(): void + once(): void + atLeast(count: Number): void + atMost(count: Number): void +} + +export declare class MockKit { + constructor() + mockFunc(obj: Object, func: Function): Function + mockObject(obj: Object): Object + verify(methodName: String, argsArray: Array): VerificationMode + ignoreMock(obj: Object, func: Function): void + clear(obj: Object): void + clearAll(): void +} + +export declare class SysTestKit { + static getDescribeName(): string; + static getItName(): string; + static getItAttribute(): TestType | Size | Level + static actionStart(tag: string): void + static actionEnd(tag: string): void + static existKeyword(keyword: string, timeout?: number): boolean +} + diff --git a/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/index.js b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/index.js new file mode 100644 index 0000000000000000000000000000000000000000..02d06d9d1b4b478aa2aec70ba3a73a5e123c98db --- /dev/null +++ b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/index.js @@ -0,0 +1,261 @@ +/* + * Copyright (c) 2021-2024 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 Core from './src/main/core'; +import { DEFAULT, TestType, Size, Level, TAG, PrintTag } from './src/main/Constant'; +import DataDriver from './src/main/module/config/DataDriver'; +import ExpectExtend from './src/main/module/assert/ExpectExtend'; +import OhReport from './src/main/module/report/OhReport'; +import SysTestKit from './src/main/module/kit/SysTestKit'; +import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect, beforeItSpecified, afterItSpecified, xdescribe, xit } from './src/main/interface'; +import { MockKit, when } from './src/main/module/mock/MockKit'; +import ArgumentMatchers from './src/main/module/mock/ArgumentMatchers'; +import worker from '@ohos.worker'; + +class Hypium { + static context = new Map(); + static setData(data) { + const core = Core.getInstance(); + const dataDriver = new DataDriver({ data }); + core.addService('dataDriver', dataDriver); + } + + static setTimeConfig(systemTime) { + SysTestKit.systemTime = systemTime; + } + + static set(key, value) { + Hypium.context.set(key, value); + } + + static get(key) { + return Hypium.context.get(key); + } + + static hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite) { + const core = Core.getInstance(); + const expectExtend = new ExpectExtend({ + 'id': 'extend' + }); + core.addService('expect', expectExtend); + const ohReport = new OhReport({ + 'delegator': abilityDelegator, + 'abilityDelegatorArguments': abilityDelegatorArguments + }); + SysTestKit.delegator = abilityDelegator; + core.addService('report', ohReport); + core.init(); + core.subscribeEvent('spec', ohReport); + core.subscribeEvent('suite', ohReport); + core.subscribeEvent('task', ohReport); + const configService = core.getDefaultService('config'); + if (abilityDelegatorArguments !== null) { + let testParameters = configService.translateParams(abilityDelegatorArguments.parameters); + console.info(`${TAG}parameters:${JSON.stringify(testParameters)}`); + configService.setConfig(testParameters); + } + testsuite(); + core.execute(abilityDelegator); + } + static async hypiumInitWorkers(abilityDelegator, scriptURL, workerNum = 8, params) { + console.info(`${TAG}, hypiumInitWorkers call,${scriptURL}`); + let workerPromiseArray = []; + + // 开始统计时间 + let startTime = await SysTestKit.getRealTime(); + for (let i = 0; i < workerNum; i++) { + // 创建worker线程 + const workerPromise = Hypium.createWorkerPromise(scriptURL, i, params); + workerPromiseArray.push(workerPromise); + } + const ret = {total: 0, failure: 0, error: 0, pass: 0, ignore: 0, duration: 0}; + Promise.all(workerPromiseArray).then(async (items) => { + console.info(`${TAG}, all result from workers, ${JSON.stringify(items)}`); + let allItemList = new Array(); + // 统计执行结果 + Hypium.handleWorkerTestResult(ret, allItemList, items); + console.info(`${TAG}, all it result, ${JSON.stringify(allItemList)}`); + // 统计用例执行结果 + const retResult = {total: 0, failure: 0, error: 0, pass: 0, ignore: 0, duration: 0}; + // 标记用例执行结果 + Hypium.configWorkerItTestResult(retResult, allItemList); + // 打印用例结果 + Hypium.printWorkerTestResult(abilityDelegator, allItemList); + // 用例执行完成统计时间 + let endTime = await SysTestKit.getRealTime(); + const taskConsuming = endTime - startTime; + const message = + `\n${PrintTag.OHOS_REPORT_ALL_RESULT}: stream=Test run: runTimes: ${ret.total},total: ${retResult.total}, Failure: ${retResult.failure}, Error: ${retResult.error}, Pass: ${retResult.pass}, Ignore: ${retResult.ignore}` + + `\n${PrintTag.OHOS_REPORT_ALL_CODE}: ${retResult.failure > 0 || retResult.error > 0 ? -1 : 0}` + + `\n${PrintTag.OHOS_REPORT_ALL_STATUS}: taskconsuming=${taskConsuming > 0 ? taskConsuming : ret.duration}`; + abilityDelegator.printSync(message); + console.info(`${TAG}, [end] you worker test`); + abilityDelegator.finishTest('you worker test finished!!!', 0, () => {}); + }).catch((e) => { + console.info(`${TAG}, [end] error you worker test, ${JSON.stringify(e)}`); + abilityDelegator.finishTest('you worker test error finished!!!', 0, () => {}); + }).finally(() => { + console.info(`${TAG}, all promise finally end`); + }); + } + // 创建worker线程 + static createWorkerPromise(scriptURL, i, params) { + console.info(`${TAG}, createWorkerPromiser, ${scriptURL}, ${i}`); + const workerPromise = new Promise((resolve, reject) => { + const workerInstance = new worker.ThreadWorker(scriptURL, {name: `worker_${i}`}); + console.info(`${TAG}, send data to worker`); + // 发送数据到worker线程中 + workerInstance.postMessage(params); + workerInstance.onmessage = function (e) { + let currentThreadName = e.data?.currentThreadName; + console.info(`${TAG}, receview data from ${currentThreadName}, ${JSON.stringify(e.data)}`); + // + resolve(e.data?.summary); + console.info(`${TAG}, ${currentThreadName} finish`); + workerInstance.terminate(); + }; + workerInstance.onerror = function (e) { + console.info(`${TAG}, worker error, ${JSON.stringify(e)}`); + reject(e); + workerInstance.terminate(); + }; + workerInstance.onmessageerror = function (e) { + console.info(`${TAG}, worker message error, ${JSON.stringify(e)}`); + reject(e); + workerInstance.terminate(); + }; + }); + return workerPromise; + } + static handleWorkerTestResult(ret, allItemList, items) { + console.info(`${TAG}, handleWorkerTestResult, ${JSON.stringify(items)}`); + for (const {total, failure, error, pass, ignore, duration, itItemList} of items) { + ret.total += total; + ret.failure += failure; + ret.error += error; + ret.pass += pass; + ret.ignore += ignore; + ret.duration += duration; + Hypium.handleItResult(allItemList, itItemList); + } + } + static handleItResult(allItemList, itItemList) { + // 遍历所有的用例结果统计最终结果 + for (const {currentThreadName, description, result} of itItemList) { + let item = allItemList.find((it) => it.description === description); + if (item) { + let itResult = item.result; + // 当在worker中出现一次failure就标记为failure, 出现一次error就标记为error, 所有线程都pass才标记为pass + if (itResult === 0) { + item.result = result; + item.currentThreadName = currentThreadName; + } + } else { + let it = { + description: description, + currentThreadName: currentThreadName, + result: result + }; + allItemList.push(it); + } + } + } + static configWorkerItTestResult(retResult, allItemList) { + console.info(`${TAG}, configWorkerItTestResult, ${JSON.stringify(allItemList)}`); + for (const {currentThreadName, description, result} of allItemList) { + console.info(`${TAG}, description, ${description}, result,${result}`); + retResult.total ++; + if (result === 0) { + retResult.pass ++; + } else if (result === -1) { + retResult.error ++; + } else if (result === -2) { + retResult.failure ++; + } else { + retResult.ignore ++; + } + } + } + static printWorkerTestResult(abilityDelegator, allItemList) { + console.info(`${TAG}, printWorkerTestResult, ${JSON.stringify(allItemList)}`); + let index = 1; + for (const {currentThreadName, description, result} of allItemList) { + console.info(`${TAG}, description print, ${description}, result,${result}`); + let itArray = description.split('#'); + let des; + let itName; + if (itArray.length > 1) { + des = itArray[0]; + itName = itArray[1]; + } else if (itArray.length > 1) { + des = itArray[0]; + itName = itArray[0]; + } else { + des = 'undefined'; + itName = 'undefined'; + } + + let msg = `\n${PrintTag.OHOS_REPORT_WORKER_STATUS}: class=${des}`; + msg += `\n${PrintTag.OHOS_REPORT_WORKER_STATUS}: test=${itName}`; + msg += `\n${PrintTag.OHOS_REPORT_WORKER_STATUS}: current=${index}`; + msg += `\n${PrintTag.OHOS_REPORT_WORKER_STATUS}: CODE=${result}`; + abilityDelegator.printSync(msg); + index ++; + } + } + static hypiumWorkerTest(abilityDelegator, abilityDelegatorArguments, testsuite, workerPort) { + console.info(`${TAG}, hypiumWorkerTest call`); + SysTestKit.workerPort = workerPort; + let currentWorkerName = workerPort.name; + console.info(`${TAG}, hypiumWorkerTest_currentWorkerName: ${currentWorkerName}`); + Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite); + + } + + static registerAssert(customAssertion) { + const core = Core.getInstance(); + const expectService = core.getDefaultService('expect'); + let matchers = {}; + matchers[customAssertion.name] = customAssertion; + expectService.addMatchers(matchers); + expectService.customMatchers.push(customAssertion.name); + console.info(`${TAG}success to register the ${customAssertion.name}`); + } + + static unregisterAssert(customAssertion) { + const core = Core.getInstance(); + const expectService = core.getDefaultService('expect'); + let customAssertionName = typeof customAssertion === 'function' ? customAssertion.name : customAssertion; + expectService.removeMatchers(customAssertionName); + console.info(`${TAG}success to unregister the ${customAssertionName}`); + } + +} + +export { + Hypium, + Core, + DEFAULT, + TestType, + Size, + Level, + DataDriver, + ExpectExtend, + OhReport, + SysTestKit, + describe, beforeAll, beforeEach, afterEach, afterAll, it, expect, beforeItSpecified, afterItSpecified, xdescribe, xit, + MockKit, when, + ArgumentMatchers +}; \ No newline at end of file diff --git a/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/index.ts b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/index.ts new file mode 100644 index 0000000000000000000000000000000000000000..b7082ebc98214b58d41e8681791809f1aee48f12 --- /dev/null +++ b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/index.ts @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2024 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 { TestType, Size, Level } from "./src/main/Constant"; + +export declare function xdescribe(testSuiteName: string, func: Function): void; + +export declare namespace xdescribe { + function reason(reason: string): any; +}; + +export declare function describe(testSuiteName: string, func: Function): void; + +export declare function xit(testCaseName: string, attribute: TestType | Size | Level, func: Function): void; + +export declare namespace xit { + function reason(reason: string): any; +}; + +export declare function it(testCaseName: string, attribute: TestType | Size | Level, func: Function): void; diff --git a/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/oh-package.json5 b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/oh-package.json5 new file mode 100644 index 0000000000000000000000000000000000000000..d91344eda60f35477a5caf4bf5c116ffac2e53db --- /dev/null +++ b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/oh-package.json5 @@ -0,0 +1 @@ +{"name":"@ohos/hypium","version":"1.0.19","description":"A unit test framework for OpenHarmony application","main":"index.js","keywords":["测试框架","except","mock"],"author":"huawei","license":"Apache-2.0","repository":"https://gitee.com/openharmony/testfwk_arkxtest","homepage":"https://gitee.com/openharmony/testfwk_arkxtest","dependencies":{}} diff --git a/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/Constant.js b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/Constant.js new file mode 100644 index 0000000000000000000000000000000000000000..f470d69cd9a3302b19d45c147ca7d7c1dd8a3b18 --- /dev/null +++ b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/Constant.js @@ -0,0 +1,99 @@ +/* + * Copyright (c) 2021-2024 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. + */ + +/** + * define the testcase type : TestType, Size , Level + */ +export const TAG = '[Hypium]'; + +export const DEFAULT = 0B0000; + +export class PrintTag { + static OHOS_REPORT_WORKER_STATUS = 'OHOS_REPORT_WORKER_STATUS'; + static OHOS_REPORT_ALL_RESULT = 'OHOS_REPORT_ALL_RESULT'; + static OHOS_REPORT_ALL_CODE = 'OHOS_REPORT_ALL_CODE'; + static OHOS_REPORT_ALL_STATUS = 'OHOS_REPORT_ALL_STATUS'; + static OHOS_REPORT_RESULT = 'OHOS_REPORT_RESULT'; + static OHOS_REPORT_CODE = 'OHOS_REPORT_CODE'; + static OHOS_REPORT_STATUS = 'OHOS_REPORT_STATUS'; + static OHOS_REPORT_SUM = 'OHOS_REPORT_SUM'; + static OHOS_REPORT_STATUS_CODE = 'OHOS_REPORT_STATUS_CODE'; +}; + +export class TestType { + static FUNCTION = 0B1; + static PERFORMANCE = 0B1 << 1; + static POWER = 0B1 << 2; + static RELIABILITY = 0B1 << 3; + static SECURITY = 0B1 << 4; + static GLOBAL = 0B1 << 5; + static COMPATIBILITY = 0B1 << 6; + static USER = 0B1 << 7; + static STANDARD = 0B1 << 8; + static SAFETY = 0B1 << 9; + static RESILIENCE = 0B1 << 10; +} + +export class Size { + static SMALLTEST = 0B1 << 16; + static MEDIUMTEST = 0B1 << 17; + static LARGETEST = 0B1 << 18; +} + +export class Level { + static LEVEL0 = 0B1 << 24; + static LEVEL1 = 0B1 << 25; + static LEVEL2 = 0B1 << 26; + static LEVEL3 = 0B1 << 27; + static LEVEL4 = 0B1 << 28; +} + +export const TESTTYPE = { + 'function': 1, + 'performance': 1 << 1, + 'power': 1 << 2, + 'reliability': 1 << 3, + 'security': 1 << 4, + 'global': 1 << 5, + 'compatibility': 1 << 6, + 'user': 1 << 7, + 'standard': 1 << 8, + 'safety': 1 << 9, + 'resilience': 1 << 10, +} + +export const LEVEL = { + '0': 1 << 24, + '1': 1 << 25, + '2': 1 << 26, + '3': 1 << 27, + '4': 1 << 28, +} + +export const SIZE = { + 'small': 1 << 16, + 'medium': 1 << 17, + 'large': 1 << 18, +} + +export const KEYSET = [ + '-s class', '-s notClass', '-s suite', '-s itName', + '-s level', '-s testType', '-s size', '-s timeout', + '-s dryRun', '-s random', '-s breakOnError', '-s stress', + '-s coverage', '-s skipMessage', '-s runSkipped', + 'class', 'notClass', 'suite', 'itName', + 'level', 'testType', 'size', 'timeout', 'dryRun', 'random', + 'breakOnError', 'stress', 'coverage', 'skipMessage', 'runSkipped' +] diff --git a/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/core.js b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/core.js new file mode 100644 index 0000000000000000000000000000000000000000..cfcb5f17287208f5e6869b4248faf6c9093002d9 --- /dev/null +++ b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/core.js @@ -0,0 +1,159 @@ +/* + * Copyright (c) 2021-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 {SuiteService, SpecService, ExpectService, ReportService} from './service'; +import {ConfigService} from './module/config/configService'; +import {SpecEvent, TaskEvent, SuiteEvent} from './event'; + +/** + * core service for execute testcase. + */ +class Core { + static getInstance() { + if (!this.instance) { + this.instance = new Core(); + } + return this.instance; + } + + constructor() { + this.instance = null; + this.services = { + suite: {}, + spec: {}, + config: {}, + expect: {}, + log: {}, + report: {} + + }; + this.events = { + suite: {}, + spec: {}, + task: {} + }; + } + + addService(name, service) { + let serviceObj = {}; + if (!this.services[name]) { + this.services[name] = serviceObj; + } else { + serviceObj = this.services[name]; + } + serviceObj[service.id] = service; + } + + getDefaultService(name) { + return this.services[name].default; + } + + getServices(name) { + return this.services[name]; + } + + registerEvent(serviceName, event) { + let eventObj = {}; + if (!this.events[serviceName]) { + this.events[serviceName] = eventObj; + } else { + eventObj = this.events[serviceName]; + } + eventObj[event.id] = event; + } + + unRegisterEvent(serviceName, eventID) { + const eventObj = this.events[serviceName]; + if (eventObj) { + delete eventObj[eventID]; + } + } + + subscribeEvent(serviceName, serviceObj) { + const eventObj = this.events[serviceName]; + if (eventObj) { + for (const attr in eventObj) { + eventObj[attr]['subscribeEvent'](serviceObj); + } + } + } + + async fireEvents(serviceName, eventName) { + const eventObj = this.events[serviceName]; + if (!eventObj) { + return; + } + for (const attr in eventObj) { + await eventObj[attr][eventName](); + } + } + + addToGlobal(apis) { + if (typeof globalThis !== 'undefined') { + for (let api in apis) { + globalThis[api] = apis[api]; + } + } + for (const api in apis) { + this[api] = apis[api]; + } + } + + init() { + this.addService('suite', new SuiteService({id: 'default'})); + this.addService('spec', new SpecService({id: 'default'})); + this.addService('expect', new ExpectService({id: 'default'})); + this.addService('report', new ReportService({id: 'default'})); + this.addService('config', new ConfigService({id: 'default'})); + this.registerEvent('task', new TaskEvent({id: 'default', coreContext: this})); + this.registerEvent('suite', new SuiteEvent({id: 'default', coreContext: this})); + this.registerEvent('spec', new SpecEvent({id: 'default', coreContext: this})); + this.subscribeEvent('spec', this.getDefaultService('report')); + this.subscribeEvent('suite', this.getDefaultService('report')); + this.subscribeEvent('task', this.getDefaultService('report')); + const context = this; + for (const key in this.services) { + const serviceObj = this.services[key]; + for (const serviceID in serviceObj) { + const service = serviceObj[serviceID]; + service.init(context); + + if (typeof service.apis !== 'function') { + continue; + } + const apis = service.apis(); + if (apis) { + this.addToGlobal(apis); + } + } + } + } + + execute(abilityDelegator) { + const suiteService = this.getDefaultService('suite'); + const configService = this.getDefaultService('config'); + if (configService['dryRun'] === 'true') { + (async function () { + await suiteService.dryRun(abilityDelegator); + })(); + return; + } + setTimeout(() => { + suiteService.execute(); + }, 10); + } +} + +export default Core; diff --git a/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/event.js b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/event.js new file mode 100644 index 0000000000000000000000000000000000000000..3be0211f01646c9c269c2425cbee82c87ac6d9ea --- /dev/null +++ b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/event.js @@ -0,0 +1,100 @@ +/* + * Copyright (c) 2021-2024 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. + */ + +class SpecEvent { + constructor(attr) { + this.id = attr.id; + this.coreContext = attr.context; + this.eventMonitors = []; + } + + subscribeEvent(service) { + this.eventMonitors.push(service); + } + + async specStart() { + for (const monitor of this.eventMonitors) { + await monitor['specStart'](); + } + } + + async specDone() { + for (const monitor of this.eventMonitors) { + await monitor['specDone'](); + } + } +} + +class SuiteEvent { + constructor(attr) { + this.id = attr.id; + this.suiteContext = attr.coreContext; + this.eventMonitors = []; + } + + subscribeEvent(service) { + this.eventMonitors.push(service); + } + + async suiteStart() { + for (const monitor of this.eventMonitors) { + await monitor['suiteStart'](); + } + } + + async suiteDone() { + for (const monitor of this.eventMonitors) { + await monitor['suiteDone'](); + } + } +} + +class TaskEvent { + constructor(attr) { + this.id = attr.id; + this.coreContext = attr.coreContext; + this.eventMonitors = []; + } + + subscribeEvent(service) { + this.eventMonitors.push(service); + } + + async taskStart() { + for (const monitor of this.eventMonitors) { + await monitor['taskStart'](); + } + } + + async taskDone() { + for (const monitor of this.eventMonitors) { + await monitor['taskDone'](); + } + } + + incorrectFormat() { + for (const monitor of this.eventMonitors) { + monitor['incorrectFormat'](); + } + } + + incorrectTestSuiteFormat() { + for (const monitor of this.eventMonitors) { + monitor.incorrectTestSuiteFormat(); + } + } +} + +export { SpecEvent, TaskEvent, SuiteEvent }; diff --git a/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/interface.js b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/interface.js new file mode 100644 index 0000000000000000000000000000000000000000..1bf43509ac3f70f1275e1da79388e1511e72a3f9 --- /dev/null +++ b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/interface.js @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2021-2024 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 Core from './core'; + +const core = Core.getInstance(); + +const describe = function (desc, func) { + return Reflect.has(core, 'describe') ? core.describe(desc, func) : (desc, func) => { }; +}; +const it = function (desc, filter, func) { + return Reflect.has(core, 'it') ? core.it(desc, filter, func) : (desc, filter, func) => { }; +}; +const beforeItSpecified = function (itDescs, func) { + return Reflect.has(core, 'beforeItSpecified') ? core.beforeItSpecified(itDescs, func) : (itDescs, func) => { }; +}; + +const afterItSpecified = function (itDescs, func) { + return Reflect.has(core, 'afterItSpecified') ? core.afterItSpecified(itDescs, func) : (itDescs, func) => { }; +}; +const beforeEach = function (func) { + return Reflect.has(core, 'beforeEach') ? core.beforeEach(func) : (func) => { }; +}; +const afterEach = function (func) { + return Reflect.has(core, 'afterEach') ? core.afterEach(func) : (func) => { }; +}; +const beforeAll = function (func) { + return Reflect.has(core, 'beforeAll') ? core.beforeAll(func) : (func) => { }; +}; +const afterAll = function (func) { + return Reflect.has(core, 'afterAll') ? core.afterAll(func) : (func) => { }; +}; +const expect = function (actualValue) { + return Reflect.has(core, 'expect') ? core.expect(actualValue) : (actualValue) => { }; +}; + +const xdescribe = function (desc, func) { + return Reflect.has(core, 'xdescribe') ? core.xdescribe(desc, func, null) : (desc, func, reason) => { }; +}; +xdescribe.reason = (reason) => { + return (desc, func) => { + return Reflect.has(core, 'xdescribe') ? core.xdescribe(desc, func, reason) : (desc, func, reason) => { }; + }; +}; +const xit = function (desc, filter, func) { + return Reflect.has(core, 'xit') ? core.xit(desc, filter, func, null) : (desc, filter, func, reason) => { }; +}; +xit.reason = (reason) => { + return (desc, filter, func) => { + return Reflect.has(core, 'xit') ? core.xit(desc, filter, func, reason) : (desc, filter, func, reason) => { }; + }; +}; + +export { + describe, it, beforeAll, beforeEach, afterEach, afterAll, expect, beforeItSpecified, afterItSpecified, xdescribe, xit +}; diff --git a/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module.json b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module.json new file mode 100644 index 0000000000000000000000000000000000000000..b0e022bd13205c4c3310480d6732db4707193b3a --- /dev/null +++ b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module.json @@ -0,0 +1,26 @@ +{ + "app": { + "bundleName": "com.ohos.myapplication", + "debug": true, + "versionCode": 1000000, + "versionName": "1.0.0", + "minAPIVersion": 40100011, + "targetAPIVersion": 40100011, + "apiReleaseType": "Beta1", + "compileSdkVersion": "4.1.0.55", + "compileSdkType": "HarmonyOS", + "bundleType": "app" + }, + "module": { + "name": "hypium", + "type": "har", + "deviceTypes": [ + "default", + "tablet", + "tv", + "wearable", + "car" + ], + "installationFree": false + } +} diff --git a/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/assert/ExpectExtend.js b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/assert/ExpectExtend.js new file mode 100644 index 0000000000000000000000000000000000000000..d10d15e6f9955c6d04610101f8766c951ee1a35d --- /dev/null +++ b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/assert/ExpectExtend.js @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2021-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 assertNull from './assertNull'; +import assertClose from './assertClose'; +import assertContain from './assertContain'; +import assertLess from './assertLess'; +import assertLarger from './assertLarger'; +import assertFail from './assertFail'; +import assertUndefined from './assertUndefined'; +import assertFalse from './assertFalse'; +import assertInstanceOf from './assertInstanceOf'; +import assertThrowError from './assertThrowError'; +import assertLargerOrEqual from './assertLargerOrEqual' +import assertLessOrEqual from './assertLessOrEqual' +import assertNaN from './assertNaN' +import assertNegUnlimited from './assertNegUnlimited' +import assertPosUnlimited from './assertPosUnlimited' +import assertDeepEquals from './deepEquals/assertDeepEquals' +import assertPromiseIsPending from './assertPromiseIsPending'; +import assertPromiseIsRejected from './assertPromiseIsRejected'; +import assertPromiseIsRejectedWith from './assertPromiseIsRejectedWith'; +import assertPromiseIsRejectedWithError from './assertPromiseIsRejectedWithError'; +import assertPromiseIsResolved from './assertPromiseIsResolved'; +import assertPromiseIsResolvedWith from './assertPromiseIsResolvedWith'; +class ExpectExtend { + constructor(attr) { + this.id = attr.id; + this.matchers = {}; + } + + extendsMatchers() { + this.matchers.assertNull = assertNull; + this.matchers.assertClose = assertClose; + this.matchers.assertContain = assertContain; + this.matchers.assertLess = assertLess; + this.matchers.assertLarger = assertLarger; + this.matchers.assertFail = assertFail; + this.matchers.assertUndefined = assertUndefined; + this.matchers.assertFalse = assertFalse; + this.matchers.assertInstanceOf = assertInstanceOf; + this.matchers.assertThrowError = assertThrowError; + this.matchers.assertLargerOrEqual = assertLargerOrEqual; + this.matchers.assertLessOrEqual = assertLessOrEqual; + this.matchers.assertNaN = assertNaN; + this.matchers.assertNegUnlimited = assertNegUnlimited; + this.matchers.assertPosUnlimited = assertPosUnlimited; + this.matchers.assertDeepEquals = assertDeepEquals; + this.matchers.assertPromiseIsPending = assertPromiseIsPending; + this.matchers.assertPromiseIsRejected = assertPromiseIsRejected; + this.matchers.assertPromiseIsRejectedWith = assertPromiseIsRejectedWith; + this.matchers.assertPromiseIsRejectedWithError = assertPromiseIsRejectedWithError; + this.matchers.assertPromiseIsResolved = assertPromiseIsResolved; + this.matchers.assertPromiseIsResolvedWith = assertPromiseIsResolvedWith; + } + + init(coreContext) { + this.coreContext = coreContext; + this.extendsMatchers(); + const expectService = this.coreContext.getDefaultService('expect'); + expectService.addMatchers(this.matchers); + } + + apis() { + return { + 'expect': function (actualValue) { + return this.coreContext.getDefaultService('expect').expect(actualValue); + } + }; + } +} + +export default ExpectExtend; diff --git a/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/assert/assertClose.js b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/assert/assertClose.js new file mode 100644 index 0000000000000000000000000000000000000000..7e692bd25f1c026640978a042a9c9f64b0e8d5d3 --- /dev/null +++ b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/assert/assertClose.js @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2021-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. + */ + +function assertClose(actualValue, expected) { + if (actualValue === null && expected[0] === null) { + throw new Error('actualValue and expected can not be both null!!!'); + } + let result; + let diff = Math.abs(expected[0] - actualValue); + let actualAbs = Math.abs(actualValue); + if ((actualAbs - 0) === 0) { + if ((diff - 0) === 0) { + result = true; + } else { + result = false; + } + } else if (diff / actualAbs < expected[1]) { + result = true; + } else { + result = false; + } + return { + pass: result, + message: '|' + actualValue + ' - ' + expected[0] + '|/' + actualValue + ' is not less than ' + expected[1] + }; +} + +export default assertClose; diff --git a/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/assert/assertContain.js b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/assert/assertContain.js new file mode 100644 index 0000000000000000000000000000000000000000..7fba0d9755503e5e926f6c1a4e425e0d1cf47570 --- /dev/null +++ b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/assert/assertContain.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2021-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. + */ + +function assertContain(actualValue, expect) { + let result = false; + if (Object.prototype.toString.call(actualValue).indexOf('Array')) { + for (let i in actualValue) { + if (actualValue[i] == expect[0]) { + result = true; + } + } + } + let type = Object.prototype.toString.call(actualValue); + if (type === '[object String]') { + result = actualValue.indexOf(expect[0]) >= 0; + } + return { + pass: result, + message: 'expect false, ' + actualValue + ' do not have ' + expect[0] + }; +} + +export default assertContain; diff --git a/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/assert/assertFail.js b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/assert/assertFail.js new file mode 100644 index 0000000000000000000000000000000000000000..8ab4ac5caef712c75c4eac49dfbbb91d33669d9a --- /dev/null +++ b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/assert/assertFail.js @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2021-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. + */ + +function assertFail() { + return { + pass: false, + message: 'fail ' + }; +} + +export default assertFail; diff --git a/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/assert/assertFalse.js b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/assert/assertFalse.js new file mode 100644 index 0000000000000000000000000000000000000000..c5008e94f4b2ce13ed35b604811793c76b542347 --- /dev/null +++ b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/assert/assertFalse.js @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2021-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. + */ + +function assertFalse(actualValue) { + return { + pass: (actualValue) === false, + message: 'expect false, actualValue is ' + actualValue + }; +} + +export default assertFalse; diff --git a/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/assert/assertInstanceOf.js b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/assert/assertInstanceOf.js new file mode 100644 index 0000000000000000000000000000000000000000..1e11b93f7251c67f5455c5007cd7be268aa53b32 --- /dev/null +++ b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/assert/assertInstanceOf.js @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2021-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. + */ + +function assertInstanceOf(actualValue, expected) { + if (Object.prototype.toString.call(actualValue) == '[object ' + expected[0] + ']') { + return { + pass: true + }; + } else { + return { + pass: false, + message: actualValue + ' is ' + Object.prototype.toString.call(actualValue) + 'not ' + expected[0] + }; + } +} + +export default assertInstanceOf; diff --git a/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/assert/assertLarger.js b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/assert/assertLarger.js new file mode 100644 index 0000000000000000000000000000000000000000..a74f4a8cedaf3add9c2dc2d3799081a83198732f --- /dev/null +++ b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/assert/assertLarger.js @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2021-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. + */ + +function assertLarger(actualValue, expected) { + return { + pass: (actualValue) > expected[0], + message: (actualValue) + ' is not larger than ' + expected[0] + }; +} + +export default assertLarger; diff --git a/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/assert/assertLargerOrEqual.js b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/assert/assertLargerOrEqual.js new file mode 100644 index 0000000000000000000000000000000000000000..e847e6c217364b7f69c173c66fb98d10efc45ef1 --- /dev/null +++ b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/assert/assertLargerOrEqual.js @@ -0,0 +1,23 @@ +/* + * 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. + */ + +function assertLargerOrEqual(actualValue, expected) { + return { + pass: (actualValue) >= expected[0], + message: (actualValue) + ' is not larger than ' + expected[0] + }; +} + +export default assertLargerOrEqual; diff --git a/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/assert/assertLess.js b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/assert/assertLess.js new file mode 100644 index 0000000000000000000000000000000000000000..17e84b0abaeb20804048a5a15c19e0603634846d --- /dev/null +++ b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/assert/assertLess.js @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2021-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. + */ + +function assertLess(actualValue, expected) { + return { + pass: (actualValue) < expected[0], + message: (actualValue) + ' is not less than ' + expected[0] + }; +} + +export default assertLess; diff --git a/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/assert/assertLessOrEqual.js b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/assert/assertLessOrEqual.js new file mode 100644 index 0000000000000000000000000000000000000000..f754f97ffa9d24e7852efe2423a1dd35d448af82 --- /dev/null +++ b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/assert/assertLessOrEqual.js @@ -0,0 +1,23 @@ +/* + * 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. + */ + +function assertLessOrEqual(actualValue, expected) { + return { + pass: (actualValue) <= expected[0], + message: (actualValue) + ' is not less than ' + expected[0] + }; +} + +export default assertLessOrEqual; diff --git a/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/assert/assertNaN.js b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/assert/assertNaN.js new file mode 100644 index 0000000000000000000000000000000000000000..8d45d6a93b86c5ed325a68b32ff014835993a58e --- /dev/null +++ b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/assert/assertNaN.js @@ -0,0 +1,23 @@ +/* + * 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. + */ + +function assertNaN(actualValue) { + return { + pass: actualValue !== actualValue, + message: 'expect NaN, actualValue is ' + actualValue + }; +} + +export default assertNaN; diff --git a/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/assert/assertNegUnlimited.js b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/assert/assertNegUnlimited.js new file mode 100644 index 0000000000000000000000000000000000000000..ceac555afc826e057970e6cfe9c73b322c672aa2 --- /dev/null +++ b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/assert/assertNegUnlimited.js @@ -0,0 +1,23 @@ +/* +* 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. +*/ + +function assertNegUnlimited(actualValue) { + return { + pass: actualValue === Number.NEGATIVE_INFINITY, + message: 'Expected actualValue not to be -Infinity. actualValue is,' + actualValue + }; +} + +export default assertNegUnlimited; diff --git a/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/assert/assertNull.js b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/assert/assertNull.js new file mode 100644 index 0000000000000000000000000000000000000000..53a7bad827323a98d3302a4e7eea679551b459c5 --- /dev/null +++ b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/assert/assertNull.js @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2021-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. + */ + +function assertNull(actualValue) { + return { + pass: (actualValue) === null, + message: 'expect null, actualValue is ' + (actualValue) + }; +} + +export default assertNull; diff --git a/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/assert/assertPosUnlimited.js b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/assert/assertPosUnlimited.js new file mode 100644 index 0000000000000000000000000000000000000000..6e68c0e2b6c499f4dc3dd56c13e9ea1073a3c54c --- /dev/null +++ b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/assert/assertPosUnlimited.js @@ -0,0 +1,23 @@ +/* +* 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. +*/ + +function assertPosUnlimited(actualValue) { + return { + pass: actualValue === Number.POSITIVE_INFINITY, + message: 'Expected actualValue is POSITIVE_INFINITY. actualValue is,' + actualValue + }; +} + +export default assertPosUnlimited; diff --git a/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/assert/assertPromiseIsPending.js b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/assert/assertPromiseIsPending.js new file mode 100644 index 0000000000000000000000000000000000000000..7e2ca2ce14d50c39554fc1157d6d4eb9329d5c39 --- /dev/null +++ b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/assert/assertPromiseIsPending.js @@ -0,0 +1,42 @@ +/* + * 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 isPromiseLike from './isPromiseLike'; + +function assertPromiseIsPending(actualPromise) { + if (!isPromiseLike(actualPromise)) { + return Promise.reject().then(function () { + }, function () { + return {pass: false, message: 'Expected not be called on a promise.'}; + }); + } + const helper = {}; + return Promise.race([actualPromise, Promise.resolve(helper)]).then( + function (got) { + return helper === got ? {pass: true, message: 'actualValue is isPending'} + : { + pass: false, + message: 'expect isPending, actualValue is resolve' + }; + }, + function () { + return { + pass: false + , message: 'expect isPending, actualValue is reject' + }; + }); +} + +export default assertPromiseIsPending; \ No newline at end of file diff --git a/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/assert/assertPromiseIsRejected.js b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/assert/assertPromiseIsRejected.js new file mode 100644 index 0000000000000000000000000000000000000000..380075a369a84d6856e7f2db366f704e04302a8d --- /dev/null +++ b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/assert/assertPromiseIsRejected.js @@ -0,0 +1,38 @@ +/* + * 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 isPromiseLike from './isPromiseLike'; + +function assertPromiseIsRejected(actualPromise) { + if (!isPromiseLike(actualPromise)) { + return Promise.reject().then(function () { + }, function () { + return {pass: false, message: 'Expected not be called on a promise.'}; + }); + } + return actualPromise.then( + function (got) { + return { + pass: false, + message: 'expect isRejected, but actualValue is resolve' + }; + }, + function () { + return {pass: true, message: 'actualValue is isRejected'}; + } + ); +} + +export default assertPromiseIsRejected; \ No newline at end of file diff --git a/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/assert/assertPromiseIsRejectedWith.js b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/assert/assertPromiseIsRejectedWith.js new file mode 100644 index 0000000000000000000000000000000000000000..8179589d5580f9c305d2200b4b197d64ac9d53ae --- /dev/null +++ b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/assert/assertPromiseIsRejectedWith.js @@ -0,0 +1,55 @@ +/* + * 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 isPromiseLike from './isPromiseLike'; + +function assertPromiseIsRejectedWith(actualPromise, expectedValue) { + + if (!isPromiseLike(actualPromise)) { + return Promise.reject().then(function () { + }, function () { + return {pass: false, message: 'Expected not be called on a promise.'}; + }); + } + + function tips(passed) { + return ('Expected a promise ' + (passed ? 'not ' : '') + + 'to be rejected with ' + JSON.stringify(expectedValue[0])); + } + + return actualPromise.then( + function (got) { + return { + pass: false, + message: tips(false) + ' but actualValue is resolve' + }; + }, + function (actualValue) { + if (JSON.stringify(actualValue) == JSON.stringify(expectedValue[0])) { + return { + pass: true, + message: 'actualValue was rejected with ' + JSON.stringify(actualValue) + '.' + }; + } else { + return { + pass: false, + message: tips(false) + ' but it was rejected with ' + JSON.stringify(actualValue) + '.' + }; + } + } + ); +} + +export default assertPromiseIsRejectedWith; \ No newline at end of file diff --git a/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/assert/assertPromiseIsRejectedWithError.js b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/assert/assertPromiseIsRejectedWithError.js new file mode 100644 index 0000000000000000000000000000000000000000..291af8e5032b7bcd9bcb3e996a39a4fa8ba23157 --- /dev/null +++ b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/assert/assertPromiseIsRejectedWithError.js @@ -0,0 +1,76 @@ +/* + * 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 isPromiseLike from './isPromiseLike'; + +function assertPromiseIsRejectedWithError(actualPromise, expectedValue) { + if (!isPromiseLike(actualPromise)) { + return Promise.reject().then(function () { + }, function () { + return {pass: false, message: 'Expected not be called on a promise.'}; + }); + } + return actualPromise.then( + function (got) { + return { + pass: false, + message: 'Expected a promise to be rejected but actualValue is resolve' + }; + }, + function (actualValue) { + return matchError(actualValue, expectedValue); + } + ); + +} + +function matchError(actualValue, expectedValue) { + if (expectedValue.length == 1 && typeof expectedValue[0] === 'function') { + if (expectedValue[0].name === actualValue.__proto__.name) { + return {pass: true, message: 'actual error type is ' + actualValue.name + '.'}; + } + return {pass: false, message: `except error type is ${expectedValue[0].name},but actual is ${actualValue.name}.`}; + } + + if (expectedValue.length == 1 && typeof expectedValue[0] === 'string') { + if (expectedValue[0] === actualValue.message) { + return {pass: true, message: `actual error message is ${actualValue.message}.`}; + } + return {pass: false, message: `except error message ${expectedValue[0]},but actual is ${actualValue.message}.`}; + } + + if (expectedValue.length == 1) { + return {pass: false, message: 'When only one parameter, it should be error type or error message.'}; + } + + if (expectedValue.length == 2 && typeof expectedValue[0] === 'function' && expectedValue[0].name === actualValue.name) { + if (typeof expectedValue[1] === 'string' && actualValue.message === expectedValue[1]) { + return {pass: true, message: 'actual error message is ' + actualValue.message + '.'}; + } + return {pass: false, message: `except error message is ${expectedValue[1]},but actual is ${actualValue.message}.`}; + } + + if (expectedValue.length == 2 && typeof expectedValue[0] === 'function' && expectedValue[0].name !== actualValue.name) { + if (typeof expectedValue[1] === 'string' && actualValue.message === expectedValue[1]) { + return {pass: false, message: `except error type is ${expectedValue[0].name},but actual is ${actualValue.name}.`}; + } + return {pass: false, message: 'except error type and message are incorrect.'}; + } + if (expectedValue.length > 2) { + return {pass: false, message: 'Up to two parameters are supported.'}; + } +} + +export default assertPromiseIsRejectedWithError; \ No newline at end of file diff --git a/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/assert/assertPromiseIsResolved.js b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/assert/assertPromiseIsResolved.js new file mode 100644 index 0000000000000000000000000000000000000000..86f559c32873f27b95d635452d760029de0ed657 --- /dev/null +++ b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/assert/assertPromiseIsResolved.js @@ -0,0 +1,40 @@ +/* + * 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 isPromiseLike from './isPromiseLike'; + +function assertPromiseIsResolved(actualPromise) { + if (!isPromiseLike(actualPromise)) { + return Promise.reject().then(function () { + }, function () { + return {pass: false, message: 'Expected not be called on a promise.'}; + }); + } + + return actualPromise.then( + function (got) { + return {pass: true, message: 'actualValue is isResolved'}; + }, + function (rej) { + return { + pass: false, + message: 'Expected a promise to be resolved but it was ' + + 'rejected with ' + JSON.stringify(rej) + '.' + }; + } + ); +} + +export default assertPromiseIsResolved; \ No newline at end of file diff --git a/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/assert/assertPromiseIsResolvedWith.js b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/assert/assertPromiseIsResolvedWith.js new file mode 100644 index 0000000000000000000000000000000000000000..c6f0ef68fde5b04a589a9fa3c6e2ab2b39acf4d3 --- /dev/null +++ b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/assert/assertPromiseIsResolvedWith.js @@ -0,0 +1,55 @@ +/* + * 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 isPromiseLike from './isPromiseLike'; + +function assertPromiseIsResolvedWith(actualPromise, expectedValue) { + if (!isPromiseLike(actualPromise)) { + return Promise.reject().then(function () { + }, function () { + return {pass: false, message: 'Expected not be called on a promise.'}; + }); + } + + function tips(passed) { + return ( + 'Expected a promise ' + (passed ? 'not ' : '') + + 'to be resolved with ' + JSON.stringify(expectedValue[0])); + } + + return actualPromise.then( + function (got) { + if (JSON.stringify(got) == JSON.stringify(expectedValue[0])) { + return { + pass: true, + message: 'actualValue was resolved with ' + JSON.stringify(got) + '.' + }; + } + return { + pass: false, + message: tips(false) + ' but it was resolved with ' + + JSON.stringify(got) + '.' + }; + }, + function (rej) { + return { + pass: false, + message: tips(false) + ' but it was rejected with ' + JSON.stringify(rej) + '.' + }; + } + ); +} + +export default assertPromiseIsResolvedWith; \ No newline at end of file diff --git a/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/assert/assertThrowError.js b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/assert/assertThrowError.js new file mode 100644 index 0000000000000000000000000000000000000000..c4544a7f825bcecd1a07d5e98dd9a7b99d237278 --- /dev/null +++ b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/assert/assertThrowError.js @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2021-2024 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. + */ + +function assertThrowError(actualValue, expected) { + let result = false; + let message = ''; + let err; + if (typeof actualValue !== 'function') { + throw new Error('actualValue is not a function'); + } + try { + actualValue(); + return { + pass: result, + message: ' An error is not thrown while it is expected!' + }; + } catch (e) { + err = e; + } + if (err instanceof Error) { + let type = typeof expected[0]; + if (type === 'function') { + result = err.constructor.name === expected[0].name; + message = 'expected throw failed , ' + err.constructor.name + ' is not ' + expected[0].name; + }else if(type === 'string'){ + result = err.message.includes(expected[0]); + message = 'expected throw failed , ' + err.message + ' is not ' + expected[0]; + } + } + return { + pass: result, + message: message + }; +} + +export default assertThrowError; diff --git a/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/assert/assertUndefined.js b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/assert/assertUndefined.js new file mode 100644 index 0000000000000000000000000000000000000000..61f092d715dd1630297518b59ff13ef0940991e1 --- /dev/null +++ b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/assert/assertUndefined.js @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2021-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. + */ + +function assertUndefined(actualValue) { + return { + pass: undefined === (actualValue), + message: 'expect Undefined, actualValue is ' + (actualValue) + }; +} + +export default assertUndefined; diff --git a/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/assert/deepEquals/DeepTypeUtils.js b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/assert/deepEquals/DeepTypeUtils.js new file mode 100644 index 0000000000000000000000000000000000000000..916824d9cb77a75d1fb35bc3500d7598bfc73e80 --- /dev/null +++ b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/assert/deepEquals/DeepTypeUtils.js @@ -0,0 +1,139 @@ +/* + * Copyright (c) 2022-2024 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. + */ + +class DeepTypeUtils { + static getType(value) { + return Object.prototype.toString.apply(value); + } + static isA(typeName, value) { + return this.getType(value) === '[object ' + typeName + ']'; + } + static isAsymmetricEqualityTester(obj) { + return obj ? this.isA('Function', obj.asymmetricMatch) : false; + } + + /** + * 是否是function + * @param value + */ + static isFunction(value) { + return this.isA('Function', value); + } + + /** + * 是否是undefined + * @param obj + */ + static isUndefined(obj) { + return obj === void 0; + } + + /** + * 是否是Node + * @param obj + */ + static isDomNode(obj) { + return obj !== null && + typeof obj === 'object' && + typeof obj.nodeType === 'number' && + typeof obj.nodeName === 'string'; + } + + /** + * 是否是promise对象 + * @param obj + */ + static isPromise(obj) { + return !!obj && obj.constructor === Promise; + }; + /** + * 是否是map对象 + * @param obj + */ + static isMap(obj) { + return ( + obj !== null && + typeof obj !== 'undefined' && + obj.constructor === Map + ); + } + + /** + * 是否是set对象 + * @param obj 对象 + */ + static isSet(obj) { + return ( + obj !== null && + typeof obj !== 'undefined' && + obj.constructor === Set + ); + } + + /** + * 对象是否有key属性 + * @param obj 对象 + * @param key 对象属性名称 + */ + static has(obj, key) { + return Object.prototype.hasOwnProperty.call(obj, key); + } + + /** + * 获取对象的自有属性 + * @param obj 对象 + * @param isArray 是否是数组,[object Array] + */ + static keys(obj, isArray) { + const extraKeys = []; + // 获取对象所有属性 + const allKeys = this.getAllKeys(obj); + if (!isArray) { + return allKeys; + } + if (allKeys.length === 0) { + return allKeys; + } + for (const k of allKeys) { + if (typeof k === 'symbol' || !/^[0-9]+$/.test(k)) { + extraKeys.push(k); + } + } + return extraKeys; + } + + /** + * 获取obj对象的所有属性 + * @param obj obj对象 + */ + static getAllKeys(obj) { + const keys = []; + for (let key in obj) { + if (this.has(obj, key)) { + keys.push(key); + } + } + const symbols = Object.getOwnPropertySymbols(obj); + for (const sym of symbols) { + // obj.propertyIsEnumerable(sym) + if (Object.prototype.propertyIsEnumerable.call(obj, sym)) { + keys.push(sym); + } + } + return keys; + } + +} +export default DeepTypeUtils; \ No newline at end of file diff --git a/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/assert/deepEquals/assertDeepEquals.js b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/assert/deepEquals/assertDeepEquals.js new file mode 100644 index 0000000000000000000000000000000000000000..60de33f7e1afdcfaf205c8c56484ef33dfda8160 --- /dev/null +++ b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/assert/deepEquals/assertDeepEquals.js @@ -0,0 +1,341 @@ +/* + * Copyright (c) 2022-2024 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 DeepTypeUtils from './DeepTypeUtils'; +function assertDeepEquals(actualValue, expected) { + let result = eq(actualValue, expected[0]) + let msg = logMsg(actualValue, expected[0]); + return { + pass: result, + message: msg + }; +} + +/** + * 获取失败显示日志 + * @param actualValue 实际对象 + * @param expected 期待比较对象 + */ +function logMsg(actualValue, expected) { + // 获取a的对象名称 + const aClassName = Object.prototype.toString.call(actualValue); + const bClassName = Object.prototype.toString.call(expected); + let actualMsg; + let expectMsg; + if (aClassName == '[object Function]') { + actualMsg = 'actualValue Function'; + } else if (aClassName == '[object Promise]') { + actualMsg = 'actualValue Promise'; + } else if (aClassName == '[object Set]' || aClassName == '[object Map]') { + actualMsg = JSON.stringify(Array.from(actualValue)); + } else if (aClassName == '[object RegExp]') { + actualMsg = JSON.stringify(actualValue.source.replace('\\','')); + } else if (aClassName == '[object BigInt]') { + actualMsg = actualValue; + } else if (aClassName == '[object Error]') { + actualMsg = actualValue.message; + } else if (aClassName == '[object ArrayBuffer]') { + actualMsg = actualValue.byteLength; + } + else { + actualMsg = JSON.stringify(actualValue); + } + if (bClassName == '[object Function]') { + expectMsg = 'expected Function'; + } else if (bClassName == '[object Promise]') { + expectMsg = 'expected Promise'; + } else if (bClassName == '[object Set]' || bClassName == '[object Map]') { + expectMsg = JSON.stringify(Array.from(expected)); + } else if (bClassName == '[object RegExp]') { + expectMsg = JSON.stringify(expected.source.replace('\\','')); + } else if (bClassName == '[object BigInt]') { + expectMsg = expected; + } else if (bClassName == '[object Error]') { + expectMsg = expected.message; + } else if (bClassName == '[object ArrayBuffer]') { + expectMsg = expected.byteLength; + } + else { + expectMsg = JSON.stringify(expected); + } + return actualMsg + ' is not deep equal ' + expectMsg; +} + +function eq(a, b) { + let result = true; + + if (a === b) { + result = a !== 0 || 1 / a === 1 / b; + return result; + } + + if (a === null || b === null) { + result = a === b; + return result; + } + // 获取a的对象名称 + const aClassName = Object.prototype.toString.call(a); + const bClassName = Object.prototype.toString.call(b); + // 不同类型不同对象 + if (aClassName !== bClassName) { + return false; + } + if (aClassName === '[object String]' || aClassName === '[object Number]' || aClassName === '[object Date]' || + aClassName === '[object Boolean]' || aClassName === '[object ArrayBuffer]' || + aClassName === '[object RegExp]' || aClassName === '[object Error]') { + result = isEqualSampleObj(a, b); + return result; + } + + if (typeof a !== 'object' || typeof b !== 'object') { + return false; + } + + if (DeepTypeUtils.isDomNode(a) || DeepTypeUtils.isPromise(a) || DeepTypeUtils.isFunction(a)) { + result = isEqualNodeOrPromiseOrFunction(a, b); + return result; + } + + if (aClassName === '[object Array]' || aClassName === '[object Map]' || aClassName === '[object Set]') { + result = isEqualCollection(a, b); + return result; + } + + result = isEqualObj(a, b); + return result; +} + +function isEqualNodeOrPromiseOrFunction(a, b) { + let equalNodeOrPromiseOrFunction = true; + if (DeepTypeUtils.isDomNode(a) && DeepTypeUtils.isDomNode(b)) { + const aIsDomNode = DeepTypeUtils.isDomNode(a); + const bIsDomNode = DeepTypeUtils.isDomNode(b); + if (aIsDomNode && bIsDomNode) { + // At first try to use DOM3 method isEqualNode + equalNodeOrPromiseOrFunction = a.isEqualNode(b); + return equalNodeOrPromiseOrFunction; + } + if (aIsDomNode || bIsDomNode) { + equalNodeOrPromiseOrFunction = false; + return false; + } + } + + if (DeepTypeUtils.isPromise(a) && DeepTypeUtils.isPromise(b)) { + const aIsPromise = DeepTypeUtils.isPromise(a); + const bIsPromise = DeepTypeUtils.isPromise(b); + // 俩个Promise对象 + if (aIsPromise && bIsPromise) { + equalNodeOrPromiseOrFunction = a === b; + return a === b; + } + } + if (DeepTypeUtils.isFunction(a) && DeepTypeUtils.isFunction(b)) { + // 俩个函数对象 + const aCtor = a.constructor, + bCtor = b.constructor; + if ( + aCtor !== bCtor && + DeepTypeUtils.isFunction(aCtor) && + DeepTypeUtils.isFunction(bCtor) && + a instanceof aCtor && + b instanceof bCtor && + !(aCtor instanceof aCtor && bCtor instanceof bCtor) + ) { + equalNodeOrPromiseOrFunction = false; + return false; + } + } + return equalNodeOrPromiseOrFunction; +} + +function isEqualCollection(a, b) { + let equalCollection = true; + // 获取a的对象名称 + const aClassName = Object.prototype.toString.call(a); + const bClassName = Object.prototype.toString.call(b); + // 都是数组 + if (aClassName === '[object Array]') { + equalCollection = isEqualArray(a, b); + return equalCollection; + } + + // 都是Map + if (DeepTypeUtils.isMap(a) && DeepTypeUtils.isMap(b)) { + equalCollection = isEqualMap(a, b); + return equalCollection; + } + + // 都是Set + if (DeepTypeUtils.isSet(a) && DeepTypeUtils.isSet(b)) { + equalCollection = isEqualSet(a, b); + return equalCollection; + } + + return true; +} + +function isEqualSampleObj(a, b) { + let equalSampleObj = true; + const aClassName = Object.prototype.toString.call(a); + const bClassName = Object.prototype.toString.call(b); + // 俩个string对象 + if (aClassName === '[object String]') { + equalSampleObj = a === String(b); + return equalSampleObj; + } + // 俩个Number对象 + if (aClassName === '[object Number]') { + equalSampleObj = a !== +a ? b !== +b : a === 0 && b === 0 ? 1 / a === 1 / b : a === +b; + return equalSampleObj; + } + + // 俩个Date对象/ boolean对象 + if (aClassName === '[object Date]' || aClassName === '[object Boolean]') { + equalSampleObj = +a === +b; + return equalSampleObj; + } + + // 俩个ArrayBuffer + if (aClassName === '[object ArrayBuffer]') { + equalSampleObj = eq(new Uint8Array(a), new Uint8Array(b)); + return equalSampleObj; + } + + // 正则表达式 + if (aClassName === '[object RegExp]') { + return ( + a.source === b.source && + a.global === b.global && + a.multiline === b.multiline && + a.ignoreCase === b.ignoreCase + ); + } + + if (a instanceof Error && b instanceof Error) { + equalSampleObj = a.message === b.message; + return equalSampleObj; + } + + return equalSampleObj; +} + +function isEqualObj(a, b) { + let equalObj = true; + const aClassName = Object.prototype.toString.call(a); + const bClassName = Object.prototype.toString.call(b); + const aKeys = DeepTypeUtils.keys(a, aClassName === '[object Array]'); + let size = aKeys.length; + + // 俩个对象属性长度不一致, 俩对象不相同 + if (DeepTypeUtils.keys(b, bClassName === '[object Array]').length !== size) { + return false; + } + + // 俩对象属性数量相同, 递归比较每个属性值得值 + for (const key of aKeys) { + // b 没有 key 属性 + if (!DeepTypeUtils.has(b, key)) { + equalObj = false; + continue; + } + if (!eq(a[key], b[key])) { + equalObj = false; + } + } + return equalObj; +} + +function isEqualArray(a, b) { + let equalArray = true; + const aLength = a.length; + const bLength = b.length; + if (aLength !== bLength) { + // 数组长度不同,不是同一个对象 + return false; + } + for (let i = 0; i < aLength || i < bLength; i++) { + // 递归每一个元素是否相同 + equalArray = eq(i < aLength ? a[i] : void 0, i < bLength ? b[i] : void 0) && equalArray; + } + return equalArray; +} + +function isEqualMap(a, b) { + let equalMap = true; + if (a.size !== b.size) { + return false; + } + const keysA = []; + const keysB = []; + a.forEach(function(valueA, keyA) { + keysA.push(keyA); + }); + b.forEach(function(valueB, keyB) { + keysB.push(keyB); + }); + const mapKeys = [keysA, keysB]; + const cmpKeys = [keysB, keysA]; + for (let i = 0; equalMap && i < mapKeys.length; i++) { + const mapIter = mapKeys[i]; + const cmpIter = cmpKeys[i]; + + for (let j = 0; equalMap && j < mapIter.length; j++) { + const mapKey = mapIter[j]; + const cmpKey = cmpIter[j]; + const mapValueA = a.get(mapKey); + let mapValueB; + if (eq(mapKey, cmpKey)) { + mapValueB = b.get(cmpKey); + } else { + mapValueB = b.get(mapKey); + } + equalMap = eq(mapValueA, mapValueB); + } + } + return equalMap; +} + +function isEqualSet(a, b) { + let equalSet = true; + if (a.size !== b.size) { + return false; + } + const valuesA = []; + a.forEach(function(valueA) { + valuesA.push(valueA); + }); + const valuesB = []; + b.forEach(function(valueB) { + valuesB.push(valueB); + }); + const setPairs = [[valuesA, valuesB], [valuesB, valuesA]]; + for (let i = 0; equalSet && i < setPairs.length; i++) { + const baseValues = setPairs[i][0]; + const otherValues = setPairs[i][1]; + for (const baseValue of baseValues) { + let found = false; + for (let j = 0; !found && j < otherValues.length; j++) { + const otherValue = otherValues[j]; + // 深度比较对象 + found = eq(baseValue, otherValue); + } + equalSet = equalSet && found; + } + } + return equalSet; +} + +export default assertDeepEquals; diff --git a/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/assert/isPromiseLike.js b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/assert/isPromiseLike.js new file mode 100644 index 0000000000000000000000000000000000000000..015ab19a2a0c4872d7cb490b61f8e1dd6a8ac90b --- /dev/null +++ b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/assert/isPromiseLike.js @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2021-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. + */ + +function isPromiseLike(obj) { + return !!obj && isFunction_(obj.then); +} + +function isFunction_(value) { + return isA_('Function', value); +} + +function isA_(typeName, value) { + return getType_(value) === '[object ' + typeName + ']'; +} + +function getType_(value) { + return Object.prototype.toString.apply(value); +} + +export default isPromiseLike; diff --git a/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/config/DataDriver.js b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/config/DataDriver.js new file mode 100644 index 0000000000000000000000000000000000000000..639dffc9cdb912f1f33a6ccb61868c9ed7c695bf --- /dev/null +++ b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/config/DataDriver.js @@ -0,0 +1,116 @@ +/* + * Copyright (c) 2021-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. + */ + +const SUITES_KEY = 'suites'; +const SPECS_KEY = 'items'; +const DESCRIBE_KEY = 'describe'; +const IT_KEY = 'it'; +const PARAMS_KEY = 'params'; +const STRESS_KEY = 'stress'; + +class ObjectUtils { + static get(object, name, defaultValue) { + let result = defaultValue; + for (const key in object) { + if (key === name) { + return object[key]; + } + } + return result; + } + + static has(object, key) { + return Object.prototype.hasOwnProperty.call(object, key); + } +} + +class DataDriver { + constructor(attr) { + this.id = 'dataDriver'; + this.data = attr.data || {}; + } + + init(coreContext) { + this.coreContext = coreContext; + this.suiteService = this.coreContext.getDefaultService('suite'); + this.specService = this.coreContext.getDefaultService('spec'); + } + + getSpecParams() { + let specParams = []; + let suiteDesc = this.suiteService.getCurrentRunningSuite().description; + let specDesc = this.specService.getCurrentRunningSpec().description; + let suites = ObjectUtils.get(this.data, SUITES_KEY, []); + for (const suiteItem of suites) { + let describeValue = ObjectUtils.get(suiteItem, DESCRIBE_KEY, ''); + if (ObjectUtils.has(suiteItem, DESCRIBE_KEY) && (typeof describeValue === 'object') && describeValue.constructor === Array && describeValue.includes(suiteDesc)) { + let specs = ObjectUtils.get(suiteItem, SPECS_KEY, []); + for (const specItem of specs) { + if (ObjectUtils.has(specItem, IT_KEY) && ObjectUtils.get(specItem, IT_KEY) === specDesc) { + return ObjectUtils.get(specItem, PARAMS_KEY, specParams); + } + } + } + } + return specParams; + } + + getSuiteParams() { + let suiteParams = {}; + let suiteDesc = this.suiteService.getCurrentRunningSuite().description; + let suites = ObjectUtils.get(this.data, SUITES_KEY, []); + for (const suiteItem of suites) { + let describeValue = ObjectUtils.get(suiteItem, DESCRIBE_KEY, []); + if (ObjectUtils.has(suiteItem, DESCRIBE_KEY) && (typeof describeValue === 'object') && describeValue.constructor === Array && describeValue.includes(suiteDesc)) { + suiteParams = Object.assign({}, suiteParams, ObjectUtils.get(suiteItem, PARAMS_KEY, suiteParams)); + } + } + return suiteParams; + } + + getSpecStress(specDesc) { + let stress = 1; + let suiteDesc = this.suiteService.getCurrentRunningSuite().description; + let suites = ObjectUtils.get(this.data, SUITES_KEY, []); + for (const suiteItem of suites) { + let describeValue = ObjectUtils.get(suiteItem, DESCRIBE_KEY, ''); + if (ObjectUtils.has(suiteItem, DESCRIBE_KEY) && (typeof describeValue === 'object') && describeValue.constructor === Array && describeValue.includes(suiteDesc)) { + let specs = ObjectUtils.get(suiteItem, SPECS_KEY, []); + for (const specItem of specs) { + if (ObjectUtils.has(specItem, IT_KEY) && ObjectUtils.get(specItem, IT_KEY) === specDesc) { + let tempStress = ObjectUtils.get(specItem, STRESS_KEY, stress); + return (Number.isInteger(tempStress) && tempStress >= 1) ? tempStress : stress; + } + } + } + } + return stress; + } + + getSuiteStress(suiteDesc) { + let stress = 1; + let suites = ObjectUtils.get(this.data, SUITES_KEY, []); + for (const suiteItem of suites) { + let describeValue = ObjectUtils.get(suiteItem, DESCRIBE_KEY, []); + if (ObjectUtils.has(suiteItem, DESCRIBE_KEY) && (typeof describeValue === 'object') && describeValue.constructor === Array && describeValue.includes(suiteDesc)) { + let tempStress = ObjectUtils.get(suiteItem, STRESS_KEY, stress); + return (Number.isInteger(tempStress) && tempStress >= 1) ? tempStress : stress; + } + } + return stress; + } +} + +export default DataDriver; diff --git a/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/config/Filter.js b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/config/Filter.js new file mode 100644 index 0000000000000000000000000000000000000000..b07e6c681bfff618cc9f5ca92ec85d1d9880202d --- /dev/null +++ b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/config/Filter.js @@ -0,0 +1,143 @@ +/* + * Copyright (c) 2021-2024 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 { LEVEL, SIZE, TESTTYPE } from '../../Constant'; + +class ClassFilter { + constructor(suiteName, itName, params) { + this.suiteName = suiteName; + this.itName = itName; + this.params = params; + } + + filterSuite() { + return !this.params.split(',').map(item => item.split('#')[0]).map(item => item == this.suiteName).reduce((pre, cur) => pre || cur, false); + } + + filterIt() { + let classArray = this.params.split(',') || []; + let suiteFilterResult = classArray.filter(item => !item.includes('#')).map(item => item == this.suiteName).reduce((pre, cur) => pre || cur, false); + let itFilterResult = classArray.filter(item => item.includes('#')).map(item => item == (this.suiteName + '#' + this.itName)).reduce((pre, cur) => pre || cur, false); + return !(suiteFilterResult || itFilterResult); + } +} + +class NotClassFilter { + constructor(suiteName, itName, params) { + this.suiteName = suiteName; + this.itName = itName; + this.params = params; + } + + filterSuite() { + return this.params.split(',').map(item => item == this.suiteName).reduce((pre, cur) => pre || cur, false); + } + + filterIt() { + return this.params.split(',').some(item => item == (this.suiteName + '#' + this.itName)); + } +} + +class SuiteAndItNameFilter { + constructor(suiteName, itName, params) { + this.suiteName = suiteName; + this.itName = itName; + this.params = params; + } + + filterSuite() { + return !this.params.split(',').map(item => item == this.suiteName).reduce((pre, cur) => pre || cur, false); + } + + filterIt() { + return !this.params.split(',').map(item => item == this.itName).reduce((pre, cur) => pre || cur, false); + } +} + + +class TestTypesFilter { + constructor(suiteName, itName, fi, params) { + this.suiteName = suiteName; + this.itName = itName; + this.params = params; + this.fi = fi; + } + + filterIt() { + return !((this.params === (this.fi & this.params)) || this.fi === 0); + } +} + +class NestFilter { + filterNestName(targetSuiteArray, targetSpecArray, suiteStack, desc) { + let targetSuiteName = ''; + for (let key in suiteStack) { + targetSuiteName = targetSuiteName + '.' + suiteStack[key].description; + } + targetSuiteName = targetSuiteName.substring(2); + const targetSpecName = targetSuiteName + '#' + desc; + let isFilter = true; + if (targetSpecArray.includes(targetSpecName)) { + return false; + } + for (let index in targetSuiteArray) { + if (targetSuiteName.startsWith(targetSuiteArray[index])) { + return false; + } + } + return isFilter; + } + + filterNotClass(notClass, suiteStack, desc) { + let isFilterNotClass = false; + if (notClass != null) { + let notClassArray = notClass.split(','); + let targetSuiteName = ''; + for (let key in suiteStack) { + targetSuiteName = targetSuiteName + '.' + suiteStack[key].description; + } + targetSuiteName = targetSuiteName.substring(2); + const targetSpecName = targetSuiteName + '#' + desc; + if (notClassArray.includes(targetSpecName) || notClassArray.some(key => targetSpecName.startsWith(key))) { + isFilterNotClass = true; + } + } + return isFilterNotClass; + } + + filterLevelOrSizeOrTestType(level, size, testType, filter) { + let result = false; + if (filter === 0 || filter === '0') { + return result; + } + if (level == null && size == null && testType == null) { + return result; + } + if (level != null) { + let levelFilter = LEVEL[`${level}`]; + result = result || filter === levelFilter; + } + if (size != null) { + let sizeFilter = SIZE[`${size}`]; + result = result || filter === sizeFilter; + } + if (testType != null) { + let testTypeFilter = TESTTYPE[`${testType}`]; + result = result || filter === testTypeFilter; + } + return !result; + } +} +export { ClassFilter, NotClassFilter, SuiteAndItNameFilter, TestTypesFilter, NestFilter }; diff --git a/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/config/configService.js b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/config/configService.js new file mode 100644 index 0000000000000000000000000000000000000000..17674d8cf7e2343bcb4a14ad47eb11cd03c15aac --- /dev/null +++ b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/config/configService.js @@ -0,0 +1,299 @@ +/* + * Copyright (c) 2021-2024 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 { ClassFilter, NotClassFilter, SuiteAndItNameFilter, TestTypesFilter, NestFilter } from './Filter'; +import { TAG, TESTTYPE, LEVEL, SIZE, KEYSET } from '../../Constant'; +const STRESS_RULE = /^[1-9]\d*$/; + +class ConfigService { + constructor(attr) { + this.id = attr.id; + this.supportAsync = true; // 默认异步处理测试用例 + this.random = false; + this.filterValid = []; + this.filter = 0; + this.flag = false; + this.suite = null; + this.itName = null; + this.testType = null; + this.level = null; + this.size = null; + this.class = null; + this.notClass = null; + this.timeout = null; + // 遇错即停模式配置 + this.breakOnError = false; + // 压力测试配置 + this.stress = null; + this.skipMessage = false; + this.runSkipped = ''; + this.filterXdescribe = []; + } + + init(coreContext) { + this.coreContext = coreContext; + } + + isNormalInteger(str) { + const n = Math.floor(Number(str)); + return n !== Infinity && String(n) === String(str) && n >= 0; + } + + + getStress() { + if (this.stress === undefined || this.stress === '' || this.stress === null) { + return 1; + } + return !this.stress.match(STRESS_RULE) ? 1 : Number.parseInt(this.stress); + } + + basicParamValidCheck(params) { + let size = params.size; + if (size !== undefined && size !== '' && size !== null) { + let sizeArray = ['small', 'medium', 'large']; + if (sizeArray.indexOf(size) === -1) { + this.filterValid.push('size:' + size); + } + } + let level = params.level; + if (level !== undefined && level !== '' && level !== null) { + let levelArray = ['0', '1', '2', '3', '4']; + if (levelArray.indexOf(level) === -1) { + this.filterValid.push('level:' + level); + } + } + let testType = params.testType; + if (testType !== undefined && testType !== '' && testType !== null) { + let testTypeArray = ['function', 'performance', 'power', 'reliability', 'security', + 'global', 'compatibility', 'user', 'standard', 'safety', 'resilience']; + if (testTypeArray.indexOf(testType) === -1) { + this.filterValid.push('testType:' + testType); + } + } + } + + filterParamValidCheck(params) { + let timeout = params.timeout; + if (timeout !== undefined && timeout !== '' && timeout !== null) { + if (!this.isNormalInteger(timeout)) { + this.filterValid.push('timeout:' + timeout); + } + } + + let paramKeys = ['dryRun', 'random', 'breakOnError', 'coverage', 'skipMessage']; + for (const key of paramKeys) { + if (params[key] !== undefined && params[key] !== 'true' && params[key] !== 'false') { + this.filterValid.push(`${key}:${params[key]}`); + } + } + + // 压力测试参数验证,正整数 + if (params.stress !== undefined && params.stress !== '' && params.stress !== null) { + if (!params.stress.match(STRESS_RULE)) { + this.filterValid.push('stress:' + params.stress); + } + } + + let nameRule = /^[A-Za-z]{1}[\w#,.]*$/; + let paramClassKeys = ['class', 'notClass']; + for (const key of paramClassKeys) { + if (params[key] !== undefined && params[key] !== '' && params[key] !== null) { + let classArray = params[key].split(','); + classArray.forEach(item => !item.match(nameRule) ? this.filterValid.push(`${key}:${params[key]}`) : null); + } + } + } + + setConfig(params) { + this.basicParamValidCheck(params); + this.filterParamValidCheck(params); + try { + this.class = params.class; + this.notClass = params.notClass; + this.flag = params.flag || { flag: false }; + this.suite = params.suite; + this.itName = params.itName; + this.filter = params.filter; + this.testType = params.testType; + this.level = params.level; + this.size = params.size; + this.timeout = params.timeout; + this.dryRun = params.dryRun; + this.breakOnError = params.breakOnError; + this.random = params.random === 'true' ? true : false; + this.stress = params.stress; + this.coverage = params.coverage; + this.skipMessage = params.skipMessage; + this.runSkipped = params.runSkipped; + this.filterParam = { + testType: TESTTYPE, + level: LEVEL, + size: SIZE + }; + this.parseParams(); + } catch (err) { + console.info(`${TAG}setConfig error: ${err.message}`); + } + } + + parseParams() { + if (this.filter != null) { + return; + } + let testTypeFilter = 0; + let sizeFilter = 0; + let levelFilter = 0; + if (this.testType != null) { + testTypeFilter = this.testType.split(',') + .map(item => this.filterParam.testType[item] || 0) + .reduce((pre, cur) => pre | cur, 0); + } + if (this.level != null) { + levelFilter = this.level.split(',') + .map(item => this.filterParam.level[item] || 0) + .reduce((pre, cur) => pre | cur, 0); + } + if (this.size != null) { + sizeFilter = this.size.split(',') + .map(item => this.filterParam.size[item] || 0) + .reduce((pre, cur) => pre | cur, 0); + } + this.filter = testTypeFilter | sizeFilter | levelFilter; + console.info(`${TAG}filter params:${this.filter}`); + } + + isCurrentSuite(description) { + if (this.suite !== undefined && this.suite !== '' && this.suite !== null) { + let suiteArray = this.suite.split(','); + return suiteArray.indexOf(description) !== -1; + } + return false; + } + + filterSuite(currentSuiteName) { + let filterArray = []; + if (this.suite !== undefined && this.suite !== '' && this.suite !== null) { + filterArray.push(new SuiteAndItNameFilter(currentSuiteName, '', this.suite)); + } + if (this.class !== undefined && this.class !== '' && this.class !== null) { + filterArray.push(new ClassFilter(currentSuiteName, '', this.class)); + } + if (this.notClass !== undefined && this.notClass !== '' && this.notClass !== null) { + filterArray.push(new NotClassFilter(currentSuiteName, '', this.notClass)); + } + + let result = filterArray.map(item => item.filterSuite()).reduce((pre, cur) => pre || cur, false); + return result; + } + + filterDesc(currentSuiteName, desc, fi, coreContext) { + let filterArray = []; + if (this.itName !== undefined && this.itName !== '' && this.itName !== null) { + filterArray.push(new SuiteAndItNameFilter(currentSuiteName, desc, this.itName)); + } + if (this.class !== undefined && this.class !== '' && this.class !== null) { + filterArray.push(new ClassFilter(currentSuiteName, desc, this.class)); + } + if (this.notClass !== undefined && this.notClass !== '' && this.notClass !== null) { + filterArray.push(new NotClassFilter(currentSuiteName, desc, this.notClass)); + } + if (typeof (this.filter) !== 'undefined' && this.filter !== 0 && fi !== 0) { + filterArray.push(new TestTypesFilter('', '', fi, this.filter)); + } + let result = filterArray.map(item => item.filterIt()).reduce((pre, cur) => pre || cur, false); + return result; + } + + filterWithNest(desc, filter) { + let filterArray = []; + const nestFilter = new NestFilter(); + const targetSuiteArray = this.coreContext.getDefaultService('suite').targetSuiteArray; + const targetSpecArray = this.coreContext.getDefaultService('suite').targetSpecArray; + const suiteStack = this.coreContext.getDefaultService('suite').suitesStack; + let isFilter = nestFilter.filterNestName(targetSuiteArray, targetSpecArray, suiteStack, desc); + const isFullRun = this.coreContext.getDefaultService('suite').fullRun; + if (typeof (this.filter) !== 'undefined' && this.filter !== 0 && filter !== 0) { + filterArray.push(new TestTypesFilter('', '', filter, this.filter)); + return filterArray.map(item => item.filterIt()).reduce((pre, cur) => pre || cur, false); + } + if (isFilter && !isFullRun) { + return true; + } + return nestFilter.filterNotClass(this.notClass, suiteStack, desc); + + } + + isRandom() { + return this.random || false; + } + + isBreakOnError() { + return this.breakOnError !== 'true' ? false : true; + } + + setSupportAsync(value) { + this.supportAsync = value; + } + + isSupportAsync() { + return this.supportAsync; + } + + translateParams(parameters) { + const keySet = new Set(KEYSET); + let targetParams = {}; + for (const key in parameters) { + if (keySet.has(key)) { + var newKey = key.replace('-s ', ''); + targetParams[newKey] = parameters[key]; + } + } + return targetParams; + } + translateParamsToString(parameters) { + const keySet = new Set(KEYSET); + let targetParams = ''; + for (const key in parameters) { + if (keySet.has(key)) { + targetParams += ' ' + key + ' ' + parameters[key]; + } + } + return targetParams.trim(); + } + + execute() { + } + + checkIfSuiteInSkipRun(desc) { + return this.runSkipped.split(',').some(item => { + return item === desc || item.startsWith(desc + '.') || item.startsWith(desc + '#') || desc.startsWith(item + '.') || this.runSkipped === 'skipped'; + }); + } + + checkIfSpecInSkipRun(desc) { + return this.runSkipped.split(',').some(item => { + if (item.includes('#')) { + return item === desc; + } else { + return desc.startsWith(item + '.') || desc.startsWith(item + '#') || this.runSkipped === 'skipped'; + } + } + ); + } +} + +export { + ConfigService +}; diff --git a/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/coverage/coverageCollect.js b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/coverage/coverageCollect.js new file mode 100644 index 0000000000000000000000000000000000000000..334a33db9561dd2070c4081457632decf2589b83 --- /dev/null +++ b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/coverage/coverageCollect.js @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2023 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 SysTestKit from '../kit/SysTestKit'; +import fs from '@ohos.file.fs'; +import {TAG} from '../../Constant'; + +const jsCoverageFileName = 'js_coverage.json'; + +export async function collectCoverageData() { + if (globalThis.__coverage__ === undefined) { + console.info(`${TAG} globalThis not have coverage`); + return; + } + const strJson = JSON.stringify(globalThis.__coverage__); + let testMode = globalThis.__testMode__; + console.info(`${TAG} coverage data testMode: ${testMode}`); + let savePath = globalThis.__savePath__; + console.info(`${TAG} write coverage data to: ${savePath}`); + let readPath = globalThis.__readPath__; + console.info(`${TAG} read coverage data in: ${readPath}`); + + // run callback mode if local test or (save path and read path ) is not defined + if (!testMode || !isCoveragePathValid(savePath)) { + console.info(`${TAG} run coverage data in call back mode`); + const strLen = strJson.length; + const maxLen = 500; + const maxCount = Math.floor(strLen / maxLen); + const OHOS_REPORT_COVERAGE_DATA = 'OHOS_REPORT_COVERAGE_DATA:'; + for (let count = 0; count <= maxCount; count++) { + console.info(`${OHOS_REPORT_COVERAGE_DATA} ${strJson.substring(count * maxLen, (count + 1) * maxLen)}`); + await SysTestKit.print(`${OHOS_REPORT_COVERAGE_DATA} ${strJson.substring(count * maxLen, (count + 1) * maxLen)}`); + } + return; + } + console.info(`${TAG} run coverage data in save file mode`); + if (fs.accessSync(savePath)) { + fs.unlinkSync(savePath); + } + + let inputPathDir = savePath.substring(0, savePath.length - jsCoverageFileName.length); + if (!fs.accessSync(inputPathDir)) { + console.info(`${TAG} coverage data create dir: ${inputPathDir}`); + fs.mkdirSync(inputPathDir); + } + + let file = fs.openSync(savePath, fs.OpenMode.READ_WRITE | fs.OpenMode.CREATE); + let writeLen = fs.writeSync(file.fd, strJson, {encoding:'utf-8'}); + console.info(`${TAG} write coverage data success: ${writeLen}`); + fs.closeSync(file); + const OHOS_REPORT_COVERAGE_PATH = 'OHOS_REPORT_COVERAGE_PATH:'; + await SysTestKit.print(`${OHOS_REPORT_COVERAGE_PATH} ${readPath}`); + console.info(`${OHOS_REPORT_COVERAGE_PATH} ${readPath}`); +} + +function isCoveragePathValid(inputPath) { + if (!inputPath) { + return false; + } + if (inputPath.indexOf(jsCoverageFileName) === -1) { + return false; + } + return true; +} \ No newline at end of file diff --git a/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/kit/SysTestKit.js b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/kit/SysTestKit.js new file mode 100644 index 0000000000000000000000000000000000000000..6e2f256514cff87450f910098b1130943a40e39c --- /dev/null +++ b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/kit/SysTestKit.js @@ -0,0 +1,102 @@ +/* + * Copyright (c) 2022-2023 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 {TAG} from '../../Constant'; +import Core from '../../core.js'; + +export default class SysTestKit { + + static delegator = null; + static systemTime = null; + static workerPort = null; + + constructor() { + this.id = 'sysTestKit'; + this.index = 0; + } + + static getDescribeName() { + return Core.getInstance().getDefaultService('suite').getCurrentRunningSuite().description; + } + + static getItName() { + return Core.getInstance().getDefaultService('spec').getCurrentRunningSpec().description; + } + + static getItAttribute() { + return Core.getInstance().getDefaultService('spec').getCurrentRunningSpec().fi; + } + + static actionStart(tag) { + console.info(`${TAG}${JSON.stringify(tag)}`); + var message = '\n' + 'OHOS_REPORT_ACTIONSTART: ' + JSON.stringify(tag) + '\n'; + SysTestKit.print(message); + console.info(`${TAG}${JSON.stringify(tag)} actionStart print success`); + } + + static actionEnd(tag) { + console.info(`${TAG}${JSON.stringify(tag)}`); + var message = '\n' + 'OHOS_REPORT_ACTIONEND: ' + JSON.stringify(tag) + '\n'; + SysTestKit.print(message); + console.info(`${TAG}${JSON.stringify(tag)} actionEnd print success`); + } + + static async existKeyword(keyword, timeout) { + let reg = new RegExp(/^[a-zA-Z0-9]{1,}$/); + if (!reg.test(keyword)) { + throw new Error('keyword must contain more than one string, and only letters and numbers are supported.'); + } + timeout = timeout || 4; + + let searchResult = false; + let cmd = 'hilog -x | grep -i \'' + keyword + '\' | wc -l'; + await executePromise(cmd, timeout).then((data) => { + searchResult = data; + }); + return searchResult; + } + static async print(message) { + if ('printSync' in SysTestKit.delegator) { + console.info(`${TAG}printSync called ...`); + SysTestKit.delegator.printSync(message); + } else { + await SysTestKit.delegator.print(message); + } + } + + static async getRealTime() { + let currentTime = new Date().getTime(); + if (SysTestKit.systemTime !== null && SysTestKit.systemTime !== undefined) { + await SysTestKit.systemTime.getRealTime().then((time) => { + console.info(`${TAG}systemTime.getRealTime success data: ${JSON.stringify(time)}`); + currentTime = time; + }).catch((error) => { + console.error(`${TAG}failed to systemTime.getRealTime because ${JSON.stringify(error)}`); + }); + } + return currentTime; + } +} + +function executePromise(cmd, timeout) { + return new Promise((resolve, reject) => { + SysTestKit.delegator.executeShellCommand(cmd, timeout, + (error, data) => { + console.info(`${TAG}existKeyword CallBack: err : ${JSON.stringify(error)}`); + console.info(`${TAG}existKeyword CallBack: data : ${JSON.stringify(data)}`); + resolve(parseInt(data.stdResult) > 3 ? true : false); + }); + }); +} \ No newline at end of file diff --git a/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/mock/ArgumentMatchers.js b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/mock/ArgumentMatchers.js new file mode 100644 index 0000000000000000000000000000000000000000..1e69ac401049589986968a8575ca45a02a299327 --- /dev/null +++ b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/mock/ArgumentMatchers.js @@ -0,0 +1,122 @@ +/* + * Copyright (c) 2022-2024 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. + */ + +class ArgumentMatchers { + ANY = ''; + ANY_STRING = ''; + ANY_BOOLEAN = ''; + ANY_NUMBER = ''; + ANY_OBJECT = ''; + ANY_FUNCTION = ''; + MATCH_REGEXS = ''; + + static any() { + } + + static anyString() { + } + + static anyBoolean() { + } + + static anyNumber() { + } + + static anyObj() { + } + + static anyFunction() { + } + + static matchRegexs() { + let regex = arguments[0]; + if (ArgumentMatchers.isRegExp(regex)) { + return regex; + } + throw Error('not a regex'); + } + + static isRegExp(value) { + return Object.prototype.toString.call(value) === '[object RegExp]'; + } + + matcheReturnKey() { + let arg = arguments[0]; + let regex = arguments[1]; + let stubSetKey = arguments[2]; + + if (stubSetKey && stubSetKey == this.ANY) { + return this.ANY; + } + + if (typeof arg === 'string' && !regex) { + return this.ANY_STRING; + } + + if (typeof arg === 'boolean' && !regex) { + return this.ANY_BOOLEAN; + } + + if (typeof arg === 'number' && !regex) { + return this.ANY_NUMBER; + } + + if (typeof arg === 'object' && !regex) { + return this.ANY_OBJECT; + } + + if (typeof arg === 'function' && !regex) { + return this.ANY_FUNCTION; + } + + if (typeof arg === 'string' && regex) { + return regex.test(arg); + } + + return null; + } + + matcheStubKey() { + let key = arguments[0]; + + if (key === ArgumentMatchers.any) { + return this.ANY; + } + + if (key === ArgumentMatchers.anyString) { + return this.ANY_STRING; + } + if (key === ArgumentMatchers.anyBoolean) { + return this.ANY_BOOLEAN; + } + if (key === ArgumentMatchers.anyNumber) { + return this.ANY_NUMBER; + } + if (key === ArgumentMatchers.anyObj) { + return this.ANY_OBJECT; + } + if (key === ArgumentMatchers.anyFunction) { + return this.ANY_FUNCTION; + } + + if (ArgumentMatchers.isRegExp(key)) { + return key; + } + + return null; + } +} + +export default ArgumentMatchers; \ No newline at end of file diff --git a/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/mock/ExtendInterface.js b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/mock/ExtendInterface.js new file mode 100644 index 0000000000000000000000000000000000000000..c6a866a6df662ad10a7f6869dcbc2381fa47bcdc --- /dev/null +++ b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/mock/ExtendInterface.js @@ -0,0 +1,57 @@ +/* + * 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. + */ + +class ExtendInterface { + constructor(mocker) { + this.mocker = mocker; + } + + stub() { + this.params = arguments; + return this; + } + + stubMockedCall(returnInfo) { + this.mocker.stubApply(this, this.params, returnInfo); + } + + afterReturn(value) { + this.stubMockedCall(function () { + return value; + }); + } + + afterReturnNothing() { + this.stubMockedCall(function () { + return undefined; + }); + } + + afterAction(action) { + this.stubMockedCall(action); + } + + afterThrow(msg) { + this.stubMockedCall(function () { + throw msg; + }); + } + + clear() { + this.mocker.clear(); + } +} + +export default ExtendInterface; \ No newline at end of file diff --git a/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/mock/MockKit.js b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/mock/MockKit.js new file mode 100644 index 0000000000000000000000000000000000000000..5895666bc89ed4270582b436c82045745d5249b4 --- /dev/null +++ b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/mock/MockKit.js @@ -0,0 +1,266 @@ +/* + * Copyright (c) 2022-2024 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 ExtendInterface from './ExtendInterface'; +import VerificationMode from './VerificationMode'; +import ArgumentMatchers from './ArgumentMatchers'; + +class MockKit { + + constructor() { + this.mFunctions = []; + this.stubs = new Map(); + this.recordCalls = new Map(); + this.currentSetKey = new Map(); + this.mockObj = null; + this.recordMockedMethod = new Map(); + } + + init() { + this.reset(); + } + + reset() { + this.mFunctions = []; + this.stubs = {}; + this.recordCalls = {}; + this.currentSetKey = new Map(); + this.mockObj = null; + this.recordMockedMethod = new Map(); + } + + clearAll() { + this.reset(); + var props = Object.keys(this); + for (var i = 0; i < props.length; i++) { + delete this[props[i]]; + } + + var props = Object.getOwnPropertyNames(this); + for (var i = 0; i < props.length; i++) { + delete this[props[i]]; + } + for (var key in this) { + delete this[key]; + } + } + + clear(obj) { + if (!obj) { + throw Error('Please enter an object to be cleaned'); + } + if (typeof (obj) !== 'object' && typeof (obj) !== 'function') { + throw new Error('Not a object or static class'); + } + this.recordMockedMethod.forEach(function (value, key, map) { + if (key) { + obj[key] = value; + } + }); + } + + ignoreMock(obj, method) { + if (typeof (obj) !== 'object' && typeof (obj) !== 'function') { + throw new Error('Not a object or static class'); + } + if (typeof (method) !== 'function') { + throw new Error('Not a function'); + } + let og = this.recordMockedMethod.get(method.propName); + if (og) { + obj[method.propName] = og; + this.recordMockedMethod.set(method.propName, undefined); + } + } + + extend(dest, source) { + dest['stub'] = source['stub']; + dest['afterReturn'] = source['afterReturn']; + dest['afterReturnNothing'] = source['afterReturnNothing']; + dest['afterAction'] = source['afterAction']; + dest['afterThrow'] = source['afterThrow']; + dest['stubMockedCall'] = source['stubMockedCall']; + dest['clear'] = source['clear']; + return dest; + } + + stubApply(f, params, returnInfo) { + let values = this.stubs.get(f); + if (!values) { + values = new Map(); + } + let key = params[0]; + if (typeof key == 'undefined') { + key = 'anonymous-mock-' + f.propName; + } + let matcher = new ArgumentMatchers(); + if (matcher.matcheStubKey(key)) { + key = matcher.matcheStubKey(key); + if (key) { + this.currentSetKey.set(f, key); + } + } + values.set(key, returnInfo); + this.stubs.set(f, values); + } + + getReturnInfo(f, params) { + let values = this.stubs.get(f); + if (!values) { + return undefined; + } + let retrunKet = params[0]; + if (typeof retrunKet == 'undefined') { + retrunKet = 'anonymous-mock-' + f.propName; + } + let stubSetKey = this.currentSetKey.get(f); + + if (stubSetKey && (typeof (retrunKet) !== 'undefined')) { + retrunKet = stubSetKey; + } + let matcher = new ArgumentMatchers(); + if (matcher.matcheReturnKey(params[0], undefined, stubSetKey) && matcher.matcheReturnKey(params[0], undefined, stubSetKey) !== stubSetKey) { + retrunKet = params[0]; + } + + values.forEach(function (value, key, map) { + if (ArgumentMatchers.isRegExp(key) && matcher.matcheReturnKey(params[0], key)) { + retrunKet = key; + } + }); + + return values.get(retrunKet); + } + + findName(obj, value) { + let properties = this.findProperties(obj); + let name = null; + properties.filter(item => (item !== 'caller' && item !== 'arguments')).forEach( + function (va1, idx, array) { + if (obj[va1] === value) { + name = va1; + } + } + ); + return name; + } + + isFunctionFromPrototype(f, container, propName) { + if (container.constructor !== Object && container.constructor.prototype !== container) { + return container.constructor.prototype[propName] === f; + } + return false; + } + + findProperties(obj, ...arg) { + function getProperty(newObj) { + if (newObj.__proto__ === null) { + return []; + } + let properties = Object.getOwnPropertyNames(newObj); + return [...properties, ...getProperty(newObj.__proto__)]; + } + return getProperty(obj); + } + + recordMethodCall(originalMethod, args) { + Function.prototype.getName = function () { + return this.name || this.toString().match(/function\s*([^(]*)\(/)[1]; + }; + let name = originalMethod.getName(); + let arglistString = name + '(' + Array.from(args).toString() + ')'; + let records = this.recordCalls.get(arglistString); + if (!records) { + records = 0; + } + records++; + this.recordCalls.set(arglistString, records); + } + + mockFunc(originalObject, originalMethod) { + let tmp = this; + this.originalMethod = originalMethod; + let f = function () { + let args = arguments; + let action = tmp.getReturnInfo(f, args); + if (originalMethod) { + tmp.recordMethodCall(originalMethod, args); + } + if (action) { + return action.apply(this, args); + } + }; + + f.container = null || originalObject; + f.original = originalMethod || null; + + if (originalObject && originalMethod) { + if (typeof (originalMethod) !== 'function') { + throw new Error('Not a function'); + } + var name = this.findName(originalObject, originalMethod); + originalObject[name] = f; + this.recordMockedMethod.set(name, originalMethod); + f.propName = name; + f.originalFromPrototype = this.isFunctionFromPrototype(f.original, originalObject, f.propName); + } + f.mocker = this; + this.mFunctions.push(f); + this.extend(f, new ExtendInterface(this)); + return f; + } + + verify(methodName, argsArray) { + if (!methodName) { + throw Error('not a function name'); + } + let a = this.recordCalls.get(methodName + '(' + argsArray.toString() + ')'); + return new VerificationMode(a ? a : 0); + } + + mockObject(object) { + if (!object || typeof object === 'string') { + throw Error(`this ${object} cannot be mocked`); + } + const _this = this; + let mockedObject = {}; + let keys = Reflect.ownKeys(object); + keys.filter(key => (typeof Reflect.get(object, key)) === 'function') + .forEach(key => { + mockedObject[key] = object[key]; + mockedObject[key] = _this.mockFunc(mockedObject, mockedObject[key]); + }); + return mockedObject; + } +} + +function ifMockedFunction(f) { + if (Object.prototype.toString.call(f) !== '[object Function]' && + Object.prototype.toString.call(f) !== '[object AsyncFunction]') { + throw Error('not a function'); + } + if (!f.stub) { + throw Error('not a mock function'); + } + return true; +} + +function when(f) { + if (ifMockedFunction(f)) { + return f.stub.bind(f); + } +} + +export {MockKit, when}; \ No newline at end of file diff --git a/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/mock/VerificationMode.js b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/mock/VerificationMode.js new file mode 100644 index 0000000000000000000000000000000000000000..aaf2fdfae00135d3d2055320fc5ea403b44d0bf3 --- /dev/null +++ b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/mock/VerificationMode.js @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2022-2023 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 {expect} from '../../interface'; + +class VerificationMode { + constructor(times) { + this.doTimes = times; + } + + times(count) { + expect(count).assertEqual(this.doTimes); + } + + never() { + console.info(this.doTimes); + expect(0).assertEqual(this.doTimes); + } + + once() { + expect(1).assertEqual(this.doTimes); + } + + atLeast(count) { + if (count > this.doTimes) { + throw Error('failed ' + count + ' greater than the actual execution times of method'); + } + } + + atMost(count) { + if (count < this.doTimes) { + throw Error('failed ' + count + ' less than the actual execution times of method'); + } + } +} + +export default VerificationMode; \ No newline at end of file diff --git a/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/report/LogExpectError.js b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/report/LogExpectError.js new file mode 100644 index 0000000000000000000000000000000000000000..5a94cecb4625205797ae886c19ac592f189c2232 --- /dev/null +++ b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/report/LogExpectError.js @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2024 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. + */ + +class LogExpectError { + static getErrorMsg(matcherName, actualValue, expect, originMsg) { + if (matcherName === 'assertNull') { + return 'expect not null, actualValue is ' + (actualValue); + } + if (matcherName === 'assertTrue') { + return 'expect not true, actualValue is ' + (actualValue); + } + if (matcherName === 'assertFalse') { + return 'expect not false, actualValue is ' + (actualValue); + } + if (matcherName === 'assertEqual') { + return 'expect not Equal, actualValue is ' + actualValue + ' equals ' + expect; + } + if (matcherName === 'assertContain') { + return 'expect not have, ' + actualValue + ' have ' + expect; + } + if (matcherName === 'assertInstanceOf') { + return 'expect not InstanceOf, ' + actualValue + ' is ' + + Object.prototype.toString.call(actualValue) + expect; + } + if (matcherName === 'assertLarger') { + return 'expect not Larger, ' + + (actualValue) + ' is larger than ' + expect; + } + if (matcherName === 'assertLargerOrEqual') { + return 'expect not LargerOrEqual, ' + (actualValue) + ' larger than ' + expect; + } + if (matcherName === 'assertLess') { + return 'expect not Less, ' + (actualValue) + ' less than ' + expect; + } + if (matcherName === 'assertLessOrEqual') { + return 'expect not LessOrEqual, ' + (actualValue) + ' is less than ' + expect; + } + if (matcherName === 'assertNaN') { + return 'expect not NaN, actualValue is ' + (actualValue); + } + if (matcherName === 'assertNegUnlimited') { + return 'expect not NegUnlimited, actualValue is ' + (actualValue); + } + if (matcherName === 'assertPosUnlimited') { + return 'expect not PosUnlimited, actualValue is ' + (actualValue); + } + if (matcherName === 'assertUndefined') { + return 'expect not Undefined, actualValue is ' + (actualValue); + } + return originMsg; + } +} +export default LogExpectError; \ No newline at end of file diff --git a/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/report/OhReport.js b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/report/OhReport.js new file mode 100644 index 0000000000000000000000000000000000000000..653e56be9e88e810f6ab1f3d58049cf08d2ac0b6 --- /dev/null +++ b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/report/OhReport.js @@ -0,0 +1,213 @@ +/* + * Copyright (c) 2021-2024 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 SysTestKit from "../kit/SysTestKit"; +import { collectCoverageData } from '../coverage/coverageCollect'; +import { TAG, PrintTag } from '../../Constant'; + +class OhReport { + constructor(attr) { + this.delegator = attr.delegator; + this.abilityDelegatorArguments = attr.abilityDelegatorArguments; + this.id = 'report'; + this.index = 0; + this.duration = 0; + this.currentThreadName = 'mainThread'; + } + + init(coreContext) { + this.coreContext = coreContext; + this.suiteService = this.coreContext.getDefaultService('suite'); + this.specService = this.coreContext.getDefaultService('spec'); + if (SysTestKit.workerPort !== null) { + this.currentThreadName = SysTestKit.workerPort.name; + } + } + + taskStart() { + } + + async taskDone() { + let summary = this.suiteService.getSummary(); + if (this.abilityDelegatorArguments !== null) { + this.taskDoneTime = new Date().getTime(); + const configService = this.coreContext.getDefaultService('config'); + const suiteService = this.coreContext.getDefaultService('suite'); + const specService = this.coreContext.getDefaultService('spec'); + if (configService['coverage'] === 'true') { + await collectCoverageData(); + } + let message = '\n' + `${PrintTag.OHOS_REPORT_RESULT}: stream=Tests run: ` + summary.total + ', Failure: ' + summary.failure; + message += ', Error: ' + summary.error; + message += ', Pass: ' + summary.pass; + message += ', Ignore: ' + summary.ignore; + if (specService.skipSpecNum > 0) { + message += ', SkipSpec: ' + specService.skipSpecNum; + } + message += '\n' + `${PrintTag.OHOS_REPORT_CODE}: ` + (summary.failure > 0 ? -1 : 0) + '\n'; + let isHasError = summary.failure > 0 || summary.error > 0; + let config = this.coreContext.getDefaultService('config'); + if (config.isBreakOnError() && isHasError) { + // 未执行全部说明 + message += '\n' + `${PrintTag.OHOS_REPORT_RESULT}: breakOnError model, Stopping whole test suite if one specific test case failed or error` + '\n'; + } + message += `${PrintTag.OHOS_REPORT_STATUS}: taskconsuming=` + summary.duration + '\n'; + console.info(`${message}`); + await SysTestKit.print(message); + } + if (SysTestKit.workerPort === null || SysTestKit.workerPort === undefined) { + // 主线程执行完成 结束任务。 + console.info(`${TAG}report print success`); + this.delegator.finishTest('your test finished!!!', 0, () => { }); + } else { + // worker线程执行完成将数据发送到主线程中。 + let sendData = { + currentThreadName: this.currentThreadName, + summary: summary + }; + console.info(`${TAG}, send data to mainThread, ${this.currentThreadName}, ${JSON.stringify(sendData)}`); + SysTestKit.workerPort.postMessage(sendData); + } + } + + incorrectFormat() { + if (this.coreContext.getDefaultService('config').filterValid.length !== 0) { + var value = this.coreContext.getDefaultService('config').filterValid; + var message = 'this param ' + value.join(',') + ' is invalid' + '\n'; + this.delegator.finishTest(message, 0, () => { + }); + } + } + + incorrectTestSuiteFormat() { + if (this.coreContext.getDefaultService('config').filterXdescribe.length !== 0) { + let value = this.coreContext.getDefaultService('config').filterXdescribe; + let message = 'xdescribe ' + value.join(',') + ' should not contain it' + '\n'; + this.delegator.finishTest(message, 0, () => { + }); + } + } + async suiteStart() { + if (this.abilityDelegatorArguments !== null) { + let specArr = []; + this.suiteService.getAllChildSuiteNum(this.suiteService.getCurrentRunningSuite(), specArr); + let message = '\n' + `${PrintTag.OHOS_REPORT_SUM}: ` + specArr.length; + this.suiteService.setCurrentRunningSuiteDesc(this.suiteService.getRootSuite(), this.suiteService.getCurrentRunningSuite(), ''); + message += '\n' + `${PrintTag.OHOS_REPORT_STATUS}: class=` + this.suiteService.getCurrentRunningSuiteDesc() + '\n'; + if (this.suiteService.currentRunningSuite.isSkip) { + message += `${PrintTag.OHOS_REPORT_STATUS}: skipReason=` + this.suiteService.currentRunningSuite.skipReason + '\n'; + } + if (SysTestKit.workerPort !== null) { + message += `${PrintTag.OHOS_REPORT_STATUS}: currentWorkerName=` + this.currentThreadName; + } + console.info(`${message}`); + await SysTestKit.print(message); + console.info(`${TAG}${this.suiteService.getCurrentRunningSuite().description} suiteStart print success`); + } + } + + async suiteDone() { + if (this.abilityDelegatorArguments !== null) { + const currentRunningSuite = this.suiteService.getCurrentRunningSuite(); + this.suiteService.setCurrentRunningSuiteDesc(this.suiteService.getRootSuite(), this.suiteService.getCurrentRunningSuite(), ''); + let message = '\n' + `${PrintTag.OHOS_REPORT_STATUS}: class=` + this.suiteService.getCurrentRunningSuiteDesc(); + if (this.suiteService.currentRunningSuite.isSkip && this.suiteService.currentRunningSuite.skipReason !== '') { + message += '\n' + `${PrintTag.OHOS_REPORT_STATUS}: skipReason=` + this.suiteService.currentRunningSuite.skipReason; + } + message += '\n' + `${PrintTag.OHOS_REPORT_STATUS}: suiteconsuming=` + this.suiteService.getCurrentRunningSuite().duration; + if (currentRunningSuite.hookError) { + message += '\n' + `${PrintTag.OHOS_REPORT_STATUS}: ${currentRunningSuite.hookError.message}`; + } + message += '\n'; + if (SysTestKit.workerPort !== null) { + message += `${PrintTag.OHOS_REPORT_STATUS}: currentWorkerName=` + this.currentThreadName; + } + console.info(`${message}`); + await SysTestKit.print(message); + console.info(`${TAG}${this.suiteService.getCurrentRunningSuite().description} suiteDone print success`); + } + } + + async specStart() { + if (this.abilityDelegatorArguments !== null) { + let message = '\n' + `${PrintTag.OHOS_REPORT_STATUS}: class=` + this.suiteService.getCurrentRunningSuiteDesc(); + message += '\n' + `${PrintTag.OHOS_REPORT_STATUS}: current=` + (++this.index); + message += '\n' + `${PrintTag.OHOS_REPORT_STATUS}: id=JS`; + message += '\n' + `${PrintTag.OHOS_REPORT_STATUS}: numtests=` + this.specService.getTestTotal(); + message += '\n' + `${PrintTag.OHOS_REPORT_STATUS}: stream=`; + message += '\n' + `${PrintTag.OHOS_REPORT_STATUS}: test=` + this.specService.currentRunningSpec.description; + message += '\n' + `${PrintTag.OHOS_REPORT_STATUS_CODE}: 1` + '\n'; + if (this.specService.currentRunningSpec.isSkip) { + message += `${PrintTag.OHOS_REPORT_STATUS}: skipReason=` + this.specService.currentRunningSpec.skipReason + '\n'; + } + if (SysTestKit.workerPort !== null) { + message += `${PrintTag.OHOS_REPORT_STATUS}: currentWorkerName=` + this.currentThreadName; + } + console.info(`${message}`); + await SysTestKit.print(message); + console.info(`${TAG}${this.specService.currentRunningSpec.description} specStart start print success`); + } + } + + async specDone() { + if (this.abilityDelegatorArguments !== null) { + let message = '\n' + `${PrintTag.OHOS_REPORT_STATUS}: class=` + this.suiteService.getCurrentRunningSuiteDesc(); + message += '\n' + `${PrintTag.OHOS_REPORT_STATUS}: current=` + (this.index); + message += '\n' + `${PrintTag.OHOS_REPORT_STATUS}: id=JS`; + message += '\n' + `${PrintTag.OHOS_REPORT_STATUS}: numtests=` + this.specService.getTestTotal(); + let messageStack = ''; + let messageCode = ''; + if (this.specService.currentRunningSpec.error) { + messageStack = `${PrintTag.OHOS_REPORT_STATUS}: stack=` + this.specService.currentRunningSpec.error?.stack?.slice(0, -1); + messageCode += `${PrintTag.OHOS_REPORT_STATUS}: stream=`; + messageCode += this.specService.currentRunningSpec.expectMsg !== '' ? + `message: ${this.specService.currentRunningSpec.expectMsg}, Error in ${this.specService.currentRunningSpec.description}, ${this.specService.currentRunningSpec.error?.message}` : + `Error in ${this.specService.currentRunningSpec.description}, ${this.specService.currentRunningSpec.error?.message}`; + messageCode += '\n' + `${PrintTag.OHOS_REPORT_STATUS}: test=` + this.specService.currentRunningSpec.description; + messageCode += '\n' + `${PrintTag.OHOS_REPORT_STATUS_CODE}: -1` + '\n'; + } else if (this.specService.currentRunningSpec) { + if (this.specService.currentRunningSpec.fail) { + messageStack += `${PrintTag.OHOS_REPORT_STATUS}: stack=` + this.specService.currentRunningSpec.fail?.stack?.slice(0, -1); + messageCode += `${PrintTag.OHOS_REPORT_STATUS}: stream=`; + messageCode += this.specService.currentRunningSpec.expectMsg !== '' ? + `message: ${this.specService.currentRunningSpec.expectMsg}, Error in ${this.specService.currentRunningSpec.description}, ${this.specService.currentRunningSpec.fail?.message}` : + `Error in ${this.specService.currentRunningSpec.description}, ${this.specService.currentRunningSpec.fail?.message}`; + messageCode += '\n' + `${PrintTag.OHOS_REPORT_STATUS}: test=` + this.specService.currentRunningSpec.description; + messageCode += '\n' + `${PrintTag.OHOS_REPORT_STATUS_CODE}: -2` + '\n'; + } else { + messageStack += `${PrintTag.OHOS_REPORT_STATUS}: stream=`; + messageCode += `${PrintTag.OHOS_REPORT_STATUS}: test=` + this.specService.currentRunningSpec.description; + messageCode += '\n' + `${PrintTag.OHOS_REPORT_STATUS_CODE}: 0` + '\n'; + messageCode += this.specService.currentRunningSpec.isSkip ? (`${PrintTag.OHOS_REPORT_STATUS}: skipReason=` + this.specService.currentRunningSpec.skipReason + '\n') : ''; + } + } else { + messageCode += '\n'; + } + messageCode += `${PrintTag.OHOS_REPORT_STATUS}: consuming=` + this.specService.currentRunningSpec.duration + '\n'; + if (SysTestKit.workerPort !== null) { + messageCode += `${PrintTag.OHOS_REPORT_STATUS}: currentWorkerName=` + this.currentThreadName; + } + console.info(`${message}`); + console.info(`\n${messageStack}`); + console.info(`\n${messageCode}`); + await SysTestKit.print(message); + await SysTestKit.print(messageStack); + await SysTestKit.print(messageCode); + console.info(`${TAG}${this.specService.currentRunningSpec.description} specDone end print success`); + } + } +} + +export default OhReport; diff --git a/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/report/ReportExtend.js b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/report/ReportExtend.js new file mode 100644 index 0000000000000000000000000000000000000000..852fbcd5cbf97e776ebe5177a029df0f516594a5 --- /dev/null +++ b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/module/report/ReportExtend.js @@ -0,0 +1,137 @@ +/* + * Copyright (c) 2021-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. + */ + +class ReportExtend { + constructor(fileModule) { + this.id = 'extend'; + this.fileModule = fileModule; + } + + init(coreContext) { + this.coreContext = coreContext; + this.suiteService = this.coreContext.getDefaultService('suite'); + } + + taskStart() { + + } + + taskDone() { + const report = { + tag: 'testsuites', + name: 'summary_report', + timestamp: new Date().toDateString(), + time: '1', + errors: 0, + failures: 0, + tests: 0, + children: [] + }; + const rootSuite = this.suiteService.rootSuite; + if (rootSuite && rootSuite.childSuites) { + for (let testsuite of rootSuite.childSuites) { + let suiteReport = { + tag: 'testsuite', + name: testsuite['description'], + errors: 0, + tests: 0, + failures: 0, + time: '0.1', + children: [] + }; + let specs = testsuite['specs']; + for (let testcase of specs) { + report.tests++; + suiteReport.tests++; + let caseReport = { + tag: 'testcase', + name: testcase['description'], + status: 'run', + time: '0.0', + classname: testsuite['description'] + }; + if (testcase.error) { + caseReport['result'] = false; + caseReport['children'] = [{ + tag: 'error', + type: '', + message: testcase.error.message + }]; + report.errors++; + suiteReport.errors++; + } else if (testcase.result.failExpects.length > 0) { + caseReport['result'] = false; + let message = ''; + testcase.result.failExpects.forEach(failExpect => { + message += failExpect.message || ('expect ' + failExpect.actualValue + ' ' + failExpect.checkFunc + ' ' + (failExpect.expectValue || '')) + ';'; + }); + caseReport['children'] = [{ + tag: 'failure', + type: '', + message: message + }]; + report.failures++; + suiteReport.failures++; + } else { + caseReport['result'] = true; + } + suiteReport.children.push(caseReport); + } + report.children.push(suiteReport); + } + } + + let reportXml = '\n' + json2xml(report); + this.fileModule.writeText({ + uri: 'internal://app/report.xml', + text: reportXml, + success: function () { + console.info('call success callback success'); + }, + fail: function (data, code) { + console.info('call fail callback success:'); + }, + complete: function () { + console.info('call complete callback success'); + } + }); + } +} + +function json2xml(json) { + let tagName; + let hasChildren = false; + let childrenStr = ''; + let attrStr = ''; + for (let key in json) { + if (key === 'tag') { + tagName = json[key]; + } else if (key === 'children') { + if (json[key].length > 0) { + hasChildren = true; + for (let child of json[key]) { + childrenStr += json2xml(child); + } + } + } else { + attrStr += ` ${key}="${json[key]}"`; + } + } + let xml = `<${tagName}${attrStr}`; + xml += hasChildren ? `>${childrenStr}` : '/>'; + return xml; +} + +export default ReportExtend; diff --git a/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/service.js b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/service.js new file mode 100644 index 0000000000000000000000000000000000000000..92d46b77959af314f40bd601ede62b9b6d8b9ba2 --- /dev/null +++ b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/service.js @@ -0,0 +1,1230 @@ +/* + * Copyright (c) 2021-2024 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 SysTestKit from './module/kit/SysTestKit'; +import { TAG } from './Constant'; +import LogExpectError from './module/report/LogExpectError'; +import { NestFilter } from './module/config/Filter'; + +class AssertException extends Error { + constructor(message) { + super(); + this.name = 'AssertException'; + this.message = message; + } +} + +function getFuncWithArgsZero(func, timeout, isStressTest) { + return new Promise(async (resolve, reject) => { + let timer = null; + if (!isStressTest) { + timer = setTimeout(() => { + reject(new Error('execute timeout ' + timeout + 'ms')); + }, timeout); + } + try { + await func(); + } catch (err) { + reject(err); + } + timer !== null ? clearTimeout(timer) : null; + resolve(); + }); +} + +function getFuncWithArgsOne(func, timeout, isStressTest) { + return new Promise(async (resolve, reject) => { + let timer = null; + if (!isStressTest) { + timer = setTimeout(() => { + reject(new Error('execute timeout ' + timeout + 'ms')); + }, timeout); + } + + function done() { + timer !== null ? clearTimeout(timer) : null; + resolve(); + } + + try { + await func(done); + } catch (err) { + timer !== null ? clearTimeout(timer) : null; + reject(err); + } + }); +} + +function getFuncWithArgsTwo(func, timeout, paramItem, isStressTest) { + return new Promise(async (resolve, reject) => { + let timer = null; + if (!isStressTest) { + timer = setTimeout(() => { + reject(new Error('execute timeout ' + timeout + 'ms')); + }, timeout); + } + + function done() { + timer !== null ? clearTimeout(timer) : null; + resolve(); + } + + try { + await func(done, paramItem); + } catch (err) { + timer !== null ? clearTimeout(timer) : null; + reject(err); + } + }); +} + +function processFunc(coreContext, func) { + let argNames = ((func || '').toString() + .replace(/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg, '') + .match(/^(function)?\s*[^\(]*\(\s*([^\)]*)\)/m) || ['', '', ''])[2] + .split(',') // split parameters + .map(item => item.replace(/^\s*(_?)(.+?)\1\s*$/, name => name.split('=')[0].trim())) + .filter(String); + let funcLen = func.length; + let processedFunc; + const config = coreContext.getDefaultService('config'); + config.setSupportAsync(true); + const timeout = + (config.timeout === undefined ? 5000 : config.timeout); + const isStressTest = (coreContext.getServices('dataDriver') !== undefined || config.getStress() > 1); + switch (funcLen) { + case 0: { + processedFunc = function () { + return getFuncWithArgsZero(func, timeout, isStressTest); + }; + break; + } + case 1: { + if (argNames[0] === 'data') { + processedFunc = function (paramItem) { + func(paramItem); + }; + } else { + processedFunc = function () { + return getFuncWithArgsOne(func, timeout, isStressTest); + }; + } + break; + } + default: { + processedFunc = function (paramItem) { + return getFuncWithArgsTwo(func, timeout, paramItem, isStressTest); + }; + break; + } + } + return processedFunc; +} + +function secureRandomNumber() { + return crypto.randomBytes(8).readUInt32LE() / 0xffffffff; +} + +class SuiteService { + constructor(attr) { + this.id = attr.id; + this.rootSuite = new SuiteService.Suite({}); + this.currentRunningSuite = this.rootSuite; + this.suitesStack = [this.rootSuite]; + this.targetSuiteArray = []; + this.targetSpecArray = []; + this.currentRunningSuiteDesc = null; + this.fullRun = false; + this.isSkipSuite = false; + this.suiteSkipReason = null; + } + + describe(desc, func) { + const configService = this.coreContext.getDefaultService('config'); + if (this.suitesStack.some(suite => { return suite.description === desc })) { + console.error(`${TAG} Loop nesting occurs : ${desc}`); + this.suiteSkipReason = ''; + this.isSkipSuite = false; + return; + } + let isFilter = this.analyzeConfigServiceClass(configService.class, desc); + if (configService.filterSuite(desc) && isFilter) { + if (this.currentRunningSuite.description === '' || this.currentRunningSuite.description == null) { + console.info(`${TAG}filter suite : ${desc}`); + this.suiteSkipReason = ''; + this.isSkipSuite = false; + return; + } + } + const suite = new SuiteService.Suite({ description: desc }); + if (this.isSkipSuite) { + suite.isSkip = true; + suite.skipReason = this.suiteSkipReason; + } + this.suiteSkipReason = ''; + this.isSkipSuite = false; + if (typeof this.coreContext.getServices('dataDriver') !== 'undefined' && configService['dryRun'] !== 'true') { + let suiteStress = this.coreContext.getServices('dataDriver').dataDriver.getSuiteStress(desc); + for (let i = 1; i < suiteStress; i++) { + this.currentRunningSuite.childSuites.push(suite); + } + } + this.currentRunningSuite.childSuites.push(suite); + this.currentRunningSuite = suite; + this.suitesStack.push(suite); + func.call(); + this.suitesStack.pop(); + this.currentRunningSuite = this.suitesStack.pop(); + this.suitesStack.push(this.currentRunningSuite); + } + xdescribe(desc, func, reason) { + const configService = this.coreContext.getDefaultService('config'); + if (!configService.skipMessage && configService.runSkipped !== 'all') { + if (configService.runSkipped != null && configService.runSkipped !== '') { + let finalDesc = ''; + this.suitesStack.map(suite => { + finalDesc = finalDesc + '.' + suite.description; + }); + finalDesc = (finalDesc + '.' + desc).substring(2); + console.info(`${TAG} finalDesc ${finalDesc}`); + if (configService.checkIfSuiteInSkipRun(finalDesc)) { + console.info(`${TAG} runSkipped suite: ${desc}`); + } else { + console.info(reason == null ? `${TAG} skip suite: ${desc}` : `${TAG} skip suite: ${desc}, and the reason is ${reason}`); + return; + } + } else { + console.info(reason == null ? `${TAG} skip suite: ${desc}` : `${TAG} skip suite: ${desc}, and the reason is ${reason}`); + return; + } + } + this.isSkipSuite = true; + this.suiteSkipReason = reason; + this.describe(desc, func); + } + + beforeAll(func) { + this.currentRunningSuite.beforeAll.push(processFunc(this.coreContext, func)); + } + + beforeEach(func) { + this.currentRunningSuite.beforeEach.push(processFunc(this.coreContext, func)); + } + + beforeItSpecified(itDescs, func) { + this.currentRunningSuite.beforeItSpecified.set(itDescs, processFunc(this.coreContext, func)); + } + + afterItSpecified(itDescs, func) { + this.currentRunningSuite.afterItSpecified.set(itDescs, processFunc(this.coreContext, func)); + } + + afterAll(func) { + this.currentRunningSuite.afterAll.push(processFunc(this.coreContext, func)); + } + + afterEach(func) { + this.currentRunningSuite.afterEach.push(processFunc(this.coreContext, func)); + } + + getCurrentRunningSuite() { + return this.currentRunningSuite; + } + + setCurrentRunningSuite(suite) { + this.currentRunningSuite = suite; + } + + getRootSuite() { + return this.rootSuite; + } + + getCurrentRunningSuiteDesc() { + return this.currentRunningSuiteDesc; + } + + + setCurrentRunningSuiteDesc(suite, currentSuite, prefix) { + if (suite != null && suite === currentSuite) { + this.currentRunningSuiteDesc = prefix; + } else if (suite != null && suite !== currentSuite) { + suite.childSuites.forEach(it => { + let temp = prefix; + if (it.description != null || it.description !== '') { + temp = prefix === '' ? it.description : prefix + '.' + it.description; + } + this.setCurrentRunningSuiteDesc(it, currentSuite, temp); + } + ); + } + } + analyzeConfigServiceClass(configServiceClass, desc) { + if (configServiceClass == null || configServiceClass === '') { + this.fullRun = true + return false; + } + if (this.targetSuiteArray.length === 0) { + const targetArray = configServiceClass.split(','); + for (let index in targetArray) { + if (targetArray[index].includes('#')) { + this.targetSpecArray.push(targetArray[index]); + } else { + this.targetSuiteArray.push(targetArray[index]); + } + } + + } + return !configServiceClass.includes(desc); + + } + traversalResults(suite, obj, breakOnError) { + if (suite.childSuites.length === 0 && suite.specs.length === 0) { + return obj; + } + if (suite.specs.length > 0) { + for (const itItem of suite.specs) { + obj.total++; + let itInfo = { + currentThreadName: 'mainThread', + description: suite.description + '#' + itItem.description, + result: -3 + }; + if (SysTestKit.workerPort !== null) { + itInfo.currentThreadName = SysTestKit.workerPort.name; + } + obj.itItemList.push(itInfo); + if (breakOnError && (obj.error > 0 || obj.failure > 0)) { // breakOnError模式 + continue; + } + if (itItem.error) { + obj.error++; + itInfo.result = -1; + } else if (itItem.fail) { + obj.failure++; + itInfo.result = -2; + } else if (itItem.pass === true) { + obj.pass++; + itInfo.result = 0; + } + } + } + + obj.duration += suite.duration; + + if (suite.childSuites.length > 0) { + for (const suiteItem of suite.childSuites) { + this.traversalResults(suiteItem, obj, breakOnError); + } + } + } + + async setSuiteResults(suite, error, coreContext) { + if (suite.childSuites.length === 0 && suite.specs.length === 0) { + return obj; + } + if (suite.specs.length > 0) { + const specService = coreContext.getDefaultService('spec'); + for (const specItem of suite.specs) { + specService.setCurrentRunningSpec(specItem); + if (error instanceof AssertException) { + specItem.fail = error; + } else { + specItem.error = error; + } + await coreContext.fireEvents('spec', 'specStart', specItem); + await coreContext.fireEvents('spec', 'specDone', specItem); + } + } + if (suite.childSuites.length > 0) { + for (const suiteItem of suite.childSuites) { + await this.setSuiteResults(suiteItem, error, coreContext); + } + } + } + + getSummary() { + let suiteService = this.coreContext.getDefaultService('suite'); + let rootSuite = suiteService.rootSuite; + const specService = this.coreContext.getDefaultService('spec'); + const configService = this.coreContext.getDefaultService('config'); + let breakOnError = configService.isBreakOnError(); + let isError = specService.getStatus(); + let isBreaKOnError = breakOnError && isError; + // itItemList 保存当前用例执行情况, 发送到主线程用例计算最终结果 + let obj = { total: 0, failure: 0, error: 0, pass: 0, ignore: 0, duration: 0, itItemList: []}; + for (const suiteItem of rootSuite.childSuites) { + this.traversalResults(suiteItem, obj, isBreaKOnError); + } + obj.ignore = obj.total - obj.pass - obj.failure - obj.error; + return obj; + } + + init(coreContext) { + this.coreContext = coreContext; + } + + traversalSuites(suite, obj, configService) { + if (suite.childSuites.length === 0 && suite.specs.length === 0) { + return []; + } + if (suite.specs.length > 0) { + let itArray = []; + for (const itItem of suite['specs']) { + if (!configService.filterDesc(suite.description, itItem.description, itItem.fi, null)) { + itArray.push({ 'itName': itItem.description }); + } + } + obj[suite.description] = itArray; + } + if (suite.childSuites.length > 0) { + let suiteArray = []; + for (const suiteItem of suite.childSuites) { + let suiteObj = {}; + this.traversalSuites(suiteItem, suiteObj, configService); + if (!configService.filterSuite(suiteItem.description)) { + suiteArray.push(suiteObj); + } + } + obj.suites = suiteArray; + } + } + + async dryRun(abilityDelegator) { + console.info(`${TAG} rootSuite : ` + JSON.stringify(this.rootSuite)); + let obj = this.rootSuite; + let prefixStack = []; + let suiteArray = []; + let skipSuiteArray = []; + this.analyzeSuitesArray(prefixStack, suiteArray, skipSuiteArray, obj); + const configService = this.coreContext.getDefaultService('config'); + let result; + if (configService.skipMessage) { + result = { 'suites': suiteArray, 'skipSuites': skipSuiteArray }; + } else { + result = { 'suites': suiteArray }; + } + let strJson = JSON.stringify(result); + let strLen = strJson.length; + let maxLen = 500; + let maxCount = Math.floor(strLen / maxLen); + for (let count = 0; count <= maxCount; count++) { + await SysTestKit.print(strJson.substring(count * maxLen, (count + 1) * maxLen)); + } + console.info(`${TAG}dryRun print success`); + abilityDelegator.finishTest('dry run finished!!!', 0, () => { }); + } + + //将suitesArray的嵌套结构展开成三层结构 + analyzeSuitesArray(prefixStack, suiteArray, skipSuiteArray, obj) { + obj.childSuites.map(suite => { + if (suite.description != null && suite.description !== '') { + let prefix = ''; + if (prefixStack.length > 0) { + prefix = prefixStack.join('.') + '.' + suite.description; + } else { + prefix = suite.description; + } + prefixStack.push(suite.description); + let temp = {}; + temp[prefix] = []; + let skipTemp = {}; + skipTemp[prefix] = []; + suite.specs.map(spec => { + let it = { 'itName': spec.description }; + spec.isSkip ? skipTemp[prefix].push(it) : temp[prefix].push(it); + }); + suiteArray.push(temp); + skipSuiteArray.push(skipTemp); + } + this.analyzeSuitesArray(prefixStack, suiteArray, skipSuiteArray, suite); + prefixStack.pop(); + }); + } + //获取当前测试套下的所有测试用例数量 + getAllChildSuiteNum(suite, specArray) { + if (suite.specs != null) { + suite.specs.forEach(spec => specArray.push(spec)); + } + if (suite.childSuites != null) { + suite.childSuites.forEach(it => this.getAllChildSuiteNum(it, specArray)); + } + } + + execute() { + const configService = this.coreContext.getDefaultService('config'); + if (configService.filterValid.length !== 0) { + this.coreContext.fireEvents('task', 'incorrectFormat'); + return; + } + if (configService.filterXdescribe.length !== 0) { + this.coreContext.fireEvents('task', 'incorrectTestSuiteFormat'); + return; + } + if (configService.isRandom() && this.rootSuite.childSuites.length > 0) { + this.rootSuite.childSuites.sort(function () { + return Math.random().toFixed(1) > 0.5 ? -1 : 1; + }); + this.currentRunningSuite = this.rootSuite.childSuites[0]; + } + if (configService.isSupportAsync()) { + console.info(`${TAG} rootSuite:` + JSON.stringify(this.rootSuite)); + let asyncExecute = async () => { + await this.coreContext.fireEvents('task', 'taskStart'); + await this.rootSuite.asyncRun(this.coreContext); + }; + asyncExecute().then(async () => { + await this.coreContext.fireEvents('task', 'taskDone'); + }); + } else { + console.info('${TAG} rootSuite:' + JSON.stringify(this.rootSuite)); + this.coreContext.fireEvents('task', 'taskStart'); + this.rootSuite.run(this.coreContext); + this.coreContext.fireEvents('task', 'taskDone'); + } + } + + apis() { + const _this = this; + return { + describe: function (desc, func) { + return _this.describe(desc, func); + }, + xdescribe: function (desc, func, reason) { + return _this.xdescribe(desc, func, reason); + }, + beforeItSpecified: function (itDescs, func) { + return _this.beforeItSpecified(itDescs, func); + }, + afterItSpecified: function (itDescs, func) { + return _this.afterItSpecified(itDescs, func); + }, + beforeAll: function (func) { + return _this.beforeAll(func); + }, + beforeEach: function (func) { + return _this.beforeEach(func); + }, + afterAll: function (func) { + return _this.afterAll(func); + }, + afterEach: function (func) { + return _this.afterEach(func); + } + }; + } +} + +SuiteService.Suite = class { + constructor(attrs) { + this.description = attrs.description || ''; + this.childSuites = []; + this.specs = []; + this.beforeAll = []; + this.afterAll = []; + this.beforeItSpecified = new Map(); + this.afterItSpecified = new Map(); + this.beforeEach = []; + this.afterEach = []; + this.duration = 0; + this.hookError = null; + this.isSkip = false; + this.skipReason = ''; + } + + pushSpec(spec) { + this.specs.push(spec); + } + + removeSpec(desc) { + this.specs = this.specs.filter((item, index) => { + return item.description !== desc; + }); + } + + getSpecsNum() { + return this.specs.length; + } + + isRun(coreContext) { + const configService = coreContext.getDefaultService('config'); + const suiteService = coreContext.getDefaultService('suite'); + const specService = coreContext.getDefaultService('spec'); + let breakOnError = configService.isBreakOnError(); + let isError = specService.getStatus(); + return breakOnError && isError; + } + + run(coreContext) { + const suiteService = coreContext.getDefaultService('suite'); + suiteService.setCurrentRunningSuite(this); + if (this.description !== '') { + coreContext.fireEvents('suite', 'suiteStart', this); + } + this.runHookFunc('beforeAll'); + if (this.specs.length > 0) { + const configService = coreContext.getDefaultService('config'); + if (configService.isRandom()) { + this.specs.sort(function () { + return Math.random().toFixed(1) > 0.5 ? -1 : 1; + }); + } + for (let spec in this.specs) { + let isBreakOnError = this.isRun(coreContext); + if (isBreakOnError) { + break; + } + this.runHookFunc('beforeEach'); + spec.run(coreContext); + this.runHookFunc('afterEach'); + } + } + if (this.childSuites.length > 0) { + for (let suite in this.childSuites) { + let isBreakOnError = this.isRun(coreContext); + if (isBreakOnError) { + break; + } + suite.run(coreContext); + suiteService.setCurrentRunningSuite(suite); + } + } + this.runHookFunc('afterAll'); + if (this.description !== '') { + coreContext.fireEvents('suite', 'suiteDone'); + } + } + + async asyncRunSpecs(coreContext) { + const configService = coreContext.getDefaultService('config'); + if (configService.isRandom()) { + this.specs.sort(function () { + return Math.random().toFixed(1) > 0.5 ? -1 : 1; + }); + } + const specService = coreContext.getDefaultService('spec'); + for (let specItem of this.specs) { + specService.setCurrentRunningSpec(specItem); + // 遇错即停模式,发现用例有问题,直接返回,不在执行后面的it + let isBreakOnError = this.isRun(coreContext); + if (isBreakOnError) { + console.info('break description :' + this.description); + break; + } + await coreContext.fireEvents('spec', 'specStart', specItem); + try { + for (const [itNames, hookFunc] of this.beforeItSpecified) { + if ((Object.prototype.toString.call(itNames) === '[object Array]' && itNames.includes(specItem.description)) || + (Object.prototype.toString.call(itNames) === '[object String]' && itNames === specItem.description)) { + await Reflect.apply(hookFunc, null, []); + } + break; + } + await this.runAsyncHookFunc('beforeEach'); + await specItem.asyncRun(coreContext); + for (const [itNames, hookFunc] of this.afterItSpecified) { + if ((Object.prototype.toString.call(itNames) === '[object Array]' && itNames.includes(specItem.description)) || + (Object.prototype.toString.call(itNames) === '[object String]' && itNames === specItem.description)) { + await Reflect.apply(hookFunc, null, []); + } + break; + } + await this.runAsyncHookFunc('afterEach'); + } catch (e) { + console.error(`${TAG}stack:${e?.stack}`); + console.error(`${TAG}stack end`); + if (e instanceof AssertException) { + specItem.fail = e; + } else { + specItem.error = e; + } + specService.setStatus(true); + } + specItem.setResult(); + await coreContext.fireEvents('spec', 'specDone', specItem); + specService.setCurrentRunningSpec(null); + } + } + + async asyncRunChildSuites(coreContext) { + for (let i = 0; i < this.childSuites.length; i++) { + // 遇错即停模式, 发现用例有问题,直接返回,不在执行后面的description + let isBreakOnError = this.isRun(coreContext); + if (isBreakOnError) { + console.info(`${TAG}break description : ${this.description}`); + break; + } + await this.childSuites[i].asyncRun(coreContext); + } + } + + async asyncRun(coreContext) { + const suiteService = coreContext.getDefaultService('suite'); + const specService = coreContext.getDefaultService('spec'); + + suiteService.setCurrentRunningSuite(this); + suiteService.suitesStack.push(this); + if (this.description !== '') { + await coreContext.fireEvents('suite', 'suiteStart', this); + } + + try { + await this.runAsyncHookFunc('beforeAll'); + } catch (error) { + console.error(`${TAG}${error?.stack}`); + this.hookError = error; + } + + if (this.hookError !== null) { + specService.setStatus(true); + await suiteService.setSuiteResults(this, this.hookError, coreContext); + } + + if (this.specs.length > 0 && this.hookError === null) { + await this.asyncRunSpecs(coreContext); + } + + if (this.childSuites.length > 0 && this.hookError === null) { + await this.asyncRunChildSuites(coreContext); + } + + try { + await this.runAsyncHookFunc('afterAll'); + } catch (error) { + console.error(`${TAG}${error?.stack}`); + this.hookError = error; + specService.setStatus(true); + } + + if (this.description !== '') { + await coreContext.fireEvents('suite', 'suiteDone'); + let childSuite = suiteService.suitesStack.pop(); + let currentRunningSuite = suiteService.suitesStack.pop(); + suiteService.setCurrentRunningSuite(currentRunningSuite); + suiteService.suitesStack.push(currentRunningSuite); + } + } + + runHookFunc(hookName) { + if (this[hookName] && this[hookName].length > 0) { + this[hookName].forEach(func => { + try { + func(); + } catch (e) { + console.error(`${TAG}${e.stack}`); + } + }); + } + } + + async runAsyncHookFunc(hookName) { + for (const hookItem of this[hookName]) { + try { + await hookItem(); + } catch (error) { + error['message'] += `, error in ${hookName} function`; + throw error; + } + + } + } +}; + +class SpecService { + constructor(attr) { + this.id = attr.id; + this.totalTest = 0; + this.hasError = false; + this.skipSpecNum = 0; + this.isSkipSpec = false; + this.specSkipReason = ''; + } + + init(coreContext) { + this.coreContext = coreContext; + } + + setCurrentRunningSpec(spec) { + this.currentRunningSpec = spec; + } + + setStatus(obj) { + this.hasError = obj; + } + + getStatus() { + return this.hasError; + } + + getTestTotal() { + return this.totalTest; + } + + getCurrentRunningSpec() { + return this.currentRunningSpec; + } + + + getSkipSpecNum() { + return this.skipSpecNum; + } + + initSpecService() { + this.isSkipSpec = false; + this.specSkipReason = ''; + } + + it(desc, filter, func) { + const suiteService = this.coreContext.getDefaultService('suite'); + const configService = this.coreContext.getDefaultService('config'); + let isFilter = new NestFilter().filterNestName(suiteService.targetSuiteArray, suiteService.targetSpecArray, suiteService.suitesStack, desc); + if (configService.filterWithNest(desc, filter)) { + console.info(`${TAG}filter it :${desc}`); + this.initSpecService(); + return; + } + if (configService.filterDesc(suiteService.currentRunningSuite.description, desc, filter, this.coreContext) && isFilter && !suiteService.fullRun) { + console.info(`${TAG}filter it :${desc}`); + this.initSpecService(); + } else { + let processedFunc = processFunc(this.coreContext, func); + const spec = new SpecService.Spec({ description: desc, fi: filter, fn: processedFunc }); + if (this.isSkipSpec) { + spec.isSkip = true; + spec.skipReason = this.specSkipReason; + } + this.initSpecService(); + if (configService.runSkipped === 'skipped' && !spec.isSkip) { + console.info(`${TAG} runSkipped is skipped , just run xit, don't run it: ${spec.description}`); + return; + } + if (suiteService.getCurrentRunningSuite().isSkip && !spec.isSkip) { + configService.filterXdescribe.push(suiteService.getCurrentRunningSuite().description); + } + if (typeof this.coreContext.getServices('dataDriver') !== 'undefined' && configService['dryRun'] !== 'true') { + let specStress = this.coreContext.getServices('dataDriver').dataDriver.getSpecStress(desc); + for (let i = 1; i < specStress; i++) { + this.totalTest++; + suiteService.getCurrentRunningSuite().pushSpec(spec); + } + } + // dryRun 状态下不统计压力测试重复数据 + if (configService['dryRun'] !== 'true') { + let stress = configService.getStress(); // 命令配置压力测试 + console.info(`${TAG}stress length : ${stress}`); + for (let i = 1; i < stress; i++) { + this.totalTest++; + suiteService.getCurrentRunningSuite().pushSpec(spec); + } + } + this.totalTest++; + suiteService.getCurrentRunningSuite().pushSpec(spec); + } + } + + xit(desc, filter, func, reason) { + const configService = this.coreContext.getDefaultService('config'); + const suiteService = this.coreContext.getDefaultService('suite'); + if (!configService.skipMessage && configService.runSkipped !== 'all') { + if (configService.runSkipped != null && configService.runSkipped !== '') { + let finalDesc = ''; + suiteService.suitesStack.map(suite => { + finalDesc = finalDesc + '.' + suite.description; + }); + finalDesc = (finalDesc + '#' + desc).substring(2); + if (configService.checkIfSpecInSkipRun(finalDesc)) { + console.info(`${TAG} runSkipped spec: ${desc}`); + } else { + console.info(reason == null ? `${TAG} skip spec: ${desc}` : `${TAG} skip spec: ${desc}, and the reason is ${reason}`); + return; + } + } else { + console.info(reason == null ? `${TAG} skip spec: ${desc}` : `${TAG} skip spec: ${desc}, and the reason is ${reason}`); + return; + } + } + this.skipSpecNum++; + this.isSkipSpec = true; + this.specSkipReason = reason; + this.it(desc, filter, func); + } + + apis() { + const _this = this; + return { + it: function (desc, filter, func) { + return _this.it(desc, filter, func); + }, + xit: function (desc, filter, func, reason) { + return _this.xit(desc, filter, func, reason); + } + }; + } +} + +SpecService.Spec = class { + constructor(attrs) { + this.description = attrs.description || ''; + this.fi = attrs.fi; + this.fn = attrs.fn || function () { + }; + this.fail = undefined; + this.error = undefined; + this.duration = 0; + this.startTime = 0; + this.isExecuted = false; // 当前用例是否执行 + this.isSkip = false; + this.skipReason = ''; + this.expectMsg = ''; + } + + setResult() { + if (this.fail) { + this.pass = false; + } else { + this.pass = true; + } + } + + run(coreContext) { + const specService = coreContext.getDefaultService('spec'); + specService.setCurrentRunningSpec(this); + coreContext.fireEvents('spec', 'specStart', this); + this.isExecuted = true; + try { + let dataDriver = coreContext.getServices('dataDriver'); + if (typeof dataDriver === 'undefined') { + this.fn(); + } else { + let suiteParams = dataDriver.dataDriver.getSuiteParams(); + let specParams = dataDriver.dataDriver.getSpecParams(); + console.info(`${TAG}[suite params] ${JSON.stringify(suiteParams)}`); + console.info(`${TAG}[spec params] ${JSON.stringify(specParams)}`); + if (this.fn.length === 0) { + this.fn(); + } else if (specParams.length === 0) { + this.fn(suiteParams); + } else { + specParams.forEach(paramItem => this.fn(Object.assign({}, paramItem, suiteParams))); + } + } + this.setResult(); + } catch (e) { + this.error = e; + specService.setStatus(true); + } + coreContext.fireEvents('spec', 'specDone', this); + } + + async asyncRun(coreContext) { + const dataDriver = coreContext.getServices('dataDriver'); + if (typeof dataDriver === 'undefined') { + await this.fn(); + } else { + const suiteParams = dataDriver.dataDriver.getSuiteParams(); + const specParams = dataDriver.dataDriver.getSpecParams(); + console.info(`[suite params] ${JSON.stringify(suiteParams)}`); + console.info(`[spec params] ${JSON.stringify(specParams)}`); + if (this.fn.length === 0) { + await this.fn(); + } else if (specParams.length === 0) { + await this.fn(suiteParams); + } else { + for (const paramItem of specParams) { + await this.fn(Object.assign({}, paramItem, suiteParams)); + } + } + } + + this.isExecuted = true; + } + + filterCheck(coreContext) { + const specService = coreContext.getDefaultService('spec'); + specService.setCurrentRunningSpec(this); + return true; + } +}; + +class ExpectService { + constructor(attr) { + this.id = attr.id; + this.matchers = {}; + this.customMatchers = []; + } + + expect(actualValue) { + return this.wrapMatchers(actualValue); + } + + init(coreContext) { + this.coreContext = coreContext; + this.addMatchers(this.basicMatchers()); + } + + addMatchers(matchers) { + for (const matcherName in matchers) { + if (Object.prototype.hasOwnProperty.call(matchers, matcherName)) { + this.matchers[matcherName] = matchers[matcherName]; + } + } + } + + removeMatchers(customAssertionName) { + if (customAssertionName === 'all') { + for (const matcherName in this.matchers) { + this.matchers[matcherName] = this.customMatchers.includes(matcherName) ? (() => {throw new Error(`${matcherName} is unregistered`)}) : undefined; + } + }else { + this.matchers[customAssertionName] = () => { + throw new Error(`${customAssertionName} is unregistered`) + }; + } + } + + basicMatchers() { + return { + assertTrue: function (actualValue) { + return { + pass: (actualValue) === true, + message: 'expect true, actualValue is ' + actualValue + }; + }, + assertEqual: function (actualValue, args) { + let msg = 'expect ' + actualValue + ' equals ' + args[0]; + if (actualValue == args[0]) { // 数值相同,提示数据类型 + const aClassName = Object.prototype.toString.call(actualValue); + const bClassName = Object.prototype.toString.call(args[0]); + msg = 'expect ' + actualValue + aClassName + ' equals ' + args[0] + bClassName + 'strict mode inspect type'; + } + return { + pass: (actualValue) === args[0], + expectValue: args[0], + message: msg + }; + }, + assertThrow: function (actual, args) { + const result = { + pass: false + }; + if (typeof actual !== 'function') { + result.message = 'toThrow\'s Actual should be a Function'; + } else { + let hasThrow = false; + let throwError; + try { + actual(); + } catch (e) { + hasThrow = true; + throwError = e; + } + if (!hasThrow) { + result.message = 'function did not throw an exception'; + } else if (throwError && throwError.message === args[0]) { + result.pass = true; + } else { + result.message = `expect to throw ${args[0]} , actual throw ${throwError.message}`; + } + } + return result; + } + }; + } + + initWrapMatchers(currentRunningSpec) { + return { + // 翻转标识 + isNot: false, + // 翻转方法 + not: function () { + this.isNot = true; + return this; + }, + message: function (msg) { + currentRunningSpec.expectMsg = msg; + console.info(`${TAG} msg: ${msg}`); + return this; + } + }; + + } + wrapMatchers(actualValue) { + const _this = this; + const specService = _this.coreContext.getDefaultService('spec'); + const currentRunningSpec = specService.getCurrentRunningSpec(); + const wrappedMatchers = this.initWrapMatchers(currentRunningSpec); + const currentRunningSuite = _this.coreContext.getDefaultService('suite').getCurrentRunningSuite(); + for (const matcherName in this.matchers) { + let result = Object.prototype.hasOwnProperty.call(this.matchers, matcherName); + if (!result) { + continue; + } + if (matcherName.search('assertPromise') == 0) { + wrappedMatchers[matcherName] = async function () { + await _this.matchers[matcherName](actualValue, arguments).then(function (result) { + if (wrappedMatchers.isNot) { + result.pass = !result.pass; + } + result.actualValue = actualValue; + result.checkFunc = matcherName; + if (!result.pass) { + const assertError = new AssertException(result.message); + currentRunningSpec ? currentRunningSpec.fail = assertError : currentRunningSuite.hookError = assertError; + throw assertError; + } + }); + }; + } else { + wrappedMatchers[matcherName] = function () { + const result = _this.customMatchers.includes(matcherName) ? _this.matchers[matcherName](actualValue, arguments[0]) : _this.matchers[matcherName](actualValue, arguments); + if (wrappedMatchers.isNot) { + result.pass = !result.pass; + result.message = LogExpectError.getErrorMsg(matcherName, actualValue, arguments[0], result.message); + } + result.actualValue = actualValue; + result.checkFunc = matcherName; + if (!result.pass) { + const assertError = new AssertException(result.message); + currentRunningSpec ? currentRunningSpec.fail = assertError : currentRunningSuite.hookError = assertError; + throw assertError; + } + }; + } + } + return wrappedMatchers; + } + + apis() { + const _this = this; + return { + expect: function (actualValue) { + return _this.expect(actualValue); + } + }; + } +} + +class ReportService { + constructor(attr) { + this.id = attr.id; + } + + init(coreContext) { + this.coreContext = coreContext; + this.specService = this.coreContext.getDefaultService('spec'); + this.suiteService = this.coreContext.getDefaultService('suite'); + this.duration = 0; + } + + taskStart() { + console.info(`${TAG}[start] start run suites`); + } + + async suiteStart() { + console.info(`${TAG}[suite start]${this.suiteService.getCurrentRunningSuite().description}`); + } + + async specStart() { + console.info(`${TAG}start running case '${this.specService.currentRunningSpec.description}'`); + this.index = this.index + 1; + let spec = this.specService.currentRunningSpec; + spec.startTime = await SysTestKit.getRealTime(); + } + + async specDone() { + let msg = ''; + let spec = this.specService.currentRunningSpec; + let suite = this.suiteService.currentRunningSuite; + spec.duration = await SysTestKit.getRealTime() - spec.startTime; + suite.duration += spec.duration; + if (spec.error) { + this.formatPrint('error', spec.description + ' ; consuming ' + spec.duration + 'ms'); + this.formatPrint('errorDetail', spec.error); + } else if (spec.fail) { + this.formatPrint('fail', spec.description + ' ; consuming ' + spec.duration + 'ms'); + this.formatPrint('failDetail', spec.fail?.message); + } else { + this.formatPrint('pass', spec.description + ' ; consuming ' + spec.duration + 'ms'); + } + this.formatPrint(this.specService.currentRunningSpec.error, msg); + } + + suiteDone() { + let suite = this.suiteService.currentRunningSuite; + let message = suite.hookError ? `, ${suite.hookError?.message}` : ''; + console.info(`[suite end] ${suite.description} consuming ${suite.duration} ms${message}`); + } + + taskDone() { + let msg = ''; + let summary = this.suiteService.getSummary(); + msg = 'total cases:' + summary.total + ';failure ' + summary.failure + ',' + 'error ' + summary.error; + msg += ',pass ' + summary.pass + '; consuming ' + summary.duration + 'ms'; + console.info(`${TAG}${msg}`); + console.info(`${TAG}[end] run suites end`); + } + + incorrectFormat() { + if (this.coreContext.getDefaultService('config').filterValid.length !== 0) { + this.coreContext.getDefaultService('config').filterValid.forEach(function (item) { + console.info(`${TAG}this param ${item} is invalid`); + }); + } + } + + incorrectTestSuiteFormat() { + if (this.coreContext.getDefaultService('config').filterXdescribe.length !== 0) { + this.coreContext.getDefaultService('config').filterXdescribe.forEach(function (item) { + console.info(`${TAG}xdescribe: ${item} should not contain it`); + }) + } + } + + formatPrint(type, msg) { + switch (type) { + case 'pass': + console.info(`${TAG}[pass]${msg}`); + break; + case 'fail': + console.info(`${TAG}[fail]${msg}`); + break; + case 'failDetail': + console.info(`${TAG}[failDetail]${msg}`); + break; + case 'error': + console.info(`${TAG}[error]${msg}`); + break; + case 'errorDetail': + console.info(`${TAG}[errorDetail]${msg}`); + break; + } + } + + sleep(numberMillis) { + var now = new Date(); + var exitTime = now.getTime() + numberMillis; + while (true) { + now = new Date(); + if (now.getTime() > exitTime) { + return; + } + } + } +} + +export { + SuiteService, + SpecService, + ExpectService, + ReportService +}; diff --git a/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/testrunner/OpenHarmonyTestRunner.ts b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/testrunner/OpenHarmonyTestRunner.ts new file mode 100644 index 0000000000000000000000000000000000000000..e6f4c1b12dd69714ed5a4524671abca1fbcaa58c --- /dev/null +++ b/NonSameLayerRendering/oh_modules/.ohpm/@ohos+hypium@1.0.19/oh_modules/@ohos/hypium/src/main/testrunner/OpenHarmonyTestRunner.ts @@ -0,0 +1,83 @@ +/* + * Copyright (c) 2023-2024 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 { abilityDelegatorRegistry, TestRunner } from '@kit.TestKit'; +import { BusinessError } from '@kit.BasicServicesKit'; +import { hilog } from '@kit.PerformanceAnalysisKit'; +import { resourceManager } from '@kit.LocalizationKit'; +import { util } from '@kit.ArkTS'; +import { Hypium } from '@ohos/hypium'; +import testsuite from '../test/List.test'; + +let abilityDelegator: abilityDelegatorRegistry.AbilityDelegator; +let abilityDelegatorArguments: abilityDelegatorRegistry.AbilityDelegatorArgs; +let jsonPath: string = 'mock/mock-config.json'; +let domain: number = 0x0000; //日志标识,0x0000作为测试框架的业务标识 +let tag: string = 'testTag'; //日志标识字符串,作为tag标识当前runner类下的测试行为 + +export default class OpenHarmonyTestRunner implements TestRunner { + constructor() { + } + + onPrepare() { + hilog.info(domain, tag, '%{public}s', 'OpenHarmonyTestRunner OnPrepare'); + } + + async onRun() { + hilog.info(domain, tag, '%{public}s', 'OpenHarmonyTestRunner onRun run'); + abilityDelegatorArguments = abilityDelegatorRegistry.getArguments(); + abilityDelegator = abilityDelegatorRegistry.getAbilityDelegator(); + let moduleName = abilityDelegatorArguments.parameters['-m']; + let context = abilityDelegator.getAppContext().getApplicationContext().createModuleContext(moduleName); + let mResourceManager = context.resourceManager; + await checkMock(abilityDelegator, mResourceManager); + hilog.info(domain, tag, '%{public}s', 'start run testcase!!!'); + Hypium.hypiumTest(abilityDelegator, abilityDelegatorArguments, testsuite); + hilog.info(domain, tag, '%{public}s', 'OpenHarmonyTestRunner onRun end'); + } +} + +async function checkMock(abilityDelegator: abilityDelegatorRegistry.AbilityDelegator, resourceManager: resourceManager.ResourceManager) { + let rawFile: Uint8Array; + try { + rawFile = resourceManager.getRawFileContentSync(jsonPath); + hilog.info(domain, tag, 'MockList file exists'); + let mockStr: string = util.TextDecoder.create("utf-8", { ignoreBOM: true }).decodeWithStream(rawFile); + let mockMap: Record = getMockList(mockStr); + try { + abilityDelegator.setMockList(mockMap); + } catch (error) { + let code = (error as BusinessError).code; + let message = (error as BusinessError).message; + hilog.error(domain, tag, `abilityDelegator.setMockList failed, error code: ${code}, message: ${message}.`); + } + } catch (error) { + let code = (error as BusinessError).code; + let message = (error as BusinessError).message; + hilog.error(domain, tag, `ResourceManager:callback getRawFileContent failed, error code: ${code}, message: ${message}.`); + } +} + +function getMockList(jsonStr: string) { + let jsonObj: Record = JSON.parse(jsonStr); + let map: Map = new Map(Object.entries(jsonObj)); + let mockList: Record = {}; + map.forEach((value: object, key: string) => { + let realValue: string = value['source'].toString(); + mockList[key] = realValue; + }); + hilog.info(domain, tag, '%{public}s', 'mock-json value:' + JSON.stringify(mockList) ?? ''); + return mockList; +} \ No newline at end of file diff --git a/NonSameLayerRendering/oh_modules/.ohpm/lock.json5 b/NonSameLayerRendering/oh_modules/.ohpm/lock.json5 new file mode 100644 index 0000000000000000000000000000000000000000..3f46e0c8dd4abcdf244fbde05959ca9a8fd0f723 --- /dev/null +++ b/NonSameLayerRendering/oh_modules/.ohpm/lock.json5 @@ -0,0 +1,55 @@ +{ + "lockVersion": "1.0", + "settings": { + "resolveConflict": true, + "resolveConflictStrict": false, + "installAll": true + }, + "overrides": {}, + "overrideDependencyMap": {}, + "modules": { + ".": { + "name": "", + "dependencies": {}, + "devDependencies": { + "@ohos/hypium": { + "specifier": "1.0.19", + "version": "1.0.19" + }, + "@ohos/hamock": { + "specifier": "1.0.0", + "version": "1.0.0" + } + }, + "dynamicDependencies": {}, + "maskedByOverrideDependencyMap": false + }, + "entry": { + "name": "entry", + "dependencies": {}, + "devDependencies": {}, + "dynamicDependencies": {}, + "maskedByOverrideDependencyMap": false + } + }, + "packages": { + "@ohos/hypium@1.0.19": { + "integrity": "sha512-cEjDgLFCm3cWZDeRXk7agBUkPqjWxUo6AQeiu0gEkb3J8ESqlduQLSIXeo3cCsm8U/asL7iKjF85ZyOuufAGSQ==", + "storePath": "oh_modules/.ohpm/@ohos+hypium@1.0.19", + "dependencies": {}, + "dynamicDependencies": {}, + "dev": true, + "dynamic": false, + "maskedByOverrideDependencyMap": false + }, + "@ohos/hamock@1.0.0": { + "integrity": "sha512-K6lDPYc6VkKe6ZBNQa9aoG+ZZMiwqfcR/7yAVFSUGIuOAhPvCJAo9+t1fZnpe0dBRBPxj2bxPPbKh69VuyAtDg==", + "storePath": "oh_modules/.ohpm/@ohos+hamock@1.0.0", + "dependencies": {}, + "dynamicDependencies": {}, + "dev": true, + "dynamic": false, + "maskedByOverrideDependencyMap": false + } + } +} \ No newline at end of file diff --git a/ScreenFlickerSolution/entry/src/main/ets/pages/ClickError.ets b/ScreenFlickerSolution/entry/src/main/ets/pages/ClickError.ets index 81eafdf54bffeb7ef684de47a306affaf4aaade1..67de8c75876497be96b3e043f322392d68175f69 100644 --- a/ScreenFlickerSolution/entry/src/main/ets/pages/ClickError.ets +++ b/ScreenFlickerSolution/entry/src/main/ets/pages/ClickError.ets @@ -13,6 +13,7 @@ * limitations under the License. */ +// [Start click_error] @Entry @Component struct ClickError { @@ -33,7 +34,7 @@ struct ClickError { .scale({ x: this.scaleValue, y: this.scaleValue }) .onClick(() => { // When the animation is delivered, the count is increased by 1 - animateTo({ + this.getUIContext().animateTo({ curve: Curve.EaseInOut, duration: 350, onFinish: () => { @@ -56,4 +57,5 @@ struct ClickError { .height('100%') .width('100%') } -} \ No newline at end of file +} +// [End click_error] \ No newline at end of file diff --git a/ScreenFlickerSolution/entry/src/main/ets/pages/ClickRight.ets b/ScreenFlickerSolution/entry/src/main/ets/pages/ClickRight.ets index c8272b765886b3f974f3135aac0b375d550aa6e3..da981b66f8fa6c3a404f66fe3f4e7036d73698df 100644 --- a/ScreenFlickerSolution/entry/src/main/ets/pages/ClickRight.ets +++ b/ScreenFlickerSolution/entry/src/main/ets/pages/ClickRight.ets @@ -13,6 +13,7 @@ * limitations under the License. */ +// [Start click_right] @Entry @Component struct ClickRight { @@ -35,7 +36,7 @@ struct ClickRight { .onClick(() => { // When the animation is delivered, the count is increased by 1 this.cnt = this.cnt + 1; - animateTo({ + this.getUIContext().animateTo({ curve: Curve.EaseInOut, duration: 350, onFinish: () => { @@ -61,4 +62,5 @@ struct ClickRight { .height('100%') .width('100%') } -} \ No newline at end of file +} +// [End click_right] \ No newline at end of file diff --git a/ScreenFlickerSolution/entry/src/main/ets/pages/Index.ets b/ScreenFlickerSolution/entry/src/main/ets/pages/Index.ets index f97d7738adc1ebbfeba4d46f80bebfc06da3e29d..f16f8671fb8c5c33232bf7f70e82cf85a2014a28 100644 --- a/ScreenFlickerSolution/entry/src/main/ets/pages/Index.ets +++ b/ScreenFlickerSolution/entry/src/main/ets/pages/Index.ets @@ -34,7 +34,7 @@ struct Index { .height(40) .fontWeight(FontWeight.Bold) .onClick(() => { - router.pushUrl({ url: 'pages/ClickError' }); + this.getUIContext().getRouter().pushUrl({ url: 'pages/ClickError' }); }) .margin({ bottom: 12 }) @@ -44,7 +44,7 @@ struct Index { .height(40) .fontWeight(FontWeight.Bold) .onClick(() => { - router.pushUrl({ url: 'pages/ClickRight' }); + this.getUIContext().getRouter().pushUrl({ url: 'pages/ClickRight' }); }) .margin({ bottom: 12 }) @@ -54,7 +54,7 @@ struct Index { .height(40) .fontWeight(FontWeight.Bold) .onClick(() => { - router.pushUrl({ url: 'pages/TabsError' }); + this.getUIContext().getRouter().pushUrl({ url: 'pages/TabsError' }); }) .margin({ bottom: 12 }) @@ -64,7 +64,7 @@ struct Index { .height(40) .fontWeight(FontWeight.Bold) .onClick(() => { - router.pushUrl({ url: 'pages/TabsRight' }); + this.getUIContext().getRouter().pushUrl({ url: 'pages/TabsRight' }); }) .margin({ bottom: 12 }) @@ -74,7 +74,7 @@ struct Index { .height(40) .fontWeight(FontWeight.Bold) .onClick(() => { - router.pushUrl({ url: 'pages/PullToRefreshError' }); + this.getUIContext().getRouter().pushUrl({ url: 'pages/PullToRefreshError' }); }) .margin({ bottom: 12 }) @@ -84,7 +84,7 @@ struct Index { .height(40) .fontWeight(FontWeight.Bold) .onClick(() => { - router.pushUrl({ url: 'pages/PullToRefreshRight' }); + this.getUIContext().getRouter().pushUrl({ url: 'pages/PullToRefreshRight' }); }) .margin({ bottom: 12 }) } diff --git a/ScreenFlickerSolution/entry/src/main/ets/pages/PullToRefreshError.ets b/ScreenFlickerSolution/entry/src/main/ets/pages/PullToRefreshError.ets index 32153f5808ce4f924ce19cac35168a9227ccdec3..58b35d056f41de55048fa79d1e122fea4568282c 100644 --- a/ScreenFlickerSolution/entry/src/main/ets/pages/PullToRefreshError.ets +++ b/ScreenFlickerSolution/entry/src/main/ets/pages/PullToRefreshError.ets @@ -15,6 +15,7 @@ import util from '@ohos.util'; import { PullToRefresh, PullToRefreshConfigurator } from '@ohos/pulltorefresh/index'; +import { common } from '@kit.AbilityKit'; @Entry @Component @@ -32,9 +33,11 @@ struct PullToRefreshError { @State private angle1?: number | string = 0; @State private angle2?: number | string = 0; @State loadText: ResourceStr = ''; + private context: common.UIAbilityContext = this.getUIContext().getHostContext() as common.UIAbilityContext; + aboutToAppear() { - const arrayModelMockData: Array = getNews('mockDataOne.json'); + const arrayModelMockData: Array = getNews('mockDataOne.json', this.context); this.newsData = arrayModelMockData; } @@ -80,9 +83,9 @@ struct PullToRefreshError { let newsModelMockData: Array = []; // Switch the obtained data file according to mockFlag if (this.mockFlag) { - newsModelMockData = getNews('mockDataTwo.json'); + newsModelMockData = getNews('mockDataTwo.json', this.context); } else { - newsModelMockData = getNews('mockDataOne.json'); + newsModelMockData = getNews('mockDataOne.json', this.context); } this.mockFlag = !this.mockFlag; const array = this.newsData.slice(); @@ -101,7 +104,7 @@ struct PullToRefreshError { if (this.newsDataListIndex < 4) { // Simulate network request operation, get data after 1.5 seconds of network request, notify the component to change the list data setTimeout(() => { - let newsModelMockData: Array = getNews('mockDataOne.json'); + let newsModelMockData: Array = getNews('mockDataOne.json', this.context); const array = this.newsData; array.push(...newsModelMockData); this.newsData = array; @@ -207,6 +210,7 @@ struct PullToRefreshError { .backgroundColor('#F1F3F5') } + // [Start get_list_view_error] @Builder private getListView() { List({ @@ -237,6 +241,7 @@ struct PullToRefreshError { // You must set the list to slide to edge to have no effect, otherwise the pullToRefresh component's slide up and drop down method cannot be triggered. .edgeEffect(EdgeEffect.None) } + // [End get_list_view_error] aboutToDisappear() { this.newsData = []; @@ -336,9 +341,9 @@ class JsonObject { } // Get data - getNewsData(): Array { + getNewsData(context: common.UIAbilityContext): Array { // Get data from a local file - const value = getContext().resourceManager.getRawFileContentSync(this.jsonFileDir); + const value = context?.resourceManager.getRawFileContentSync(this.jsonFileDir); // Decode to utf-8 format const textDecoder = util.TextDecoder.create('utf-8', { ignoreBOM: true @@ -357,8 +362,8 @@ class JsonObject { } } -function getNews(mockFileDir: string): Array { +function getNews(mockFileDir: string, context: common.UIAbilityContext): Array { const jsonObj: JsonObject = new JsonObject(mockFileDir); - const newsModelMockData: Array = jsonObj.getNewsData(); + const newsModelMockData: Array = jsonObj.getNewsData(context); return newsModelMockData; } diff --git a/ScreenFlickerSolution/entry/src/main/ets/pages/PullToRefreshRight.ets b/ScreenFlickerSolution/entry/src/main/ets/pages/PullToRefreshRight.ets index 948df30bea200e80f4c99d1b2b52e24fbd2e5fab..5a8dd2072d4b53baabd598bd28224072f5a8925b 100644 --- a/ScreenFlickerSolution/entry/src/main/ets/pages/PullToRefreshRight.ets +++ b/ScreenFlickerSolution/entry/src/main/ets/pages/PullToRefreshRight.ets @@ -15,6 +15,7 @@ import util from '@ohos.util'; import { PullToRefresh, PullToRefreshConfigurator } from '@ohos/pulltorefresh/index'; +import { common } from '@kit.AbilityKit'; @Entry @Component @@ -32,9 +33,10 @@ struct PullToRefreshError { @State private angle1?: number | string = 0; @State private angle2?: number | string = 0; @State loadText: ResourceStr = ''; + private context: common.UIAbilityContext = this.getUIContext().getHostContext() as common.UIAbilityContext; aboutToAppear() { - const arrayModelMockData: Array = getNews('mockDataOne.json'); + const arrayModelMockData: Array = getNews('mockDataOne.json', this.context); this.newsData = arrayModelMockData; } @@ -80,9 +82,9 @@ struct PullToRefreshError { let newsModelMockData: Array = []; // Switch the obtained data file according to mockFlag if (this.mockFlag) { - newsModelMockData = getNews('mockDataTwo.json'); + newsModelMockData = getNews('mockDataTwo.json', this.context); } else { - newsModelMockData = getNews('mockDataOne.json'); + newsModelMockData = getNews('mockDataOne.json', this.context); } this.mockFlag = !this.mockFlag; const array = this.newsData.slice(); @@ -101,7 +103,7 @@ struct PullToRefreshError { if (this.newsDataListIndex < 4) { // Simulate network request operation, get data after 1.5 seconds of network request, notify the component to change the list data setTimeout(() => { - let newsModelMockData: Array = getNews('mockDataOne.json'); + let newsModelMockData: Array = getNews('mockDataOne.json', this.context); const array = this.newsData; array.push(...newsModelMockData); this.newsData = array; @@ -207,6 +209,7 @@ struct PullToRefreshError { .backgroundColor('#F1F3F5') } + // [Start get_list_view_right] @Builder private getListView() { List({ @@ -237,6 +240,7 @@ struct PullToRefreshError { // You must set the list to slide to edge to have no effect, otherwise the pullToRefresh component's slide up and drop down method cannot be triggered. .edgeEffect(EdgeEffect.None) } + // [End get_list_view_right] aboutToDisappear() { this.newsData = []; @@ -336,9 +340,9 @@ class JsonObject { } // Get data - getNewsData(): Array { + getNewsData(context: common.UIAbilityContext): Array { // Get data from a local file - const value = getContext().resourceManager.getRawFileContentSync(this.jsonFileDir); + const value = context?.resourceManager.getRawFileContentSync(this.jsonFileDir); // Decode to utf-8 format const textDecoder = util.TextDecoder.create('utf-8', { ignoreBOM: true @@ -357,8 +361,8 @@ class JsonObject { } } -function getNews(mockFileDir: string): Array { +function getNews(mockFileDir: string, context: common.UIAbilityContext): Array { const jsonObj: JsonObject = new JsonObject(mockFileDir); - const newsModelMockData: Array = jsonObj.getNewsData(); + const newsModelMockData: Array = jsonObj.getNewsData(context); return newsModelMockData; } diff --git a/ScreenFlickerSolution/entry/src/main/ets/pages/TabsError.ets b/ScreenFlickerSolution/entry/src/main/ets/pages/TabsError.ets index 5904f3b065f94ed0ecf8c2f58ea2a81180be3e6f..d389381e77182879b837035f226f1f064510da50 100644 --- a/ScreenFlickerSolution/entry/src/main/ets/pages/TabsError.ets +++ b/ScreenFlickerSolution/entry/src/main/ets/pages/TabsError.ets @@ -13,6 +13,7 @@ * limitations under the License. */ +// [Start tabs_error] @Entry @Component struct TabsContainer { @@ -109,3 +110,4 @@ struct TabsContainer { .width('100%') } } +// [End tabs_error] diff --git a/ScreenFlickerSolution/entry/src/main/ets/pages/TabsRight.ets b/ScreenFlickerSolution/entry/src/main/ets/pages/TabsRight.ets index 7efdfbed45f10060dabc0f09497be18395be8c1d..6f97f9ce88e4e3e63f4087faf0898f9c4ef30213 100644 --- a/ScreenFlickerSolution/entry/src/main/ets/pages/TabsRight.ets +++ b/ScreenFlickerSolution/entry/src/main/ets/pages/TabsRight.ets @@ -43,6 +43,7 @@ struct TabsRight { .width('100%') } + // [Start tabs_right_build] build() { Stack({ alignContent: Alignment.TopStart }) { Tabs({ barPosition: BarPosition.Start }) { @@ -123,7 +124,9 @@ struct TabsRight { } .width('100%') } + // [End tabs_right_build] + // [Start get_current_indicator_info] private getCurrentIndicatorInfo(index: number, event: TabsAnimationEvent): Record { let nextIndex = index; if (index > 0 && event.currentOffset > 0) { @@ -144,7 +147,7 @@ struct TabsRight { private startAnimateTo(duration: number, leftMargin: number, width: number) { this.isStartAnimateTo = true; - animateTo({ + this.getUIContext().animateTo({ duration: duration, // duration curve: Curve.Linear, // curve iterations: 1, // iterations @@ -157,4 +160,5 @@ struct TabsRight { this.indicatorWidth = width; }); } + // [End get_current_indicator_info] } \ No newline at end of file