chore: rename hot-config-schema.json; keep schema.json for spellcheck.

This commit is contained in:
Zhongwen Deng 2022-02-25 09:41:51 +08:00
parent 114db2d14e
commit 1667a03c18
2 changed files with 13 additions and 5396 deletions

View File

@ -125,12 +125,21 @@ reset(Node, KeyPath, Opts) ->
%% @doc Called from build script. %% @doc Called from build script.
-spec dump_schema(file:name_all()) -> ok. -spec dump_schema(file:name_all()) -> ok.
dump_schema(Dir) -> dump_schema(Dir) ->
SchemaMarkdownFile = filename:join([Dir, "config.md"]), SchemaMdFile = filename:join([Dir, "config.md"]),
io:format(user, "===< Generating: ~s~n", [SchemaMarkdownFile ]), io:format(user, "===< Generating: ~s~n", [SchemaMdFile ]),
ok = gen_doc(SchemaMarkdownFile), ok = gen_doc(SchemaMdFile),
%% for scripts/spellcheck.
SchemaJsonFile = filename:join([Dir, "schema.json"]), SchemaJsonFile = filename:join([Dir, "schema.json"]),
io:format(user, "===< Generating: ~s~n", [SchemaJsonFile]), io:format(user, "===< Generating: ~s~n", [SchemaJsonFile]),
ok = gen_hot_conf_schema(SchemaJsonFile), JsonMap = hocon_schema_json:gen(emqx_conf_schema),
IoData = jsx:encode(JsonMap, [space, {indent, 4}]),
ok = file:write_file(SchemaJsonFile, IoData),
%% hot-update configuration schema
HotConfigSchemaFile = filename:join([Dir, "hot-config-schema.json"]),
io:format(user, "===< Generating: ~s~n", [HotConfigSchemaFile]),
ok = gen_hot_conf_schema(HotConfigSchemaFile),
ok. ok.
%%-------------------------------------------------------------------- %%--------------------------------------------------------------------

File diff suppressed because it is too large Load Diff