From 292e79a83677c11af1cab0ce8ca0b94846aac1b7 Mon Sep 17 00:00:00 2001 From: houhaoyu Date: Thu, 10 Feb 2022 20:25:58 +0800 Subject: [PATCH] houhaoyu@huawei.com new sdk structure for syscap Signed-off-by: houhaoyu Change-Id: I7b62676c906c1485cbd0e2b766bcb7591067bf80 --- BUILD.gn | 46 ++++++++- .../ets/{index.d.ts => index-full.d.ts} | 0 api/syscapCheck/sysCapSchema.json | 93 +++++++++++++++++++ remove_internal.py | 4 +- 4 files changed, 136 insertions(+), 7 deletions(-) rename api/@internal/component/ets/{index.d.ts => index-full.d.ts} (100%) create mode 100644 api/syscapCheck/sysCapSchema.json diff --git a/BUILD.gn b/BUILD.gn index c3244d0bb3..fec6731a5f 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -59,7 +59,7 @@ ohos_copy("ets_component") { "api/@internal/component/ets/grid_container.d.ts", "api/@internal/component/ets/image.d.ts", "api/@internal/component/ets/image_animator.d.ts", - "api/@internal/component/ets/index.d.ts", + "api/@internal/component/ets/index-full.d.ts", "api/@internal/component/ets/lazyForEach.d.ts", "api/@internal/component/ets/line.d.ts", "api/@internal/component/ets/list.d.ts", @@ -160,13 +160,49 @@ template("ohos_declaration_template") { ohos_declaration_template("ohos_declaration_ets") { } -ohos_declaration_template("ohos_declaration_phone") { +ohos_declaration_template("ohos_declaration_common") { } -ohos_copy("ace_platform") { +ohos_copy("internal_full") { sources = [ - "api/config", - "api/phone", + "api/common/@internal/console.d.ts", + "api/common/@internal/global.d.ts", + "api/common/@internal/index.d.ts", + "api/common/@internal/viewmodel.d.ts", + ] + outputs = [ target_out_dir + "/$target_name/{{source_file_part}}" ] + module_source_dir = target_out_dir + "/$target_name" + module_install_name = "" +} + +ohos_copy("internal_lite") { + sources = [ + "api/liteWearable/@internal/console.d.ts", + "api/liteWearable/@internal/global.d.ts", + "api/liteWearable/@internal/index.d.ts", + "api/liteWearable/@internal/viewmodel.d.ts", + ] + outputs = [ target_out_dir + "/$target_name/{{source_file_part}}" ] + module_source_dir = target_out_dir + "/$target_name" + module_install_name = "" +} + +ohos_copy("syscap_check") { + sources = [ "api/syscapCheck/sysCapSchema.json" ] + outputs = [ target_out_dir + "/$target_name/{{source_file_part}}" ] + module_source_dir = target_out_dir + "/$target_name" + module_install_name = "" +} + +ohos_copy("system_api") { + sources = [ + "api/common/@system.app.d.ts", + "api/common/@system.cipher.d.ts", + "api/common/@system.configuration.d.ts", + "api/common/@system.file.d.ts", + "api/common/@system.mediaquery.d.ts", + "api/common/@system.prompt.d.ts", + "api/common/@system.router.d.ts", ] outputs = [ target_out_dir + "/$target_name/{{source_file_part}}" ] module_source_dir = target_out_dir + "/$target_name" diff --git a/api/@internal/component/ets/index.d.ts b/api/@internal/component/ets/index-full.d.ts similarity index 100% rename from api/@internal/component/ets/index.d.ts rename to api/@internal/component/ets/index-full.d.ts diff --git a/api/syscapCheck/sysCapSchema.json b/api/syscapCheck/sysCapSchema.json new file mode 100644 index 0000000000..5650316dbf --- /dev/null +++ b/api/syscapCheck/sysCapSchema.json @@ -0,0 +1,93 @@ +{ + "title": "JSON schema for syscap.json", + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "additionalProperties": true, + "propertyNames": { + "enum": [ + "base", + "development", + "production" + ] + }, + "properties": { + "base": { + "description": "Basic system capability", + "type": "object", + "propertyNames": { + "enum": [ + "deviceType", + "NDeviceSysCaps" + ] + }, + "properties": { + "deviceType": { + "description": "core equipment", + "type":"array", + "items": { + "type": "string", + "enum": [ + "phone", + "tv", + "tablet", + "wearable", + "litewearable", + "car" + ] + } + }, + "NDeviceSysCaps": { + "description": "N equipment", + "type":"array", + "items": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + }, + "development": { + "description": "extra system capability", + "type": "object", + "propertyNames": { + "enum": [ + "addedSysCaps" + ] + }, + "properties": { + "addedSysCaps": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "production": { + "description": "generate RCPID", + "type": "object", + "propertyNames": { + "enum": [ + "addedSysCaps", + "removedSysCaps" + ] + }, + "properties": { + "addedSysCaps": { + "type": "array", + "items": { + "type": "string" + } + }, + "removedSysCaps": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } +} diff --git a/remove_internal.py b/remove_internal.py index 0134a5cc1a..defbb2efc1 100755 --- a/remove_internal.py +++ b/remove_internal.py @@ -8,8 +8,8 @@ import optparse import shutil # d.ts directories to be deleted -remove_list = ["@internal", "common", "config", "form", "liteWearable", - "phone", "router", "smartVision", "tablet", "tv", "wearable"] +remove_list = ["@internal", "common", "form", "liteWearable", "phone", + "router", "smartVision", "tablet", "tv", "wearable", "syscapCheck"] # traversal all fill in project folder -- Gitee