diff --git a/modulecheck/BUILD.gn b/modulecheck/BUILD.gn index 828ff8af4880ee54be83ae2240cb5c1a1e0d961b..ce6cc75a9eaef0623d54874abc77c96a3e274571 100644 --- a/modulecheck/BUILD.gn +++ b/modulecheck/BUILD.gn @@ -77,3 +77,8 @@ ohos_prebuilt_etc("configurationSchema_json") { source = "configuration.json" install_enable = false } + +ohos_prebuilt_etc("hspStartupSchema_json") { + source = "hspStartup.json" + install_enable = false +} diff --git a/modulecheck/appStartup.json b/modulecheck/appStartup.json index 238efcd8501a9cdac93ab127feeee07fdb4e0036..cf3e2ce6498c6c0308bdfa5870a8853ff77be20f 100644 --- a/modulecheck/appStartup.json +++ b/modulecheck/appStartup.json @@ -4,13 +4,13 @@ "type": "object", "additionalProperties": false, "required": [ - "startupTasks", "configEntry" ], "propertyNames": { "enum": [ "startupTasks", - "configEntry" + "configEntry", + "appPreloadHintStartupTasks" ] }, "properties": { @@ -80,6 +80,68 @@ "description": "Indicates the js code path corresponding to the startup config.", "type": "string", "maxLength": 127 + }, + "appPreloadHintStartupTasks": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "object", + "propertyNames": { + "enum": [ + "name", + "srcEntry", + "dependencies", + "excludeFromAutoStart", + "runOnThread", + "waitOnMainThread" + ] + }, + "required": [ + "name", + "srcEntry" + ], + "properties": { + "name": { + "description": "Indicates the name of the preload task.", + "type": "string", + "pattern": "^[a-zA-Z][0-9a-zA-Z_.]+$", + "maxLength": 127 + }, + "srcEntry": { + "description": "Indicates the js code path corresponding to the preload task.", + "type": "string", + "maxLength": 127 + }, + "dependencies": { + "description": "Indicates the dependencies of the preload task.", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string" + }, + "default": [] + }, + "excludeFromAutoStart": { + "description": "Indicates whether the preload task is excluded from automatic start.", + "type": "boolean", + "default": false + }, + "runOnThread": { + "description": "Indicates the running thread of the preload task.", + "type": "string", + "enum": [ + "mainThread", + "taskPool" + ], + "default": "mainThread" + }, + "waitOnMainThread": { + "description": "Indicates whether the preload task block the main thread.", + "type": "boolean", + "default": true + } + } + } } } } \ No newline at end of file diff --git a/modulecheck/hspStartup.json b/modulecheck/hspStartup.json new file mode 100644 index 0000000000000000000000000000000000000000..08b44b10e01918d412a6dce20cfc19e7a1eac2b6 --- /dev/null +++ b/modulecheck/hspStartup.json @@ -0,0 +1,140 @@ +{ + "title": "JSON schema for hsp_startup.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "additionalProperties": false, + "propertyNames": { + "enum": [ + "hspStartupTasks", + "hspPreloadHintStartupTasks" + ] + }, + "properties": { + "hspStartupTasks": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "object", + "propertyNames": { + "enum": [ + "name", + "srcEntry", + "dependencies", + "excludeFromAutoStart", + "runOnThread", + "waitOnMainThread" + ] + }, + "required": [ + "name", + "srcEntry" + ], + "properties": { + "name": { + "description": "Indicates the name of the har/hsp startup task.", + "type": "string", + "pattern": "^[a-zA-Z][0-9a-zA-Z_.]+$", + "maxLength": 127 + }, + "srcEntry": { + "description": "Indicates the js code path corresponding to the har/hsp startup task.", + "type": "string", + "maxLength": 127 + }, + "dependencies": { + "description": "Indicates the dependencies of the har/hsp startup task.", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string" + }, + "default": [] + }, + "excludeFromAutoStart": { + "description": "Har/hsp startup task does not support automatic start, excludeFromAutoStart can only be set to true.", + "type": "boolean", + "enum": [true], + "default": true + }, + "runOnThread": { + "description": "Indicates the running thread of the har/hsp startup task.", + "type": "string", + "enum": [ + "mainThread", + "taskPool" + ], + "default": "mainThread" + }, + "waitOnMainThread": { + "description": "Indicates whether the har/hsp startup task block the main thread.", + "type": "boolean", + "default": true + } + } + } + }, + "hspPreloadHintStartupTasks": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "object", + "propertyNames": { + "enum": [ + "name", + "srcEntry", + "dependencies", + "excludeFromAutoStart", + "runOnThread", + "waitOnMainThread" + ] + }, + "required": [ + "name", + "srcEntry" + ], + "properties": { + "name": { + "description": "Indicates the name of the har/hsp preload task.", + "type": "string", + "pattern": "^[a-zA-Z][0-9a-zA-Z_.]+$", + "maxLength": 127 + }, + "srcEntry": { + "description": "Indicates the js code path corresponding to the har/hsp preload task.", + "type": "string", + "maxLength": 127 + }, + "dependencies": { + "description": "Indicates the dependencies of the har/hsp preload task.", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string" + }, + "default": [] + }, + "excludeFromAutoStart": { + "description": "Har/hsp preload task does not support automatic start, excludeFromAutoStart can only be set to true.", + "type": "boolean", + "enum": [true], + "default": true + }, + "runOnThread": { + "description": "Indicates the running thread of the har/hsp preload task.", + "type": "string", + "enum": [ + "mainThread", + "taskPool" + ], + "default": "mainThread" + }, + "waitOnMainThread": { + "description": "Indicates whether the har/hsp preload task block the main thread.", + "type": "boolean", + "default": true + } + } + } + } + } +} \ No newline at end of file diff --git a/modulecheck/module.json b/modulecheck/module.json index 39621512192439bf73fbfa8c25379443991c444d..76dc049265b6686c9dd986f29c933b89aa984905 100644 --- a/modulecheck/module.json +++ b/modulecheck/module.json @@ -44,7 +44,8 @@ "targetModuleName", "targetPriority", "generateBuildHash", - "routerMap" + "routerMap", + "appStartup" ] }, "required": [ @@ -85,7 +86,8 @@ "testRunner", "dependencies", "libIsolation", - "routerMap" + "routerMap", + "appStartup" ] }, "required": [