rebar3



Build better Erlang.

Ask A Question

Questions

6
ANSWERED

Importing multi-app project

I have a project with multiple OTP apps in it. And I would like to import this project into another project via rebar dependency. And from the new project rebar3 could not see all subprojects defined in the first project. For example, `foo` is parent project and `bar` is trying to include `foo` into it. The app structure for foo looks like this. ``` root@900f642ef568:~/Developer/foo# rebar3 tree ===> Verifying dependencies... ├─ foo─0.1.0 (project app) ├─ foo_app1─0.1.0 (project app) ├─ foo_app2─0.1.0 (project app) └─ foo_app3─0.1.0 (project app) ``` And the directory structure looks like this: ``` root@900f642ef568:~/Developer/foo# tree -d . |-- apps | |-- foo_app1 | | `-- src | |-- foo_app2 | | `-- src | `-- foo_app3 | `-- src `-- src 8 directories ``` I am including this project into another project called bar and after doing `rebar3 get-deps` ``` root@900f642ef568:~/Developer/bar# tree -d . |-- _build | `-- default | `-- lib | `-- foo | |-- apps | | |-- foo_app1 | | | `-- src | | |-- foo_app2 | | | `-- src | | `-- foo_app3 | | `-- src | `-- src `-- src 13 directories ``` And my rebar tree looks like this: ``` root@900f642ef568:~/Developer/bar# rebar3 tree ===> Verifying dependencies... └─ bar─0.1.0 (project app) └─ foo─0.1.0 (git repo) ``` I would like to use `foo_app1` in this project bar (included this in `bar.app.src`). As you can see from the above `rebar3 tree` output, `foo_app1` is not listed as an app that is discovered. Because of which, when I try to launch `bar`, I get the error saying that ``` root@cello:~/Developer/bar# rebar3 shell ===> Verifying dependencies... ===> Compiling bar Erlang/OTP 20 [erts-9.2] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:0] [hipe] [kernel-poll:false] Eshell V9.2 (abort with ^G) 1> ===> The rebar3 shell is a development tool; to deploy applications in production, consider using releases (http://www.rebar3.org/docs/releases) ===> Failed to boot foo_app1 for reason {"no such file or directory", "foo_app1.app"} 1> ``` Can someone please help me how to make rebar3 see the app `foo_app1`?

Posted by Vasu Dasari 3 months ago

2

rebar3_erlydtl_plugin windows fails

After reviewing alot comments regarding usage of the rebar3_erlydtl_plugin, I am having trouble compiling the template files to the destination ebin directory. I added the DEBUG=1 setting to see the details of rebar3 build and additional tags to try to extract what erlydtl library is complaining about. Below is the setting in the local rebar.config file for subfolder that contains the "priv folder with the web content. {erlydtl_opts, [ {doc_root, "priv/templates"}, {out_dir, "ebin"}, {compiler_options, [report_errors, return, verbose, debug_info]}, {source_ext, ".dtl"}, {module_ext, "_view"}, {return, true}, {report, true} ]}. {plugins, [ {rebar3_erlydtl_plugin, ".*", {git, "https://github.com/tsloughter/rebar3_erlydtl_plugin.git", {branch, "master"}}} ]}. {provider_hooks, [ {pre, [{compile, {erlydtl, compile}}]} ]}. Below is the partial output of the rebar3 showing that it doesn't recognize the out_dir folder; however, the path is correct and I suspect that the symlinks may be the issue, since windows seem to behave as it should with them. ===> run_hooks("c:/SPRTVL/source/dashboard", pre_hooks, compile) -> no hooks defined ===> sh info: cwd: "c:/SPRTVL/source/dashboard" cmd: cmd /c mklink /j "c:\\SPRTVL\\source\\dashboard\\_build\\default\\lib\\web\\priv" "c:\\SPRTVL\\source\\dashboard\\apps\\web\\priv" ===> opts: [{use_stdout,false},return_on_error] ===> Port Cmd: cmd /q /c cmd /c mklink /j "c:\\SPRTVL\\source\\dashboard\\_build\\default\\lib\\web\\priv" "c:\\SPRTVL\\source\\dashboard\\apps\\web\\priv" Port Opts: [exit_status,{line,16384},use_stdio,stderr_to_stdout,hide,eof] ===> sh info: cwd: "c:/SPRTVL/source/dashboard" cmd: cmd /c mklink /j "c:\\SPRTVL\\source\\dashboard\\_build\\default\\lib\\web\\include" "c:\\SPRTVL\\source\\dashboard\\apps\\web\\include" ===> opts: [{use_stdout,false},return_on_error] ===> Port Cmd: cmd /q /c cmd /c mklink /j "c:\\SPRTVL\\source\\dashboard\\_build\\default\\lib\\web\\include" "c:\\SPRTVL\\source\\dashboard\\apps\\web\\include" Port Opts: [exit_status,{line,16384},use_stdio,stderr_to_stdout,hide,eof] ===> sh info: cwd: "c:/SPRTVL/source/dashboard" cmd: cmd /c mklink /j "c:\\SPRTVL\\source\\dashboard\\_build\\default\\lib\\web\\src" "c:\\SPRTVL\\source\\dashboard\\apps\\web\\src" ===> opts: [{use_stdout,false},return_on_error] ===> Port Cmd: cmd /q /c cmd /c mklink /j "c:\\SPRTVL\\source\\dashboard\\_build\\default\\lib\\web\\src" "c:\\SPRTVL\\source\\dashboard\\apps\\web\\src" Port Opts: [exit_status,{line,16384},use_stdio,stderr_to_stdout,hide,eof] ===> Compiling web ===> Running erlydtl... ===> Compiling "c:/SPRTVL/source/dashboard/apps/web/priv/templates/tl.dtl" -> "c:/SPRTVL/source/dashboard/_build/default/lib/web/ebin/tl_view.beam" with options: [{compiler_options,[report_errors,return,verbose,debug_info]}, {custom_tags_dir,"c:/SPRTVL/source/dashboard/apps/web"}, {doc_root,"c:/SPRTVL/source/dashboard/apps/web/priv/templates"}, {out_dir,"ebin"}, {compiler_options,[report_errors,return,verbose,debug_info]}, {out_dir,"c:/SPRTVL/source/dashboard/_build/default/lib/web/ebin"}, {source_ext,".dtl"}, {module_ext,"_view"}, {return,true}, {report,true}] c:/SPRTVL/source/dashboard/apps/web/priv/templates/tl.dtl: Failed to write file: no such file or directory ===> Compiling apps/web/priv/templates/tl.dtl failed c:/SPRTVL/source/dashboard/apps/web/priv/templates/tl.dtl:none: Failed to write file: no such file or directory ===> Compilation failed: {error, [["c:/SPRTVL/source/dashboard/apps/web/priv/templates/tl.dtl:none: Failed to write file: no such file or directory\n"]], []}

Posted by Jeff Starnes 7 months ago