-
Notifications
You must be signed in to change notification settings - Fork 517
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Profiles #31
Profiles #31
Conversation
apply_profile(State=#state_t{opts=Opts}, Profile) -> | ||
ConfigProfiles = rebar_state:get(State, profiles, []), | ||
Deps = rebar_state:get(State, deps, []), | ||
Opts1 = dict:store({deps, default}, Deps, dict:erase(deps, Opts)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will only work once, assuming the current profile is default
. The next time you call this, you'll possibly corrupt your default state.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, you are right. Question then is, should you be able to apply multiple profiles. lein
supports that, I originally planned to simplify it by sticking to only allowing default
+ other profile
.
So I guess apply_profile/2
should reset to default and then apply any profile. So default profile will be cached in the state somewhere.
@ferd ok, I'm stopping adding to this PR :). Just pushed dialyzer fixes so I think it is ready. Let me know. Note, I weakened some specs in |
That's a huge huge branch with intertwined fixes so I'm gonna go through the diff to try to see if I get things right, but some of my comments would have been caught by reading commits individually. |
@@ -220,7 +220,7 @@ And then we can implement the switch to figure out what to search: | |||
do(State) -> | |||
Apps = case discovery_type(State) of | |||
project -> rebar_state:project_apps(State); | |||
deps -> rebar_state:project_apps(State) ++ rebar_state:src_deps(State) | |||
deps -> rebar_state:project_apps(State) ++ rebar_state:all_deps(State) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm seeing why it's being done that way, but do the binary packages ship with the source code? Otherwise the demo app doing a search over source might look funny. Also this should require a patch on https://bitbucket.org/ferd/rebar3-todo-plugin to match the tutorial.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They do ship with source code. And yea, I'd have sent a PR if it was on github :P
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah we should just take a note when merging it so that I can go and update it.
Pushed some fixes. @ferd when you get a chance let me know if I can merge this. |
I believe you forgot to push |
Yup, pushed. |
Related doc: https://gist.github.com/tsloughter/1e16d70268182db1415a