dub.selections.json & optional dependencies: How's it work?
jmh530
john.michael.hall at gmail.com
Fri Feb 24 19:01:54 UTC 2023
I'm looking at the dub package format [1] about optional
dependencies and it says:
"With this set to true, the dependency will only be used if
explicitly selected in dub.selections.json. If omitted, this
attribute defaults to false."
And it occurs to me that I don't know anything about how
dub.selections.json works.
I would think dub optional dependencies work such that if there
are no functions being called/compiled that import an optional
dependency, then the dependency wouldn't be included. How is it
different from `dmd -i`?
The dub.selections.json in some of my projects look like a
listing of the dependencies and their versions. Above should
imply that the optional dependency would only get included there
if the import is actually used somewhere in the project. Is that
correct?
[1] https://dub.pm/package-format-json.html
More information about the Digitalmars-d-learn
mailing list