How to use synchronization with an application created using release relx assembler?

I would like to use Sync reprogramming on the fly with a Cowboy project compiled using relx (according to the Cowboy Getting Started Guide ).

The problem is that even if I manage to run Sync in my application, specifying the synchronization in the list of applications in the my_application.app.src file as follows:

{application, my_application, [
    {description, "My Cowboy Application"},
    {vsn, "0.1.0"},
    {modules, []},
    {registered, [my_app_sup]},
    {applications, [
        kernel,
        stdlib,
        cowboy,
        sync
    ]},
    {mod, {my_app, []}},
    {env, []}
]}.`

I still can't get it to work because the relx assembler is not moving my source code to the _rel directory (of course, it shouldn't).

Is there a way to tell Sync where my source files are? Or maybe I'm completely wrong, and the integration of synchronization with relx should be done in some other way?

+4
2

:

  • ERL_LIBS (.. $HOME/lib/erlang)
  • relx relx -c relx-dev.config
  • script cd, script
  • script

relx.config . , ERL_LIBS, , erlang.

relx-dev.config :

{dev_mode, true}.
{lib_dirs, ["/usr/local/erlang"]}.
{output_dir, "_rel-dev"}.
{release,
 {myapp, "0.0.1"},
 [{myapp_core, "0.0.1", '='}, sasl, syntax_tools, compiler, sync]
}.
{extended_start_script, true}.

relx-dev.config script :

relx -c relx-dev.config

console script :

#!/usr/bin/sh
_rel-dev/myapp/bin/myapp console

script erlang node, .

sync.config, , :

[{sync, [{growl, [errors, warnings]}]}].

sync README . .config erl .

+6

, , relx Scan , . , .

relx, -d.

./relx -d true

, relx, , . . _rel ( ) "".

:

1) , . :)

2) relx.config , "" syntax_tools , : (

relx.config,

{paths, ["apps", "deps"]}.
{lib_dirs, ["/usr/local/lib/erlang/lib", "apps", "deps"]}.
{sys_config, "./config/sys.config"}.
{release, {merigo_chat, "1.0.0"}, [
kernel,
stdlib,
syntax_tools,
compiler,
sync,
{mySampleApp, "1.0.0"},

% Debugging applications,  Need to run observer and debugger from within the package
tools,
wx,
observer,
runtime_tools,
webtool,
appmon,
debugger
]}.

% Not you can skip the overrides if you use the -d option in relx
{overrides, [
{mySampleApp, "apps/mySampleApp"},
]}.
{extended_start_script, true}.
+1

Source: https://habr.com/ru/post/1533461/


All Articles