JimMoen 1 год назад
Родитель
Сommit
341d894045
3 измененных файлов с 3 добавлено и 4 удалено
  1. 0 1
      rebar.config
  2. 1 1
      src/emqx_plugrel.app.src
  3. 2 2
      src/emqx_plugrel.erl

+ 0 - 1
rebar.config

@@ -1,6 +1,5 @@
 %% -*- mode: erlang -*-
 {erl_opts, [debug_info]}.
 {deps, [
-    {jsx, {git, "https://github.com/talentdeficit/jsx", {tag, "v3.1.0"}}},
     {erlavro, {git, "https://github.com/emqx/erlavro.git", {tag, "2.10.0"}}}
 ]}.

+ 1 - 1
src/emqx_plugrel.app.src

@@ -5,7 +5,7 @@
   {applications,
    [kernel,
     stdlib,
-    jsx,
+    jsone,
     erlavro
    ]},
   {env,[]},

+ 2 - 2
src/emqx_plugrel.erl

@@ -125,7 +125,7 @@ make_tar(#{name := Name, rel_vsn := Vsn, rel_apps := Apps} = Info, State) ->
     ok = filelib:ensure_dir(InfoFile),
     ok = maybe_copy_files(LibDir),
     %% write info file
-    ok = file:write_file(InfoFile, jsx:encode(Info, [space, {indent, 4}])),
+    ok = file:write_file(InfoFile, jsone:encode(Info, [{space, 1}, {indent, 4}])),
     %% copy apps to lib dir
     Sources = lists:map(fun(App) -> filename:join([BaseDir, "rel", Name, "lib", App]) end, Apps),
     ok = rebar_file_utils:cp_r(Sources, LibDir),
@@ -187,7 +187,7 @@ validate_avsc(F) ->
 
 validate_i18n(F) ->
     {ok, Bin} = file:read_file(F),
-    try jsx:decode(Bin) of
+    try jsone:decode(Bin, [{object_format, map}]) of
         _ ->
             ?LOG(debug, "Valid i18n file: ~ts", [F]),
             true