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
Include source of applications from current project #685
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains 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 characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 result in including not only source files, but all of the generated build artifacts, including the contents of the release being copied by the current in-progress assembly. It is really only intended that source code be included (so that one can use that source to modify modules and hot load them in production if needed, or at the very least, be able to read the code of the current deployed version if you don't have another means of finding that information).
If you want to bundle the entire project with the release, then I'd recommend doing that as a plugin, rather than as part of Distillery itself (since Distillery can't anticipate all the possible variations of things that may or may not want to be included).
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 code subdirectories get filtered in project_app_scr_dirs: https://github.com/bitwalker/distillery/pull/685/files#diff-f54ed4fbf4049c971597b8a1e8d04ca1R235.
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.
Ah, that's fine then. The other problem though is in the other branch: It misses the case where a project is an umbrella. We should find the app directory in the umbrella (using the
Mix.Project
config option as the base path and joining the app name) and use that as the source path. Unless I'm missing why that case was skipped.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.
Right, this is not obvious from the code, I should've added a comment.
Mix.Project.deps_paths/0
returns a map with all the deps and also all the umbrella apps. I've tried this (showing only the relevant output):Next I've verified that with distillery with this patch and
include_src: true
, the release indeed includes sources of the umbrella apps configured for the release:Is this what you thought? Should I add the comment at least? Or do you suggest some other approach?
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 would add a comment to the change that explains that - I recall the reasoning behind why that occurs, but it is definitely something I or others may miss again later.
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.
Added, please check if it's fine.