Browse Source

2.10 prepare

Namdak Tonpa 6 years ago
parent
commit
6f64744270
12 changed files with 22 additions and 27 deletions
  1. 2 7
      .travis.yml
  2. 1 1
      LICENSE
  3. 1 1
      include/mad.hrl
  4. BIN
      mad
  5. 1 1
      mix.exs
  6. 2 2
      src/compile/mad_cubical.erl
  7. 8 8
      src/compile/mad_port.erl
  8. 2 2
      src/mad.app.src
  9. 1 1
      src/mad_resolve.erl
  10. 1 1
      src/mad_static.erl
  11. 1 1
      src/profile/mad_vz.erl
  12. 2 2
      src/provision/mad_repl.erl

+ 2 - 7
.travis.yml

@@ -1,9 +1,4 @@
 language: erlang
 otp_release:
-  - 18.0
-  - R16B02
-  - R16B01
-notifications:
-  email: false
-  irc: "chat.freenode.net#n2o"
-script: "make"
+  - 19.3
+script: "curl -fsSL https://raw.github.com/synrc/mad/master/mad > mad && chmod +x mad && ./mad dep com"

+ 1 - 1
LICENSE

@@ -1,4 +1,4 @@
-Copyright (c) 2013—2015 Maxim Sokhatsky, Synrc Research Center
+Copyright (c) 2013—2018 Maxim Sokhatsky, Synrc Research Center
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the "Software"), to deal

+ 1 - 1
include/mad.hrl

@@ -1 +1 @@
--define(VERSION,"d1504d").
+-define(VERSION,"04de77").

BIN
mad


+ 1 - 1
mix.exs

@@ -3,7 +3,7 @@ defmodule MAD.Mixfile do
 
   def project do
     [app: :mad,
-     version: "2.3.0",
+     version: "2.10.0",
      description: "Small and fast rebar replacement",
      package: package]
   end

+ 2 - 2
src/compile/mad_cubical.erl

@@ -2,8 +2,8 @@
 -copyright('Maxim Sokhatsky').
 -compile(export_all).
 
-compile(File,Inc,Bin,Opt,Deps) ->
-    {X,Res,Msg} = sh:run(sh:executable("cubical"), ["-b", File], binary, "."),
+compile(File,_Inc,_Bin,_Opt,_Deps) ->
+    {_,Res,Msg} = sh:run(sh:executable("cubical"), ["-b", File], binary, "."),
     case Res of
          1 -> true;
          0 -> case binary:match(Msg,[<<"File loaded.">>]) of

+ 8 - 8
src/compile/mad_port.erl

@@ -54,11 +54,11 @@ compile_port(Dir,Specs0,Config) ->
                              Cmd = expand(System,CmdLD,[{"CXXFLAGS",""},{"LDFLAGS",""},{"CFLAGS",""}]),
                              mad:info("cc ~s~n",[Cmd]),
                              {_,Status,Report} = sh:run("cc",string:tokens(Cmd," "),binary,Dir,Env),
-                             case Status of 
+                             case Status of
                               0 -> false;
                               _ -> mad:info("Port Compilation Error:~n" ++ io_lib:format("~ts",[Report]),[]),
-                                   {error, Report},true
-                             end                      
+                                   true
+                             end
                   end;
             Errors -> mad:info("Port Compilation Error:~p~n",[Errors]),
                       true
@@ -69,7 +69,7 @@ compile_port(Dir,Specs0,Config) ->
 to_obj(F) -> filename:rootname(F) ++ ".o".
 
 %%FIXME
-expand(System, String, []) -> String;
+expand(_System, String, []) -> String;
 expand(System, String, [{K,V}|Env]) ->
   New = re:replace(String, io_lib:format("\\${?(~s)}?",[K]), V, [global, {return, list}]),
   expand(System,New,Env);
@@ -81,7 +81,7 @@ expand(System, String, [{Sys,K,V}|Env]) ->
   end.
 
 extension(F)       -> filename:extension(F).
-is_compiled(O,F)   -> filelib:is_file(O) andalso (mad_utils:last_modified(O) >= mad_utils:last_modified(F)). 
+is_compiled(O,F)   -> filelib:is_file(O) andalso (mad_utils:last_modified(O) >= mad_utils:last_modified(F)).
 join(A,B)          -> filename:join(A,B).
 concat(X)          -> lists:concat(X).
 system(Sys,System) -> Sys == System orelse match(Sys,System).
@@ -91,7 +91,7 @@ erts_dir(include)  -> " -I"++join(erts_dir(), "include").
 ei_dir()           -> case code:lib_dir(erl_interface) of {error,bad_name} -> ""; E -> E end.
 ei_dir(include)    -> case ei_dir() of "" -> ""; E -> " -I"++join(E,"include") end;
 ei_dir(lib)        -> case ei_dir() of "" -> ""; E -> " -L"++join(E,"lib") end.
