Changes between Version 23 and Version 24 of ErlangShellInterface


Ignore:
Timestamp:
Jan 31, 2013, 10:26:48 AM (12 years ago)
Author:
manualwiki
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ErlangShellInterface

    v23 v24  
    8888}}} 
    8989 
    90 You can check the already given application base directories: 
     90If the application has additional include directories, then these directories has to be also set in advance: 
     91 
     92{{{ 
     93#!erlang 
     94ri:addenv(include, "path/to/my/incldir"). 
     95}}} 
     96 
     97If the application build process contains compile-time macros, then these macros also can be set: 
     98 
     99{{{ 
     100#!erlang 
     101%if it is only used in ifdef forms. 
     102ri:addenv(def, 'my_macro'). 
     103 
     104ri:addenv(def, {'my_macro', my_macro_value}). 
     105}}} 
     106 
     107If the include forms of the application contain OS based enviromental nodes, then these nodes can be set: 
     108 
     109{{{ 
     110#!erlang 
     111ri:addenv(env_var, {os_env_name, "os_env_path"}). 
     112}}} 
     113 
     114Let's see an example: 
     115 
     116The Emakefile has the following contents: 
     117{{{ 
     118#!erlang 
     119 
     120{"/home/user/dev/lib/app1/src/*", 
     121   [{i,"/home/user/dev/lib/"}, 
     122    {d,'MY_MACRO', "ITS_VALUE"}, 
     123    {outdir,"/home/user/dev/lib/app1/ebin"}]}. 
     124 
     125{"/home/user/dev/lib/app2/src/*", 
     126   [{i,"/home/user/dev/lib/"}, 
     127    {d,'MY_MACRO', "ITS_VALUE"}, 
     128    {outdir,"/home/user/dev/lib/app2/ebin"}]}. 
     129 
     130{"/home/user/dev/lib/app3/src/*", 
     131   [{i,"/home/user/dev/lib/share/include/"}, 
     132    {i,"/home/user/dev/lib/"}, 
     133    {outdir,"/home/user/dev/lib/app3/ebin"}]}. 
     134}}} 
     135 
     136To add {{{app1}}}, {{{app2}}}, {{{app3}}} to !RefactorErl you should do the followings: 
     137{{{ 
     138#!erlang 
     139 
     140% add app1, app2 with the same configuration 
     141ri:addenv(appbase, "/home/user/dev/lib/"), 
     142ri:addenv(def, {'MY_MACRO', "ITS_VALUE"}), 
     143 
     144Apps = [app1, app2], 
     145[ri:add(home, App) || App <- Apps]. 
     146 
     147% add app3 after the configuration has been modified 
     148ri:delenv(def), 
     149ri:addenv(include, "/home/user/dev/lib/share/include/"), 
     150 
     151ri:add(home, app3). 
     152 
     153}}} 
     154 
     155 
     156You can check the already given application base directories by listing all of the enviromental nodes: 
    91157 
    92158{{{ 
     
    95161}}} 
    96162 
     163It is possible to delete the defined environment variables: 
     164 
     165{{{ 
     166#!erlang 
     167ri:delenv(include). 
     168}}} 
     169 
     170Or you can set an environmental variable to another value: 
     171{{{ 
     172#!erlang 
     173ri:setenv(env_name, "path/to/new_value"). 
     174}}} 
     175 
     176{{{ 
     177#!comment 
     178The following enviromental nodes can be set via the {{{ri}}} module: 
     179 
     180{{{output}}}: Where does RefactorErl write changes in? 
     181 
     182{{{appbase}}}: The list of the used  application based directories. 
     183 
     184{{{include}}}: The list of the used include directories. 
     185 
     186{{{def}}}: The list of the compile-time macros. 
     187 
     188{{{env_var}}}: The list of the OS based enviromental nodes. 
     189 
     190}}} 
     191 
     192{{{ 
     193#!comment 
    97194Let's see an example: 
    98195 
     
    114211... 
    115212}}} 
    116  
    117 You can also set include directories to your include files using: 
    118  
    119 {{{ 
    120 #!erlang 
    121 ri:addenv(include, "path/to/my/include"). 
    122 }}} 
    123  
    124 It is possible to delete the defined environment variables: 
    125  
    126 {{{ 
    127 #!erlang 
    128 ri:delenv(include). 
    129 }}} 
    130  
    131 Or you can set an environmental variable to another value: 
    132 {{{ 
    133 #!erlang 
    134 ri:setenv(env_name, "path/to/new_value"). 
    135 }}} 
    136  
     213}}} 
    137214 
    138215For convenience, both the filenames and the directory names can be given 
     
    481558 
    482559Here's the list of supported server management commands:\\ 
     560{{{ 
     561#!comment 
     562* '''system_info()''': Returns information about the !RefactorErl System. \\ 
     563}}} 
    483564* '''add(FDML)''': add a module, file, directory or a list of these to the database. \\ 
    484565* '''drop(FDML)''': drop a module from the database. \\