-
-
Notifications
You must be signed in to change notification settings - Fork 143
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
Check dependency availability before building #40
Conversation
manveru
commented
Jun 20, 2018
•
edited
Loading
edited
fd1a4a3
to
dbf868f
Compare
src/builder.cr
Outdated
@json = MintJson.parse_current | ||
|
||
terminal.measure "#{COG} Ensuring dependencies... " do | ||
json.check_dependencies!(sources) |
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.
Passing the sources are not needed since the json
knows about it's directory so it's calculable from there, or might not be needed at all (see last comment).
src/macros.cr
Outdated
@@ -19,6 +19,16 @@ module Mint | |||
end | |||
end | |||
|
|||
class Builder | |||
macro build_error(name) |
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 think it's not used anymore.
src/mint_json.cr
Outdated
end | ||
|
||
def dependency_exists?(sources : Array(String), name : String) | ||
pattern = /\.mint\/packages\/#{name}\/source/ |
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.
- the
source
directory might not be present for every package since it's configurable viasource-directories
- I think at this point since we don't have a lock file It's enough to check if there is a directory for the package, then the sources are not even needed here
- once we have a lock file then we can do a more thorough check
4b343e5
to
d1fec70
Compare
mint build
d1fec70
to
cdec617
Compare
@gdotdesign alright, cleaned it up a lot by simply checking the directory. I'd really like to not involve a lot of I/O during these phases, that's why I went with the sources approach, but maybe that can improved in the future as you say. |