Revisions
-
bjnortier revised this gist
Oct 7, 2010 . 2 changed files with 1 addition and 1 deletion.There are no files selected for viewing
Empty file.This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -35,7 +35,7 @@ normalize_rebar_error(Err, FileName) -> rebar_build(FileName, Path) -> file:set_cwd(Path), Cmd = "./rebar compile skip_deps=true 2>&1", [_|T] = string:tokens(os:cmd(Cmd), "\n"), Errors = [normalize_rebar_error(Err, FileName) || Err <- T], io:format("~s", [string:join(Errors, "\n") ++ "\n"]). -
kevsmith created this gist
Apr 10, 2010 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,4 @@ 1) Use build_flymake.sh to compile flymake.erl into the eflymake script. 2) Replace your existing eflymake script with the newly built one. NOTE: Don't forget to make a back up copy of your original eflymake in case this one has bugs! This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,6 @@ #!/bin/sh erlc flymake.erl echo "#!/usr/bin/env escript" > eflymake cat flymake.beam >> eflymake chmod +x eflymake This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,49 @@ -module(flymake). -export([main/1]). -define(REBARS, ["..", "../../.."]). file_exists(FileName) -> case file:read_file_info(FileName) of {error, _} -> false; _ -> true end. locate_build_tool([]) -> not_found; locate_build_tool([H|T]) -> case file_exists(filename:join([H, "rebar"])) of true -> H; false -> locate_build_tool(T) end. manual_compile(FileName) -> compile:file(FileName, [warn_obsolete_guard, warn_unused_import, warn_shadow_vars, warn_export_vars, strong_validation, report, {i, "../include"}, {outdir, "/tmp"}]). normalize_rebar_error(Err, FileName) -> [_|T] = string:tokens(Err, ":"), string:join([FileName|T], ":"). rebar_build(FileName, Path) -> file:set_cwd(Path), Cmd = "./rebar compile 2>&1", [_|T] = string:tokens(os:cmd(Cmd), "\n"), Errors = [normalize_rebar_error(Err, FileName) || Err <- T], io:format("~s", [string:join(Errors, "\n") ++ "\n"]). main([FileName]) -> case locate_build_tool(?REBARS) of not_found -> manual_compile(FileName); Rebar -> rebar_build(FileName, Rebar) end.