Skip to content
This repository has been archived by the owner on May 12, 2018. It is now read-only.

Fix #205 (erlydtl:compile/3 returns warnings) #210

Merged
merged 2 commits into from Jan 16, 2014
Merged

Fix #205 (erlydtl:compile/3 returns warnings) #210

merged 2 commits into from Jan 16, 2014

Conversation

ghost
Copy link

@ghost ghost commented Jan 11, 2014

Adapt rebar_erlydtl_compiler to handle warnings emitted by erlydtl:compile/3.

Adapt rebar_erlydtl_compiler to handle warnings emitted by
erlydtl:compile/3.
@goofansu
Copy link
Contributor

Erlydtl cannot write file if found warnings. Please see my comment in #205.

@ghost
Copy link
Author

ghost commented Jan 11, 2014

So, erlydtl:compile/3 by default does not succeed if there are warnings?

@goofansu
Copy link
Contributor

Yes, it will not generate the beam file.

@goofansu
Copy link
Contributor

@ghost
Copy link
Author

ghost commented Jan 11, 2014

Should we merge #210 then? Any erlydtl backward compatibility issue this would cause?

@goofansu
Copy link
Contributor

If using erlydtl 0.7.0, the beam file cannot be generated.

You can consider #211 as a solution.

@ghost
Copy link
Author

ghost commented Jan 11, 2014

But wouldn't that report warnings one way via erlydtl and errors another way via rebar? I'm not sure that's a good idea. What about detecting >= 0.8.0 at runtime?

@goofansu
Copy link
Contributor

What about detecting >= 0.8.0 at runtime?

I think it's the only solution.

@ghost
Copy link
Author

ghost commented Jan 11, 2014

OK, do you want to submit a (new) patch with that solution?

@goofansu
Copy link
Contributor

Yes, my pleasure.

@ghost ghost closed this Jan 11, 2014
@ghost ghost deleted the erlydtl-warnings branch January 11, 2014 21:46
@ghost ghost restored the erlydtl-warnings branch January 13, 2014 13:38
@ghost
Copy link
Author

ghost commented Jan 13, 2014

Reopen. Once erlydtl/erlydtl#116 is resolved, we should merge this patch.

@ghost ghost reopened this Jan 13, 2014
@@ -210,6 +210,8 @@ do_compile(Config, Source, Target, DtlOpts) ->
Opts) of
ok ->
ok;
{ok, _Mod, _Bin, Ws} ->
rebar_base_compiler:ok_tuple(Config, Source, Ws);
error ->
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Tuncer erlydtl/erlydtl#116 adds binary option.

If there is no option {binary, true} in erlydtl_opts, erlydtl will return tuple {ok, Mod, Ws} instead of {ok, Mod, Bin, Ws}.

So this PR should add {ok, Mod, Ws} clause.

Please see https://github.com/goofansu/rebar/commit/da9b08228fb71bee4a74b20cf627f7f5b2a05a38

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, fixed!

erlydtl implemented 'binary' option. Add new clause for {binary, false}.
@kaos
Copy link
Contributor

kaos commented Jan 16, 2014

👍 This looks good.

@jaredmorrow
Copy link
Contributor

Looks good to me too, this ready @Tuncer?

@ghost
Copy link
Author

ghost commented Jan 16, 2014

@jaredmorrow yes.

jaredmorrow added a commit that referenced this pull request Jan 16, 2014
Fix #205 (erlydtl:compile/3 returns warnings)
@jaredmorrow jaredmorrow merged commit 477fbab into rebar:master Jan 16, 2014
@ghost ghost deleted the erlydtl-warnings branch January 16, 2014 22:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants