-
Notifications
You must be signed in to change notification settings - Fork 78
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
Can cargo-bundle bundle resources from a lib into a bin #40
Comments
This isn't currently possible, no. It's not immediately clear to me how it would work -- if this were a feature of cargo-bundle, how would non-cargo-bundled binaries depending on that library know how to find the resources? Meanwhile, as a workaround, depending on what kinds of resources your library needs, you might consider using the |
My idea is roughly this:
Get's a bit complicated I know....but it's either this, or we bake all files in as code using include_str!() and the like, to libs and binaries, and then write methods to navigate around and find them....kind of like a FileSystem :-) Alternative Ideas: I guess I could look at creating a custom Framework (Mac OS) and bundling that? Not sure how it works on other OS.... |
Any feedback on the idea @mdsteele ? Thinking about my project, this is the cleanest way to achieve what I want to do, I guess we'd need to run cargo-bundle on all the dependencies (libs, workspace members) in the build (which is quite a big deal :-( ) and have those assets "bundled" (copied) into the output directory where the final build is done and cargo-bundle would create the final applicaiton bundle when the binary is finally built.... Either way I'll will do work on #42 as that's good for everyone. |
I looked into this a little more, and it might be doable:
Not sure how expensive all that is to do for every |
Wow! That's much more encouraging than I expected. I'd kind of given up.... Yes, some kind of "include subproject bundled files" flag would do it!
|
Now that I've made progress on fixing the workspace awareness, I might be able to attack this in the next week or two (busy all next week). Where the "included" files are bundled from ("target" directory) should follow the same logic as the non-workspace/workspace case I guess. I guess that when building a library, the recursive bundling wouldn't need to be done (just let cargo "include" it's own files), as that can be deferred until a binary is built, and then it can do the whole dependency tree. |
I'd like to have a set of resource files in a lib project, that then get installed as part of the .app bundle when a binary using that lib is built.
Is that possible? Thanks!
The text was updated successfully, but these errors were encountered: