summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDave Smith <dizzyd@dizzyd.com>2010-04-28 13:02:51 -0600
committerDave Smith <dizzyd@dizzyd.com>2010-04-28 13:02:51 -0600
commitc28a16258cec1fac8471793b33f4183fa8f07df1 (patch)
tree1f23ad54481294d8c3e42ce52041ef72025d36bd /src
parentf81cf34bb9d29c72cfdaba4cd0e64aafcf34d355 (diff)
Add caching of app file
Diffstat (limited to 'src')
-rw-r--r--src/rebar_app_utils.erl20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/rebar_app_utils.erl b/src/rebar_app_utils.erl
index 7f48ffd..744af4c 100644
--- a/src/rebar_app_utils.erl
+++ b/src/rebar_app_utils.erl
@@ -85,11 +85,17 @@ app_vsn(AppFile) ->
%% ===================================================================
load_app_file(Filename) ->
- case file:consult(Filename) of
- {ok, [{application, AppName, AppData}]} ->
- {ok, AppName, AppData};
- {error, Reason} ->
- {error, Reason};
- Other ->
- {error, {unexpected_terms, Other}}
+ case erlang:get({app_file, Filename}) of
+ undefined ->
+ case file:consult(Filename) of
+ {ok, [{application, AppName, AppData}]} ->
+ erlang:put({app_file, Filename}, {AppName, AppData}),
+ {ok, AppName, AppData};
+ {error, Reason} ->
+ {error, Reason};
+ Other ->
+ {error, {unexpected_terms, Other}}
+ end;
+ {AppName, AppData} ->
+ {ok, AppName, AppData}
end.