{
"_notes": [
"Bridge 代码生成配置文件 - bridge_gen_files.py",
"",
"【使用方法】",
" python3 ohos_interface/ohos_glue/scripts/bridge_gen_files.py \\",
" --config ohos_interface/ohos_glue/scripts/bridge_generation.conf.json \\",
" --output ohos_interface/ohos_glue --base-dir ohos_interface",
"",
"【类配置字段说明】",
" 必需字段:",
" name - 类名 (如 'NWebConsoleLog')",
" system - 系统类型: 'ohos_adapter' 或 'ohos_nweb'",
" arkweb - ArkWeb 接口头文件路径 (相对于 base_dir)",
" nweb - NWeb 接口头文件路径 (相对于 base_dir)",
" generate - 文件类型数组: ['impl', 'wrapper']",
" * impl: 生成 ArkWebImpl 类 (在 ohos_glue 中实现 NWeb 接口)",
" * wrapper: 生成 NWebWrapper 类 (在 ohos_glue 中包装 ArkWeb 接口)",
"",
" 可选字段:",
" description - 类的描述信息",
" using_aliases - 嵌套枚举类型别名映射",
" 格式: {\"NWeb完整类型\": \"ArkWeb别名\"}",
" 示例: {\"OHOS::NWeb::NWebConsoleLog::Level\": \"LogLevel\"}",
" struct_mappings - 结构体与类双向转换配置",
" 格式: {\"ArkWeb类型\": {配置对象}}",
" 配置对象包含: nweb_type, class_to_struct, struct_to_class",
" vector_headers - Vector 类型头文件配置 (用于自定义 Vector 类型)",
" use_reference_type - 是否使用引用类型 (默认自动检测)",
"",
"【完整配置示例】",
" {",
" \"name\": \"DateTimeChooser\",",
" \"system\": \"ohos_nweb\",",
" \"arkweb\": \"ohos_glue/ohos_nweb/include/ark_web_date_time_chooser.h\",",
" \"nweb\": \"include/ohos_nweb/nweb_date_time_chooser.h\",",
" \"generate\": [\"impl\", \"wrapper\"],",
" \"description\": \"日期时间选择器\",",
" \"using_aliases\": {",
" \"OHOS::NWeb::DateTimeChooser::DateTimeType\": \"DateTimeType\"",
" },",
" \"struct_mappings\": {",
" \"ArkWebDateTime\": {",
" \"nweb_type\": \"OHOS::NWeb::DateTime\",",
" \"class_to_struct\": \"ArkWebDateTimeClassToStruct\",",
" \"struct_to_class\": \"ArkWebDateTimeStructToClass\"",
" }",
" }",
" }",
"",
"【最小配置示例】",
" {",
" \"name\": \"LocationInfo\",",
" \"system\": \"ohos_adapter\",",
" \"arkweb\": \"ohos_glue/ohos_adapter/include/ark_location_adapter.h\",",
" \"nweb\": \"include/ohos_adapter/location_adapter.h\",",
" \"generate\": [\"impl\", \"wrapper\"]",
" }",
"",
"【注意】",
" - JSON 格式不支持注释,_notes 字段仅供说明",
" - 使用 --validate 参数可先验证配置",
" - 更多帮助: python3 bridge_gen_files.py --help"
],
"version": "1.0",
"description": "Bridge代码生成配置文件",
"base_dir": ".",
"classes": [
{
"name": "LocationInfo",
"system": "ohos_adapter",
"arkweb": "ohos_glue/ohos_adapter/include/ark_location_adapter.h",
"nweb": "include/ohos_adapter/location_adapter.h",
"generate": ["impl", "wrapper"],
"description": "web位置服务, 获取位置信息"
}
]
}