Permalink
Browse files

Now Agner will build rebar-incompatible packages provided they have '…

…build_command' property
  • Loading branch information...
1 parent cb4746d commit 5fd7b65480eb1ac44cace55fac01efc598af99a0 @yrashk yrashk committed Jan 28, 2011
Showing with 12 additions and 1 deletion.
  1. +2 −0 include/agner_spec.hrl
  2. +10 −1 src/agner_main.erl
View
@@ -12,6 +12,7 @@
-type agner_spec_property_authors() :: {authors, list(string())}.
-type agner_spec_property_homepage() :: {homepage, string()}.
-type agner_spec_property_rebar_compatible() :: {rebar_compatible, boolean()}.
+-type agner_spec_property_build_command() :: {build_command, string()}.
-type agner_spec_property_license() :: {license, string(), file()} |
{license, string()}.
-type agner_spec_property_erlang_versions() :: {erlang_versions, list(atom())}.
@@ -29,6 +30,7 @@
agner_spec_property_authors() |
agner_spec_property_homepage() |
agner_spec_property_rebar_compatible() |
+ agner_spec_property_build_command() |
agner_spec_property_license() |
agner_spec_property_erlang_versions() |
agner_spec_property_applications() |
View
@@ -217,7 +217,16 @@ handle_command(fetch, Opts) ->
rebar:main(["compile"]),
file:set_cwd(Cwd);
_ ->
- io:format("ERROR: Can't compile rebar-incompatible packages at this moment. To be fixed.~n")
+ case proplists:get_value(build_command, Spec) of
+ undefined ->
+ io:format("ERROR: No build_command specified, can't compile this package");
+ Command ->
+ io:format("Compiling (output will be shown when done)...~n"),
+ {ok, Cwd} = file:get_cwd(),
+ file:set_cwd(Directory),
+ io:format("~s~n",[os:cmd(Command)]),
+ file:set_cwd(Cwd)
+ end
end,
case proplists:get_value(addpath, Opts) of
true ->

0 comments on commit 5fd7b65

Please sign in to comment.