From d8819131831d93b1f9ad1abbf555dfd255da28cb Mon Sep 17 00:00:00 2001 From: HanSY Date: Fri, 15 Aug 2025 17:46:38 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0iddefinedSchema=E6=96=87?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: HanSY --- BUILD.gn | 7 +++++++ id_defines.json | 43 +++++++++++++++++++++++++++++++++++++++++++ restool.gni | 1 + 3 files changed, 51 insertions(+) create mode 100644 id_defines.json diff --git a/BUILD.gn b/BUILD.gn index bba7d1b..1c369a7 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -116,4 +116,11 @@ ohos_prebuilt_etc("restool_faq") { subsystem_name = "developtools" part_name = "global_resource_tool" install_enable = false +} + +ohos_prebuilt_etc("restool_ids_schema") { + source = "${ids_schema_path}" + subsystem_name = "developtools" + part_name = "global_resource_tool" + install_enable = false } \ No newline at end of file diff --git a/id_defines.json b/id_defines.json new file mode 100644 index 0000000..30e1531 --- /dev/null +++ b/id_defines.json @@ -0,0 +1,43 @@ +{ + "title": "JSON schema for definedIds.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "properties": { + "record": { + "type": "array", + "items": { + "type": "object", + "properties": { + "type": { + "type": "string", + "enum": [ + "media", + "profile", + "integer", + "string", + "strarray", + "intarray", + "color", + "plural", + "boolean", + "pattern", + "theme", + "float", + "symbol" + ] + }, + "name": { + "type": "string", + "minLength": 1 + }, + "id": { + "type": "string", + "pattern": "^0x(0[1-689a-fA-F][0-9a-fA-F]{6}|[1-9a-fA-F][0-9a-fA-F]{7})$" + } + }, + "required": ["type", "name", "id"], + "additionalProperties": false + } + } + } +} \ No newline at end of file diff --git a/restool.gni b/restool.gni index 13476e1..f79c751 100755 --- a/restool.gni +++ b/restool.gni @@ -13,3 +13,4 @@ id_defined_path = "//base/global/system_resources/systemres/main/resources/base/element/id_defined.json" restool_faq_path = "//developtools/global_resource_tool/restool_faq.json" +ids_schema_path = "//developtools/global_resource_tool/id_defines.json" -- Gitee