-
-
Notifications
You must be signed in to change notification settings - Fork 229
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
Expanding on --import-paths for other BuildSettings fields #562
Comments
I think I'd be happy with just about any approach which works and lets you get all of the values out in the right formats. When I added the path commands, I just wanted something so I could get the paths out without having to rely on some other program being installed, to make it easy to add the import paths to any syntax checker which uses dub already. |
Mmh, what's wrong with processing the json output? After all you don't want 10 invocations of dub anyhow. What might make sense is something akin to |
It's a fairly fundamental package manager feature that (realistically) is necessary for using dub's package management functionality while opting out of its build system. Because of that, an external tool (while probably technically feasible) is really a bit too unwieldy and inconvenient.
I'm not all that familiar with pkg-config (I really should be though...), but I assume you're talking about outputting multiple types of flags (compiler flags and library filepaths) with the same invocation. If so, yes, I was thinking of allowing the same thing, like you say, to avoid extra invocations. For outputting the values in a compiler-formatted style that shouldn't be too much of an issue. I'm not entirely certain what to do about the current formatting of "list each value, compiler-independent format, on a separate line". Either just dump everything and let the user fend for themself at sorting them out. Or separate each section with a blank line. Or just ONLY allow
I'm not sure what you mean by this. What potential issues do you see? |
If you mean deciding whether to include in the output the info for dependencies versus only displaying for root project only, then the more I think about this whole idea, the more convinced I am the user should be explicitly choosing "recursive / with dependencies" vs "non-recursive / root project only" each time for each individual setting. So something like this (I'm not sure what to actually call the flags though):
Naturally some more common or potentially-fiddly uses would have a shortcut, like |
Actually, I think this way would be better, because then (I think) the requested ordering could be preserved (and "package" is probably more accurate at implying non-recursive than "project"):
|
…nd optional recursion into dependencies.
You can already specify the compiler using |
See, if you want to write an alternative build tool for dub, than you can simply parse the json output of dub describe. That's by no means more complicated than passing 20 arguments and parsing the output of that. |
If there's a way to determine "the user did not specify a --compiler=" as opposed to simply getting dub's default choice of compiler (I'm not sure offhand if there is. Is there?), then yes, I suppose that could work. The downsides are that it would preclude the ability to explicitly request the default of --import-paths's current list-style format (ie
Yea it really actually would be more involved. Besides, I'm working towards some sort of Additionally, this is realistically needed just to even use rdmd (let alone anything else) in a dub-distributed lib, and rdmd can hardly be considered an "alternative" build tool. |
…nd optional recursion into dependencies.
Solved via the new |
I'd like to expand on the recent "dub describe --[string-]import-paths" to support some of the other fields in BuildSettings (such as libs and versions), and also optionally allow these to be output pre-formatted for a particular compiler (such as DMD-style: "-Ipath1 -Ipath2").
But before getting started, I wanted to get feedback regarding the CLI interface for it. I'm wondering whether following the example set by "--[string-]import-paths" by adding "--versions", "--debug-versions", "--libs", "--pre-generate-commands", etc might be a bit cluttered. Should it be changed to something like "--build-setting=import-paths"? Or is current approach fine?
The text was updated successfully, but these errors were encountered: