-
-
Notifications
You must be signed in to change notification settings - Fork 230
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
Implement single-file packages. Fixes #103. #851
Conversation
Inferring the package name requires some additional changes. |
#!/usr/bin/env dub | ||
/+ SDL | ||
name "hello_world" | ||
+/ |
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.
Is it possible to have a tested example with dependencies?
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.
Good point. While normal dependencies work fine, while extending the test case, I noticed that path based dependencies are broken. Fixing this cleanly requires some more thought.
Okay, should be ready now. I propose to defer inferring the package name, because that requires some package parser API changes that may or may not be worth it. |
Overall LGTM. BTW is dub.json supported as a comment? |
The pretty informative comment on |
Thanks for looking through it! I'll add a dub.json test and rebase + pull. |
string file_content = readText(path.toNativeString()); | ||
auto idx = file_content.indexOf("/+"); | ||
enforce(idx >= 0, "Missing /+ ... +/ recipe comment."); | ||
file_content = file_content[idx+2 .. $].strip(); |
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 calling strip
here is unnecessary, as the call below should cover its purpose.
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.
Indeed, that was left-over from an earlier code version.
144299c
to
8131dc5
Compare
Can be invoked by either running with the --single switch, or by omitting the command and instead specifying a file with a .d extension.
8131dc5
to
810257e
Compare
Thanks for the changes (especially for removing the |
Travis is green again. Merging. |
See #103.