Browse Source

add strip beam

mihawk 7 years ago
parent
commit
725bf09213
3 changed files with 11 additions and 2 deletions
  1. 2 1
      src/mad.erl
  2. 7 0
      src/mad_strip.erl
  3. 2 1
      src/profile/mad_local.erl

+ 2 - 1
src/mad.erl

@@ -45,6 +45,7 @@ atomize("att"++_) -> 'attach';
 atomize("sh")     -> 'sh';
 atomize("rep"++_) -> 'sh';
 atomize("pla"++_) -> 'resolve';
+atomize("str"++_) -> 'strip';
 atomize(Else)     -> Else.
 
 profile()         -> application:get_env(mad,profile,mad_local).
@@ -71,7 +72,7 @@ help()            -> info("MAD Container Tool version ~s~n",[?VERSION]),
                      info("~n"),
                      info("    invoke = mad params~n"),
                      info("    params = [] | command [ options  ] params ~n"),
-                     info("   command = app     | deps  | clean | compile | up | eunit~n"),
+                     info("   command = app     | deps  | clean | compile | up | eunit | strip~n"),
                      info("           | release [ beam  | ling  | script  | runc | depot ]~n"),
                      info("           | deploy  | start | stop  | attach  | sh | static [ <watch|min> ] ~n"),
                      return(false).

+ 7 - 0
src/mad_strip.erl

@@ -0,0 +1,7 @@
+-module(mad_strip).
+-export([main/1]).
+
+main(_) ->
+ Res = beam_lib:strip_files(mad_repl:wildcards(["{apps,deps,lib}/*/ebin/*.beam","ebin/*.beam"])),
+ mad:info("~p~n",[Res]),
+ false.

+ 2 - 1
src/profile/mad_local.erl

@@ -14,4 +14,5 @@ deps(Params)      -> mad_git:deps(Params).
 up(Params)        -> mad_git:up(Params).
 fetch(Params)     -> mad_git:fetch(Params).
 static(Params)    -> mad_static:main([],Params).
-eunit(Params)     -> mad_eunit:main_test(Params).
+eunit(Params)     -> mad_eunit:main_test(Params).
+strip(Params)     -> mad_strip:main(Params).