You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
1.4 KiB

пре 15 година
пре 15 година
пре 15 година
пре 15 година
пре 14 година
пре 15 година
пре 15 година
пре 14 година
пре 15 година
пре 15 година
пре 15 година
  1. -module(tdeps1_rt).
  2. -compile(export_all).
  3. %% Exercise transitive dependencies
  4. %% A -> B -> C, where A includes a .hrl from B which includes .hrl from C
  5. files() ->
  6. [
  7. %% A application
  8. {create, "ebin/a.app", app(a, [a])},
  9. {copy, "a.rebar.config", "rebar.config"},
  10. {copy, "a.erl", "src/a.erl"},
  11. {copy, "../../rebar", "rebar"},
  12. %% B application
  13. {create, "repo/b/ebin/b.app", app(b, [])},
  14. {copy, "b.rebar.config", "repo/b/rebar.config"},
  15. {copy, "b.hrl", "repo/b/include/b.hrl"},
  16. %% C application
  17. {create, "repo/c/ebin/c.app", app(c, [])},
  18. {copy, "c.hrl", "repo/c/include/c.hrl"}
  19. ].
  20. run(_Dir) ->
  21. %% Initialize the b/c apps as mercurial repos so that dependencies pull
  22. %% properly
  23. HgCmd = "/bin/sh -c \"hg init && hg add && hg commit -m 'Initial commit'\"",
  24. {ok, _} = retest_sh:run(HgCmd, [{dir, "repo/b"}]),
  25. {ok, _} = retest_sh:run(HgCmd, [{dir, "repo/c"}]),
  26. {ok, _} = retest_sh:run("./rebar get-deps compile", []),
  27. true = filelib:is_regular("ebin/a.beam"),
  28. ok.
  29. %%
  30. %% Generate the contents of a simple .app file
  31. %%
  32. app(Name, Modules) ->
  33. App = {application, Name,
  34. [{description, atom_to_list(Name)},
  35. {vsn, "1"},
  36. {modules, Modules},
  37. {registered, []},
  38. {applications, [kernel, stdlib]}]},
  39. io_lib:format("~p.\n", [App]).