diff --git a/modulecheck/BUILD.gn b/modulecheck/BUILD.gn index 828ff8af4880ee54be83ae2240cb5c1a1e0d961b..9424383cfa99b9f246430a474c4e533526a1f90d 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("appStartupInnerSchema_json") { + source = "appStartupInner.json" + install_enable = false +} diff --git a/modulecheck/appStartup.json b/modulecheck/appStartup.json index 238efcd8501a9cdac93ab127feeee07fdb4e0036..92d5c7b31f86d9d7e4071aa5c0bab6c6615dc979 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,61 @@ "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" + ] + }, + "required": [ + "name", + "srcEntry", + "runOnThread" + ], + "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, preload task runs only on child thread.", + "type": "string", + "enum": [ + "taskPool" + ] + } + } + } } } } \ No newline at end of file diff --git a/modulecheck/appStartupInner.json b/modulecheck/appStartupInner.json new file mode 100644 index 0000000000000000000000000000000000000000..7d2b884982c404c8e71082804c8a20948f9bba01 --- /dev/null +++ b/modulecheck/appStartupInner.json @@ -0,0 +1,137 @@ +{ + "title": "JSON schema for appStartup_inner.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "additionalProperties": false, + "propertyNames": { + "enum": [ + "startupTasks", + "appPreloadHintStartupTasks" + ] + }, + "properties": { + "startupTasks": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "object", + "propertyNames": { + "enum": [ + "name", + "srcEntry", + "dependencies", + "excludeFromAutoStart", + "runOnThread", + "waitOnMainThread" + ] + }, + "required": [ + "name", + "srcEntry", + "excludeFromAutoStart" + ], + "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 + ] + }, + "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 + } + } + } + }, + "appPreloadHintStartupTasks": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "object", + "propertyNames": { + "enum": [ + "name", + "srcEntry", + "dependencies", + "excludeFromAutoStart", + "runOnThread" + ] + }, + "required": [ + "name", + "srcEntry", + "excludeFromAutoStart", + "runOnThread" + ], + "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 + ] + }, + "runOnThread": { + "description": "Indicates the running thread, preload task runs only on child thread.", + "type": "string", + "enum": [ + "taskPool" + ] + } + } + } + } + } +} \ 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": [