-link_lang(Files)   -> lists:foldl(fun(F,cxx) -> cxx;
+link_lang(Files)   -> lists:foldl(fun(_,cxx) -> cxx;
                                      (F,cc) -> case compiler(extension(F)) == "$CXX" of 
                                                 true -> cxx;false -> cc end
                                   end,cc,Files).
@@ -120,8 +120,8 @@ tpl_ld(exe,cxx) -> " $PORT_IN_FILES $LDFLAGS $EXE_LDFLAGS -o $PORT_OUT_FILE".
 erl_ldflag() -> concat([ei_dir(include), erts_dir(include), " "]).
 
 default_env() ->
-    Arch = os:getenv("REBAR_TARGET_ARCH"),
-    Vsn = os:getenv("REBAR_TARGET_ARCH_VSN"),
+    _Arch = os:getenv("REBAR_TARGET_ARCH"),
+    _Vsn = os:getenv("REBAR_TARGET_ARCH_VSN"),
     [
      {"darwin", "DRV_LDFLAGS", "-bundle -flat_namespace -undefined suppress " ++ei_dir(lib) ++" -lerl_interface -lei"},
      {"DRV_CFLAGS" , "-g -Wall -fPIC -MMD " ++ erl_ldflag()},

+ 2 - 2
src/mad.app.src

@@ -1,6 +1,6 @@
 {application, mad,
- [{description, "MAD Erlang/OTP Containers"},
-  {vsn, "2.3"},
+ [{description, "MAD Managing Dependencies"},
+  {vsn, "2.10"},
   {registered, []},
   {applications, [kernel,stdlib,inets]},
   {env, []}]}.

+ 1 - 1
src/mad_resolve.erl

@@ -47,6 +47,6 @@ system_deps(A) ->
 
 main(_) ->
     case orderapps() of
-         {ok,Ordered}   -> mad:info("Ordered: ~p~n",[Ordered]),
+         {ok,Ordered}   -> mad:info("Generating .applist ~p~n",[Ordered]),
                            file:write_file(".applist",io_lib:format("~w",[Ordered])), {ok,Ordered};
          {error,Reason} -> {error,Reason} end.

+ 1 - 1
src/mad_static.erl

@@ -3,7 +3,7 @@
 -compile(export_all).
 -define(NODE(Bin), "node_modules/.bin/"++Bin).
 
-main(Config, ["min"]) ->
+main(_Config, ["min"]) ->
     {ok,[SysConfig]} = file:consult("sys.config"),
     N2O     = proplists:get_value(n2o,SysConfig,[]),
     AppName = proplists:get_value(app,N2O,sample),

+ 1 - 1
src/profile/mad_vz.erl

@@ -9,7 +9,7 @@ attach(Params)    -> mad_vz:attach(Params).
 stop(Params)      -> mad_vz:stop(Params).
 release(Params)   -> mad_release:release(Params).
 resolve(Params)   -> mad_resolve:main(Params).
-sh(Params)        -> {error,'N/A'}.
+sh(_Params)       -> {error,'N/A'}.
 deps(Params)      -> mad_synrc:deps(Params).
 up(Params)        -> mad_synrc:up(Params).
 fetch(Params)     -> mad_synrc:fetch(Params).

+ 2 - 2
src/provision/mad_repl.erl

@@ -75,7 +75,7 @@ load(X,A,Acc,Config) ->
     try {application,Name,Map} = load_config(A),
         NewEnv = merge(Config,Map,Name),
         acc_start({application,Name,set_value(env,1,Map,{env,NewEnv})},Acc)
-    catch E:R -> io:format("Application Load Error: ~p",[{X,A,Acc}]) end.
+    catch _:_ -> io:format("Application Load Error: ~p",[{X,A,Acc}]) end.
 
 merge(Config,Map,Name) ->
     lists:foldl(fun({Name2,E},Acc2) when Name2 =:= Name ->
@@ -87,7 +87,7 @@ load_apps(["applist"],Config,Acc)    -> load_apps([],Config,Acc);
 load_apps(Params,_,_Acc)             -> [ application:ensure_all_started(list_to_atom(A))||A<-Params].
 
 set_value(Name,Pos,List,New)         -> add_replace(lists:keyfind(Name,Pos,List),Name,Pos,List,New).
-add_replace(false,Name,Pos,List,New) -> [New|List];
+add_replace(false,_N,_P,List,New)    -> [New|List];
 add_replace(_____,Name,Pos,List,New) -> lists:keyreplace(Name,Pos,List,New).
 
 cwd() -> case  file:get_cwd() of {ok, Cwd} -> Cwd; _ -> "." end.