diff --git a/.gitignore b/.gitignore index 92cd213..22972da 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ *.orig # build outputs .rebar/ +_build/ rebar.cross_compile.config config.tmp *.pdb diff --git a/rebar.config.script b/rebar.config.script new file mode 100644 index 0000000..01274e3 --- /dev/null +++ b/rebar.config.script @@ -0,0 +1,37 @@ +ModCfg0 = fun(F, Cfg, [Key|Tail], Op, Default) -> + {OldVal,PartCfg} = case lists:keytake(Key, 1, Cfg) of + {value, {_, V1}, V2} -> {V1, V2}; + false -> {if Tail == [] -> Default; true -> [] end, Cfg} + end, + case Tail of + [] -> + [{Key, Op(OldVal)} | PartCfg]; + _ -> + [{Key, F(F, OldVal, Tail, Op, Default)} | PartCfg] + end + end, +ModCfg = fun(Cfg, Keys, Op, Default) -> ModCfg0(ModCfg0, Cfg, Keys, Op, Default) end. + +%% Rebar3 support for hex.pm support: +%% - Add rebar3_hex plugin +IsRebar3 = case application:get_key(rebar, vsn) of + {ok, VSN} -> + [VSN1 | _] = string:tokens(VSN, "-"), + [Maj, Min, Patch] = string:tokens(VSN1, "."), + (list_to_integer(Maj) >= 3); + undefined -> + lists:keymember(mix, 1, application:loaded_applications()) + end, +Cfg = case IsRebar3 of + true -> + ModCfg(CONFIG, [plugins], fun(V) -> V ++ [rebar3_hex] end, []); + false -> + CONFIG + end, + +Cfg. + +%% Local Variables: +%% mode: erlang +%% End: +%% vim: set filetype=erlang tabstop=8: \ No newline at end of file diff --git a/src/sqlite3.app.src b/src/sqlite3.app.src index 50a66c2..119955f 100644 --- a/src/sqlite3.app.src +++ b/src/sqlite3.app.src @@ -8,7 +8,7 @@ {env, []}, %% hex.pm packaging: - {files, ["src/", "include/", "c_src/sqlite3_drv.c", "c_src/sqlite3_drv.h", "rebar.config", "README.md", "LICENSE"]}, + {files, ["src/", "include/", "c_src/sqlite3_drv.c", "c_src/sqlite3_drv.h", "sqlite3_amalgamation/shell.c", "sqlite3_amalgamation/sqlite3.c", "sqlite3_amalgamation/sqlite3.h", "sqlite3_amalgamation/sqlite3ext.h", "rebar.config", "README.md", "LICENSE"]}, {licenses, ["EPL 1.1"]}, {maintainers, ["alexeyr", "ProcessOne"]}, {links, [{"Github", "https://github.com/processone/erlang-sqlite3"}]}]}.